实现 tp循环输出el
php-html<div id = "computed_props{$v['id']}">
<input style="width:50px;"type = "text" v-model = "kilometers" placeholder="20" >
<a class="btn btn-xs btn-info" style="display:inline-block;"v-bind:href="url" >修改比例为{{meters}}</a>
</div>vue.js
<script type = "text/javascript">
var ids = <?=$v['id']?>;
var shop_xjcbl = <?=$v['shop_xjcbl']?>;
var vm = new Vue({
el: '#computed_props'+<?=$v['id']?>,
data: {
kilometers : <?=$v['shop_xjcbl']?>,
meters: <?=$v['shop_xjcbl']?>,
id:<?=$v['id']?>,
url:'/nc.php?s=/goods/xiugaibili/id/'+ids+'/shop_xjcbl/'+shop_xjcbl+'.html',
},
methods: {
},
computed :{
},
watch : {
kilometers:function(val) {
this.kilometers = val;
this.meters = val ;
this.url = '/nc.php?s=/goods/xiugaibili/id/'+this.id+'/shop_xjcbl/'+this.kilometers+'.html';
},
meters : function (val) {
this.kilometers = val;
this.meters = val;
}
}
});
</script>
页:
[1]