@尤雨溪
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="vue.js"></script>
<script>
var vm = new Vue({
data: {
str: "str",
html: "html"
},
methods: {
click: function () {
console.log("xxx")
}
}
})
window.onload = function () {
vm.$mount(document.body)
setTimeout(function () {
vm.html = '<div v-text="str"></div>'
}, 1000)
setTimeout(function () {
vm.html = '<button v-el:button v-on:click="click">click me</button>'
}, 2000)
}
</script>
</head>
<body v-html="html">
</body>
</html>
有没有人能解答。。