在vue 的html拼接在添加點擊事件用原生的onclick來觸發事件,將事件掛在window上
<template>
<div>
<el-button @click="hahha">
添加
</el-button>
<div style="height:500px;width:1000px;background:#666;" >
1111
</div>
</div>
</template>
<script>
export default {
data() {
return {
tooltip:"test",
};
},
methods: {
hahha(){
var item=this
debugger
item.tooltip
var circle = $(".circle");
// onclick=atlas_edit('+v.pk_atlas_main+',"'+v.name+'") '+onclick=bimshowinfo() +'
circle[0].innerHTML=`<div ><img src="https://img.uj5u.com/2020/09/10/et50367100832311.png" height="35" width="49"/><div ><span ><span style="display: block;float:left">${item.tooltip}</span> <span style="display: block;float:right;color:#3aa1fe;cursor: pointer;;"></i><i style="margin-left:10px;margin-right:20px;font-size:25px;" onclick="closebimface()" ></i> </span></span><div id="canvasDiv" ></div></div></div>`
window.closebimface =function(){
console.log("ssss")
}
},
},
};
</script>
<style >
.leadTips {display: flex; justify-content: start; width: auto; transform: translateY(-40px);width:1000px;height:300px;}
.leadTips img {display: inline-block; width: 49px; height: 40px}
.leadText {display: block; background: #fff; color: #fff; padding: 10px;width:800px;height: 300px;}
.ecanvasDiv{width:800px;height: 280px;}
.canvspna{
width: 785px;
height: 28px;
line-height: 28px;
color:#409eff;
}
</style>
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/1470.html
標籤:其他
下一篇:Vue創建專案步驟
