let compileStr = Vue.compile(this.templateString)this.template = compileStr.render
templateString: function (scope) {
let fun = function () {
console.log('afe')
} return ` <div>
<el-button type="primary" @click="${fun}">查询</el-button>
<el-button type="primary">详情</el-button>
</div>
`
}点击后fun不执行。。。
如果修改为${fun()}有报错
Invalid handler for event "click": got undefined
有没一种方法可以是的能够编译处理,并且点击能正确执行fun? 我现在用的是把fun方法data里面
MYYA
慕森王
随时随地看视频慕课网APP
相关分类