Vue训练——数据删除和添加
使用splice和push进行数据的删除和添加。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script src="./js/vue.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div id="app">
<h1 v-bind:style="title" v-text="msg"></h1>
<h2 v-html="msg"></h2>
<table border="1" cellspacing="0" width="100%">
<tr>
<th>编号</th>
<th>商品名</th>
<th>价格</th>
<th>数量</th>
<th>操作</th>
</tr>
<!-- 循环指示器 in 循环目标 -->
<tr v-for="(item,index) in goods">
<td v-text="index+1"></td>
<td v-text="i