docs: update examples to use function declarations for clarity (#30588)

This commit is contained in:
Alex Liu 2025-01-14 22:36:09 +08:00 committed by GitHub
parent 2448e86f84
commit 0a2b01fbc4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -77,7 +77,7 @@ let previousTodos = []
// Access to the cached value of useAsyncData in todos.vue
const { data: todos } = useNuxtData('todos')
const addTodo = async () => {
async function addTodo () {
return $fetch('/api/addTodo', {
method: 'post',
body: {