hexi icon indicating copy to clipboard operation
hexi copied to clipboard

wxParser怎么遍历数组数据 然后输出

Open iamzuijiasunyou opened this issue 6 years ago • 2 comments

您好 我想问下如果要遍历数据 然后再转换成富文本 wepy里要怎么写呢? 我用了repeat来遍历输出 一直显示 “没有任何内容需要转换”

iamzuijiasunyou avatar Mar 30 '18 07:03 iamzuijiasunyou

image

iamzuijiasunyou avatar Mar 30 '18 07:03 iamzuijiasunyou

你好,具体我没有仔细研究,你的意思我不是很明白,这个组件接受的已经是字符串了。你可以转换成字符串塞给它。只要你的格式是对的,你的那个报错应该是,被try { let htmlContent = WxParse.wxParse(this.parserName, this.parserType, this.parserContent || this.props.parserContent.default, this, this.parserPadding) // this.htmlParserTpl = this[this.parserName]; this.htmlParserTpl = htmlContent[this.parserName] this.$apply() } catch (e) { console.warn('kinerHtmlParser:', '没有任何内容需要转换', e) }给catch了,看看 参数 e 打印的什么

wyk304443164 avatar Mar 30 '18 08:03 wyk304443164