Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 1164d35

Browse files
committed
use script-setup
1 parent a702140 commit 1164d35

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

starters/vue/client/layouts/auth.vue

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,15 @@
22
<div class="contents">
33
<template v-if="!state.user.authenticated">
44
<p>This route needs authentication.</p>
5-
<button @click="authenticate">
5+
<button @click="actions.authenticate(state)">
66
Click this button to authenticate.
77
</button>
88
</template>
99
<slot v-else></slot>
1010
</div>
1111
</template>
1212

13-
<script>
13+
<script setup>
1414
import { useRouteContext } from '/dx:core.js'
15-
16-
export default {
17-
setup () {
18-
const { actions, state } = useRouteContext()
19-
return {
20-
state,
21-
authenticate: () => actions.authenticate(state)
22-
}
23-
}
24-
}
15+
const { actions, state } = useRouteContext()
2516
</script>

0 commit comments

Comments
 (0)