安装完剪切板的第三方库后,依据官网使用案例,在本地怎么也不能cv成功
官网:https://clipboardjs.com/#example-action
<!-- Target -->
<input id="foo" value="https://github.com/zenorocha/clipboard.js.git">
<!-- Trigger -->
<button class="btn" data-clipboard-target="#foo">
<img src="assets/clippy.svg" alt="Copy to clipboard">
</button>

后面往下看了点,可以通过加事件监听来获取text
onMounted(() => {
//不加这个事件,光靠dom cv不成功
new ClipboardJS(".btn").on("success", (e) => {
console.info("Text:", e.text);
});
});