转载地址:https://blog.csdn.net/weixin_43728978/article/details/104530261

1.首先你有一段拼接的html代码

let conten=`<button οnclick="come()">点我</button>`;

2.然后你需要在methods中有一个函数

methods:{
	come:function(){
		alert('你好,再见!')
	},
}

3.下一步就是连接起桥梁的关键点

created(){
	let _this=this;
	window.come=_this.come;
},

相关文章:

  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-26
  • 2022-01-23
  • 2021-07-29
猜你喜欢
  • 2022-12-23
  • 2021-12-04
  • 2022-01-03
  • 2021-11-08
  • 2021-05-12
  • 2022-12-23
相关资源
相似解决方案