File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 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'),
1616 * and a few reserved methods
1717 */
1818function 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 ;
2021 new Compiler ( this , options )
2122}
2223
2324// All VM prototype methods are inenumerable
2425// so it can be stringified/looped through as raw data
2526var VMProto = ViewModel . prototype
2627
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+
2736/**
2837 * Convenience function to get a value from
2938 * a keypath
@@ -177,4 +186,4 @@ function query (el) {
177186 : el
178187}
179188
180- module . exports = ViewModel
189+ module . exports = ViewModel
You can’t perform that action at this time.
0 commit comments