File tree 2 files changed +32
-0
lines changed
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html xmlns ="http://www.w3.org/1999/html ">
3
+ < head >
4
+ < meta charset ="UTF-8 ">
5
+ < title > vuejs练习</ title >
6
+
7
+ </ head >
8
+ < body >
9
+ < div id ="demo " v-demo:hello ="msg "> </ div >
10
+ < script src ='http://cdn.jsdelivr.net/vue/1.0.26/vue.min.js '> </ script >
11
+ < script src ="index.js "> </ script >
12
+ </ body >
13
+ </ html >
Original file line number Diff line number Diff line change
1
+ Vue . directive ( 'demo' , {
2
+ bind : function ( ) {
3
+ console . log ( 'demo bound!' )
4
+ } ,
5
+ update : function ( value ) {
6
+ this . el . innerHTML =
7
+ 'name - ' + this . name + '<br>' +
8
+ 'expression - ' + this . expression + '<br>' +
9
+ 'argument - ' + this . arg + '<br>' +
10
+ 'modifiers - ' + JSON . stringify ( this . modifiers ) + '<br>' +
11
+ 'value - ' + value
12
+ }
13
+ } )
14
+ var demo = new Vue ( {
15
+ el : '#demo' ,
16
+ data : {
17
+ msg : 'hello!'
18
+ }
19
+ } )
You can’t perform that action at this time.
0 commit comments