App.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <TitleBar />
  3. <CenterPage/>
  4. <StatusBar />
  5. </template>
  6. <script>
  7. import TitleBar from "./components/TitleBar.vue";
  8. import CenterPage from "./components/CenterPage.vue";
  9. import StatusBar from "./components/StatusBar.vue";
  10. import MessageBridge from "./assets/script/MessageBridge";
  11. export default {
  12. name: "App",
  13. components: {
  14. TitleBar,
  15. CenterPage,
  16. StatusBar,
  17. },
  18. props:{
  19. },
  20. created: function () {
  21. this.initData()
  22. },
  23. methods: {
  24. initData: function () {
  25. var mb = MessageBridge.getInstance();
  26. var vs = [{ key: "/topic/windturbine", action: this.windturbineMessage }];
  27. mb.register(vs);
  28. },
  29. windturbineMessage(msg) {
  30. var json = JSON.parse(msg);
  31. this.$store.commit('windturbinelist', json)
  32. },
  33. },
  34. };
  35. </script>
  36. <style>
  37. @import "./assets/style/main.css";
  38. /*#app {
  39. font-family: Avenir, Helvetica, Arial, sans-serif;
  40. -webkit-font-smoothing: antialiased;
  41. -moz-osx-font-smoothing: grayscale;
  42. text-align: center;
  43. color: #2c3e50;
  44. margin-top: 60px;
  45. background-color: coral;
  46. padding: 0;
  47. margin: 0;
  48. border: none;
  49. } */
  50. body {
  51. /* 设置内容不可选中 */
  52. -webkit-user-select: none;
  53. -moz-user-select: none;
  54. -ms-user-select: none;
  55. user-select: none;
  56. }
  57. </style>