Intermedio
4 ottobre 2026Trova il bug: Vue.js / Nuxt.js
Uno snippet di codice. Trova il bug, o dimostra che non ce n'è.
typescript
1import { defineStore } from 'pinia'
2
3type OrderStatus = 'pending' | 'paid' | 'shipped' | 'cancelled'
4
5export const useOrderStore = defineStore('order', {
6 actions: {
7 getStatusLabel(status: OrderStatus): string {
8 switch (status) {
9 case 'pending':
10 return 'En attente'
11 case 'paid':
12 case 'shipped':
13 return 'Payée'
14 case 'cancelled':
15 return 'Annulée'
16 default:
17 return 'Inconnu'
18 }
19 },
20 },
21})Clicca sulle righe che causano il problema.
Il tuo verdetto
Un tentativo al giorno. La risposta appare subito dopo.
Mantieni la tua serie
Crea un account per conservare la tua serie e seguire i tuoi progressi.