Open nomatterfine opened 1 year ago
2.7.9
https://cdn.bootcdn.net/ajax/libs/vue/2.7.9/vue.js
Select root, and the value should be displayed in data on the right
data cannot be displayed after root is selected
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>数据绑定</title> <!-- 引入Vue --> <!-- <script type="text/javascript" src="../js/vue.js"></script>--> <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.7.9/vue.js"></script> </head> <body> <!-- Vue中有2种数据绑定的方式: 1.单向绑定(v-bind):数据只能从data流向页面。 2.双向绑定(v-model):数据不仅能从data流向页面,还可以从页面流向data。 备注: 1.双向绑定一般都应用在表单类元素上(如:input、select等) 2.v-model:value 可以简写为 v-model,因为v-model默认收集的就是value值。 --> <!-- 准备好一个容器--> <div id="root"> <!-- 普通写法 --> <!-- 单向数据绑定:<input type="text" v-bind:value="name"><br/> 双向数据绑定:<input type="text" v-model:value="name"><br/> --> <!-- 简写 --> 单向数据绑定:<input type="text" :value="name"><br/> 双向数据绑定:<input type="text" v-model="name"><br/> <!-- 如下代码是错误的,因为v-model只能应用在表单类元素(输入类元素)上 --> <!-- <h2 v-model:x="name">你好啊</h2> --> </div> </body> <script type="text/javascript"> Vue.config.productionTip = false //阻止 vue 在启动时生成生产提示。 new Vue({ el:'#root', data:{ name:'尚硅谷' } }) </script> </html>
No response
Is this a problem with the code
I found that the Chinese in data had this problem name:'尚硅谷'
Vue devtools version
2.7.9
Link to minimal reproduction
https://cdn.bootcdn.net/ajax/libs/vue/2.7.9/vue.js
Steps to reproduce & screenshots
What is expected?
Select root, and the value should be displayed in data on the right
What is actually happening?
data cannot be displayed after root is selected
System Info
Any additional comments?
No response