转载地址:https://blog.csdn.net/weixin_43728978/article/details/104530261
-
首先你有一段拼接的 html 代码
let conten=<button οnclick=“come()”>ClickThis; -
然后你需要在 methods 中有一个函数
methods:{come:function(){ alert(‘Hello’) },
}
-
这一步就是连接起桥梁的关键点
created(){let _this=this; window.come=_this.come;
},