Index.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <div id="app-demo-window-view">
  3. <div class="one-block-1">
  4. <span>
  5. 1. 监控电源状态
  6. </span>
  7. </div>
  8. <div class="one-block-2">
  9. <a-space>
  10. <p>当前状态:{{ currentStatus }}</p>
  11. </a-space>
  12. <p>* 拔掉电源,使用电池供电</p>
  13. <p>* 接入电源</p>
  14. <p>* 锁屏</p>
  15. <p>* 解锁</p>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. export default {
  21. data() {
  22. return {
  23. currentStatus: '无',
  24. };
  25. },
  26. mounted () {
  27. this.init();
  28. },
  29. methods: {
  30. init () {
  31. const self = this;
  32. self.$ipc.on('example.initPowerMonitor', (event, result) => {
  33. if (Object.prototype.toString.call(result) == '[object Object]') {
  34. self.currentStatus = result.msg;
  35. self.$message.info(result.msg);
  36. }
  37. })
  38. this.$ipc.send('example.initPowerMonitor', '');
  39. }
  40. }
  41. };
  42. </script>
  43. <style lang="less" scoped>
  44. #app-demo-window-view {
  45. padding: 0px 10px;
  46. text-align: left;
  47. width: 100%;
  48. .one-block-1 {
  49. font-size: 16px;
  50. padding-top: 10px;
  51. }
  52. .one-block-2 {
  53. padding-top: 10px;
  54. }
  55. }
  56. </style>