|
|
@@ -16,7 +16,8 @@ var Compiler = require('./compiler'),
|
|
|
* and a few reserved methods
|
|
|
*/
|
|
|
function ViewModel (options) {
|
|
|
- // just compile. options are passed directly to compiler
|
|
|
+ // compile if options passed, if false return. options are passed directly to compiler
|
|
|
+ if( options === false ) return;
|
|
|
new Compiler(this, options)
|
|
|
}
|
|
|
|
|
|
@@ -24,6 +25,14 @@ function ViewModel (options) {
|
|
|
// so it can be stringified/looped through as raw data
|
|
|
var VMProto = ViewModel.prototype
|
|
|
|
|
|
+/**
|
|
|
+ * init allows config compilation after instantiation
|
|
|
+ * var a = new Vue(false); a.init( config );
|
|
|
+ */
|
|
|
+def(VMProto, 'init', function (options) {
|
|
|
+ new Compiler( this, options )
|
|
|
+})
|
|
|
+
|
|
|
/**
|
|
|
* Convenience function to get a value from
|
|
|
* a keypath
|
|
|
@@ -177,4 +186,4 @@ function query (el) {
|
|
|
: el
|
|
|
}
|
|
|
|
|
|
-module.exports = ViewModel
|
|
|
+module.exports = ViewModel
|