管理员
论坛积分
分
威望 点
贡献值 个
金币 枚
|
php-html& V+ r$ I& a! u7 ^* Q
- <div id = "computed_props{$v['id']}">; \( i0 j1 f }% e/ u
- <input style="width:50px;" type = "text" v-model = "kilometers" placeholder="20" >% J8 |( D9 Y% ] {# a9 o$ b: K* ]
- <a class="btn btn-xs btn-info" style="display:inline-block;" v-bind:href="url" >修改比例为{{meters}}</a>
( g' q9 |+ n* r& _ - </div>
复制代码 vue.js
1 J; z. S! ?: M' ~: G- <script type = "text/javascript">
9 l1 k; i5 |( M# D+ w -
- u8 C5 e( Y# ?- A' Z - var ids = <?=$v['id']?>;
; s* P) w9 i% O+ U - var shop_xjcbl = <?=$v['shop_xjcbl']?>;
0 O- H2 o9 ]7 A. }+ q2 m: S+ v; Z - : B+ @6 ]8 ?# }# h: c- `8 W: i
- var vm = new Vue({
+ k' |7 L" |" D+ q$ O9 \ ` - el: '#computed_props'+<?=$v['id']?>,+ I2 y0 _$ z! W
- data: {
, g7 @/ q9 y3 d: \ - kilometers : <?=$v['shop_xjcbl']?>,$ L& k* M* K# g
- meters: <?=$v['shop_xjcbl']?>,
# c4 b- }* i) `! N - id:<?=$v['id']?>,1 ?: h U) I2 s! f7 s0 B
- url:'/nc.php?s=/goods/xiugaibili/id/'+ids+'/shop_xjcbl/'+shop_xjcbl+'.html',
! R; E" s8 |8 x9 K - },
% a( t7 N% z+ S+ h9 E8 L: u. Z) S - methods: {
2 M) W& |' L) d# w- H! x& r: y -
, j0 L# f0 H$ c) [0 ~ - },, S. }* `" e1 [& |
- computed :{
9 m) u, m1 }% j; r% }* s! s - },5 b4 E4 G- v/ g. S2 u* l) k: M
- watch : {4 C1 ^$ z' K5 m) S( I% }9 K
- kilometers:function(val) {" `" Z- q' C$ |" z& C# W" z
- this.kilometers = val;
) l# M* c: K! i- @9 ~8 c - this.meters = val ;
) |" l8 C% S4 n- @" S - this.url = '/nc.php?s=/goods/xiugaibili/id/'+this.id+'/shop_xjcbl/'+this.kilometers+'.html';
; u( U/ y ~( u# V, n - },
- p/ O) G. A" M6 N - meters : function (val) {+ R ?. r F$ c! w- G, u" x2 ?
- this.kilometers = val;1 }, m' l& {0 y/ D. C2 |2 c
- this.meters = val;
3 d0 B# ^' J3 M2 G* K - }
" m" x, }6 ^$ @9 M - }
( B& x d0 \$ Q# O' ]' u - });
2 A4 w0 K0 Y2 K( w
1 q' n: G% {% o: O* v1 F" R
- M; N- _( i. H; e- </script>
复制代码
! r( g0 {, i/ z
. K# t, _7 X7 O5 {/ C/ b |
|