Merge branch 'master' of github.com:sveltejs/svelte

pull/3394/head
Richard Harris 6 years ago
commit bb9a9efec2

@ -94,6 +94,14 @@ An element or component can have multiple spread attributes, interspersed with r
<Widget {...things}/>
```
---
*`$$props`* references all props that are passed to a component including ones that are not declared with `export`. It is useful in rare cases, but not generally recommended, as it is difficult for Svelte to optimise.
```html
<Widget {...$$props}/>
```
### Text expressions

@ -220,9 +220,9 @@ export default class InlineComponentWrapper extends Wrapper {
const conditions = Array.from(all_dependencies).map(dep => `changed.${dep}`).join(' || ');
updates.push(deindent`
var ${name_changes} = ${all_dependencies.size === 1 ? `${conditions}` : `(${conditions})`} ? @get_spread_update(${levels}, [
var ${name_changes} = ${conditions ? `(${conditions}) ? @get_spread_update(${levels}, [
${changes.join(',\n')}
]) : {};
]) : {}` : '{}'};
`);
} else {
this.node.attributes

@ -0,0 +1,5 @@
<script>
export let foo;
</script>
<p>foo: {foo}</p>

@ -0,0 +1,5 @@
export default {
html: `
<div><p>foo: bar</p></div>
`
};

@ -0,0 +1,7 @@
<script>
import Widget from './Widget.svelte';
</script>
<div>
<Widget {...{ foo: 'bar' }}/>
</div>
Loading…
Cancel
Save