make inter-component root and yield options _private

pull/212/head
Rich-Harris 8 years ago
parent ef933ae93b
commit 7dd129a357

@ -268,8 +268,8 @@ export default function dom ( parsed, source, options, names ) {
if ( templateProperties.onrender ) {
builders.init.addBlock( deindent`
if ( options.root ) {
options.root.__renderHooks.push({ fn: template.onrender, context: this });
if ( options._root ) {
options._root.__renderHooks.push({ fn: template.onrender, context: this });
} else {
template.onrender.call( this );
}
@ -298,8 +298,8 @@ export default function dom ( parsed, source, options, names ) {
this.set = set;
this.teardown = teardown;
this.root = options.root;
this.yield = options.yield;
this._root = options._root;
this._yield = options._yield;
${builders.init}
}

@ -26,7 +26,7 @@ export default {
const componentInitProperties = [
`target: ${!isToplevel ? generator.current.target: 'null'}`,
'root: component.root || component'
'_root: component._root || component'
];
// Component has children, put them in a separate {{yield}} block
@ -43,7 +43,7 @@ export default {
`${name}_yieldFragment.update( changed, root );`
);
componentInitProperties.push(`yield: ${name}_yieldFragment`);
componentInitProperties.push( `_yield: ${name}_yieldFragment`);
}
const statements = [];

@ -4,11 +4,11 @@ export default {
generator.createAnchor( anchor, 'yield' );
generator.current.builders.mount.addLine(
`component.yield && component.yield.mount( ${generator.current.target}, ${anchor} );`
`component._yield && component._yield.mount( ${generator.current.target}, ${anchor} );`
);
generator.current.builders.teardown.addLine(
`component.yield && component.yield.teardown( detach );`
`component._yield && component._yield.teardown( detach );`
);
}
};

Loading…
Cancel
Save