-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da41fdb
commit 252aa45
Showing
13 changed files
with
190 additions
and
46 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
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,48 @@ | ||
<script props> | ||
module.exports = { | ||
aBoolean: true, | ||
aString: 'My String', | ||
aString2: locals.aString2 === 'yes' ? 'I am string 2' : 'I am not string 2', | ||
anArray: ['one', 'two', 'three'], | ||
anArray2: ['one2', 'two2', 'three2'], | ||
anObject: { one: 'One', two: 'Two', three: 'Three'}, | ||
anObject2: { one: 'One2', two: 'Two2', three: 'Three2'} | ||
}; | ||
</script> | ||
<div> | ||
aBoolean | ||
value: {{ aBoolean }} | ||
type: {{ typeof aBoolean }} | ||
|
||
aString | ||
value: {{ aString }} | ||
type: {{ typeof aString }} | ||
|
||
aString2 | ||
value: {{ aString2 }} | ||
type: {{ typeof aString2 }} | ||
|
||
anArray | ||
value: {{ anArray }} | ||
type: {{ typeof anArray }} | ||
|
||
anObject | ||
value: {{ anObject }} | ||
type: {{ typeof anObject }} | ||
|
||
anArray2 | ||
value: {{ anArray2 }} | ||
type: {{ typeof anArray2 }} | ||
|
||
anObject2 | ||
value: {{ anObject2 }} | ||
type: {{ typeof anObject2 }} | ||
</div> | ||
|
||
<if condition="$slots.child.filled"> | ||
<slot child></slot> | ||
</if> | ||
|
||
<else> | ||
<slot></slot> | ||
</else> |
2 changes: 1 addition & 1 deletion
2
test/templates/components/component-locals-json-and-string.html
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<script defaultLocals> | ||
<script props> | ||
module.exports = { | ||
title: 'Default title', | ||
body: 'Default body' | ||
|
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,4 +1,4 @@ | ||
<script defaultLocals> | ||
<script props> | ||
module.exports = { | ||
title: 'Default title', | ||
body: 'Default body' | ||
|
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,53 @@ | ||
<script props> | ||
module.exports = { | ||
aBoolean: true, | ||
aString: 'My String', | ||
aString2: locals.aString2 === 'yes' ? 'I am string 2' : 'I am not string 2', | ||
anArray: ['one', 'two', 'three'], | ||
anArray2: ['one2', 'two2', 'three2'], | ||
anObject: { one: 'One', two: 'Two', three: 'Three'}, | ||
anObject2: { one: 'One2', two: 'Two2', three: 'Three2'} | ||
}; | ||
</script> | ||
PARENT: | ||
<div> | ||
aBoolean | ||
value: {{ aBoolean }} | ||
type: {{ typeof aBoolean }} | ||
|
||
aString | ||
value: {{ aString }} | ||
type: {{ typeof aString }} | ||
|
||
aString2 | ||
value: {{ aString2 }} | ||
type: {{ typeof aString2 }} | ||
|
||
anArray | ||
value: {{ anArray }} | ||
type: {{ typeof anArray }} | ||
|
||
anObject | ||
value: {{ anObject }} | ||
type: {{ typeof anObject }} | ||
|
||
anArray2 | ||
value: {{ anArray2 }} | ||
type: {{ typeof anArray2 }} | ||
|
||
anObject2 | ||
value: {{ anObject2 }} | ||
type: {{ typeof anObject2 }} | ||
</div> | ||
|
||
<if condition="$slots.child.filled"> | ||
<x-child | ||
aBoolean="{{ typeof $slots.child.locals?.aBoolean !== 'undefined' ? $slots.child.locals.aBoolean : aBoolean }}" | ||
aString="{{ $slots.child.locals?.aString || aString }}" | ||
> | ||
<slot child></slot> | ||
</x-child> | ||
</if> | ||
<else> | ||
<slot></slot> | ||
</else> |
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,8 @@ | ||
<script props> | ||
module.exports = { | ||
hasSlot: locals.$slots | ||
}; | ||
</script> | ||
{{hasSlot}}{{typeof hasSlot}} | ||
{{$slots}}{{typeof $slots}} | ||
<div><slot first></slot><slot second></slot></div> |
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,4 +1,4 @@ | ||
<script defaultLocals> | ||
<script props> | ||
module.exports = { | ||
title: 'Default title' | ||
} | ||
|
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