mirror of
https://gitee.com/layui/layui.git
synced 2026-01-28 11:11:21 +08:00
feat(code): 支持获取复制状态,阻止默认提示 (#2419)
* feat(code): 新增 onCopy(code, copied) 函数签名 * update code
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user