download.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <el-form
  3. :model="data"
  4. ref="form"
  5. label-width="120px"
  6. class="cameraVersion-from"
  7. >
  8. <el-form-item label="App下载地址">
  9. <div class="column">
  10. <el-input maxlength="30" v-model="data.url" disabled></el-input>
  11. <useClipboard v-slot="{ copy, copied }" :source="data.url">
  12. <el-button type="primary" style="margin-left: 20px" @click="copy()">
  13. {{ copied ? "已复制" : "复制" }}
  14. </el-button>
  15. </useClipboard>
  16. </div>
  17. </el-form-item>
  18. <div class="qrcode">
  19. <qrcode-vue :value="data.url" :size="300"></qrcode-vue>
  20. </div>
  21. </el-form>
  22. </template>
  23. <script setup lang="ts">
  24. import { computed, ref, unref, watch, watchEffect } from "vue";
  25. import { QuiskExpose } from "@/helper/mount";
  26. import QrcodeVue from "qrcode.vue";
  27. import { UseClipboard } from "@vueuse/components";
  28. const props = withDefaults(
  29. defineProps<{
  30. url: string;
  31. }>(),
  32. {
  33. url: "",
  34. }
  35. );
  36. const data = ref<{
  37. url: string;
  38. }>({
  39. url: "",
  40. });
  41. const form = ref();
  42. watchEffect(() => {
  43. if (props.url) {
  44. data.value.url = props.url;
  45. }
  46. });
  47. defineExpose<QuiskExpose>({
  48. async submit() {},
  49. });
  50. </script>
  51. <style scoped>
  52. .icon-style {
  53. font-size: 20px;
  54. line-height: 50px;
  55. }
  56. .qrcode {
  57. width: 100%;
  58. display: flex;
  59. justify-content: center;
  60. align-items: center;
  61. }
  62. .column {
  63. display: flex;
  64. width: 100%;
  65. }
  66. </style>