Index.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <div id="app-base-screen">
  3. <div class="one-block-1">
  4. <span>
  5. 1. 屏幕信息
  6. </span>
  7. </div>
  8. <div class="one-block-2">
  9. <a-space>
  10. <a-button @click="getScreen(0)">获取当前鼠标位置</a-button>
  11. <a-button @click="getScreen(1)">获取主屏幕</a-button>
  12. <a-button @click="getScreen(2)">获取所有屏幕</a-button>
  13. </a-space>
  14. </div>
  15. <div class="one-block-1">
  16. <span>
  17. 结果:
  18. </span>
  19. </div>
  20. <div class="one-block-2">
  21. <a-descriptions title="">
  22. <a-descriptions-item v-for="(info, index) in data" :key="index" :label="info.title" >
  23. {{ info.desc }}
  24. </a-descriptions-item>
  25. </a-descriptions>
  26. </div>
  27. </div>
  28. </template>
  29. <script>
  30. import { ipcApiRoute } from '@/api/main'
  31. export default {
  32. data() {
  33. return {
  34. data: [],
  35. };
  36. },
  37. mounted () {
  38. },
  39. methods: {
  40. getScreen (index) {
  41. const self = this;
  42. this.$ipc.invoke(ipcApiRoute.getScreen, index).then(result => {
  43. self.data = result;
  44. })
  45. },
  46. }
  47. };
  48. </script>
  49. <style lang="less" scoped>
  50. #app-base-screen {
  51. padding: 0px 10px;
  52. text-align: left;
  53. width: 100%;
  54. .one-block-1 {
  55. font-size: 16px;
  56. padding-top: 10px;
  57. }
  58. .one-block-2 {
  59. padding-top: 10px;
  60. }
  61. }
  62. </style>