<head>
<meta charset="utf-8">
<title></title>
<script src="../js/vue.js" type="text/javascript" charset="utf-8"></script>
<style type="text/css">
* {
margin: 0 auto;
padding: 0;
}
.book {}
</style>
</head>
<body>
<div id="app">
<div class="da">
<div class="book">
<div>****
<label for="id">
编号:
<input type="text" id="id" v-model='id' />
</label>
<label for="name">
名称:
</label>
<input type="text" id="name" v-model='name' />
<button @click="handle">提交</button>
</div>
</div>
</div>
<thead>
<table border="1" width="500" height="200">
<th>编号</th>
<th>名称</th>
<th>时间</th>
<th>操作</th>
</tr>
</thead>
<tr :key='item.id' v-for='item in bosl'>
<td>{{item.id}}</td>
<td>{{item.name}}</td>
<td>{{item.date}}</td>
<td>
<a href="" @click.prevent>修改</a> <!-- prevent阻止默认跳转 -->
<span>|</span>
<a href="" @click.prevent>删除</a>
</td>
</tr>
</table>
</div>
</div>
</body>
<script type="text/javascript">
var mv = new Vue({
el: '#app',
data: {
bosl: [{
id: 1,
name: '王者',
date: ''
},
{
id: 2,
name: '穿越',
date: ''
},
{
id: 3,
name: '飞车',
date: ''
},
{
id: 4,
name: 'HTML',
date: ''
},
]
},
methods: {
handle: function() {
var book = {};
book.id = this.id;
book.name = this.name;
book.date = "";
this.bosl = plus(book);
//清空表单
this.id = '';
this.name = '';
}
}
});
</script>
![img](https://img-mid.csdnimg.cn/release/static/image/mid/ask/596155923036114.png 'he.png')
为什么会报错我不是绑定了吗
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
3条回答 默认 最新
悬赏问题
- ¥15 无线电能传输系统MATLAB仿真问题
- ¥50 如何用脚本实现输入法的热键设置
- ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
- ¥30 深度学习,前后端连接
- ¥15 孟德尔随机化结果不一致
- ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
- ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
- ¥15 谁有desed数据集呀
- ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
- ¥15 关于#hadoop#的问题