input组件怎么禁止用户复制粘贴内容?

小程序 文章 2022-01-24 12:00 1093 0 全屏看文

AI助手支持GPT4.0

input组件怎么禁止用户复制粘贴内容?How does the input component prevent users from copying and pasting content?

input组件怎么禁止用户复制粘贴内容?

现在有个需求要将input输入框中的内容做禁止用户复制粘贴的功能,应该怎么实现?

Now there is a requirement to prohibit users from copying and pasting the contents in the input box. How should it be implemented?

回答:

c:

input上放一个mask 点击mask的时候input聚焦就行了

同时你也会失去一些功能 (全选呀 移动光标呀 ,感觉有点得不偿失)。


微盟:

input组件不支持,但是可以通过逻辑实现类似这样的需求

brave:

不支持。

-EOF-

AI助手支持GPT4.0