Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
data-table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2024-08-01 17:39:41 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2c95b04b68133cf181ed55744a2c8b573722868d
2c95b04b
1 parent
a6682f6a
fix 表格控件-禁止图片复制
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
src/components/TEditor/index.vue
src/components/TEditor/index.vue
View file @
2c95b04
<!--
* @Date: 2024-07-12 13:28:27
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-08-01 17:
07:24
* @LastEditTime: 2024-08-01 17:
38:43
* @FilePath: /data-table/src/components/TEditor/index.vue
* @Description: 文件描述
-->
...
...
@@ -236,7 +236,22 @@ const tinymceOptions = {
// document.getElementById(editor.id).click();
// });
// 初始化实例
handleSetContent(props.table_html)
handleSetContent(props.table_html);
// 禁止图片复制
editor.on('paste', function (e) {
// 获取粘贴的数据
const clipboardData = e.clipboardData || window.clipboardData;
const items = clipboardData.items;
// 检查剪贴板是否包含图片
for (let i = 0; i < items.length; i++) {
if (items[i].type.indexOf('image') !== -1) {
e.preventDefault(); // 阻止图片粘贴
alert('禁止粘贴图片到编辑器中。');
break;
}
}
});
},
}
...
...
Please
register
or
login
to post a comment