mirror of
				https://github.com/soybeanjs/soybean-admin.git
				synced 2025-11-04 15:53:43 +08:00 
			
		
		
		
	build(projects): 引入@unocss/vite替换unocss,精简体积
This commit is contained in:
		@@ -1,7 +1,7 @@
 | 
			
		||||
import type { PluginOption } from 'vite';
 | 
			
		||||
import vue from '@vitejs/plugin-vue';
 | 
			
		||||
import vueJsx from '@vitejs/plugin-vue-jsx';
 | 
			
		||||
import unocss from 'unocss/vite';
 | 
			
		||||
import unocss from '@unocss/vite';
 | 
			
		||||
import { VitePWA } from 'vite-plugin-pwa';
 | 
			
		||||
import progress from 'vite-plugin-progress';
 | 
			
		||||
import html from './html';
 | 
			
		||||
 
 | 
			
		||||
@@ -46,6 +46,7 @@
 | 
			
		||||
    "typecheck": "vue-tsc --noEmit --skipLibCheck",
 | 
			
		||||
    "lint": "eslint . --fix",
 | 
			
		||||
    "prepare": "husky install",
 | 
			
		||||
    "clean": "pnpm rimraf node_modules pnpm-lock.yaml",
 | 
			
		||||
    "postinstall": "patch-package",
 | 
			
		||||
    "release": "standard-version",
 | 
			
		||||
    "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md"
 | 
			
		||||
@@ -89,6 +90,8 @@
 | 
			
		||||
    "@types/node": "^18.7.14",
 | 
			
		||||
    "@types/qs": "^6.9.7",
 | 
			
		||||
    "@types/ua-parser-js": "^0.7.36",
 | 
			
		||||
    "@unocss/preset-uno": "^0.45.13",
 | 
			
		||||
    "@unocss/vite": "^0.45.13",
 | 
			
		||||
    "@vitejs/plugin-vue": "^3.0.3",
 | 
			
		||||
    "@vitejs/plugin-vue-jsx": "^2.0.0",
 | 
			
		||||
    "commitizen": "^4.2.5",
 | 
			
		||||
@@ -105,7 +108,6 @@
 | 
			
		||||
    "sass": "^1.54.7",
 | 
			
		||||
    "standard-version": "^9.5.0",
 | 
			
		||||
    "typescript": "4.8.2",
 | 
			
		||||
    "unocss": "^0.45.13",
 | 
			
		||||
    "unplugin-icons": "^0.14.8",
 | 
			
		||||
    "unplugin-vue-components": "0.22.4",
 | 
			
		||||
    "unplugin-vue-define-options": "^0.11.1",
 | 
			
		||||
 
 | 
			
		||||
@@ -14,8 +14,9 @@
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup lang="ts">
 | 
			
		||||
<script setup lang="tsx">
 | 
			
		||||
import { onMounted, ref } from 'vue';
 | 
			
		||||
import { NSpace, NButton, NPopconfirm } from 'naive-ui';
 | 
			
		||||
import type { DataTableColumn } from 'naive-ui';
 | 
			
		||||
import { useLoadingEmpty } from '@/hooks';
 | 
			
		||||
import { getRandomInteger } from '@/utils';
 | 
			
		||||
@@ -36,11 +37,33 @@ const columns: DataTableColumn[] = [
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    title: 'Age',
 | 
			
		||||
    key: 'age'
 | 
			
		||||
    key: 'age',
 | 
			
		||||
    align: 'center'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    title: 'Address',
 | 
			
		||||
    key: 'address'
 | 
			
		||||
    key: 'address',
 | 
			
		||||
    align: 'center'
 | 
			
		||||
  },
 | 
			
		||||
  {
 | 
			
		||||
    key: 'action',
 | 
			
		||||
    title: 'Action',
 | 
			
		||||
    align: 'center',
 | 
			
		||||
    render: () => {
 | 
			
		||||
      return (
 | 
			
		||||
        <NSpace justify={'center'}>
 | 
			
		||||
          <NButton size={'small'} onClick={() => {}}>
 | 
			
		||||
            编辑
 | 
			
		||||
          </NButton>
 | 
			
		||||
          <NPopconfirm onPositiveClick={() => {}}>
 | 
			
		||||
            {{
 | 
			
		||||
              default: () => '确认删除',
 | 
			
		||||
              trigger: () => <NButton size={'small'}>删除</NButton>
 | 
			
		||||
            }}
 | 
			
		||||
          </NPopconfirm>
 | 
			
		||||
        </NSpace>
 | 
			
		||||
      );
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,8 @@
 | 
			
		||||
import { defineConfig, presetUno } from 'unocss';
 | 
			
		||||
import { defineConfig } from '@unocss/vite';
 | 
			
		||||
import presetUno from '@unocss/preset-uno';
 | 
			
		||||
 | 
			
		||||
export default defineConfig({
 | 
			
		||||
  exclude: ['node_modules', '.git', '.husky', '.vscode', 'dist', 'public', 'build', 'mock', './stats.html'],
 | 
			
		||||
  exclude: ['node_modules', 'dist', '.git', '.husky', '.vscode', 'public', 'build', 'mock', './stats.html'],
 | 
			
		||||
  presets: [presetUno({ dark: 'class' })],
 | 
			
		||||
  shortcuts: {
 | 
			
		||||
    'wh-full': 'w-full h-full',
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user