Skip to content

Commit 9448652

Browse files
Fix vue code fences (#1420)
1 parent dfa2e45 commit 9448652

File tree

1 file changed

+34
-30
lines changed

1 file changed

+34
-30
lines changed

examples/tutorials/vue.md

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,10 @@ at `/:dinosaur`.
203203
Finally, you can delete all of the code in the `src/App.vue` file to and update
204204
it to include only the `<RouterView>` component:
205205
206-
```vue title="App.vue"
206+
```html title="App.vue"
207207
<template>
208208
<RouterView />
209-
</template>;
209+
</template>
210210
```
211211
212212
### The components
@@ -231,25 +231,27 @@ up earlier and render them as links using the
231231
`lang="ts"` attribute on the script tag.) Add the following code to the
232232
`Dinosaurs.vue` file:
233233
234-
```vue title="Dinosaurs.vue"
234+
```html title="Dinosaurs.vue"
235235
<script lang="ts">
236-
import { defineComponent } from 'vue';
236+
import { defineComponent } from "vue";
237237

238-
export default defineComponent({
238+
export default defineComponent({
239239
async setup() {
240-
const res = await fetch("http://localhost:8000/dinosaurs")
241-
const dinosaurs = await res.json() as Dinosaur[];
242-
return { dinosaurs };
243-
}
244-
});
240+
const res = await fetch("http://localhost:8000/dinosaurs");
241+
const dinosaurs = await res.json() as Dinosaur[];
242+
return { dinosaurs };
243+
},
244+
});
245245
</script>
246246

247247
<template>
248-
<div v-for="dinosaur in dinosaurs" :key="dinosaur.name">
249-
<RouterLink :to="{ name: 'Dinosaur', params: { dinosaur: `${dinosaur.name.toLowerCase()}` } }" >
250-
{{ dinosaur.name }}
251-
</RouterLink>
252-
</div>
248+
<div v-for="dinosaur in dinosaurs" :key="dinosaur.name">
249+
<RouterLink
250+
:to="{ name: 'Dinosaur', params: { dinosaur: `${dinosaur.name.toLowerCase()}` } }"
251+
>
252+
{{ dinosaur.name }}
253+
</RouterLink>
254+
</div>
253255
</template>
254256
```
255257
@@ -265,9 +267,9 @@ uniquely identify each dinosaur.
265267
The homepage will contain a heading and then it will render the `Dinosaurs`
266268
component. Add the following code to the `HomePage.vue` file:
267269
268-
```vue title="HomePage.vue"
270+
```html title="HomePage.vue"
269271
<script setup lang="ts">
270-
import Dinosaurs from './Dinosaurs.vue';
272+
import Dinosaurs from "./Dinosaurs.vue";
271273
</script>
272274
<template>
273275
<h1>Welcome to the Dinosaur App! 🦕</h1>
@@ -308,28 +310,30 @@ type ComponentData = {
308310
309311
Then update the `Dinosaur.vue` file:
310312
311-
```vue title="Dinosaur.vue"
313+
```html title="Dinosaur.vue"
312314
<script lang="ts">
313-
import { defineComponent } from 'vue';
315+
import { defineComponent } from "vue";
314316

315-
export default defineComponent({
317+
export default defineComponent({
316318
props: { dinosaur: String },
317319
data(): ComponentData {
318-
return {
319-
dinosaurDetails: null
320-
};
320+
return {
321+
dinosaurDetails: null,
322+
};
321323
},
322324
async mounted() {
323-
const res = await fetch(`http://localhost:8000/dinosaurs/${this.dinosaur}`);
324-
this.dinosaurDetails = await res.json();
325-
}
326-
});
325+
const res = await fetch(
326+
`http://localhost:8000/dinosaurs/${this.dinosaur}`,
327+
);
328+
this.dinosaurDetails = await res.json();
329+
},
330+
});
327331
</script>
328332

329333
<template>
330-
<h1>{{ dinosaurDetails?.name }}</h1>
331-
<p>{{ dinosaurDetails?.description }}</p>
332-
<RouterLink to="/">🠠 Back to all dinosaurs</RouterLink>
334+
<h1>{{ dinosaurDetails?.name }}</h1>
335+
<p>{{ dinosaurDetails?.description }}</p>
336+
<RouterLink to="/">🠠 Back to all dinosaurs</RouterLink>
333337
</template>
334338
```
335339

0 commit comments

Comments
 (0)