handle missing data

pull/31/head
Rich-Harris 8 years ago
parent 48ce1c9054
commit 50a02cc344

@ -377,7 +377,7 @@ export default function generate ( parsed, source, options ) {
${parsed.css ? `if ( !addedCss ) addCss();` : ''} ${parsed.css ? `if ( !addedCss ) addCss();` : ''}
var mainFragment = renderMainFragment( this, options.target ); var mainFragment = renderMainFragment( this, options.target );
this.set( ${templateProperties.data ? `Object.assign( template.data(), options.data )` : `options.data`} ); this.set( ${templateProperties.data ? `Object.assign( template.data(), options.data )` : `options.data || {}`} );
${templateProperties.onrender ? `template.onrender.call( this );` : ``} ${templateProperties.onrender ? `template.onrender.call( this );` : ``}
} }

Loading…
Cancel
Save