管理员
论坛积分
分
威望 点
贡献值 个
金币 枚
|
php-html/ v% X) h8 r* w' Z& e9 X X
- <div id = "computed_props{$v['id']}">
! i/ o3 P! r3 l0 m - <input style="width:50px;" type = "text" v-model = "kilometers" placeholder="20" >: r- F: c& @+ g
- <a class="btn btn-xs btn-info" style="display:inline-block;" v-bind:href="url" >修改比例为{{meters}}</a>4 C6 ^/ F) o t1 m& G1 J5 r5 ^
- </div>
复制代码 vue.js
, P6 v/ }; T/ X& x- <script type = "text/javascript">
! p4 ?% C% J9 b% S# U' [% J" Q - ' t. E9 O7 r8 E5 D
- var ids = <?=$v['id']?>;
& X$ N2 d% {% Y6 I& w9 r X' m - var shop_xjcbl = <?=$v['shop_xjcbl']?>;0 c: y* S0 _9 u6 b0 t3 B; k5 a
- # E2 Q- O8 A" M: A
- var vm = new Vue({! Z% E; }7 o* z
- el: '#computed_props'+<?=$v['id']?>,
9 m( N& ]8 E$ Q' _# n9 u - data: {
' H- D: c" c; Y! I: a. C' Z; l2 E - kilometers : <?=$v['shop_xjcbl']?>,: K/ @" c; O9 W. F2 @7 S
- meters: <?=$v['shop_xjcbl']?>,
7 Q5 x3 H& g2 ~- W8 P9 p, I: X - id:<?=$v['id']?>,
- x. Y2 J! T/ G" Q# T - url:'/nc.php?s=/goods/xiugaibili/id/'+ids+'/shop_xjcbl/'+shop_xjcbl+'.html',' n9 ^% B L4 I- x T9 v: O9 g1 ~, l
- },1 Y0 i8 T! U6 C4 J) i. o+ F
- methods: {3 c2 M4 E6 [- J L' \) h* `
-
6 H! R( B( a" B" ~1 E a" C - },+ O2 {; T ~ {3 N) I! l/ ~
- computed :{
! x j% `+ ~+ v' V - },! k7 D; A$ \. b; J( w9 _
- watch : {
9 u. Z# o8 ?' `" G9 m - kilometers:function(val) {
! Q& }& `$ X5 l2 i5 Z/ J0 }7 Z; z- H - this.kilometers = val;* Z* c- T# X; t t- [
- this.meters = val ;
5 F( f( v2 ]' u' @8 N9 i6 G; }6 I - this.url = '/nc.php?s=/goods/xiugaibili/id/'+this.id+'/shop_xjcbl/'+this.kilometers+'.html';
& j" W- s1 d' I - },
# U1 _) v K0 P* k/ H - meters : function (val) {
}" ]' C. A9 @! n8 j: `' j& Z9 M& M - this.kilometers = val;
9 d- y/ |& `) \% ~6 A, G - this.meters = val;
: B8 X, G3 k* g5 m( a - }7 W: ~+ A) P# L3 |
- }# I2 m8 j' t' F J) O. O0 _6 E
- });5 K% U0 i, j5 O I
- ; l- i& p/ z3 e J6 C
- - f3 Z. i* G9 F0 O
- </script>
复制代码
; a% J5 |; r* [, @7 f
" W+ F1 G+ [9 d% d8 w! B' D |
|