File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,23 @@ var Compiler = require('./compiler'),
16
16
* and a few reserved methods
17
17
*/
18
18
function ViewModel ( options ) {
19
- // just compile. options are passed directly to compiler
19
+ // compile if options passed, if false return. options are passed directly to compiler
20
+ if ( options === false ) return ;
20
21
new Compiler ( this , options )
21
22
}
22
23
23
24
// All VM prototype methods are inenumerable
24
25
// so it can be stringified/looped through as raw data
25
26
var VMProto = ViewModel . prototype
26
27
28
+ /**
29
+ * init allows config compilation after instantiation
30
+ * var a = new Vue(false); a.init( config );
31
+ */
32
+ def ( VMProto , 'init' , function ( options ) {
33
+ new Compiler ( this , options )
34
+ } )
35
+
27
36
/**
28
37
* Convenience function to get a value from
29
38
* a keypath
@@ -177,4 +186,4 @@ function query (el) {
177
186
: el
178
187
}
179
188
180
- module . exports = ViewModel
189
+ module . exports = ViewModel
You can’t perform that action at this time.
0 commit comments