|
|
@ -190,9 +190,7 @@ export default function dom(
|
|
|
|
`if (!options || (!options.target && !options._root)) throw new Error("'target' is a required option");`}
|
|
|
|
`if (!options || (!options.target && !options._root)) throw new Error("'target' is a required option");`}
|
|
|
|
@init(this, options);
|
|
|
|
@init(this, options);
|
|
|
|
${generator.usesRefs && `this.refs = {};`}
|
|
|
|
${generator.usesRefs && `this.refs = {};`}
|
|
|
|
this._state = ${templateProperties.data
|
|
|
|
this._state = @assign(${templateProperties.data ? '%data()' : '{}'}, options.data);
|
|
|
|
? `@assign(%data(), options.data)`
|
|
|
|
|
|
|
|
: `options.data || {}`};
|
|
|
|
|
|
|
|
${generator.metaBindings}
|
|
|
|
${generator.metaBindings}
|
|
|
|
${computations.length && `this._recompute({ ${Array.from(computationDeps).map(dep => `${dep}: 1`).join(', ')} }, this._state);`}
|
|
|
|
${computations.length && `this._recompute({ ${Array.from(computationDeps).map(dep => `${dep}: 1`).join(', ')} }, this._state);`}
|
|
|
|
${options.dev &&
|
|
|
|
${options.dev &&
|
|
|
|