123456789101112131415161718192021222324252627282930313233343536373839 |
- // components/diy-richtext/index.js
- var Nova = getApp().Nova;
- const rechText = require('../../utils/rech-text')
- Component({
- /**
- * 组件的属性列表
- */
- properties: {
- options: null,
- },
- /**
- * 组件的初始数据
- */
- data: {},
- ready: function () {
- // 在组件布局完成后执行,确保options参数中有data信息
- this.loadData();
- },
- /**
- * 组件的方法列表
- */
- methods: {
- async loadData() {
- await Nova.checkComponentsDataProperties(this);
- // let list = await Nova.getBlockData(this.data.options.data);
- let { options } = this.data;
- console.log("富文本", options);
- options.data.richtext = rechText.formatRichText(options.data.richtext)
- this.setData({
- options: options
- })
-
- },
- },
- });
|