refactor!: 重构多个子包

- 移除 unbuild --stub 模式
- faToast -> useFaToast
This commit is contained in:
Hooray
2026-05-17 03:54:49 +08:00
parent 40cab5efa3
commit 749c55edbc
372 changed files with 806 additions and 2265 deletions
+2 -2
View File
@@ -51,7 +51,7 @@ function handleError(error: any) {
useAppAccountStore().requestLogout()
}
else {
faToast.error('Error', {
useFaToast().error('Error', {
description: error.message,
})
}
@@ -70,7 +70,7 @@ api.interceptors.response.use(
if (typeof response.data === 'object') {
if (response.data.status === 1) {
if (response.data.error) {
faToast.warning('Warning', {
useFaToast().warning('Warning', {
description: response.data.error,
})
return Promise.reject(response.data)
@@ -32,7 +32,7 @@ const form = useForm({
const onSubmit = form.handleSubmit((values) => {
loading.value = true
appAccountStore.editPassword(values).then(async () => {
faToast.success('模拟修改成功,请重新登录')
useFaToast().success('模拟修改成功,请重新登录')
appAccountStore.logout()
}).finally(() => {
loading.value = false
+2 -2
View File
@@ -80,13 +80,13 @@ export function useAppTabbar() {
const index = appTabbarStore.list.findIndex(item => item.tabId === tabId)
if (index < 0) {
flag = false
!checkOnly && faToast.warning('关闭的标签页不存在', {
!checkOnly && useFaToast().warning('关闭的标签页不存在', {
position: 'top-center',
})
}
else if (appTabbarStore.list.length <= 1) {
flag = false
!checkOnly && faToast.warning('当前只有一个标签页,不可关闭', {
!checkOnly && useFaToast().warning('当前只有一个标签页,不可关闭', {
position: 'top-center',
})
}
@@ -72,13 +72,13 @@ watch(() => route, (val) => {
function tabbarScrollTip() {
if (tabContainerRef.value?.$el.clientWidth > (tabsRef.value?.ref?.$el.clientWidth ?? 0) && !localStorage.has('tabbarScrollTip')) {
localStorage.setItem('tabbarScrollTip', '')
const tips = faToast.info('温馨提示', {
const tips = useFaToast().info('温馨提示', {
description: '标签栏数量超过展示区域范围,可以将鼠标移到标签栏上,通过鼠标滚轮滑动浏览',
position: 'top-center',
duration: Infinity,
action: {
label: '知道了',
onClick: () => faToast.dismiss(tips),
onClick: () => useFaToast().dismiss(tips),
},
})
}
@@ -8,7 +8,7 @@ defineOptions({
const route = useRoute()
const { copy, copied } = useClipboard()
watch(copied, (val) => {
val && faToast.success('复制成功')
val && useFaToast().success('复制成功')
})
function open() {
+1 -1
View File
@@ -16,7 +16,6 @@ declare global {
const defineComponent: typeof import('vue').defineComponent
const defineStore: typeof import('pinia').defineStore
const effectScope: typeof import('vue').effectScope
const faToast: typeof import('@fantastic-admin/components').faToast
const getActivePinia: typeof import('pinia').getActivePinia
const getCurrentInstance: typeof import('vue').getCurrentInstance
const getCurrentScope: typeof import('vue').getCurrentScope
@@ -84,6 +83,7 @@ declare global {
const useFaDrawer: typeof import('@fantastic-admin/components').useFaDrawer
const useFaImagePreview: typeof import('@fantastic-admin/components').useFaImagePreview
const useFaModal: typeof import('@fantastic-admin/components').useFaModal
const useFaToast: typeof import('@fantastic-admin/components').useFaToast
const useId: typeof import('vue').useId
const useLink: typeof import('vue-router').useLink
const useModel: typeof import('vue').useModel
Vendored Executable → Regular
View File
+4 -1
View File
@@ -47,7 +47,10 @@ export default defineConfig(({ mode, command }) => {
},
plugins: createVitePlugins(mode, command === 'build'),
optimizeDeps: {
exclude: ['@fantastic-admin/components'],
exclude: [
'@fantastic-admin/components',
'@fantastic-admin/composables',
],
},
resolve: {
alias: {