1 Star 1 Fork 0

两行泪/myVue

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
index.html 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
两行泪 提交于 2022-05-27 17:20 +08:00 . 监听input事件,实现双向数据绑定
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>MVVM实现原理</title>
</head>
<body>
<div id="app">
<h2>{{user.name}}--{{user.age}}</h2>
<h2>{{user.age}}</h2>
<h3 v-text='user.name'></h3>
<h4 v-text='msg'></h4>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
<div v-html='htmlStr'></div>
<div v-html='user.depict'></div>
<input type="text" v-model='msg'>
</div>
<script src="js/MVue.js"></script>
<script src="js/Observer.js"></script>
<script>
let vm = new MVue({
el: '#app',
data: {
user: {
name: "tom",
age:18,
depict:"<h3>hello MVVM</h3>",
},
msg: 'MVVM实现原理',
htmlStr:"<h3>hello MVVM1</h3>",
},
})
</script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fatesgo/my-vue.git
git@gitee.com:fatesgo/my-vue.git
fatesgo
my-vue
myVue
master

搜索帮助