|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
9 Y; U! b8 [: o4 U
5 z' ^8 |* @' P4 u: f<!DOCTYPE html>: h* r: G3 I! o u
<html lang="en"># C8 y" {) J5 G" h8 F
6 ^0 W$ q# n- @2 O- E
<head>
! z4 ^1 w( v0 E( v <meta charset="UTF-8">& D: B5 q7 \/ o% v U( k% {
<title>Event Bind</title>9 ]0 `$ L! }1 k: z5 x
<script src="./vue.js"></script>
. R6 D" ^; `0 T5 {5 j: G: {( k</head>
! a) L3 H& P5 J9 B5 \4 c h4 F0 T2 \" f; O3 g7 V: u
<body>' e# x: @/ H0 y
<div id="root">
0 _$ R0 a* V& b; w# I* C First Name: <input type="text" v-model="firstName" />
& n' {3 m7 S2 [# d* q3 J Last Name: <input type="text" v-model="lastName" />& `4 v" B/ M6 {" o7 O( J' L
<div>
0 A" p- x/ D, H2 {1 V, y& p% V Full Name : {{fullname}}9 a) B5 U* g8 @) p" x5 y
</div>
7 _6 z0 T3 E4 T( j' r% i$ _6 E1 ] <div>
8 z8 g* [, k) r- H9 o9 S- O <h2>{{changeTime}}</h2>
/ h/ S4 f7 ]5 G9 g </div>
, Q* y, X. |% b' E S* Q0 e3 P. i </div>
9 y ]3 k1 N9 P4 Y7 z <script>" `# V, f9 _; f, e% W: g; q
new Vue(
0 b0 P7 y1 `- I' b# ` {
# ]" T& c: ^. D2 Z) i el: root,9 K# [, M( D. {. W1 m/ ?
data: {5 M0 x% l, O5 Q9 m7 `8 h
firstName: '',4 z- B2 P% m) K" C
lastName: '',, N, [( K6 W4 p& G! B
changeTime: 0" \4 n% @1 E8 J/ F6 [& `
},
3 x9 t6 t, o: J1 k5 s/ u methods: {. G) e. x! T0 v0 y
1 j) ~0 F* M4 z: t- O
},
: Q1 O9 o/ ^ C2 E e computed: {, S, F' a2 l* ^: m
fullname: function () {
6 U5 W, L/ w& Y/ o return this.firstName + ' ' + this.lastName;
2 N# c) Q/ k8 X3 `2 i }0 @% Y! v0 k: j4 a" u6 |! E8 }) {; W
},+ R7 d! m7 v+ y7 Z1 y
waTCh: {; L) v- T# O/ Q/ |: e7 l0 E
fullname: function () {
5 Y) A$ ]$ e& q$ I/ A/ ~8 Q this.changeTime++;- m; K4 x8 C' a
}
* Y, D- x$ M7 ^7 p6 ?1 ^/ b/ U }6 F6 @* @+ o0 f0 q" U+ N
}
; _/ S# R2 [8 B9 x, o& D4 M )
$ e) O5 ?% T5 o </script>
+ Z! Y5 M! j9 H: \3 S</body>" W+ j$ z" [0 [
# l: x% |* l+ A2 E) Z! r</html>% b9 g6 k E- l: N$ j
0 x# {& w7 R3 G: q. n* p3 Z" O( L% i7 W
|
|