|
@@ -16,17 +16,32 @@
|
|
|
<button @click="$router.push({name: 'DrawView'})">
|
|
|
体验版画过程
|
|
|
</button>
|
|
|
- <button>分享</button>
|
|
|
+ <button @click="copy('sldkfksfklslkdf')">
|
|
|
+ 分享
|
|
|
+ </button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
+import { watch, ref } from "vue"
|
|
|
+import { useClipboard } from '@vueuse/core'
|
|
|
+
|
|
|
const {
|
|
|
windowSizeInCssForRef,
|
|
|
windowSizeWhenDesignForRef,
|
|
|
} = useSizeAdapt()
|
|
|
|
|
|
+const source = ref('Hello')
|
|
|
+const { text, copy, copied, isSupported } = useClipboard({
|
|
|
+ source,
|
|
|
+ legacy: true,
|
|
|
+})
|
|
|
+watch(copied, (vNew) => {
|
|
|
+ if (vNew) {
|
|
|
+ window.alert('copied!')
|
|
|
+ }
|
|
|
+})
|
|
|
|
|
|
</script>
|
|
|
|