build(pinia): Add pinia
build(vite-plugin-vue-setup-extend): Delete vite-plugin-vue-setup-extend build(unplugin-auto-import): Delete unplugin-auto-import build(unplugin-vue-components): Delete unplugin-vue-components build(vite-plugin-style-import): Add vite-plugin-style-import
This commit is contained in:
51
src/App.vue
51
src/App.vue
@@ -1,46 +1,11 @@
|
||||
<template>
|
||||
<div>sss</div>
|
||||
<div v:bg="blue-400 hover:blue-500 dark:blue-500 dark:hover:blue-600"> sssss </div>
|
||||
<div>sss</div>
|
||||
<HelloWorld msg="Hello Vue 3 + TypeScript + Vite" />
|
||||
<div>{{ t('test.about') }}</div>
|
||||
<div>{{ t('test2.go') }}</div>
|
||||
<button @click="change">切换语言</button>
|
||||
<el-icon><ep-add-location /></el-icon>
|
||||
<el-button size="mini">ss</el-button>
|
||||
<el-radio v-model="radio1" label="1">Option 1</el-radio>
|
||||
<el-radio v-model="radio1" label="2">Option 2</el-radio>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
// This starter template is using Vue 3 <script setup> SFCs
|
||||
// Check out https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup
|
||||
import HelloWorld from './components/HelloWorld.vue'
|
||||
const { t, availableLocales, locale } = useI18n()
|
||||
|
||||
const rootStyle = document.documentElement.style
|
||||
console.log(rootStyle)
|
||||
const radio1 = ref('')
|
||||
|
||||
function change() {
|
||||
const color = useCssVar('--el-color-primary', document.documentElement)
|
||||
color.value = '#df8543'
|
||||
const locales = availableLocales
|
||||
locale.value = locales[(locales.indexOf(locale.value) + 1) % locales.length]
|
||||
}
|
||||
import { ElConfigProvider } from 'element-plus'
|
||||
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
|
||||
// import en from 'element-plus/lib/locale/lang/en'
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#app {
|
||||
margin-top: 60px;
|
||||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
color: #2c3e50;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div {
|
||||
color: #2c3e50;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<ElConfigProvider :locale="zhCn">
|
||||
<RouterView class="app" />
|
||||
</ElConfigProvider>
|
||||
</template>
|
||||
|
||||
3
src/components/Form/index.ts
Normal file
3
src/components/Form/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import BfFrom from './src/BfForm.vue'
|
||||
|
||||
export { BfFrom }
|
||||
10
src/components/Form/src/BfForm.vue
Normal file
10
src/components/Form/src/BfForm.vue
Normal file
@@ -0,0 +1,10 @@
|
||||
<script lang="ts" setup>
|
||||
// import { propTypes } from '@/utils/propTypes'
|
||||
// import { array } from 'vue-types'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>hahah</div>
|
||||
</template>
|
||||
|
||||
<style lang="less" scoped></style>
|
||||
@@ -1,50 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
|
||||
defineProps<{ msg: string }>()
|
||||
|
||||
const count = ref(0)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<h1>{{ msg }}</h1>
|
||||
|
||||
<p>
|
||||
Recommended IDE setup:
|
||||
<a href="https://code.visualstudio.com/" target="_blank">VSCode</a>
|
||||
+
|
||||
<a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>
|
||||
</p>
|
||||
|
||||
<p>See <code>README.md</code> for more information.</p>
|
||||
|
||||
<p>
|
||||
<a href="https://vitejs.dev/guide/features.html" target="_blank"> Vite Docs </a>
|
||||
|
|
||||
<a href="https://v3.vuejs.org/" target="_blank">Vue 3 Docs</a>
|
||||
</p>
|
||||
|
||||
<button type="button" @click="count++"> count is: {{ count }} </button>
|
||||
<p>
|
||||
Edit
|
||||
<code>components/HelloWorld.vue</code> to test hot module replacement.
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
a {
|
||||
color: #42b983;
|
||||
}
|
||||
|
||||
label {
|
||||
margin: 0 0.5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
code {
|
||||
padding: 2px 4px;
|
||||
color: #304455;
|
||||
background-color: #eee;
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
||||
6
src/components/index.ts
Normal file
6
src/components/index.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { App } from 'vue'
|
||||
import { BfFrom } from './Form'
|
||||
|
||||
export function setupGlobCom(app: App<Element>) {
|
||||
app.component('BfFrom', BfFrom)
|
||||
}
|
||||
@@ -7,8 +7,16 @@ const app = createApp(App)
|
||||
// 引入windi css
|
||||
import '@/plugins/windicss'
|
||||
|
||||
// 引入全局组件
|
||||
import { setupGlobCom } from '@/components'
|
||||
setupGlobCom(app)
|
||||
|
||||
// 引入多语言
|
||||
import { setupI18n } from '@/plugins/i18n'
|
||||
setupI18n(app)
|
||||
|
||||
// 引入状态管理
|
||||
import { setupStore } from '@/store'
|
||||
setupStore(app)
|
||||
|
||||
app.mount('#app')
|
||||
|
||||
10
src/store/index.ts
Normal file
10
src/store/index.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { App } from 'vue'
|
||||
import { createPinia } from 'pinia'
|
||||
|
||||
const store = createPinia()
|
||||
|
||||
export function setupStore(app: App<Element>) {
|
||||
app.use(store)
|
||||
}
|
||||
|
||||
export { store }
|
||||
155
src/store/modules/app.ts
Normal file
155
src/store/modules/app.ts
Normal file
@@ -0,0 +1,155 @@
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
import { store } from '../index'
|
||||
|
||||
export type LayoutType = 'Classic' | 'LeftTop' | 'Top' | 'Test'
|
||||
|
||||
export interface AppState {
|
||||
collapsed: boolean
|
||||
showTags: boolean
|
||||
showLogo: boolean
|
||||
showNavbar: boolean
|
||||
fixedHeader: boolean
|
||||
layout: LayoutType
|
||||
showBreadcrumb: boolean
|
||||
showHamburger: boolean
|
||||
showScreenfull: boolean
|
||||
showUserInfo: boolean
|
||||
title: string
|
||||
logoTitle: string
|
||||
userInfo: string
|
||||
greyMode: boolean
|
||||
showBackTop: boolean
|
||||
showMenuTab: boolean
|
||||
requestTime: boolean
|
||||
}
|
||||
|
||||
export const useAppStore = defineStore({
|
||||
id: 'app',
|
||||
state: (): AppState => ({
|
||||
collapsed: false, // 菜单栏是否栏缩收
|
||||
showLogo: true, // 是否显示logo
|
||||
showTags: true, // 是否显示标签栏
|
||||
showNavbar: true, // 是否显示navbar
|
||||
fixedHeader: true, // 是否固定header
|
||||
layout: 'Classic', // layout布局
|
||||
showBreadcrumb: true, // 是否显示面包屑
|
||||
showHamburger: true, // 是否显示侧边栏缩收按钮
|
||||
showScreenfull: true, // 是否全屏按钮
|
||||
showUserInfo: true, // 是否显示用户头像
|
||||
title: 'butterfly-admin', // 标题
|
||||
logoTitle: 'butterfly-admin', // logo标题
|
||||
userInfo: 'userInfo', // 登录信息存储字段-建议每个项目换一个字段,避免与其他项目冲突
|
||||
greyMode: false, // 是否开始灰色模式,用于特殊悼念日
|
||||
showBackTop: true, // 是否显示回到顶部
|
||||
showMenuTab: false, // 是否固定一级菜单
|
||||
requestTime: false // 是否在接口调用时添加时间戳,避免IE缓存
|
||||
}),
|
||||
getters: {
|
||||
getCollapsed(): boolean {
|
||||
return this.collapsed
|
||||
},
|
||||
getShowLogo(): boolean {
|
||||
return this.showLogo
|
||||
},
|
||||
getShowTags(): boolean {
|
||||
return this.showTags
|
||||
},
|
||||
getShowNavbar(): boolean {
|
||||
return this.showNavbar
|
||||
},
|
||||
getFixedHeader(): boolean {
|
||||
return this.fixedHeader
|
||||
},
|
||||
getLayout(): LayoutType {
|
||||
return this.layout
|
||||
},
|
||||
getShowBreadcrumb(): boolean {
|
||||
return this.showBreadcrumb
|
||||
},
|
||||
getShowHamburger(): boolean {
|
||||
return this.showHamburger
|
||||
},
|
||||
getShowScreenfull(): boolean {
|
||||
return this.showScreenfull
|
||||
},
|
||||
getShowUserInfo(): boolean {
|
||||
return this.showUserInfo
|
||||
},
|
||||
getTitle(): string {
|
||||
return this.title
|
||||
},
|
||||
getLogoTitle(): string {
|
||||
return this.logoTitle
|
||||
},
|
||||
getUserInfo(): string {
|
||||
return this.userInfo
|
||||
},
|
||||
getGreyMode(): boolean {
|
||||
return this.greyMode
|
||||
},
|
||||
getShowBackTop(): boolean {
|
||||
return this.showBackTop
|
||||
},
|
||||
getShowMenuTab(): boolean {
|
||||
return this.showMenuTab
|
||||
},
|
||||
getRequestTime(): boolean {
|
||||
return this.requestTime
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
setCollapsed(collapsed: boolean): void {
|
||||
this.collapsed = collapsed
|
||||
},
|
||||
setShowLogo(showLogo: boolean): void {
|
||||
this.showLogo = showLogo
|
||||
},
|
||||
setShowTags(showTags: boolean): void {
|
||||
this.showTags = showTags
|
||||
},
|
||||
setShowNavbar(showNavbar: boolean): void {
|
||||
this.showNavbar = showNavbar
|
||||
},
|
||||
setFixedHeader(fixedHeader: boolean): void {
|
||||
this.fixedHeader = fixedHeader
|
||||
},
|
||||
setLayout(layout: LayoutType): void {
|
||||
this.layout = layout
|
||||
},
|
||||
setBreadcrumb(showBreadcrumb: boolean): void {
|
||||
this.showBreadcrumb = showBreadcrumb
|
||||
},
|
||||
setHamburger(showHamburger: boolean): void {
|
||||
this.showHamburger = showHamburger
|
||||
},
|
||||
setScreenfull(showScreenfull: boolean): void {
|
||||
this.showScreenfull = showScreenfull
|
||||
},
|
||||
setUserInfo(showUserInfo: boolean): void {
|
||||
this.showUserInfo = showUserInfo
|
||||
},
|
||||
setTitle(title: string): void {
|
||||
this.title = title
|
||||
},
|
||||
setLogoTitle(logoTitle: string): void {
|
||||
this.logoTitle = logoTitle
|
||||
},
|
||||
setGreyMode(greyMode: boolean): void {
|
||||
this.greyMode = greyMode
|
||||
},
|
||||
setShowBackTop(showBackTop: boolean): void {
|
||||
this.showBackTop = showBackTop
|
||||
},
|
||||
setShowMenuTab(showMenuTab: boolean): void {
|
||||
this.showMenuTab = showMenuTab
|
||||
},
|
||||
setRequestTime(requestTime: boolean): void {
|
||||
this.requestTime = requestTime
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
export function useAppStoreWithOut() {
|
||||
return useAppStore(store)
|
||||
}
|
||||
194
src/types/auto-imports.d.ts
vendored
194
src/types/auto-imports.d.ts
vendored
@@ -1,194 +0,0 @@
|
||||
// Generated by 'unplugin-auto-import'
|
||||
// We suggest you to commit this file into source control
|
||||
declare global {
|
||||
const asyncComputed: typeof import('@vueuse/core')['asyncComputed']
|
||||
const autoResetRef: typeof import('@vueuse/core')['autoResetRef']
|
||||
const biSyncRef: typeof import('@vueuse/core')['biSyncRef']
|
||||
const computed: typeof import('vue')['computed']
|
||||
const computedInject: typeof import('@vueuse/core')['computedInject']
|
||||
const controlledComputed: typeof import('@vueuse/core')['controlledComputed']
|
||||
const controlledRef: typeof import('@vueuse/core')['controlledRef']
|
||||
const createApp: typeof import('vue')['createApp']
|
||||
const createEventHook: typeof import('@vueuse/core')['createEventHook']
|
||||
const createGlobalState: typeof import('@vueuse/core')['createGlobalState']
|
||||
const createReactiveFn: typeof import('@vueuse/core')['createReactiveFn']
|
||||
const createSharedComposable: typeof import('@vueuse/core')['createSharedComposable']
|
||||
const createUnrefFn: typeof import('@vueuse/core')['createUnrefFn']
|
||||
const customRef: typeof import('vue')['customRef']
|
||||
const debouncedRef: typeof import('@vueuse/core')['debouncedRef']
|
||||
const debouncedWatch: typeof import('@vueuse/core')['debouncedWatch']
|
||||
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
|
||||
const defineComponent: typeof import('vue')['defineComponent']
|
||||
const eagerComputed: typeof import('@vueuse/core')['eagerComputed']
|
||||
const effectScope: typeof import('vue')['effectScope']
|
||||
const EffectScope: typeof import('vue')['EffectScope']
|
||||
const extendRef: typeof import('@vueuse/core')['extendRef']
|
||||
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
|
||||
const getCurrentScope: typeof import('vue')['getCurrentScope']
|
||||
const h: typeof import('vue')['h']
|
||||
const ignorableWatch: typeof import('@vueuse/core')['ignorableWatch']
|
||||
const inject: typeof import('vue')['inject']
|
||||
const isDefined: typeof import('@vueuse/core')['isDefined']
|
||||
const isReadonly: typeof import('vue')['isReadonly']
|
||||
const isRef: typeof import('vue')['isRef']
|
||||
const makeDestructurable: typeof import('@vueuse/core')['makeDestructurable']
|
||||
const markRaw: typeof import('vue')['markRaw']
|
||||
const nextTick: typeof import('vue')['nextTick']
|
||||
const onActivated: typeof import('vue')['onActivated']
|
||||
const onBeforeMount: typeof import('vue')['onBeforeMount']
|
||||
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
|
||||
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
|
||||
const onClickOutside: typeof import('@vueuse/core')['onClickOutside']
|
||||
const onDeactivated: typeof import('vue')['onDeactivated']
|
||||
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
|
||||
const onKeyStroke: typeof import('@vueuse/core')['onKeyStroke']
|
||||
const onMounted: typeof import('vue')['onMounted']
|
||||
const onRenderTracked: typeof import('vue')['onRenderTracked']
|
||||
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
|
||||
const onScopeDispose: typeof import('vue')['onScopeDispose']
|
||||
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
|
||||
const onStartTyping: typeof import('@vueuse/core')['onStartTyping']
|
||||
const onUnmounted: typeof import('vue')['onUnmounted']
|
||||
const onUpdated: typeof import('vue')['onUpdated']
|
||||
const pausableWatch: typeof import('@vueuse/core')['pausableWatch']
|
||||
const provide: typeof import('vue')['provide']
|
||||
const reactify: typeof import('@vueuse/core')['reactify']
|
||||
const reactifyObject: typeof import('@vueuse/core')['reactifyObject']
|
||||
const reactive: typeof import('vue')['reactive']
|
||||
const reactivePick: typeof import('@vueuse/core')['reactivePick']
|
||||
const readonly: typeof import('vue')['readonly']
|
||||
const ref: typeof import('vue')['ref']
|
||||
const refDefault: typeof import('@vueuse/core')['refDefault']
|
||||
const shallowReactive: typeof import('vue')['shallowReactive']
|
||||
const shallowReadonly: typeof import('vue')['shallowReadonly']
|
||||
const shallowRef: typeof import('vue')['shallowRef']
|
||||
const syncRef: typeof import('@vueuse/core')['syncRef']
|
||||
const templateRef: typeof import('@vueuse/core')['templateRef']
|
||||
const throttledRef: typeof import('@vueuse/core')['throttledRef']
|
||||
const throttledWatch: typeof import('@vueuse/core')['throttledWatch']
|
||||
const toRaw: typeof import('vue')['toRaw']
|
||||
const toReactive: typeof import('@vueuse/core')['toReactive']
|
||||
const toRef: typeof import('vue')['toRef']
|
||||
const toRefs: typeof import('vue')['toRefs']
|
||||
const triggerRef: typeof import('vue')['triggerRef']
|
||||
const tryOnBeforeUnmount: typeof import('@vueuse/core')['tryOnBeforeUnmount']
|
||||
const tryOnMounted: typeof import('@vueuse/core')['tryOnMounted']
|
||||
const tryOnScopeDispose: typeof import('@vueuse/core')['tryOnScopeDispose']
|
||||
const tryOnUnmounted: typeof import('@vueuse/core')['tryOnUnmounted']
|
||||
const unref: typeof import('vue')['unref']
|
||||
const unrefElement: typeof import('@vueuse/core')['unrefElement']
|
||||
const until: typeof import('@vueuse/core')['until']
|
||||
const useActiveElement: typeof import('@vueuse/core')['useActiveElement']
|
||||
const useAsyncQueue: typeof import('@vueuse/core')['useAsyncQueue']
|
||||
const useAsyncState: typeof import('@vueuse/core')['useAsyncState']
|
||||
const useAttrs: typeof import('vue')['useAttrs']
|
||||
const useBase64: typeof import('@vueuse/core')['useBase64']
|
||||
const useBattery: typeof import('@vueuse/core')['useBattery']
|
||||
const useBreakpoints: typeof import('@vueuse/core')['useBreakpoints']
|
||||
const useBrowserLocation: typeof import('@vueuse/core')['useBrowserLocation']
|
||||
const useClamp: typeof import('@vueuse/core')['useClamp']
|
||||
const useClipboard: typeof import('@vueuse/core')['useClipboard']
|
||||
const useConfirmDialog: typeof import('@vueuse/core')['useConfirmDialog']
|
||||
const useCounter: typeof import('@vueuse/core')['useCounter']
|
||||
const useCssModule: typeof import('vue')['useCssModule']
|
||||
const useCssVar: typeof import('@vueuse/core')['useCssVar']
|
||||
const useDark: typeof import('@vueuse/core')['useDark']
|
||||
const useDebounce: typeof import('@vueuse/core')['useDebounce']
|
||||
const useDebouncedRefHistory: typeof import('@vueuse/core')['useDebouncedRefHistory']
|
||||
const useDebounceFn: typeof import('@vueuse/core')['useDebounceFn']
|
||||
const useDeviceMotion: typeof import('@vueuse/core')['useDeviceMotion']
|
||||
const useDeviceOrientation: typeof import('@vueuse/core')['useDeviceOrientation']
|
||||
const useDevicePixelRatio: typeof import('@vueuse/core')['useDevicePixelRatio']
|
||||
const useDevicesList: typeof import('@vueuse/core')['useDevicesList']
|
||||
const useDisplayMedia: typeof import('@vueuse/core')['useDisplayMedia']
|
||||
const useDocumentVisibility: typeof import('@vueuse/core')['useDocumentVisibility']
|
||||
const useDraggable: typeof import('@vueuse/core')['useDraggable']
|
||||
const useElementBounding: typeof import('@vueuse/core')['useElementBounding']
|
||||
const useElementHover: typeof import('@vueuse/core')['useElementHover']
|
||||
const useElementSize: typeof import('@vueuse/core')['useElementSize']
|
||||
const useElementVisibility: typeof import('@vueuse/core')['useElementVisibility']
|
||||
const useEventBus: typeof import('@vueuse/core')['useEventBus']
|
||||
const useEventListener: typeof import('@vueuse/core')['useEventListener']
|
||||
const useEventSource: typeof import('@vueuse/core')['useEventSource']
|
||||
const useEyeDropper: typeof import('@vueuse/core')['useEyeDropper']
|
||||
const useFavicon: typeof import('@vueuse/core')['useFavicon']
|
||||
const useFetch: typeof import('@vueuse/core')['useFetch']
|
||||
const useFocus: typeof import('@vueuse/core')['useFocus']
|
||||
const useFps: typeof import('@vueuse/core')['useFps']
|
||||
const useFullscreen: typeof import('@vueuse/core')['useFullscreen']
|
||||
const useGeolocation: typeof import('@vueuse/core')['useGeolocation']
|
||||
const useI18n: typeof import('vue-i18n')['useI18n']
|
||||
const useIdle: typeof import('@vueuse/core')['useIdle']
|
||||
const useIntersectionObserver: typeof import('@vueuse/core')['useIntersectionObserver']
|
||||
const useInterval: typeof import('@vueuse/core')['useInterval']
|
||||
const useIntervalFn: typeof import('@vueuse/core')['useIntervalFn']
|
||||
const useKeyModifier: typeof import('@vueuse/core')['useKeyModifier']
|
||||
const useLastChanged: typeof import('@vueuse/core')['useLastChanged']
|
||||
const useLocalStorage: typeof import('@vueuse/core')['useLocalStorage']
|
||||
const useMagicKeys: typeof import('@vueuse/core')['useMagicKeys']
|
||||
const useManualRefHistory: typeof import('@vueuse/core')['useManualRefHistory']
|
||||
const useMediaControls: typeof import('@vueuse/core')['useMediaControls']
|
||||
const useMediaQuery: typeof import('@vueuse/core')['useMediaQuery']
|
||||
const useMemory: typeof import('@vueuse/core')['useMemory']
|
||||
const useMounted: typeof import('@vueuse/core')['useMounted']
|
||||
const useMouse: typeof import('@vueuse/core')['useMouse']
|
||||
const useMouseInElement: typeof import('@vueuse/core')['useMouseInElement']
|
||||
const useMousePressed: typeof import('@vueuse/core')['useMousePressed']
|
||||
const useMutationObserver: typeof import('@vueuse/core')['useMutationObserver']
|
||||
const useNetwork: typeof import('@vueuse/core')['useNetwork']
|
||||
const useNow: typeof import('@vueuse/core')['useNow']
|
||||
const useOnline: typeof import('@vueuse/core')['useOnline']
|
||||
const usePageLeave: typeof import('@vueuse/core')['usePageLeave']
|
||||
const useParallax: typeof import('@vueuse/core')['useParallax']
|
||||
const usePermission: typeof import('@vueuse/core')['usePermission']
|
||||
const usePointer: typeof import('@vueuse/core')['usePointer']
|
||||
const usePointerSwipe: typeof import('@vueuse/core')['usePointerSwipe']
|
||||
const usePreferredColorScheme: typeof import('@vueuse/core')['usePreferredColorScheme']
|
||||
const usePreferredDark: typeof import('@vueuse/core')['usePreferredDark']
|
||||
const usePreferredLanguages: typeof import('@vueuse/core')['usePreferredLanguages']
|
||||
const useRafFn: typeof import('@vueuse/core')['useRafFn']
|
||||
const useRefHistory: typeof import('@vueuse/core')['useRefHistory']
|
||||
const useResizeObserver: typeof import('@vueuse/core')['useResizeObserver']
|
||||
const useRoute: typeof import('vue-router')['useRoute']
|
||||
const useRouter: typeof import('vue-router')['useRouter']
|
||||
const useScriptTag: typeof import('@vueuse/core')['useScriptTag']
|
||||
const useScroll: typeof import('@vueuse/core')['useScroll']
|
||||
const useScrollLock: typeof import('@vueuse/core')['useScrollLock']
|
||||
const useSessionStorage: typeof import('@vueuse/core')['useSessionStorage']
|
||||
const useShare: typeof import('@vueuse/core')['useShare']
|
||||
const useSlots: typeof import('vue')['useSlots']
|
||||
const useSpeechRecognition: typeof import('@vueuse/core')['useSpeechRecognition']
|
||||
const useSpeechSynthesis: typeof import('@vueuse/core')['useSpeechSynthesis']
|
||||
const useStorage: typeof import('@vueuse/core')['useStorage']
|
||||
const useSwipe: typeof import('@vueuse/core')['useSwipe']
|
||||
const useTemplateRefsList: typeof import('@vueuse/core')['useTemplateRefsList']
|
||||
const useThrottle: typeof import('@vueuse/core')['useThrottle']
|
||||
const useThrottledRefHistory: typeof import('@vueuse/core')['useThrottledRefHistory']
|
||||
const useThrottleFn: typeof import('@vueuse/core')['useThrottleFn']
|
||||
const useTimeAgo: typeof import('@vueuse/core')['useTimeAgo']
|
||||
const useTimeout: typeof import('@vueuse/core')['useTimeout']
|
||||
const useTimeoutFn: typeof import('@vueuse/core')['useTimeoutFn']
|
||||
const useTimestamp: typeof import('@vueuse/core')['useTimestamp']
|
||||
const useTitle: typeof import('@vueuse/core')['useTitle']
|
||||
const useToggle: typeof import('@vueuse/core')['useToggle']
|
||||
const useTransition: typeof import('@vueuse/core')['useTransition']
|
||||
const useUrlSearchParams: typeof import('@vueuse/core')['useUrlSearchParams']
|
||||
const useUserMedia: typeof import('@vueuse/core')['useUserMedia']
|
||||
const useVirtualList: typeof import('@vueuse/core')['useVirtualList']
|
||||
const useVModel: typeof import('@vueuse/core')['useVModel']
|
||||
const useVModels: typeof import('@vueuse/core')['useVModels']
|
||||
const useWakeLock: typeof import('@vueuse/core')['useWakeLock']
|
||||
const useWebSocket: typeof import('@vueuse/core')['useWebSocket']
|
||||
const useWebWorker: typeof import('@vueuse/core')['useWebWorker']
|
||||
const useWebWorkerFn: typeof import('@vueuse/core')['useWebWorkerFn']
|
||||
const useWindowFocus: typeof import('@vueuse/core')['useWindowFocus']
|
||||
const useWindowScroll: typeof import('@vueuse/core')['useWindowScroll']
|
||||
const useWindowSize: typeof import('@vueuse/core')['useWindowSize']
|
||||
const watch: typeof import('vue')['watch']
|
||||
const watchAtMost: typeof import('@vueuse/core')['watchAtMost']
|
||||
const watchEffect: typeof import('vue')['watchEffect']
|
||||
const watchOnce: typeof import('@vueuse/core')['watchOnce']
|
||||
const watchWithFilter: typeof import('@vueuse/core')['watchWithFilter']
|
||||
const whenever: typeof import('@vueuse/core')['whenever']
|
||||
}
|
||||
export {}
|
||||
15
src/types/components.d.ts
vendored
15
src/types/components.d.ts
vendored
@@ -1,15 +0,0 @@
|
||||
// generated by unplugin-vue-components
|
||||
// We suggest you to commit this file into source control
|
||||
// Read more: https://github.com/vuejs/vue-next/pull/3399
|
||||
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
ElButton: typeof import('element-plus/es')['ElButton']
|
||||
ElIcon: typeof import('element-plus/es')['ElIcon']
|
||||
ElRadio: typeof import('element-plus/es')['ElRadio']
|
||||
EpAddLocation: typeof import('~icons/ep/add-location')['default']
|
||||
HelloWorld: typeof import('./../components/HelloWorld.vue')['default']
|
||||
}
|
||||
}
|
||||
|
||||
export {}
|
||||
7
src/types/v-components.d.ts
vendored
7
src/types/v-components.d.ts
vendored
@@ -0,0 +1,7 @@
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
BfFrom: typeof import('../components/Form/src/BfForm.vue')['default']
|
||||
}
|
||||
}
|
||||
|
||||
export {}
|
||||
|
||||
18
src/utils/index.ts
Normal file
18
src/utils/index.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { App, Plugin } from 'vue'
|
||||
|
||||
/**
|
||||
*
|
||||
* @param component 需要注册的组件
|
||||
* @param alias 组件别名
|
||||
* @returns any
|
||||
*/
|
||||
export const withInstall = <T>(component: T, alias?: string) => {
|
||||
const comp = component as any
|
||||
comp.install = (app: App) => {
|
||||
app.component(comp.name || comp.displayName, component)
|
||||
if (alias) {
|
||||
app.config.globalProperties[alias] = component
|
||||
}
|
||||
}
|
||||
return component as T & Plugin
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
import { createTypes, VueTypesInterface } from 'vue-types'
|
||||
|
||||
// 自定义扩展vue-types
|
||||
type PropTypes = VueTypesInterface & {}
|
||||
|
||||
const propTypes: PropTypes = createTypes({
|
||||
func: undefined,
|
||||
bool: undefined,
|
||||
string: undefined,
|
||||
number: undefined,
|
||||
object: undefined,
|
||||
integer: undefined,
|
||||
array: undefined
|
||||
})
|
||||
|
||||
// 需要自定义扩展的类型
|
||||
// see: https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#the-extend-method
|
||||
propTypes.extend([])
|
||||
|
||||
export { propTypes }
|
||||
31
src/utils/propTypes.ts
Normal file
31
src/utils/propTypes.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { createTypes, VueTypesInterface, VueTypeValidableDef } from 'vue-types'
|
||||
import { CSSProperties } from 'vue'
|
||||
|
||||
// 自定义扩展vue-types
|
||||
type PropTypes = VueTypesInterface & {
|
||||
readonly style: VueTypeValidableDef<CSSProperties>
|
||||
}
|
||||
|
||||
const propTypes = createTypes({
|
||||
func: undefined,
|
||||
bool: undefined,
|
||||
string: undefined,
|
||||
number: undefined,
|
||||
object: undefined,
|
||||
integer: undefined
|
||||
}) as PropTypes
|
||||
|
||||
console.log(propTypes.array)
|
||||
|
||||
// 需要自定义扩展的类型
|
||||
// see: https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#the-extend-method
|
||||
propTypes.extend([
|
||||
{
|
||||
name: 'style',
|
||||
getter: true,
|
||||
type: [String, Object],
|
||||
default: undefined
|
||||
}
|
||||
])
|
||||
|
||||
export { propTypes }
|
||||
Reference in New Issue
Block a user