|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
) S6 ^! t9 i7 N. A" b9 D' L6 rVuejs 挂载点 模板 实例和实例中的数据,事件和方法8 P1 W- F M+ f( f
4 f& q& q- F g# t
<!DOCTYPE html>
5 x' A# r; b p<html lang="en">
5 |" x G9 X8 l% l! ?- }<head>0 Y1 M: O8 R( m! q
<meta charset="UTF-8">
$ O5 c: E/ @6 U( q( m4 P7 r* L7 p <title>Vue start</title>9 g, H, S& r2 M& o4 o
<script src="./vue.js"></script>, B6 n w( q+ C8 I3 H( T- n
</head>" k) P6 Y1 q, j" E- j. x, L, ?
; w& A/ H6 `/ Y [
<body>( W( Y2 H" u3 }9 n" Q
<div id="root">{{message}}
2 _4 F& I1 L7 r' `7 d. } <h1 @click="changeword()">hello {{word}}</h1>
( a* w3 N8 J) ?9 J0 ? {{number}}4 L5 {" w5 q% a j9 `) ^ b/ _
<h1 v-text="number"></h1>% {: |2 ]6 q" V' r# B) V
<h1 v-html="content"></h1>
! M/ H) j8 M3 r& T* E8 m2 `$ h </div>2 V& `4 ^5 Z# k
<script>: C" N4 {5 m2 H Z! V& z
new Vue({
9 ^8 X7 y- {: ]* q8 j el: "#root",
X7 F# H4 d+ m& V {# |. F // template:"<h1>template can be here<h1>",/ C5 Z# L# u- Y. z; d! k- R
data: {
) _4 W+ _5 r4 @, R* N message: 'hello world',* p9 v' ?- H- j5 B- G t5 H
word:'plmhome',
' `( s+ b# ]8 | number: 123,
/ J1 t I- E- k$ h7 _ content:"<h2>hello world<h2>" ?9 v" u9 ^& U5 w6 B' H! ^% o
},0 K# R4 _* M! `! D
methods: {" N+ W: H, v# u) Y) U
changeword(){
2 ^. Y4 B: F7 Y this.word = "plmhome.com" //change the word
1 t' J8 l8 e: u6 H }
$ W! c9 Y% ~+ m% } }- Z" i' u/ r( Z1 L
})
" Z4 q) \$ r1 \$ p$ S" E </script>
8 v' T$ w6 N5 r/ h
9 o" p W& g8 u! J& C" K3 [ U</body>
& d! L3 ^5 t3 ~9 x: T8 t, J! k
( x9 n1 r$ G1 N( S0 G [# e</html>
+ }& \/ |% |" L
5 n g. @/ {% u6 W; q
6 c7 \8 s9 u" c9 J, ~ |
|