管理员
论坛积分
分
威望 点
贡献值 个
金币 枚
|
php-html
1 `) _8 I! u1 ^9 h! F+ X- <div id = "computed_props{$v['id']}">7 _+ f' |7 Z7 W: D# ]8 N
- <input style="width:50px;" type = "text" v-model = "kilometers" placeholder="20" >, L* n" S% F5 x: `% k) y
- <a class="btn btn-xs btn-info" style="display:inline-block;" v-bind:href="url" >修改比例为{{meters}}</a>
4 }1 g! H H. c0 Y2 o; Z - </div>
复制代码 vue.js
% F: g3 N. k5 K: B- <script type = "text/javascript">
* g9 J% s& } i4 o - ! e& U! `4 k8 C! x
- var ids = <?=$v['id']?>;
5 z+ ^& [0 G; x# O' Q7 V - var shop_xjcbl = <?=$v['shop_xjcbl']?>;0 u6 j; W j' {
- 1 W& @( u1 J% T* j7 C9 T
- var vm = new Vue({0 A5 Q( F) [# E8 U
- el: '#computed_props'+<?=$v['id']?>,0 v3 Q( d. z4 f. k
- data: {; \: [5 X) L4 G- w8 w
- kilometers : <?=$v['shop_xjcbl']?>,/ N( d& ^: w0 P% C
- meters: <?=$v['shop_xjcbl']?>,
! a3 K `2 e* B8 i: v' R" { - id:<?=$v['id']?>,
* l7 \+ k @* m. O - url:'/nc.php?s=/goods/xiugaibili/id/'+ids+'/shop_xjcbl/'+shop_xjcbl+'.html',
{: u" p: ~0 X - },& c% \- |" a; b: c- l/ L
- methods: {
) I; o6 H! r/ `; H9 P) Z" h - ; W/ I* F& m; H) k4 s
- },* V7 x7 R3 J1 Y2 o4 Q5 @
- computed :{ [2 k) g& k5 r0 q6 e' i d- U6 Z
- },1 p, f! {$ c; A, @: Q
- watch : {
1 R& X8 J/ C- q$ E - kilometers:function(val) {3 m; R) V+ I' a% @2 h: K) f
- this.kilometers = val;
' E# z- S3 j& H# f: u - this.meters = val ;9 d- G# M. C+ w; J+ l7 c+ {0 z! C
- this.url = '/nc.php?s=/goods/xiugaibili/id/'+this.id+'/shop_xjcbl/'+this.kilometers+'.html';
, B; D7 M# v- q' H H - },
; p( X+ [% c/ `( J0 P6 j& E9 q3 U - meters : function (val) {3 p! u4 L1 b$ ~; g9 M- P
- this.kilometers = val;8 m: w( I/ d1 }, ]
- this.meters = val;
+ Y8 N$ b2 m; T7 b& U* J - }5 M" H0 \, r/ W6 p4 m1 Y
- }
+ M4 w' W6 ]9 f0 j8 Z0 [" R - });7 w& g' b$ g$ ~: o
$ H, R0 ~5 J/ k. Z- ) c: ~* b: U+ B( E: k/ Z1 S
- </script>
复制代码 x0 W7 K7 z, p" i0 M# s
/ w7 W: V" y( @( n( Q
|
|