管理员
论坛积分
分
威望 点
贡献值 个
金币 枚
|
php-html
' @" `. R" W5 m3 ~& I3 c- <div id = "computed_props{$v['id']}">, G! V( S, n- V8 A h1 ]
- <input style="width:50px;" type = "text" v-model = "kilometers" placeholder="20" >
8 [5 p1 m0 m* x) Y' z0 ^ - <a class="btn btn-xs btn-info" style="display:inline-block;" v-bind:href="url" >修改比例为{{meters}}</a>
. S1 s1 ^$ s5 Z - </div>
复制代码 vue.js
$ \& [5 `/ a0 M, |2 W% u$ h: |- <script type = "text/javascript">1 x; n! s5 _' O8 `) X: M2 v2 U+ `
-
8 }: E# \4 L: w9 X" w - var ids = <?=$v['id']?>;* [5 S/ ]# A' I" y# P& K) J9 h
- var shop_xjcbl = <?=$v['shop_xjcbl']?>;
- i+ r1 x f* t4 C6 H: l - ! K1 A: i/ ]8 m" v
- var vm = new Vue({
9 o$ P) {; A. O' w - el: '#computed_props'+<?=$v['id']?>,! v6 i4 U, t2 \" H6 r* J
- data: {
" E5 D4 R% U- [; V& `# N - kilometers : <?=$v['shop_xjcbl']?>,4 u3 Q$ ^1 n9 Q0 ]
- meters: <?=$v['shop_xjcbl']?>,5 m( e; V' c1 P7 F( ~
- id:<?=$v['id']?>,' Y8 M! _/ C8 X9 m5 m1 T$ E8 i
- url:'/nc.php?s=/goods/xiugaibili/id/'+ids+'/shop_xjcbl/'+shop_xjcbl+'.html',! j7 j, X% t0 c* @- N7 X: K6 N7 z) m% ^) C
- },1 Z5 u( K- ]7 S8 ?+ V( z
- methods: {
4 F$ p$ m& K3 s$ z" X3 p8 b2 ] - & r6 [* n: Z8 g# |. V
- },6 r) T) L/ @$ K$ U9 U. Y# K$ b
- computed :{
8 d. A: u; G" y; N k' h - },
0 F! J7 F0 @5 B - watch : {0 z+ L3 x/ h: i1 P9 c( ]( S: {
- kilometers:function(val) {# Q3 s# T) I/ p! g4 a6 o
- this.kilometers = val;
; s2 m- h# e& M/ {6 A - this.meters = val ;
Z+ g7 V8 m. q) w - this.url = '/nc.php?s=/goods/xiugaibili/id/'+this.id+'/shop_xjcbl/'+this.kilometers+'.html';% }5 T. D Q5 @6 S6 i$ @- x
- },
) A* J6 j6 x9 q2 W5 i. M - meters : function (val) {
! o0 P4 C- W$ |3 `* ]* R - this.kilometers = val;
0 A! a1 E% m/ c- L8 ] - this.meters = val;$ n" X+ w& {( f5 n6 F7 `
- }. M. ?: _5 k5 M+ W1 M3 C& c
- }2 b! Q5 x) W/ [2 y- j( j! [1 ^
- });0 o J# v( m! @ z4 |& s) d
- # ?7 F+ Y; y! s7 z/ H
- 0 o3 z) C7 E2 |2 T3 T* T( ~# j, P5 O
- </script>
复制代码
# J+ r2 p% d: L6 m8 P$ \
. i: b+ B# ?' g$ y9 v |
|