Skip to content

Commit

Permalink
fix: render error for fetching-data example (#2937)
Browse files Browse the repository at this point in the history
  • Loading branch information
wbxl2000 authored Jul 23, 2024
1 parent a946fec commit 327acb6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/examples/src/fetching-data/App/composition.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const branches = ['main', 'v2-compat']
export default {
setup() {
const currentBranch = ref(branches[0])
const commits = ref(null)
const commits = ref([])

watchEffect(async () => {
// this effect will run immediately and then
Expand Down
2 changes: 1 addition & 1 deletion src/examples/src/fetching-data/App/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
data: () => ({
branches: ['main', 'v2-compat'],
currentBranch: 'main',
commits: null
commits: []
}),

created() {
Expand Down
4 changes: 2 additions & 2 deletions src/examples/src/fetching-data/App/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ <h1>Latest Vue Core Commits</h1>
<label :for="branch">{{ branch }}</label>
</template>
<p>vuejs/vue@{{ currentBranch }}</p>
<ul>
<li v-for="{ html_url, sha, author, commit } in commits">
<ul v-if="commits.length > 0">
<li v-for="{ html_url, sha, author, commit } in commits" :key="sha">
<a :href="html_url" target="_blank" class="commit">{{ sha.slice(0, 7) }}</a>
- <span class="message">{{ truncate(commit.message) }}</span><br>
by <span class="author">
Expand Down

0 comments on commit 327acb6

Please sign in to comment.