管理员
论坛积分
分
威望 点
贡献值 个
金币 枚
|
php-html
& Y0 B6 z9 k8 X( p. |! ~- <div id = "computed_props{$v['id']}">
8 Q5 R; O$ R% r" C; Q1 E( g - <input style="width:50px;" type = "text" v-model = "kilometers" placeholder="20" >8 A) D- M0 e) H, k" m1 B# o; P
- <a class="btn btn-xs btn-info" style="display:inline-block;" v-bind:href="url" >修改比例为{{meters}}</a>7 o) q& u5 {0 q# R3 O
- </div>
复制代码 vue.js0 Y) l- T: S0 x& k3 n
- <script type = "text/javascript">% y4 c& I @. k% V
- ; V+ s1 i& C. [. l* E- f
- var ids = <?=$v['id']?>;
+ O' ^) I4 Z$ r - var shop_xjcbl = <?=$v['shop_xjcbl']?>;7 x5 e$ D% B, H& D/ m& E+ K
- 9 H+ x! H8 a! H8 l
- var vm = new Vue({+ R& H1 M) o6 D. i! B$ I) g
- el: '#computed_props'+<?=$v['id']?>,
" |4 Z6 e# I6 p( z; e - data: {0 V/ V' w' h# j. g! Q5 L
- kilometers : <?=$v['shop_xjcbl']?>,/ J( v% L1 ?# n5 W, S- F
- meters: <?=$v['shop_xjcbl']?>," F3 ]2 p# n, p% K9 _& R' |
- id:<?=$v['id']?>,
& j6 t# J: L" `$ S) Y - url:'/nc.php?s=/goods/xiugaibili/id/'+ids+'/shop_xjcbl/'+shop_xjcbl+'.html',) i6 Z: Q o; K o- V$ c
- },4 L5 L9 L0 J; N0 l2 H) L
- methods: {
/ W# Z. z4 B9 M/ `% b9 d - / \5 r ?: R2 d/ e9 |
- },. }& j1 w" L( a4 v7 g
- computed :{4 c9 {% s8 z; o. L7 M- ^
- },( ], D: U3 ]7 S c2 r
- watch : {) y) x+ i. a" h2 m
- kilometers:function(val) {
3 c b7 n2 I2 {5 } J& v5 D - this.kilometers = val;
3 ~. ^: e; N7 Z: o( F6 S" ]6 g# d - this.meters = val ;
" S9 H0 X% Z! z9 W0 l5 k4 [: X/ ^1 l4 W - this.url = '/nc.php?s=/goods/xiugaibili/id/'+this.id+'/shop_xjcbl/'+this.kilometers+'.html';7 D6 n6 |% N3 J8 V4 V
- },
+ K# K! M. w+ j- J3 O9 a( Z1 @ - meters : function (val) {
" }! m/ G' E0 d, M - this.kilometers = val;
: Y5 q2 q9 A# N4 E0 d - this.meters = val;
7 t8 n( k! a3 _5 C# _ ]% J - }# g6 }5 y8 U9 o& _' ?0 J V3 x
- }
$ U/ b M. ~4 s1 X% |, G, {2 e - });
- Y/ L* D+ e1 a$ ^2 D" a
! c. w: r- V! s& t- n
# X. D! [% I, F! t L: B: O- </script>
复制代码 5 n7 B9 ?/ |4 p! L& [5 u) m
- w; ]) F( |5 b; h! M8 u
|
|