refactor: migrate to Vant and set up auto-imports
- replace uni-ui drawer and icon components with Vant equivalents - add unplugin-auto-import and unplugin-vue-components to Vite config - update project dependencies to compatible versions - generate auto-import and component type declaration files - clean up deprecated imports and commented code in home page components - fix App.vue to use lowercase router-view and script setup
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<uni-drawer ref="drawerRef" mode="left" :width="320">
|
||||
<van-popup v-model:show="show" ref="drawerRef" position="left">
|
||||
<div class="drawer-home">
|
||||
<div class="drawer-home-nav">
|
||||
<uni-icons type="closeempty" size="22" color="#333333" class="close-icon" @click="close" />
|
||||
<van-icon name="cross" size="22" color="#333333" class="close-icon" @click="close" />
|
||||
<span class="title">我的</span>
|
||||
</div>
|
||||
|
||||
<MineSetting ref="mineSettingRef" @close="close" />
|
||||
<!-- <MineSetting ref="mineSettingRef" @close="close" /> -->
|
||||
</div>
|
||||
</uni-drawer>
|
||||
</van-popup>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -20,10 +20,12 @@ const drawerRef = ref(null);
|
||||
|
||||
// 监听抽屉显示事件
|
||||
const mineSettingRef = ref(null);
|
||||
const show = ref(false);
|
||||
|
||||
const open = async () => {
|
||||
await checkToken();
|
||||
|
||||
drawerRef.value?.open?.();
|
||||
show.value = true;
|
||||
|
||||
try {
|
||||
await mineSettingRef.value?.getLoginUserPhoneInfo?.();
|
||||
@@ -33,7 +35,7 @@ const open = async () => {
|
||||
};
|
||||
|
||||
// 监听抽屉隐藏事件
|
||||
const close = () => drawerRef.value?.close?.();
|
||||
const close = () => show.value = false;
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
|
||||
Reference in New Issue
Block a user