管理员
论坛积分
分
威望 点
贡献值 个
金币 枚
|
php-html3 e7 u/ t- O% W7 f0 x' U
- <div id = "computed_props{$v['id']}">
( f: k6 y# z, y+ E5 u1 x9 o! B - <input style="width:50px;" type = "text" v-model = "kilometers" placeholder="20" >& }) Q3 T k. @0 B) P v6 ?
- <a class="btn btn-xs btn-info" style="display:inline-block;" v-bind:href="url" >修改比例为{{meters}}</a>
& D) l; o1 r& W$ L9 [ - </div>
复制代码 vue.js) D7 i3 G, u3 H: ]7 v' B
- <script type = "text/javascript">
8 T& \' [: L/ R5 H: q/ W$ b# N - $ x, |8 G8 W3 _7 ^6 d
- var ids = <?=$v['id']?>;+ f9 u, Q" t- f/ N, s1 G
- var shop_xjcbl = <?=$v['shop_xjcbl']?>;
1 e4 @% S, U8 x/ R& r( R -
4 j+ L) L' ]3 l5 X8 u. Y5 S+ [$ r - var vm = new Vue({! @5 x+ p# L. `# G8 F, }6 v
- el: '#computed_props'+<?=$v['id']?>,7 F( R- m* C& `+ M7 O/ j
- data: {
! E' V: i& C) a. F- N- X r - kilometers : <?=$v['shop_xjcbl']?>,% ]- m( F ^0 }! L; i# e4 k
- meters: <?=$v['shop_xjcbl']?>,& b! K$ y3 Z# o4 L) x4 l
- id:<?=$v['id']?>,
2 _* L' T3 p `1 e2 B" f - url:'/nc.php?s=/goods/xiugaibili/id/'+ids+'/shop_xjcbl/'+shop_xjcbl+'.html',4 n4 t" Q. [( m4 G) f) l
- },& J; X! U" ~! p- V$ _, E# E
- methods: {
' I% o2 a1 p, U+ L- { O, y8 z/ L - , P- B e8 i3 C% e7 I' B: p
- },
$ Q' ?; Y2 a6 K - computed :{: u) m% U: F( J' F
- },9 Z" N2 E: p0 p& [
- watch : {
- B2 T4 N6 O4 K- p; q - kilometers:function(val) {$ `- L X1 M( ?% k$ g
- this.kilometers = val;$ |- P; R/ t- q% Q9 x: Z
- this.meters = val ;
* I# Y2 B, d2 a - this.url = '/nc.php?s=/goods/xiugaibili/id/'+this.id+'/shop_xjcbl/'+this.kilometers+'.html';" Y# L" [8 T7 v* g
- },
3 Y' r" b( `8 D* ^+ p - meters : function (val) {
" I( S0 B$ O9 H' ]+ h - this.kilometers = val;
9 @, P7 I; L7 P4 E - this.meters = val;
3 g: Y3 }8 u! k( ]2 U/ K' i7 q9 X3 c: ~ - }* E) }2 @5 H0 n$ g7 D
- }+ P3 f) v0 B9 t Q
- });
; ]7 H7 b! A7 a2 e/ S* F0 \( f& _! X6 ? - 9 h$ }0 M+ S: D" @: p7 D
4 b- @5 m9 k# R$ z) M' s& J- </script>
复制代码 2 c2 L) ^7 `; V
) ^9 p: d( o# \$ j |
|