richText.js 482 B

1234567891011121314151617181920212223242526272829
  1. // 富文本插件
  2. import wxParse from '../../../wxParse/wxParse.js';
  3. Component({
  4. options: {
  5. addGlobalClass: true,
  6. },
  7. /**
  8. * 组件的属性列表
  9. * 用于组件自定义设置
  10. */
  11. properties: {
  12. itemIndex: String,
  13. itemStyle: Object,
  14. params: Object
  15. },
  16. ready: function() {
  17. let content = this.data.params.content;
  18. // 富文本转码
  19. if (content.length > 0) {
  20. wxParse.wxParse('content', 'html', content, this, 0);
  21. }
  22. },
  23. })