Skip to content

Commit

Permalink
fix(cli): fixed .wxs
Browse files Browse the repository at this point in the history
  • Loading branch information
Gcaufy committed May 29, 2019
1 parent 2ef05d5 commit 3b551aa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/cli/core/plugins/template/directives/v-on.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ exports = module.exports = function () {
});

this.register('template-parse-ast-attr-v-on.wxs', function ({ item, name, expr, event, scope, ctx }) {
event.expr = event.parsed.callee.name;
event.expr = `{{ ${event.parsed.callee.name} }}`;
event.proxy = false;
event.params = event.parsed.params.map(p => {
if (p.type === 'Literal') {
Expand Down Expand Up @@ -174,6 +174,10 @@ exports = module.exports = function () {
this.register('template-parse-ast-attr-v-on-apply', function parseBindClass ({ parsed, rel }) {
let vOn = parsed['v-on'];

if (!vOn.proxy) {
return { parsed, rel };
}

let isComponent = !!rel.components[vOn.tag];

if (isComponent) { // it is a custom defined component
Expand Down

0 comments on commit 3b551aa

Please sign in to comment.