微信小程序,内容组件中兼容的H5组件

受信任的HTML节点及属性

全局支持class和style属性,不支持id属性

节点属性
a 
abbr 
address 
article 
aside 
b 
bdi 
bdodir
big 
blockquote 
br 
caption 
center 
cite 
code 
colspan,width
colgroupspan,width
dd 
del 
div 
dl 
dt 
em 
fieldset 
font 
footer 
h1 
h2 
h3 
h4 
h5 
h6 
header 
hr 
i 
imgalt,src,height,width
ins 
label 
legend 
li 
mark 
nav 
olstart,type
p 
pre 
q 
rt 
ruby 
s 
section 
small 
span 
strong 
sub 
sup 
tablewidth
tbody 
tdcolspan,height,rowspan,width
tfoot 
thcolspan,height,rowspan,width
thead 
trcolspan,height,rowspan,width
tt 
u 
ul 

Bug & Tip

  1. tip: nodes 不推荐使用 String 类型,性能会有所下降。
  2. tiprich-text 组件内屏蔽所有节点的事件。
  3. tip: attrs 属性不支持 id ,支持 class 。
  4. tip: name 属性大小写不敏感。
  5. tip: 如果使用了不受信任的HTML节点,该节点及其所有子节点将会被移除。
  6. tip: img 标签仅支持网络图片。
  7. tip: 如果在自定义组件中使用 rich-text 组件,那么仅自定义组件的 wxss 样式对 rich-text 中的 class 生效。

转载于:https://www.cnblogs.com/max-hou/p/11563624.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值