请参阅下面的我的代码段.如何获得已更改模型的旧值,在这种情况下是vuejs中的年龄?
var app = new Vue({
el:"#table1",
data:{
items:[{name:'long name One',age:21},{name:'long name Two',age:22}]
},
methods:{
changeAge:function(item,event){
alert(item.age);
}
}
});Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<table class="table table-cart" id="table1">
<thead>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
</thead>
<tbody>
<tr v-for="(item,index) in items">
<td>{{item.name}} :</td>
<td>
<input type="text" name="qty"
v-model="item.age"
@change="changeAge(item,$event)">
</td>
</tr>
</tbody>
</table>Run Code Online (Sandbox Code Playgroud)
我正在尝试使用手表,但我无法找到任何帮助来观察一系列物品的年龄.
如何从输入类型文本中获取旧值和新值;
<input type="text" name="quantity-row_111" value="1" id="quantity-row_111" onchange="myfunction(id);">
function myfunction(id){
var oldvalue = getoldvalue();
var newvalue = getnewvalue();
}
Run Code Online (Sandbox Code Playgroud) 我最近在其中一个网站上找到了这样的标签:
<script data-ip="93.1xx.3.2x" data-backuri="something.com">
我找不到任何有关它的信息.这些标签用于什么?