-
Notifications
You must be signed in to change notification settings - Fork 4
/
DescRichText.js
79 lines (64 loc) · 1.46 KB
/
DescRichText.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import Taro, {Component} from '@tarojs/taro'
import {
View
}
from '@tarojs/components'
import './DescRichText.scss'
var WxParse = require('./wxParse/wxParse');
export default class DescRichText extends Component {
static defaultProps = {
isEnable: true
}
state = {
}
constructor(props) {
super(props)
this.state = {
desc: ''
}
}
componentWillReceiveProps(nextProps) {
console.log('componentWillReceiveProps::',nextProps)
var self = this
self.setState({
desc:nextProps.desc
})
}
componentWillUpdate() {
console.log('componentWillUpdate::',this.state.desc)
}
componentDidUpdate() {
console.log('componentDidUpdate::',this.state.desc)
var self = this
var that = this.$scope
if (self.state.desc) {
console.log('有内容')
var article = self.state.desc
WxParse.wxParse('article', 'html', article, that, 0)
}
else {
console.log('没有获取到资源')
}
}
componentWillMount() {
console.log('componentWillMount::',this.state.desc)
}
componentDidMount() {
console.log('componentDidMount::',this.state.desc)
}
componentWillUnmout() {
}
componentDidShow() {
}
componentDidHide() {
}
render() {
return (
<View>
{/*<RichText nodes={detail.item.extra}></RichText>*/}
<import src='./wxParse/wxParse.wxml'/>
<template is="wxParse" data="{{wxParseData:article.nodes}}"/>
</View>
)
}
}