管理员
论坛积分
分
威望 点
贡献值 个
金币 枚
|
php-html
+ Z5 b- K3 e* O% Q1 o- <div id = "computed_props{$v['id']}">3 N) G# m U: S; E0 J: B% O% @; m
- <input style="width:50px;" type = "text" v-model = "kilometers" placeholder="20" >
* Z4 D# Z2 _& ]& i7 p: ` - <a class="btn btn-xs btn-info" style="display:inline-block;" v-bind:href="url" >修改比例为{{meters}}</a>
7 q5 T! L" p2 w, X% ^; o7 a3 `) e - </div>
复制代码 vue.js
. ^/ F; S: `' }# C* M- <script type = "text/javascript">7 s; j6 }9 X5 [8 i5 D* T
- ) K7 O$ h( Z8 q* w( }
- var ids = <?=$v['id']?>;2 ~" M# f* S" t9 Q4 d, c2 E$ m
- var shop_xjcbl = <?=$v['shop_xjcbl']?>;' Q. L& N% P7 e( [/ i/ c2 q
- 6 F/ s' A2 L C, q
- var vm = new Vue({
. Q$ ^3 v( Z4 C, }% h - el: '#computed_props'+<?=$v['id']?>,( d3 F: D1 G+ R( W* U3 o
- data: {9 o! _4 o6 i; `
- kilometers : <?=$v['shop_xjcbl']?>,
4 M% C5 Z1 N% g - meters: <?=$v['shop_xjcbl']?>,
}* J' ^1 M, y* Y! z - id:<?=$v['id']?>,
) ^9 w2 |1 x' _6 R6 n - url:'/nc.php?s=/goods/xiugaibili/id/'+ids+'/shop_xjcbl/'+shop_xjcbl+'.html',; N7 u3 d0 W4 ^8 t
- },
7 Q- Y0 v$ c3 _; x - methods: {: f# h1 ?' s% v* ]
-
; u8 s! G" Y9 u3 k - },
N* @. N8 o, K7 \; e - computed :{
& I; Z# w2 ~& \: L' g& X - },
! J7 W7 e `9 A - watch : {
* O" l' N* c: G" _. k' T3 U - kilometers:function(val) {/ n2 B+ t5 A7 y9 H
- this.kilometers = val;
5 ? r% a) g" H1 r+ P' @ - this.meters = val ;
+ `9 }9 Z1 C0 x2 U - this.url = '/nc.php?s=/goods/xiugaibili/id/'+this.id+'/shop_xjcbl/'+this.kilometers+'.html';
8 l" ]/ M J. n0 y/ L$ e3 C - },' i. R( o. g. \" H m
- meters : function (val) {0 K2 d! u) @$ p4 U
- this.kilometers = val;
4 K" j! J8 c1 ` - this.meters = val;
4 M. x9 d9 ~# f t - }
( X7 U% B$ |, k% c6 j - }2 C" m3 _# O* l
- });
7 }, A) @- f3 b- K' [- C* ] s - ! i* d- @) j7 p7 A( x
" ?" W+ D5 [& w: O- </script>
复制代码 % O- @1 P, _$ X
* a* x, P& ^8 j. X/ n& q
|
|