mirror of
https://github.com/fantastic-admin/basic.git
synced 2026-10-06 14:43:13 +08:00
refactor: useClipboard 增加兼容性支持
This commit is contained in:
@@ -38,7 +38,7 @@ onMounted(() => {
|
||||
})
|
||||
})
|
||||
|
||||
const { copy, copied, isSupported } = useClipboard()
|
||||
const { copy, copied, isSupported } = useClipboard({ legacy: true })
|
||||
|
||||
function handleCopy() {
|
||||
copy(JSON.stringify(diffTwoObj(settingsDefault, appSettingsStore.settings), null, 2))
|
||||
|
||||
@@ -6,7 +6,7 @@ defineOptions({
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
const { copy, copied } = useClipboard()
|
||||
const { copy, copied } = useClipboard({ legacy: true })
|
||||
watch(copied, (val) => {
|
||||
val && useFaToast().success('复制成功')
|
||||
})
|
||||
|
||||
@@ -38,7 +38,7 @@ onMounted(() => {
|
||||
})
|
||||
})
|
||||
|
||||
const { copy, copied, isSupported } = useClipboard()
|
||||
const { copy, copied, isSupported } = useClipboard({ legacy: true })
|
||||
|
||||
function handleCopy() {
|
||||
copy(JSON.stringify(diffTwoObj(settingsDefault, appSettingsStore.settings), null, 2))
|
||||
|
||||
@@ -6,7 +6,7 @@ defineOptions({
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
const { copy, copied } = useClipboard()
|
||||
const { copy, copied } = useClipboard({ legacy: true })
|
||||
watch(copied, (val) => {
|
||||
val && useFaToast().success('复制成功')
|
||||
})
|
||||
|
||||
@@ -38,7 +38,7 @@ onMounted(() => {
|
||||
})
|
||||
})
|
||||
|
||||
const { copy, copied, isSupported } = useClipboard()
|
||||
const { copy, copied, isSupported } = useClipboard({ legacy: true })
|
||||
|
||||
function handleCopy() {
|
||||
copy(JSON.stringify(diffTwoObj(settingsDefault, appSettingsStore.settings), null, 2))
|
||||
|
||||
@@ -6,7 +6,7 @@ defineOptions({
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
const { copy, copied } = useClipboard()
|
||||
const { copy, copied } = useClipboard({ legacy: true })
|
||||
watch(copied, (val) => {
|
||||
val && useFaToast().success('复制成功')
|
||||
})
|
||||
|
||||
@@ -38,7 +38,7 @@ onMounted(() => {
|
||||
})
|
||||
})
|
||||
|
||||
const { copy, copied, isSupported } = useClipboard()
|
||||
const { copy, copied, isSupported } = useClipboard({ legacy: true })
|
||||
|
||||
function handleCopy() {
|
||||
copy(JSON.stringify(diffTwoObj(settingsDefault, appSettingsStore.settings), null, 2))
|
||||
|
||||
@@ -6,7 +6,7 @@ defineOptions({
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
const { copy, copied } = useClipboard()
|
||||
const { copy, copied } = useClipboard({ legacy: true })
|
||||
watch(copied, (val) => {
|
||||
val && useFaToast().success('复制成功')
|
||||
})
|
||||
|
||||
@@ -38,7 +38,7 @@ onMounted(() => {
|
||||
})
|
||||
})
|
||||
|
||||
const { copy, copied, isSupported } = useClipboard()
|
||||
const { copy, copied, isSupported } = useClipboard({ legacy: true })
|
||||
|
||||
function handleCopy() {
|
||||
copy(JSON.stringify(diffTwoObj(settingsDefault, appSettingsStore.settings), null, 2))
|
||||
|
||||
@@ -6,7 +6,7 @@ defineOptions({
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
const { copy, copied } = useClipboard()
|
||||
const { copy, copied } = useClipboard({ legacy: true })
|
||||
watch(copied, (val) => {
|
||||
val && useFaToast().success('复制成功')
|
||||
})
|
||||
|
||||
@@ -38,7 +38,7 @@ onMounted(() => {
|
||||
})
|
||||
})
|
||||
|
||||
const { copy, copied, isSupported } = useClipboard()
|
||||
const { copy, copied, isSupported } = useClipboard({ legacy: true })
|
||||
|
||||
function handleCopy() {
|
||||
copy(JSON.stringify(diffTwoObj(settingsDefault, appSettingsStore.settings), null, 2))
|
||||
|
||||
@@ -6,7 +6,7 @@ defineOptions({
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
const { copy, copied } = useClipboard()
|
||||
const { copy, copied } = useClipboard({ legacy: true })
|
||||
watch(copied, (val) => {
|
||||
val && useFaToast().success('复制成功')
|
||||
})
|
||||
|
||||
@@ -38,7 +38,7 @@ onMounted(() => {
|
||||
})
|
||||
})
|
||||
|
||||
const { copy, copied, isSupported } = useClipboard()
|
||||
const { copy, copied, isSupported } = useClipboard({ legacy: true })
|
||||
|
||||
function handleCopy() {
|
||||
copy(JSON.stringify(diffTwoObj(settingsDefault, appSettingsStore.settings), null, 2))
|
||||
|
||||
@@ -6,7 +6,7 @@ defineOptions({
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
const { copy, copied } = useClipboard()
|
||||
const { copy, copied } = useClipboard({ legacy: true })
|
||||
watch(copied, (val) => {
|
||||
val && useFaToast().success('复制成功')
|
||||
})
|
||||
|
||||
@@ -38,7 +38,7 @@ onMounted(() => {
|
||||
})
|
||||
})
|
||||
|
||||
const { copy, copied, isSupported } = useClipboard()
|
||||
const { copy, copied, isSupported } = useClipboard({ legacy: true })
|
||||
|
||||
function handleCopy() {
|
||||
copy(JSON.stringify(diffTwoObj(settingsDefault, appSettingsStore.settings), null, 2))
|
||||
|
||||
@@ -6,7 +6,7 @@ defineOptions({
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
const { copy, copied } = useClipboard()
|
||||
const { copy, copied } = useClipboard({ legacy: true })
|
||||
watch(copied, (val) => {
|
||||
val && useFaToast().success('复制成功')
|
||||
})
|
||||
|
||||
@@ -38,7 +38,7 @@ onMounted(() => {
|
||||
})
|
||||
})
|
||||
|
||||
const { copy, copied, isSupported } = useClipboard()
|
||||
const { copy, copied, isSupported } = useClipboard({ legacy: true })
|
||||
|
||||
function handleCopy() {
|
||||
copy(JSON.stringify(diffTwoObj(settingsDefault, appSettingsStore.settings), null, 2))
|
||||
|
||||
@@ -6,7 +6,7 @@ defineOptions({
|
||||
})
|
||||
|
||||
const route = useRoute()
|
||||
const { copy, copied } = useClipboard()
|
||||
const { copy, copied } = useClipboard({ legacy: true })
|
||||
watch(copied, (val) => {
|
||||
val && useFaToast().success('复制成功')
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { useClipboard } from '@vueuse/core'
|
||||
|
||||
const { text, copy, copied } = useClipboard()
|
||||
const { text, copy, copied } = useClipboard({ legacy: true })
|
||||
|
||||
/* eslint-disable regexp/no-super-linear-backtracking, regexp/no-dupe-disjunctions, regexp/optimal-quantifier-concatenation, regexp/no-useless-assertions, regexp/no-contradiction-with-assertion, regexp/no-misleading-capturing-group */
|
||||
const rules = ref([
|
||||
|
||||
@@ -14,7 +14,7 @@ const throttle = useThrottleFn(() => {
|
||||
}, 1000)
|
||||
|
||||
const input = ref('test')
|
||||
const { text, copy, copied, isSupported } = useClipboard()
|
||||
const { text, copy, copied, isSupported } = useClipboard({ legacy: true })
|
||||
watch(copied, (val) => {
|
||||
val && useFaToast().success(text.value)
|
||||
})
|
||||
|
||||
@@ -5,7 +5,7 @@ const props = defineProps<{
|
||||
text: string
|
||||
}>()
|
||||
|
||||
const { copy, copied, isSupported } = useClipboard()
|
||||
const { copy, copied, isSupported } = useClipboard({ legacy: true })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -144,7 +144,7 @@ onMounted(async () => {
|
||||
numberValue.value = 1234.5
|
||||
})
|
||||
|
||||
const { copy, copied, isSupported } = useClipboard()
|
||||
const { copy, copied, isSupported } = useClipboard({ legacy: true })
|
||||
|
||||
watch(copied, (val) => {
|
||||
if (val) {
|
||||
|
||||
Reference in New Issue
Block a user