32 lines
923 B
JavaScript
32 lines
923 B
JavaScript
"use strict";
|
|
const TUIKit_tuiCustomerServicePlugin_adapterVue = require("../adapter-vue.js");
|
|
const common_vendor = require("../../../common/vendor.js");
|
|
const { computed } = TUIKit_tuiCustomerServicePlugin_adapterVue.vue;
|
|
const _sfc_main = {
|
|
props: {
|
|
payload: {
|
|
type: Object,
|
|
default: () => ({})
|
|
}
|
|
},
|
|
setup(props) {
|
|
const formatedContent = computed(() => {
|
|
let richtext = common_vendor.marked.parse(props.payload.content);
|
|
const regex = new RegExp("<img", "gi");
|
|
richtext = richtext.replace(regex, `<img style="max-width: 100%;"`);
|
|
return richtext;
|
|
});
|
|
return {
|
|
props,
|
|
formatedContent
|
|
};
|
|
}
|
|
};
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return {
|
|
a: $setup.formatedContent
|
|
};
|
|
}
|
|
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
wx.createComponent(Component);
|