Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复复制的内容动态改变时,指令没更新值的问题 #247

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

admin00001
Copy link

看例子,此种情况,当copyText变更时,是需要同步更新的,同时,组件销毁时也需要移除监听click事件才对

// html
<el-button v-copyText="copyText" v-copyText:callback="copySuccess">复制</el-button>

// script
const copyText =computed(() => {
  const text = props.copyList.map(item => `${item.name}: ${item.value ?? ''}`).join('\n');
  return text;
})

function copySuccess() {
  proxy.$modal.msgSuccess("复制成功");
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant