管理员
论坛积分
分
威望 点
贡献值 个
金币 枚
|
php-html+ w; v! S* R# \. u6 |3 v5 S
- <div id = "computed_props{$v['id']}">+ ^5 C; X" o ~1 f. l$ b
- <input style="width:50px;" type = "text" v-model = "kilometers" placeholder="20" > y- q& x( b, U+ h$ F
- <a class="btn btn-xs btn-info" style="display:inline-block;" v-bind:href="url" >修改比例为{{meters}}</a>+ E6 f; |' I+ w6 h
- </div>
复制代码 vue.js
7 d2 O* {& W, c2 ^- <script type = "text/javascript">' }8 ^0 P# U1 [. d1 U
-
7 I: y; n9 B1 L- }5 e - var ids = <?=$v['id']?>;
+ {1 R; V, a6 a - var shop_xjcbl = <?=$v['shop_xjcbl']?>;9 ~' c- a) {, V$ I& Q
- " H0 w# j3 m6 O: {# `! ?6 b% y% ?
- var vm = new Vue({
0 ^9 c6 Z1 ]$ ?# c$ K3 F3 n3 ]6 w2 y0 z - el: '#computed_props'+<?=$v['id']?>, j6 H9 D( h) r. ?( m: d8 z
- data: {, X1 A4 K- p8 z& O! _
- kilometers : <?=$v['shop_xjcbl']?>,
0 O) ?7 v! e ~ I% M" E# Y - meters: <?=$v['shop_xjcbl']?>,
* [8 p+ E: o) z& w$ ?, j - id:<?=$v['id']?>,
& F0 p) ~. y* |3 j( W - url:'/nc.php?s=/goods/xiugaibili/id/'+ids+'/shop_xjcbl/'+shop_xjcbl+'.html',$ l, m3 D1 ^9 V' e* d
- },
- \8 L% e. f5 Z$ L# U - methods: {
) W# E8 \) i& R' M5 f - . l! u% }' I5 A9 W7 d3 b9 ~
- },
- e' c z4 h3 k$ P9 Y& S; ^ - computed :{1 m; [5 `% f/ P" k( R. B& H7 ~
- },2 f4 }7 i, w, Z4 I" i: F8 g! j
- watch : {
$ O0 F3 M9 w) @$ ^ - kilometers:function(val) {
: J' q: x& A( n: T3 i" h. M6 P - this.kilometers = val;
) K4 E2 G( H. b* w5 b |* S - this.meters = val ;
1 ^, f& P" u7 ^ - this.url = '/nc.php?s=/goods/xiugaibili/id/'+this.id+'/shop_xjcbl/'+this.kilometers+'.html';
0 g7 Q8 X' H1 z: V- o4 \7 S4 b - },$ Q6 l$ Z( }; N' f1 O( h
- meters : function (val) {9 `/ I3 p4 u* j" F5 K
- this.kilometers = val;
$ z; B! ~7 N, X2 ^- i! G - this.meters = val;" `0 s. K$ c. J1 w( ~7 E! N
- }
8 r: f2 U* h# x2 V - }8 f3 ~1 [5 }4 S5 R6 C( r/ R
- });
8 _# _1 `0 ^8 S9 R/ x6 R/ B - 1 \% a$ ?8 K; f* Y) K `5 D
- ! k6 ~7 Y2 S% x. x& C1 s
- </script>
复制代码
6 a' q5 y3 a5 C# L1 `1 d$ |7 g8 N5 g. s& C" @9 E
|
|