feat(code): 支持获取复制状态,阻止默认提示 (#2419)

* feat(code): 新增 onCopy(code, copied) 函数签名

* update code
This commit is contained in:
morning-star
2024-12-25 16:33:52 +08:00
committed by GitHub
parent 34d00e9c40
commit e1aef65c4f
2 changed files with 15 additions and 3 deletions

View File

@@ -384,9 +384,13 @@ done: function(obj){
</div>
```
onCopy: function(code){
onCopy: function(code, copied){
console.log(code); // 得到当前 code 内容
console.log(copied); // 是否复制成功(2.9.21+)
return false; // 返回 false 阻止内置提示(2.9.21+)
}
```
</td>