This commit is contained in:
zhangchuanlong 2022-02-25 14:15:08 +08:00
commit d955f55f7c
11 changed files with 880 additions and 512 deletions

View File

@ -1,11 +1,24 @@
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
import VueSetupExtend from 'vite-plugin-vue-setup-extend'
import { unocss } from './unocss'
import { configHtmlPlugin } from './html'
import { configMockPlugin } from './mock'
export function createVitePlugins(viteEnv, isBuild) {
const plugins = [vue(), VueSetupExtend(), unocss(), configHtmlPlugin(viteEnv, isBuild)]
const plugins = [
vue(),
Components({
resolvers: [NaiveUiResolver()],
}),
VueSetupExtend(),
unocss(),
configHtmlPlugin(viteEnv, isBuild),
]
viteEnv?.VITE_APP_USE_MOCK && plugins.push(configMockPlugin(isBuild))

View File

@ -39,6 +39,7 @@
"sass": "^1.38.1",
"unocss": "^0.16.4",
"vite": "^2.8.0",
"unplugin-vue-components": "^0.17.18",
"vite-plugin-html": "^2.1.1",
"vite-plugin-mock": "^2.9.6",
"vite-plugin-vue-setup-extend": "^0.3.0"

961
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,4 @@
<script setup>
import { NConfigProvider, NGlobalStyle, NLoadingBarProvider, NMessageProvider, NDialogProvider } from 'naive-ui'
import MessageContent from './MessageContent.vue'
import DialogContent from './DialogContent.vue'
import LoadingBar from './LoadingBar.vue'

View File

@ -1,5 +1,4 @@
<script setup>
import { NBreadcrumb, NBreadcrumbItem } from 'naive-ui'
import { useRouter } from 'vue-router'
const router = useRouter()
const { currentRoute } = router

View File

@ -1,7 +1,6 @@
<script setup>
import { useUserStore } from '@/store/modules/user'
import { useRouter } from 'vue-router'
import { NDropdown } from 'naive-ui'
import { resetRouter } from '@/router'
import { usePermissionStore } from '@/store/modules/permission'
import { NOT_FOUND_ROUTE } from '@/router/routes'

View File

@ -1,5 +1,4 @@
<script setup>
import { NGradientText, NIcon } from 'naive-ui'
import { LastfmSquare } from '@vicons/fa'
const title = import.meta.env.VITE_APP_TITLE
</script>

View File

@ -1,7 +1,6 @@
<script setup>
import { NMenu } from 'naive-ui'
import { useRouter } from 'vue-router'
import { computed, toRef } from 'vue'
import { computed } from 'vue'
import { usePermissionStore } from '@/store/modules/permission'
import { isExternal } from '@/utils/is'

View File

@ -1,6 +1,4 @@
<script setup>
import { NLayout, NLayoutHeader, NLayoutSider } from 'naive-ui'
import AppHeader from './components/header/index.vue'
import SideMenu from './components/sidebar/index.vue'
import AppMain from './components/AppMain.vue'

View File

@ -1,5 +1,4 @@
<script setup name="TestDialog">
import { NButton } from 'naive-ui'
const handleDelete = function () {
$dialog.confirm({
content: '确认删除?',

View File

@ -1,6 +1,4 @@
<script setup>
import { NButton } from 'naive-ui'
function handleLogin() {
$message.loading('登陆中...')
setTimeout(() => {