Nuxt/test/fixtures/bridge/pages/index.vue

21 lines
569 B
Vue
Raw Normal View History

2021-09-05 21:21:33 +00:00
<template>
2021-10-11 17:48:03 +00:00
<div>
<div>Hello Vue {{ version }}!</div>
<div>
State: {{ state }} <button @click="updateState">
Update
</button>
</div>
Rendered on server: {{ serverBuild }}
2021-10-11 17:48:03 +00:00
</div>
2021-09-05 21:21:33 +00:00
</template>
<script setup>
useMeta({ meta: [{ name: 'description', content: 'This is a page to demo Nuxt Bridge.' }] })
const version = ref('2')
2021-10-11 17:48:03 +00:00
const state = useState('test-state')
state.value = '123'
const updateState = () => { state.value = '456' }
const serverBuild = useState('server-build', () => getCurrentInstance().proxy.$isServer)
</script>