Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(jsx-directive): v-for directive supports Map and Set (#464)
* feat(jsx-directive): v-for directive supports Map and Set * chore: add changeset
- Loading branch information
1 parent
8ad8454
commit e79e3e4
Showing
8 changed files
with
94 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@vue-macros/jsx-directive': patch | ||
'@vue-macros/volar': patch | ||
--- | ||
|
||
v-for directive supports Map and Set. |
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
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,11 +1,25 @@ | ||
<script setup lang="tsx"> | ||
const list = [1, 2, 3] | ||
const map = new Map([ | ||
[1, '2'], | ||
[3, '4'], | ||
]) | ||
const set = new Set(['1', '2', '3']) | ||
defineRender(() => ( | ||
<> | ||
<div v-for={i in list} key={i}> | ||
<div v-for={i in [1, 2, 3]} key={i}> | ||
<div>{i}</div> | ||
</div> | ||
<div v-for={i in set} key={i}> | ||
<div>{i}</div> | ||
</div> | ||
<div v-for={([key, value], index) in map} key={index}> | ||
<div> | ||
{key}: {value} | ||
</div> | ||
</div> | ||
</> | ||
)) | ||
</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