-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
get store() to work with nested components in SSR compiler
- Loading branch information
1 parent
733e949
commit f7c540b
Showing
6 changed files
with
31 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>It's nice to see you, {{$name}}.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
export default { | ||
html: `<h1>Hello world!</h1>`, | ||
store: true, // TODO remove this in v2 | ||
|
||
html: ` | ||
<h1>Hello world!</h1> | ||
<p>It's nice to see you, world.</p> | ||
`, | ||
|
||
test(assert, component, target) { | ||
component.store.set({ name: 'everybody' }); | ||
|
||
assert.htmlEqual(target.innerHTML, `<h1>Hello everybody!</h1>`); | ||
assert.htmlEqual(target.innerHTML, ` | ||
<h1>Hello everybody!</h1> | ||
<p>It's nice to see you, everybody.</p> | ||
`); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
<h1>Hello {{$name}}!</h1> | ||
<Nested/> | ||
|
||
<script> | ||
import { Store } from '../../../../store.js'; | ||
export default { | ||
store () { | ||
return new Store({ | ||
name: 'world' | ||
}); | ||
} | ||
} | ||
import { Store } from '../../../../store.js'; | ||
import Nested from './Nested.html'; | ||
|
||
export default { | ||
store () { | ||
return new Store({ | ||
name: 'world' | ||
}); | ||
}, | ||
|
||
components: { | ||
Nested | ||
} | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters