-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Description
After version 1.2.0, we find some errors related to vue-template-es2015-compiler
. Here's a reproduction: https://github.com/QingWei-Li/vue-compiler-strip-with-bug .
Basically, there are two errors corresponding to two console.error
s if you try to run the demo above:
ReferenceError: prop is not defined
This is because<div :attr="obj[prop]">123</div>
in template is compiled to_vm.obj[prop]
but it should be_vm.obj[_vm.prop]
ReferenceError: _h is not defined
Ifinline-template
is used in the template, contents beforeinline-template
is compiled fine but contents after it gets some error. For example:
<div>正常:{{ name }}</div>
<inline inline-template>
<div>{{ name }}</div>
</inline>
<div>错误:{{ name }}</div>
will be compiled to
return _vm._h('div', [_vm._h('div', ["正常:" + _vm._s(_vm.name)]), " ", _vm._h('inline', {
inlineTemplate: {
render: function() {
var _vm=this;
return _vm._h('div', [_vm._s(_vm.name)])
},
staticRenderFns: []
}
}), " ", _h('div', ["错误:" + _s(name)])])
The last line should be _vm._h('div', ["错误:" + _vm._s(_vm.name)])
.
That's what we've found so far.
Here's another thing: is there any chance that with
in render function is not entirely removed but can be configured by users? If in some cases users need this implementation, they can add with
back. This line seems to make with
configurable, but I'm not sure.
HerringtonDarkholme
Metadata
Metadata
Assignees
Labels
No labels