当前位置:网站首页>02_ Data binding
02_ Data binding
2022-07-19 01:36:00 【ID does not exist.】
Data binding
Vue There is 2 A way of data binding :
One way data binding (v-bind): Data can only be obtained from data Flow page
Two way data binding (v-model): Data can be obtained not only from data Flow page , You can also flow from the page to data
Bidirectional binding is generally applied to table elements ( Such as :input,select etc. )
v-model:value I could just write it as v-model, because v-model The default collection is value value ]
<body>
<div id="root">
<!-- Common writing -->
<!-- One way data binding :<input type="text" v-bind:value="name"><br/>
Two way data binding :<input type="text" v-model:value="name"><br/> -->
<!-- Abbreviation -->
One way data binding :<input type="text" :value="name"><br />
Two way data binding :<input type="text" v-model="name"><br />
<!-- The following code is wrong , because v-model Can only be applied to form class elements ( Input class element ) On -->
<!-- <h2 v-model:x="name"> How do you do </h2> -->
</div>
</body>
<script type="text/javascript">
Vue.config.productionTip = false // prevent vue Generate production prompts at startup .
new Vue({
el: '#root',
data: {
name: '111'
}
})
</script>边栏推荐
- es可选链
- 紅日安全靶場3
- 使用leaflet仿原神提瓦特大地图制作日记
- Uni app wechat official account (4) - address management page
- JS intercepts the first few digits of the string or the last few digits of the string
- Text indent in uniapp doesn't work, and the indentation in the first line of uniapp doesn't work. How to solve it?
- 解决小程序自定义底部菜单切换闪动
- Replace special characters in URL (%e2%80%8b)
- Colorful text advertising code, text advertising code beautification version, add text advertising tutorials to the website
- 服务器如何安装宝塔面板?(宝塔面板安装教程)
猜你喜欢
随机推荐
服务器如何安装宝塔面板?(宝塔面板安装教程)
uni-app微信小程序——商城(4)——商家
量化行业知识汇总
Express项目创建以及其路由介绍
qs模块是?
网站被黑,通过百度/搜狗等搜索关键词访问跳转到其他网站怎么办?
C Programming Language(2nd Edition)--读书笔记--1.5.1
Uni app wechat official account (5) - add and modify addresses
JSX syntax
JS replaces a character in the string, and JS modifies the specified character in the string
今天的码农女孩总结了jQuery处理缓存的方法和事件委托方法的区别的笔记
uniapp开发App中上传图片直传oss
How does the website count the number of visitors? How to install and use 51la?
时间戳转化时间
v-model原理及修饰符
Uni app wechat official account (1) - Web page authorization login
Win10 vscode 代码格式化设置与远程断点调试
el-date-picker时间范围控制
【ElenmentUI el-date-picker日期选择器,结束时间不得早于开始时间,且只能选择距开始时间指定天数的日期】
Replace special characters in URL (%e2%80%8b)









