vue 定时刷新改变输出内容
<!DOCTYPE html><html><head><meta charset="UTF-8"><title>vue-test</title><script src="./vue.js
·
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>vue-test</title>
<script src="./vue.js"></script>
</head>
<body>
<div id="app">
{{content}}
</div>
<script>
var app = new Vue({
el: "#app",
data: {
content: 'hello world',
}
})
setTimeout(function() {
app.$data.content = 'bye world'
}, 2000)
</script>
</body>
</html>
更多推荐
已为社区贡献5条内容
所有评论(0)