1.vue文件
<el-dialog
:close-on-click-modal="false"
title="绘制签到手势"
width="30%"
:visible="showCavGesture"
:destroy-on-close="true"
@close="cancel"
>
<iframe class="ifram" src="signin.html" @getpointList="getpointList"></iframe>// 位于public目录下
<!-- <CavGesture v-model="gestureData" :show-gesture="showCavGesture" /> -->
<div>
<li v-for="(item,index) in newSignInItem.gesture" :key="index"></li>
</div>
{{ newSignInItem.gesture }}
<div slot="footer" class="dialog-footer">
<el-button type="primary" size="small" @click="sure">确 定</el-button>
<el-button size="small" @click="cancel">取 消</el-button>
</div>
</el-dialog>
created() {
window.getpointList = this.getpointList // 把vue实例中的方法引用给window对象
}
2.html文件
touchEnd(e) {
if(!this.isDownOnPoint) return;
this.isDownOnPoint = false;
this.draw();
if(this.points.length > 1) {
// alert("点击的顺序是:" + this.points.join(","));
parent.getpointList(this.points)
this.points = [];
this.draw();
}
}