Index.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. this.$ipc.invoke(ipcApiRoute.getScreen, index).then(result => {
  42. this.data = result;
  43. })
  44. },
  45. }
  46. };
  47. </script>
  48. <style lang="less" scoped>
  49. #app-base-screen {
  50. padding: 0px 10px;
  51. text-align: left;
  52. width: 100%;
  53. .one-block-1 {
  54. font-size: 16px;
  55. padding-top: 10px;
  56. }
  57. .one-block-2 {
  58. padding-top: 10px;
  59. }
  60. }
  61. </style>