Merge remote-tracking branch 'origin/master'

pull/878/head
YunaiV 2026-05-18 01:03:15 +08:00
commit f6963cde37
16 changed files with 94 additions and 77 deletions

View File

@ -18,7 +18,7 @@
</el-select> </el-select>
</ElDialog> </ElDialog>
<div v-else class="custom-hover" @click.stop="showTopSearch = !showTopSearch"> <div v-else class="custom-hover" @click.stop="showTopSearch = !showTopSearch">
<Icon icon="ep:search" :color="color"/> <Icon icon="ep:search" :color="color" />
<el-select <el-select
@click.stop @click.stop
filterable filterable

View File

@ -2,7 +2,6 @@
import { useAppStore } from '@/store/modules/app' import { useAppStore } from '@/store/modules/app'
import { useDesign } from '@/hooks/web/useDesign' import { useDesign } from '@/hooks/web/useDesign'
// eslint-disable-next-line vue/no-reserved-component-names
defineOptions({ name: 'Footer' }) defineOptions({ name: 'Footer' })
const { getPrefixCls } = useDesign() const { getPrefixCls } = useDesign()

View File

@ -13,7 +13,6 @@ const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('menu') const prefixCls = getPrefixCls('menu')
export default defineComponent({ export default defineComponent({
// eslint-disable-next-line vue/no-reserved-component-names
name: 'Menu', name: 'Menu',
props: { props: {
menuSelect: { menuSelect: {

View File

@ -52,7 +52,6 @@ export const setCssVar = (prop: string, val: any, dom = document.documentElement
* @param {Array} ary * @param {Array} ary
* @param {Functon} fn * @param {Functon} fn
*/ */
// eslint-disable-next-line
export const findIndex = <T = Recordable>(ary: Array<T>, fn: Fn): number => { export const findIndex = <T = Recordable>(ary: Array<T>, fn: Fn): number => {
if (ary.findIndex) { if (ary.findIndex) {
return ary.findIndex(fn) return ary.findIndex(fn)

View File

@ -89,11 +89,19 @@
:href="row.url" :href="row.url"
:underline="false" :underline="false"
target="_blank" target="_blank"
>预览</el-link
> >
<el-link v-else type="primary" download :href="row.url" :underline="false" target="_blank" 预览
>下载</el-link </el-link>
<el-link
v-else
type="primary"
download
:href="row.url"
:underline="false"
target="_blank"
> >
下载
</el-link>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column

View File

@ -1,6 +1,6 @@
import {resolve} from 'path' import {resolve} from 'path'
import type {ConfigEnv, UserConfig} from 'vite' import type {ConfigEnv, UserConfig} from 'vite'
import {loadEnv} from 'vite' import {loadEnv, normalizePath} from 'vite'
import {createVitePlugins} from './build/vite' import {createVitePlugins} from './build/vite'
import {exclude, include} from "./build/vite/optimize" import {exclude, include} from "./build/vite/optimize"
// 当前执行node命令时文件夹的地址(工作目录) // 当前执行node命令时文件夹的地址(工作目录)
@ -20,6 +20,7 @@ export default ({command, mode}: ConfigEnv): UserConfig => {
} else { } else {
env = loadEnv(mode, root) env = loadEnv(mode, root)
} }
const variablesScssPath = normalizePath(pathResolve('src/styles/variables.scss'))
return { return {
base: env.VITE_BASE_PATH, base: env.VITE_BASE_PATH,
root: root, root: root,
@ -47,7 +48,18 @@ export default ({command, mode}: ConfigEnv): UserConfig => {
}, },
preprocessorOptions: { preprocessorOptions: {
scss: { scss: {
additionalData: `@use "${pathResolve('src/styles/variables.scss')}" as *;`, additionalData: (source: string, filename: string) => {
const normalizedFilename = normalizePath(filename)
// Windows 下更容易触发重复注入:定义或显式转导变量的文件,不能再次注入同一个
// `@use ... as *`,否则 Sass 会报 duplicate global variables。
if (
normalizedFilename.endsWith('/src/styles/variables.scss') ||
normalizedFilename.endsWith('/src/styles/global.module.scss')
) {
return source
}
return `@use "${variablesScssPath}" as *;\n${source}`
},
api: 'modern-compiler' api: 'modern-compiler'
} }
} }