uni-app(H5)论坛 | 社区 表情选择 UI组件

export default { data() { return { minions:{ '[小黄人-微笑]':'f0/xhrnew_weixiao_org.png', '[小黄人-剪刀手]':'63/xhrnew_jiandaoshou_org.png', '[小黄人-不屑]':'b2/xhrnew_buxie_org.png', '[小黄人-高兴]':'41/xhrnew_gaoxing_org.png', '[小黄人-惊讶]':'fd/xhrnew_jingya_thumb.png', '[小黄人-委屈]':'79/xhrnew_weiqu_org.png', '[小黄人-坏笑]':'be/xhrnew_huaixiao_thumb.png', '[小黄人-白眼]':'e2/xhrnew_baiyan_org.png', '[小黄人-无奈]':'15/xhrnew_wunai_org.png', '[小黄人-得意]':'c8/xhrnew_deyi_org.png' } } }, filters:{ formatMinions:function(content, minions){ var res = "" if(content){ res = content.replace(/\[(.*?)\]/gi,(item)=>{ if(item.indexOf('小黄人-') != -1){ let suffix = minions[item] return `<image class="emoji-sticker" src="https://face.t.sinajs.cn/t4/appstyle/expression/ext/normal/${suffix}" mode=""></image>` } return "" }) } return res } } }
上一篇:Java 基于微信小程序的助农扶贫小程序


下一篇:ES6-2:Iterator、Proxy、Promise、生成器函数...-12-set结构