已更新至组件的data为什么是函数
This commit is contained in:
parent
f54a539c2a
commit
9a4610fd03
|
@ -19,7 +19,7 @@
|
|||
</div>
|
||||
<template id="tpl">
|
||||
<div>
|
||||
<h1>这是一个水标签</h1>
|
||||
<h1>这是组件的水(静态)标签</h1>
|
||||
<h1>{{content}}</h1>
|
||||
</div>
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
|||
'apps',{
|
||||
template:"#tpl",
|
||||
data(){
|
||||
return {content:"这是真实标签"}
|
||||
return {content:"这是组件的真实(动态)标签"}
|
||||
}
|
||||
})
|
||||
// 这是一个Vue实例对象
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
|
||||
</div>
|
||||
</body>
|
||||
<script src="../../JavaScript/vue.js"></script>
|
||||
<script>
|
||||
// 这是一个Vue实例对象
|
||||
const vue=new Vue({
|
||||
el:"#app"
|
||||
})
|
||||
</script>
|
||||
</html>
|
Loading…
Reference in New Issue