App.vue 721 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <div id="app">
  3. <router-view/>
  4. </div>
  5. </template>
  6. <script>
  7. export default {
  8. name: 'App',
  9. components: {},
  10. data() {
  11. return {};
  12. },
  13. watch: {},
  14. mounted () {
  15. // 初始化一个公共消息通信频道
  16. this.initIpc();
  17. },
  18. methods: {
  19. initIpc () {
  20. const self = this;
  21. // 公共频道
  22. self.$ipc.on('public.message', (event, result) => {
  23. // 使用ant-desing-vue, message组件
  24. self.$message.info(result);
  25. })
  26. },
  27. }
  28. }
  29. </script>
  30. <style>
  31. #app {
  32. font-family: Avenir, Helvetica, Arial, sans-serif;
  33. -webkit-font-smoothing: antialiased;
  34. -moz-osx-font-smoothing: grayscale;
  35. text-align: center;
  36. color: #2c3e50;
  37. height: 100%;
  38. }
  39. </style>