Skip to content

Commit

Permalink
style(API): style adjustments and importing TailwindCSS
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoJiSen committed Jul 22, 2024
1 parent 03f1d74 commit 21ad5df
Show file tree
Hide file tree
Showing 8 changed files with 466 additions and 4 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"@vitejs/plugin-vue": "^5.0.5",
"autoprefixer": "^10.4.19",
"cz-git": "1.9.0",
"czg": "^1.9.0",
"eslint": "^8.57.0",
Expand All @@ -60,6 +61,7 @@
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-config-standard": "^36.0.0",
"stylelint-config-standard-scss": "^13.0.0",
"tailwindcss": "^3.4.6",
"typescript": "^5.5.3",
"typescript-eslint": "^7.15.0",
"unplugin-vue-components": "^0.27.2",
Expand Down
417 changes: 417 additions & 0 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
autoprefixer: {},
tailwindcss: {}
}
};
26 changes: 23 additions & 3 deletions src/layouts/components/FileManagement/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<template>
<div>
<n-descriptions label-placement="top" class="tree-wrapper" :title="t('List of Assets')">
<n-descriptions label-placement="top" class="tree-wrapper">
<template #header>
<n-flex align="center" justify="space-between">
{{ t('List of Assets') }}
<n-icon size="16px" :component="EllipsisHorizontal" class="mr-2.5 cursor-pointer" />
</n-flex>
</template>
<n-descriptions-item>
<n-collapse arrow-placement="left" :default-expanded-names="['asset-tree']">
<n-collapse-item title="资产树" class="collapse-item" name="asset-tree">
Expand Down Expand Up @@ -59,7 +65,12 @@ import { reactive, ref, h, onUnmounted, onMounted } from 'vue';
import { getTreeSource, getTreeDetailById } from '@/API/modules/tree';
import ConnectionDialog from '@/components/ConnectionDialog/index.vue';
import { NIcon, TreeOption, DropdownOption, useDialog, NPopover } from 'naive-ui';
import { Folder, FolderOpenOutline, FileTrayFullOutline } from '@vicons/ionicons5';
import {
Folder,
FolderOpenOutline,
FileTrayFullOutline,
EllipsisHorizontal
} from '@vicons/ionicons5';
import type { Tree } from '@/API/interface';
Expand Down Expand Up @@ -270,8 +281,9 @@ onUnmounted(() => {
:deep(.n-descriptions-header) {
height: 35px;
margin-bottom: unset;
margin-left: 21px;
margin-left: 24px;
font-size: 11px;
font-weight: 400;
line-height: 40px;
color: var(--el-aside-tree-text-color);
}
Expand All @@ -284,14 +296,22 @@ onUnmounted(() => {
padding-top: 0;
.n-collapse-item__header-main {
height: 22px;
margin-left: 5px;
.n-collapse-item-arrow {
font-size: 16px;
}
}
}
:deep(.n-collapse-item__content-wrapper) {
margin-left: 16px;
.n-collapse-item__content-inner {
padding-top: 0;
.tree-item .n-tree-node-wrapper {
padding: unset;
line-height: 22px;
.n-tree-node-content {
padding: 0 6px 0 0;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/components/Main/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<n-layout-content class="main-content" content-style="padding: 24px;">
<n-list class="tips" :show-divider="false">
<n-list-item v-for="(tip, index) of systemTips" :key="index">
<n-flex align="center">
<n-flex align="center" style="flex-wrap: nowrap">
<n-tag size="large" round>
{{ tip.action }}
<template #icon>
Expand Down
2 changes: 2 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import 'normalize.css';
import 'vfonts/OpenSans.css';
// 引入自定义初始化样式
import '@/styles/reset.scss';
// 引入 Tailwind
import 'tailwindcss/tailwind.css';
// 引入图标注册脚本
import 'virtual:svg-icons-register';
// 引入 vue-fullscreen
Expand Down
8 changes: 8 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
theme: {
extend: {}
},
plugins: []
};
7 changes: 7 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import vue from '@vitejs/plugin-vue';
import tailwindcss from 'tailwindcss';
import autoprefixer from 'autoprefixer';
import Components from 'unplugin-vue-components/vite';

import { resolve } from 'path';
Expand All @@ -19,6 +21,11 @@ export default defineConfig({
symbolId: 'icon-[dir]-[name]'
})
],
css: {
postcss: {
plugins: [tailwindcss, autoprefixer]
}
},
resolve: {
extensions: ['.ts', '.tsx', '.vue', '.js', '.json'],
alias: {
Expand Down

0 comments on commit 21ad5df

Please sign in to comment.