mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-16 02:44:51 +00:00
32 lines
510 B
Vue
32 lines
510 B
Vue
<template>
|
|
<div>
|
|
About
|
|
{{ path }}
|
|
<button @click="path = 'newpath'">
|
|
Update path
|
|
</button>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { defineNuxtComponent } from '@nuxt/app'
|
|
import { ref } from 'vue'
|
|
|
|
export default defineNuxtComponent({
|
|
fetchKey: 'custom',
|
|
asyncData ({ route }) {
|
|
return {
|
|
path: route.path
|
|
}
|
|
},
|
|
setup () {
|
|
// This will get overwritten with asyncData
|
|
const path = ref('original path')
|
|
|
|
return {
|
|
path
|
|
}
|
|
}
|
|
})
|
|
</script>
|