后端返回的数据大致如下
// 返回html
<div id="div_readfinger">
<div class="modal-dialog form-horizontal" style="min-width:1000px" role="document">
<div class="modal-content div_readfinger_modal">
......
<iframe style="width:100%;height:500px" frameborder="0" src="test/index.html"></iframe>
<iframe style="width:100%;height:500px" frameborder="0" src="DEMO/index.html"></iframe>
</div>
</div>
</div>
<script>
var vm = new Vue({
el: '.div_readfinger_modal',
data: function () {
return {
activeName: 'first'
}
},
})
</script>
前端将这些html通过$('#box').html(html)挂载,
但是渲染出的结果是这样的,对应的vue的el实例不见了
=================================================================
排查后
经过排查后大致知道什么原因导致的了
感觉应该是iframe对于vue和jQuery冲突导致的,因为有些jquery的请求会cancle,并且vue并不会发起请求,导致后端返回的html并没有完全加载成功,才导致无法渲染这个组件
但又不知道为什么?
改成属性绑定就只会由vue发起请求了
vue el里用id试试呢,#APP这种