omip - fix this.data
This commit is contained in:
parent
fcd21e345f
commit
79bef18b7c
|
@ -405,8 +405,8 @@ function hasComplexExpression(path) {
|
|||
const parentPath = path.parentPath;
|
||||
if (jsxElement &&
|
||||
object.isThisExpression() &&
|
||||
//不应该替换成 data,导致 wxml 里的 this.data.a[1] 转换失败
|
||||
property.isIdentifier({ name: 'state' }) &&
|
||||
//@fix
|
||||
property.isIdentifier({ name: 'data' }) &&
|
||||
parentPath.isMemberExpression() &&
|
||||
parentPath.parentPath.isMemberExpression()) {
|
||||
const sourceCode = parentPath.parentPath.getSource();
|
||||
|
|
|
@ -17,6 +17,8 @@ export function define(name, ctor) {
|
|||
}
|
||||
})
|
||||
|
||||
config.data = ins._createData()
|
||||
|
||||
config.created = function () {
|
||||
ins._weappRef = this
|
||||
config.$$refs.forEach(ref => {
|
||||
|
|
Loading…
Reference in New Issue