“Vue v-model 指令”的版本间的差异
跳到导航
跳到搜索
Jihongchang(讨论 | 贡献) (建立内容为“https://www.bilibili.com/video/BV12J411m7MG/?p=17 获取和设置表单元素的值(双向数据绑定)”的新页面) |
Jihongchang(讨论 | 贡献) |
||
| 第1行: | 第1行: | ||
https://www.bilibili.com/video/BV12J411m7MG/?p=17 | https://www.bilibili.com/video/BV12J411m7MG/?p=17 | ||
| − | 获取和设置表单元素的值(双向数据绑定) | + | 获取和设置表单元素的值(双向数据绑定)<syntaxhighlight lang="html"> |
| + | <div id="app"> | ||
| + | <input type="text" v-model="message"/> | ||
| + | </div> | ||
| + | </syntaxhighlight><syntaxhighlight lang="javascript"> | ||
| + | var app = new Vue({ | ||
| + | el:"#app", | ||
| + | data:{ | ||
| + | message:"hello world" | ||
| + | } | ||
| + | }) | ||
| + | </syntaxhighlight> | ||
2023年8月9日 (三) 01:23的版本
https://www.bilibili.com/video/BV12J411m7MG/?p=17
获取和设置表单元素的值(双向数据绑定)
<div id="app">
<input type="text" v-model="message"/>
</div>
var app = new Vue({
el:"#app",
data:{
message:"hello world"
}
})