update tests

pull/1359/head
Rich Harris 8 years ago
parent 557d06f392
commit ca65638bf1

@ -162,7 +162,6 @@ export default function dom(
const constructorBody = deindent`
${options.dev && `this._debugName = '${debugName}';`}
${templateProperties.store && `this.store = %store();`}
${generator.usesRefs && `this.refs = {};`}
this._state = ${initialState.reduce((state, piece) => `@assign(${state}, ${piece})`)};
${storeProps.length > 0 && `this.store._add(this, [${storeProps.map(prop => `"${prop.slice(1)}"`)}]);`}
${generator.metaBindings}
@ -193,71 +192,51 @@ export default function dom(
}];`
)}
${generator.slots.size && `this._slotted = options.slots || {};`}
${generator.customElement ?
deindent`
this.attachShadow({ mode: 'open' });
${css.code && `this.shadowRoot.innerHTML = \`<style>${escape(css.code, { onlyEscapeAtSymbol: true }).replace(/\\/g, '\\\\')}${options.dev ? `\n/*# sourceMappingURL=${css.map.toUrl()} */` : ''}</style>\`;`}
${generator.customElement ? deindent`
${css.code && `this.shadowRoot.innerHTML = \`<style>${escape(css.code, { onlyEscapeAtSymbol: true }).replace(/\\/g, '\\\\')}${options.dev ? `\n/*# sourceMappingURL=${css.map.toUrl()} */` : ''}</style>\`;`}
` :
(generator.stylesheet.hasStyles && options.css !== false &&
`if (!document.getElementById("${generator.stylesheet.id}-style")) @add_css();`)
}
${hasInitHooks && deindent`
var self = this;
var _oncreate = function() {
var changed = { ${expectedProperties.map(p => `${p}: 1`).join(', ')} };
${templateProperties.onstate && `%onstate.call(self, { changed: changed, current: self._state });`}
${templateProperties.oncreate && `%oncreate.call(self);`}
self.fire("update", { changed: changed, current: self._state });
};
`}
${(hasInitHooks || generator.hasComponents || generator.hasComplexBindings || generator.hasIntroTransitions) && deindent`
if (!options.root) {
this._oncreate = [];
${(generator.hasComponents || generator.hasComplexBindings) && `this._beforecreate = [];`}
${(generator.hasComponents || generator.hasIntroTransitions) && `this._aftercreate = [];`}
}
`}
${generator.slots.size && `this.slots = {};`}
`if (!document.getElementById("${generator.stylesheet.id}-style")) @add_css();`)}
this._fragment = @create_main_fragment(this, this._state);
${hasInitHooks && deindent`
this.root._oncreate.push(_oncreate);
`}
this.root._oncreate.push(() => {
const changed = { ${expectedProperties.map(p => `${p}: 1`).join(', ')} };
${templateProperties.onstate && `%onstate.call(this, { changed, current: this._state });`}
${templateProperties.oncreate && `%oncreate.call(this);`}
this.fire("update", { changed, current: this._state });
});`}
${generator.customElement ? deindent`
this._fragment.c();
this._fragment.${block.hasIntroMethod ? 'i' : 'm'}(this.shadowRoot, null);
if (options.target) this._mount(options.target, options.anchor);
` : deindent`
if (options.target) {
${generator.hydratable
? deindent`
var nodes = @children(options.target);
options.hydrate ? this._fragment.l(nodes) : this._fragment.c();
nodes.forEach(@detachNode);
` :
deindent`
${options.dev && `if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the \`hydratable: true\` option");`}
this._fragment.c();
`}
this._mount(options.target, options.anchor);
${generator.customElement ?
deindent`
this._fragment.c();
this._fragment.${block.hasIntroMethod ? 'i' : 'm'}(this.shadowRoot, null);
${(generator.hasComponents || generator.hasComplexBindings || hasInitHooks || generator.hasIntroTransitions) && deindent`
${generator.hasComponents && `this._lock = true;`}
${(generator.hasComponents || generator.hasComplexBindings) && `@callAll(this._beforecreate);`}
${(generator.hasComponents || hasInitHooks) && `@callAll(this._oncreate);`}
${(generator.hasComponents || generator.hasIntroTransitions) && `@callAll(this._aftercreate);`}
${generator.hasComponents && `this._lock = false;`}
`}
}
`}
if (options.target) this._mount(options.target, options.anchor);
` :
deindent`
if (options.target) {
${generator.hydratable
? deindent`
var nodes = @children(options.target);
options.hydrate ? this._fragment.l(nodes) : this._fragment.c();
nodes.forEach(@detachNode);
` :
deindent`
${options.dev && `if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the \`hydratable: true\` option");`}
this._fragment.c();
`}
this._mount(options.target, options.anchor);
${(generator.hasComponents || generator.hasComplexBindings || hasInitHooks || generator.hasIntroTransitions) && deindent`
${generator.hasComponents && `this._lock = true;`}
${(generator.hasComponents || generator.hasComplexBindings) && `@callAll(this._beforecreate);`}
${(generator.hasComponents || hasInitHooks) && `@callAll(this._oncreate);`}
${(generator.hasComponents || generator.hasIntroTransitions) && `@callAll(this._aftercreate);`}
${generator.hasComponents && `this._lock = false;`}
`}
}`}
`;
const classMethods = [];
@ -318,6 +297,7 @@ export default function dom(
super();
this._handlers = {};
this._init.call(this, options);
this.attachShadow({ mode: 'open' });
${constructorBody}
}
@ -336,19 +316,16 @@ export default function dom(
${classMethods.length && classMethods.join('\n\n')}
${generator.slots.size && deindent`
connectedCallback() {
Object.keys(this._slotted).forEach(key => {
this.appendChild(this._slotted[key]);
});
}`}
attributeChangedCallback(attr, oldValue, newValue) {
this.set({ [attr]: newValue });
}
${(generator.hasComponents || generator.hasComplexBindings || templateProperties.oncreate || generator.hasIntroTransitions) && deindent`
${(generator.slots.size || generator.hasComponents || generator.hasComplexBindings || templateProperties.oncreate || generator.hasIntroTransitions) && deindent`
connectedCallback() {
${generator.slots.size && deindent`
Object.keys(this._slotted).forEach(key => {
this.appendChild(this._slotted[key]);
});`}
${generator.hasComponents && `this._lock = true;`}
${(generator.hasComponents || generator.hasComplexBindings) && `@callAll(this._beforecreate);`}
${(generator.hasComponents || templateProperties.oncreate) && `@callAll(this._oncreate);`}

@ -79,10 +79,20 @@ export class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -90,10 +90,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -98,10 +98,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -78,10 +78,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {
@ -163,12 +173,6 @@ class SvelteComponent extends Component {
super(options);
this._state = assign({}, options.data);
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this._fragment = create_main_fragment(this, this._state);
if (options.target) {

@ -37,12 +37,6 @@ class SvelteComponent extends Component {
super(options);
this._state = assign({}, options.data);
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this._fragment = create_main_fragment(this, this._state);
if (options.target) {

@ -78,10 +78,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {
@ -163,12 +173,6 @@ class SvelteComponent extends Component {
super(options);
this._state = assign({}, options.data);
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this._fragment = create_main_fragment(this, this._state);
if (options.target) {

@ -37,12 +37,6 @@ class SvelteComponent extends Component {
super(options);
this._state = assign({}, options.data);
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this._fragment = create_main_fragment(this, this._state);
if (options.target) {

@ -78,10 +78,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {
@ -163,12 +173,6 @@ class SvelteComponent extends Component {
super(options);
this._state = assign({}, options.data);
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this._fragment = create_main_fragment(this, this._state);
if (options.target) {

@ -37,12 +37,6 @@ class SvelteComponent extends Component {
super(options);
this._state = assign({}, options.data);
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this._fragment = create_main_fragment(this, this._state);
if (options.target) {

@ -78,10 +78,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -94,10 +94,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -90,10 +90,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {
@ -168,9 +178,9 @@ class SvelteComponent extends HTMLElement {
super();
this._handlers = {};
this._init.call(this, options);
this.attachShadow({ mode: 'open' });
this._state = assign({}, options.data);
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `<style>div{animation:foo 1s}@keyframes foo{0%{opacity:0}100%{opacity:1}}</style>`;
this._fragment = create_main_fragment(this, this._state);

@ -30,9 +30,9 @@ class SvelteComponent extends HTMLElement {
super();
this._handlers = {};
this._init.call(this, options);
this.attachShadow({ mode: 'open' });
this._state = assign({}, options.data);
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `<style>div{animation:foo 1s}@keyframes foo{0%{opacity:0}100%{opacity:1}}</style>`;
this._fragment = create_main_fragment(this, this._state);

@ -108,10 +108,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -78,10 +78,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {
@ -156,20 +166,13 @@ class SvelteComponent extends Component {
super(options);
this._state = assign(data_1(), options.data);
var self = this;
var _oncreate = function() {
var changed = { };
oncreate.call(self);
self.fire("update", { changed: changed, current: self._state });
};
if (!options.root) {
this._oncreate = [];
}
this._fragment = create_main_fragment(this, this._state);
this.root._oncreate.push(_oncreate);
this.root._oncreate.push(() => {
const changed = { };
oncreate.call(this);
this.fire("update", { changed, current: this._state });
});
if (options.target) {
this._fragment.c();

@ -31,20 +31,13 @@ class SvelteComponent extends Component {
super(options);
this._state = assign(data_1(), options.data);
var self = this;
var _oncreate = function() {
var changed = { };
oncreate.call(self);
self.fire("update", { changed: changed, current: self._state });
};
if (!options.root) {
this._oncreate = [];
}
this._fragment = create_main_fragment(this, this._state);
this.root._oncreate.push(_oncreate);
this.root._oncreate.push(() => {
const changed = { };
oncreate.call(this);
this.fire("update", { changed, current: this._state });
});
if (options.target) {
this._fragment.c();

@ -98,10 +98,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -94,10 +94,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -98,10 +98,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -98,10 +98,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -110,10 +110,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -90,10 +90,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -90,10 +90,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -94,10 +94,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -94,10 +94,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -94,10 +94,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -94,10 +94,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -94,10 +94,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -94,10 +94,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -102,10 +102,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -96,10 +96,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -106,10 +106,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {
@ -243,11 +253,6 @@ class SvelteComponent extends Component {
super(options);
this._state = assign({}, options.data);
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
}
this._fragment = create_main_fragment(this, this._state);
if (options.target) {

@ -89,11 +89,6 @@ class SvelteComponent extends Component {
super(options);
this._state = assign({}, options.data);
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
}
this._fragment = create_main_fragment(this, this._state);
if (options.target) {

@ -78,10 +78,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -78,10 +78,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -78,10 +78,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -78,10 +78,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -92,10 +92,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {
@ -187,12 +197,6 @@ class SvelteComponent extends Component {
super(options);
this._state = assign({}, options.data);
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this._fragment = create_main_fragment(this, this._state);
if (options.target) {

@ -48,12 +48,6 @@ class SvelteComponent extends Component {
super(options);
this._state = assign({}, options.data);
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this._fragment = create_main_fragment(this, this._state);
if (options.target) {

@ -78,10 +78,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -98,10 +98,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -78,10 +78,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -102,10 +102,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

@ -98,10 +98,20 @@ class Component extends Base {
_init(options) {
this._bind = options._bind;
this._slotted = options.slots || {};
this.options = options;
this.root = options.root || this;
this.store = this.root.store || options.store;
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this.refs = {};
this.slots = {};
}
_set(newState) {

Loading…
Cancel
Save