RuoYi-Vue3
RuoYi-Vue3 copied to clipboard
fix: 修复复制的内容动态改变时,指令没更新值的问题
看例子,此种情况,当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("复制成功");
}