Migrate all Vue components from Options API to <script setup>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,24 +10,15 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script setup>
|
||||
import { onMounted } from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useLoginStore } from '@/stores/login';
|
||||
|
||||
export default {
|
||||
setup() {
|
||||
const store = useLoginStore();
|
||||
const { userData } = storeToRefs(store);
|
||||
const { getUserData } = store;
|
||||
|
||||
return {
|
||||
userData,
|
||||
getUserData,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getUserData();
|
||||
}
|
||||
};
|
||||
const store = useLoginStore();
|
||||
const { userData } = storeToRefs(store);
|
||||
|
||||
onMounted(() => {
|
||||
store.getUserData();
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user