fix: fix the problem that no reaction when copy setting config in http page

This commit is contained in:
Snoword 2022-03-14 17:19:02 +08:00
parent 106331a1c8
commit 61e0e33c64
3 changed files with 69 additions and 63 deletions

View File

@ -108,7 +108,7 @@ watch(
//
const copyConfig = async () => {
const { copy, copied } = useClipboard({
const { copy, copied, isSupported } = useClipboard({
source: `
//
breadcrumb: ${appStore.getBreadcrumb},
@ -171,11 +171,15 @@ theme: {
}
`
})
if (!isSupported) {
ElMessage.error(t('setting.copyFailed'))
} else {
await copy()
if (unref(copied)) {
ElMessage.success(t('setting.copySuccess'))
}
}
}
//
const clear = () => {

View File

@ -70,6 +70,7 @@ export default {
copy: 'Copy',
clearAndReset: 'Clear cache and reset',
copySuccess: 'Copy success',
copyFailed: 'Copy failed',
footer: 'Footer'
},
size: {

View File

@ -70,6 +70,7 @@ export default {
copy: '拷贝',
clearAndReset: '清除缓存并且重置',
copySuccess: '拷贝成功',
copyFailed: '拷贝失败',
footer: '页脚'
},
size: {