Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: exclude null or undefined from v-for source
close #3102
- Loading branch information
1 parent
6fb19fb
commit 83e9ece
Showing
2 changed files
with
18 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<script setup lang="ts"> | ||
import { ref } from 'vue'; | ||
type Item = { | ||
id: number, | ||
text: string | ||
} | ||
const items = ref(null as null | Item[]) | ||
</script> | ||
|
||
<template> | ||
<div v-for="item in items" :key="item.id"> | ||
<div>{{ item.id }}</div> | ||
<div>{{ item.text }}</div> | ||
</div> | ||
</template> |