IE innerHTML break vue
HTML
<script src="https://unpkg.com/[email protected]/dist/vue.js"></script>
<div id="app"></div>
<div id="other-box"></div>
<button id="btn">click</button>
JavaScript
var app = new Vue({
el: '#app',
template: '<div>{{content}}<input type="text" v-model="content" /></div>',
data: function() {
return {
content: 'test'
};
}
});
var otherBox = document.getElementById('other-box');
app.$nextTick(function() {
otherBox.appendChild(app.$el);
});
document.getElementById('btn').addEventListener('click', function() {
/* otherBox.innerHTML = '' */;
document.body.appendChild(app.$el);
});