vue mosaic html onclick in trigger mode, vue in the onclick, vue trigger onclick, vue mosaic html

1. First you have some mosaic html code

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

2. Then you need to have a function in the methods of

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

3. The next step is to serve as a bridge connecting the key points

created(){
	let _this=this;
	window.come=_this.come;
},
Published 15 original articles · won praise 2 · Views 588

Guess you like

Origin blog.csdn.net/weixin_43728978/article/details/104530261