解决 copy 指令异常

This commit is contained in:
icssoa 2021-03-31 09:56:37 +08:00
parent be747921b3
commit 43d3d9a89a
2 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "front-next-vue3-vite",
"version": "0.0.0",
"name": "front-next",
"version": "0.0.1",
"scripts": {
"dev": "vite",
"build": "vue-tsc --noEmit && vite build",

View File

@ -18,11 +18,12 @@ function copyboard() {
copyboard();
export default {
inserted: (el: HTMLElement, binding: any) => {
mounted: (el: HTMLElement, binding: any) => {
el.className = el.className + " _copy-btn";
el.setAttribute("data-clipboard-text", binding.value);
},
update: (el: HTMLElement, binding: any) => {
beforeUpdate: (el: HTMLElement, binding: any) => {
console.log(el);
el.setAttribute("data-clipboard-text", binding.value);
}
};