管理员
论坛积分
分
威望 点
贡献值 个
金币 枚
|
php-html
& V, o$ D7 T2 h* [- <div id = "computed_props{$v['id']}">. l, d" w- s; l1 Y
- <input style="width:50px;" type = "text" v-model = "kilometers" placeholder="20" >
6 u/ L2 L. T- ]3 [/ h+ d" x/ Q - <a class="btn btn-xs btn-info" style="display:inline-block;" v-bind:href="url" >修改比例为{{meters}}</a>
+ Z# H8 ~& X3 O9 s - </div>
复制代码 vue.js
+ h6 E/ q# u* J& ?2 y3 l0 }- <script type = "text/javascript">& ?4 @5 I. l4 | U3 K
-
1 P) w4 v& R, E# c - var ids = <?=$v['id']?>;+ m. F) {$ C! o$ v
- var shop_xjcbl = <?=$v['shop_xjcbl']?>;' @/ e) v! P- b3 d' p9 Z% W/ Q
-
+ i5 ?( V( m6 Z" [9 J6 `3 s - var vm = new Vue({2 F9 `9 O4 o# w2 ^. c I
- el: '#computed_props'+<?=$v['id']?>,) z! t' Y5 m0 [, K
- data: {
F; ^( l5 }) y - kilometers : <?=$v['shop_xjcbl']?>,% E2 R! x; Z' I
- meters: <?=$v['shop_xjcbl']?>,6 D8 @0 E5 ?3 @# ?4 Q* z/ b
- id:<?=$v['id']?>,' n9 N$ G' k. U8 U* P6 @9 |& d
- url:'/nc.php?s=/goods/xiugaibili/id/'+ids+'/shop_xjcbl/'+shop_xjcbl+'.html',
1 a! O/ n- X w, E! u - },% N! E. w% n6 E4 ^8 `7 |, V. i; t
- methods: {" E2 l3 u j3 m
- 9 u5 {, i6 M' C1 l1 k k6 {, u
- }, @1 C0 u4 [0 J7 x6 U
- computed :{
9 x& b9 _5 H8 E$ b2 e - },
2 }" L1 m: P. G5 w - watch : {$ a" M* j$ y; l, J- O
- kilometers:function(val) {
, o! {& T4 a% D9 @2 v) B( U' r - this.kilometers = val;
3 V# _# Q3 b) _/ p" M4 [7 F5 r - this.meters = val ;( ]3 u; e8 B# u1 f" K$ T) `0 p
- this.url = '/nc.php?s=/goods/xiugaibili/id/'+this.id+'/shop_xjcbl/'+this.kilometers+'.html';
# `. @* T9 \- L- b( H - },% [- F: Q8 x9 D8 W1 l
- meters : function (val) {
! U" D4 v6 s, y p" V( p- U) G - this.kilometers = val;
1 \% f& h2 o( P7 a4 P" V - this.meters = val;+ e% k; r: Q! k9 Z0 L
- }0 _" n: j! d: _( J1 {$ j
- }
8 M+ C, z' l2 v4 ~0 r- M/ t- {; Z/ J - });0 c+ {) W" H7 N0 J$ P( M
- : W! h, S. b) e! g' g3 T) Y
- G& p/ d' A3 j6 N# G0 _2 E. R8 ^1 M& j- </script>
复制代码
( {! W' ]) v6 l; l! e/ [2 w9 t+ a8 N% E1 e' p0 y) @0 e4 t' P0 d
|
|