html 拼接的
html2 += "<span>"+card_txt2+":<input class=\"form-control time-s\" onclick='showCurDate()' id=\"user_key_id"+k+"\" name='time_1' value="+this.time+"></span>";
vue中:
methods:{
showCurDate(){
console.log('123')
},
}
连接两者,使页面能够加载该方法
created(){
console.log('created')
let _this = this
window.showCurDate= _this.showCurDate;
},
activated(){
console.log('activated')
let _this = this
window.showCurDate= _this.showCurDate;
},