管理员
论坛积分
分
威望 点
贡献值 个
金币 枚
|
php-html
& h. n& W( P( Y5 L$ r6 E. C- <div id = "computed_props{$v['id']}">2 R8 s& K) K x) W# i. e
- <input style="width:50px;" type = "text" v-model = "kilometers" placeholder="20" >% U8 B$ n6 c+ Q5 J6 I
- <a class="btn btn-xs btn-info" style="display:inline-block;" v-bind:href="url" >修改比例为{{meters}}</a> A" }8 L: q+ r
- </div>
复制代码 vue.js. H7 s- q; b/ |- [
- <script type = "text/javascript">
; y+ G" Z+ f% a - + S' J0 v: U' P0 M# [+ i
- var ids = <?=$v['id']?>;
3 U5 ]7 ?; t3 ?2 t2 d) D$ \ - var shop_xjcbl = <?=$v['shop_xjcbl']?>;# B7 p7 s: K/ x9 q
- : [$ z2 c4 f( h
- var vm = new Vue({) c, h- x+ ^, K7 C+ [5 C( _# H
- el: '#computed_props'+<?=$v['id']?>,- ~/ i- _6 y R% e# t. V
- data: {
$ z; `/ @1 D+ n: ^) ? - kilometers : <?=$v['shop_xjcbl']?>,
# Z$ w! L/ ~3 l4 j9 ~ - meters: <?=$v['shop_xjcbl']?>,
$ s# y* s. H C - id:<?=$v['id']?>, K8 `0 ]) _* E9 M2 P2 v# ]
- url:'/nc.php?s=/goods/xiugaibili/id/'+ids+'/shop_xjcbl/'+shop_xjcbl+'.html',
$ M6 C2 j: Y% z `% |. z- D, Y - },5 K* b7 a& }% d
- methods: {
% F* X" G$ ]3 H3 D8 j5 o -
9 z6 u3 u2 ?( e4 U! d - },
L0 G* R+ X, N5 ?2 a' m, i - computed :{2 ^9 k- G& X' e2 N5 _# g. T
- },, B q2 K1 P% @; H; R$ j8 P
- watch : {9 ~# S1 D6 ]& h J: |( X
- kilometers:function(val) {
- Z1 X; v+ _. Q$ F) q7 @% s9 O - this.kilometers = val;
! m5 A+ G1 s1 a7 h* A, N - this.meters = val ;
$ o; }9 \" e. Z( s D- q- L" h$ ] - this.url = '/nc.php?s=/goods/xiugaibili/id/'+this.id+'/shop_xjcbl/'+this.kilometers+'.html';5 w% g4 s) H9 h
- },& Q% n" J/ n2 q3 v) q+ f
- meters : function (val) {+ l8 i# G5 t0 |% q& q
- this.kilometers = val;
* L! K7 A, @, \% u+ t+ a4 V - this.meters = val;
2 C3 c9 i; }+ V6 i( g; s - }
) q8 Q/ ~8 F, r6 d- @ - }- q1 ]+ B: }, F
- });
6 i* O4 S( R. `8 \- |+ _
6 S) M* |( d/ N- $ Z2 K Y4 v' G" ^/ U9 n. o% U3 B
- </script>
复制代码 $ P( d* Z1 d' s( t- q( {' r
# {* I- _3 ]+ q0 {4 x. a) I
|
|