mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 15:42:09 +00:00
b2b4c64807
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
29 lines
435 B
Vue
29 lines
435 B
Vue
<template>
|
|
<div>
|
|
About
|
|
{{ path }}
|
|
<button @click="path = 'newpath'">
|
|
Update path
|
|
</button>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
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>
|