管理员
论坛积分
分
威望 点
贡献值 个
金币 枚
|
php-html! A3 i: \( N5 h% T& ~9 V
- <div id = "computed_props{$v['id']}">6 A2 p% I* o( b# a2 s
- <input style="width:50px;" type = "text" v-model = "kilometers" placeholder="20" >8 q* H I5 G* ^9 @+ ?" Z/ U
- <a class="btn btn-xs btn-info" style="display:inline-block;" v-bind:href="url" >修改比例为{{meters}}</a>
' |" M1 q; `$ D8 `) n9 s8 O - </div>
复制代码 vue.js* T: V W& a% L8 c. e5 X4 A
- <script type = "text/javascript">
2 @0 @3 e" ^2 W0 m7 y -
# f; g# x/ i: Y6 Z& S6 M - var ids = <?=$v['id']?>;
- r4 _( j6 f1 t- c! A. v - var shop_xjcbl = <?=$v['shop_xjcbl']?>;7 _2 J6 Z2 G: `( p7 ~8 ]
- 4 n/ h- O, X% d1 a
- var vm = new Vue({
) F9 w; w7 y5 P - el: '#computed_props'+<?=$v['id']?>,
; X \; Y1 C! u1 u - data: {
! J, z6 j' _$ U0 Q) g - kilometers : <?=$v['shop_xjcbl']?>,; H$ o1 e& e$ z3 T4 J! V% U/ a
- meters: <?=$v['shop_xjcbl']?>,1 T- X% W* N* C& a: R
- id:<?=$v['id']?>,7 ?7 p m% M q( ]3 h
- url:'/nc.php?s=/goods/xiugaibili/id/'+ids+'/shop_xjcbl/'+shop_xjcbl+'.html',7 u( R6 [$ C- _& ?- c" r
- },8 _' e6 F3 |: K
- methods: {' {9 I$ t: v# T) F M
- , [. {! N, g* n4 l+ M
- },
: V6 K* o- A' k/ ?/ W! W - computed :{
! E3 u& L3 g1 v4 ^ - },) i4 k7 r; f( O7 P, ~
- watch : {0 F. a2 M/ ~+ t0 K" M2 F
- kilometers:function(val) {
- g/ I- V) O8 q' Y# t6 F6 U& q# o - this.kilometers = val;
6 g2 q o" o" J: n) F( k - this.meters = val ;$ k, ^+ w9 U D4 m, I+ ]
- this.url = '/nc.php?s=/goods/xiugaibili/id/'+this.id+'/shop_xjcbl/'+this.kilometers+'.html';
# u9 K. n1 I; \9 X( N - },6 Z$ H" {5 I% G |
- meters : function (val) {6 V2 V8 Q# Q$ h& ?+ {/ G2 i
- this.kilometers = val;
: a U7 _* ?5 R6 S; f& }8 Z - this.meters = val;
. R% t& i) t8 d" N - }- r9 c+ b9 m* F6 V9 T4 l
- }
- n6 Y, L6 y! R - });
, j# U2 i6 V9 |- y+ P - - j6 O v9 }0 r- j
7 j8 e1 C+ f, E5 I( G7 b- </script>
复制代码
' \: u0 r* }6 J6 i" a4 i5 @" ~! o% Y
|
|