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:
@@ -22,42 +22,25 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script setup>
|
||||
import { onBeforeMount, computed, ref } from 'vue';
|
||||
import i18next from '@/i18n/i18n.js';
|
||||
import { useAcctMgmtStore } from '@/stores/acctMgmt';
|
||||
import ModalHeader from './ModalHeader.vue';
|
||||
import Badge from '../../components/Badge.vue';
|
||||
|
||||
export default {
|
||||
setup(){
|
||||
const acctMgmtStore = useAcctMgmtStore();
|
||||
const visitTime = ref(0);
|
||||
const currentViewingUser = computed(() => acctMgmtStore.currentViewingUser);
|
||||
const {
|
||||
username,
|
||||
name,
|
||||
is_admin,
|
||||
is_active,
|
||||
} = currentViewingUser.value;
|
||||
const acctMgmtStore = useAcctMgmtStore();
|
||||
const visitTime = ref(0);
|
||||
const currentViewingUser = computed(() => acctMgmtStore.currentViewingUser);
|
||||
const {
|
||||
username,
|
||||
name,
|
||||
is_admin,
|
||||
is_active,
|
||||
} = currentViewingUser.value;
|
||||
|
||||
onBeforeMount(async() => {
|
||||
await acctMgmtStore.getUserDetail(currentViewingUser.value.username);
|
||||
visitTime.value = currentViewingUser.value.detail.visits;
|
||||
});
|
||||
|
||||
return {
|
||||
i18next,
|
||||
username,
|
||||
name,
|
||||
is_admin,
|
||||
is_active,
|
||||
visitTime,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
ModalHeader,
|
||||
Badge,
|
||||
}
|
||||
}
|
||||
</script>
|
||||
onBeforeMount(async() => {
|
||||
await acctMgmtStore.getUserDetail(currentViewingUser.value.username);
|
||||
visitTime.value = currentViewingUser.value.detail.visits;
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user