ionic 2:如何使文本可选? [英] ionic 2: How to make text selectable?

查看:102
本文介绍了ionic 2:如何使文本可选?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望用户能够选择文本内容(在ionic 2中),以便他们可以将其复制并粘贴到其他位置,但是似乎文本选择已被禁用.用户可以选择输入或文本区域中的文本,但是我希望他们甚至能够选择常规内容文本.有没有办法重新启用文本选择?

I want users to be able to select text content (in ionic 2) so that they can copy it and paste it elsewhere, but it seems that text selection has been disabled. Users can select text that is in an input or a textarea, but I want them to be able to select even regular content text. Is there a way to re-enable text selection?

推荐答案

我添加了

body {
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}

app.scss文件

对于单个项目,由于这是SCSS,因此您也可以使用这4条CSS行创建一个混入.请记住,Safari或其他浏览器可能无法很好地响应用户选择.

For individual items, since this is SCSS, you can also create a mix-in with those 4 css lines. Keep in mind Safari or other browsers may not respond well to just user-select.

这篇关于ionic 2:如何使文本可选?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆