管理员
论坛积分
分
威望 点
贡献值 个
金币 枚
|
php-html1 K9 K# f# {) b" ]
- <div id = "computed_props{$v['id']}">
2 h6 e h5 _+ I7 a6 H - <input style="width:50px;" type = "text" v-model = "kilometers" placeholder="20" >
, }8 Q( u! j1 H/ P! E: b( o - <a class="btn btn-xs btn-info" style="display:inline-block;" v-bind:href="url" >修改比例为{{meters}}</a>
# g5 w4 Y( C4 o' H8 t - </div>
复制代码 vue.js
7 _1 u' L9 ~0 |1 H, H- <script type = "text/javascript">
1 ]" n: V) ?; d9 p- z5 [! G -
6 n5 f, r: {0 z+ S* K8 q+ d - var ids = <?=$v['id']?>;
+ }. S |# E# L" v" p3 Q - var shop_xjcbl = <?=$v['shop_xjcbl']?>;( ~# m* G6 V* k: m
- ! G6 Q6 Q6 G! f V
- var vm = new Vue({
! {9 _1 W# }; J( a3 k: ^ - el: '#computed_props'+<?=$v['id']?>,2 _* ?- Q3 [0 H" V6 }
- data: {5 f1 t6 c6 l6 R' x
- kilometers : <?=$v['shop_xjcbl']?>,
3 A! }* {) ?7 e5 L: R: \! G - meters: <?=$v['shop_xjcbl']?>,7 k# H8 v. z& s6 s' t- m; m/ {
- id:<?=$v['id']?>,9 ^2 [2 R. j( p9 c/ _' d5 s
- url:'/nc.php?s=/goods/xiugaibili/id/'+ids+'/shop_xjcbl/'+shop_xjcbl+'.html',
6 u; b; f3 w- C e- O. N" t3 _, U - },0 g0 d* ^3 X0 \8 a. B+ \, l
- methods: {
& F% j2 O' f R v2 O- i - 5 N/ V3 l9 v9 X
- },
9 E) u* h$ H3 p. h# ]$ } - computed :{
) f) D6 s c" F. r/ _5 B1 I( p - },+ ]5 C$ ?% @/ k# t2 m
- watch : {
- d( b) j8 Z7 s9 o: a6 Q+ |4 ~7 u - kilometers:function(val) {
+ X& n+ s" C; o- H( v2 L - this.kilometers = val;
* J* z+ c# E, c% p0 G D - this.meters = val ;
2 z; k! \( O4 [ - this.url = '/nc.php?s=/goods/xiugaibili/id/'+this.id+'/shop_xjcbl/'+this.kilometers+'.html';0 j( g0 R! N+ ~ w2 G+ s, w
- },% e) O: p |$ G" c
- meters : function (val) {7 o* s9 o7 P: ~' l- ?7 a
- this.kilometers = val;
% u9 B: j) V% E* z - this.meters = val;
# T. m( \) w m' g8 j - }& M4 P) G* c9 H+ }
- }
0 y# K! C% I8 l* f* f+ r8 | - });
& ~% ]: k% l6 Y0 F0 { - ! M: C- d) Z! ~
9 W6 d+ X* Y; n4 Z4 C- </script>
复制代码 1 l% W* v* z: {* E" U
( j9 r9 C8 M' x- o" M ^* K |
|