mod vue2 to vue3
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
// Variables exported as JS object for Vite compatibility
|
||||
// Original source: variables.scss :export block
|
||||
export default {
|
||||
menuText: '#bfcbd9',
|
||||
menuActiveText: '#409EFF',
|
||||
subMenuActiveText: '#f4f4f5',
|
||||
menuBg: '#304156',
|
||||
menuHover: '#263445',
|
||||
subMenuBg: '#1f2d3d',
|
||||
subMenuHover: '#001528',
|
||||
sideBarWidth: '210px'
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* 简易路径解析工具,替代 Node.js path 模块(Vite 不提供 Node polyfill)
|
||||
* 用法: resolve('/sys', 'config') => '/sys/config'
|
||||
*/
|
||||
export function resolve(...segments) {
|
||||
let joined = segments.join('/')
|
||||
// 去除重复斜杠
|
||||
joined = joined.replace(/\/+/g, '/')
|
||||
// 确保以 / 开头
|
||||
if (!joined.startsWith('/')) joined = '/' + joined
|
||||
// 去除末尾斜杠(除非就是根路径)
|
||||
if (joined.length > 1 && joined.endsWith('/')) joined = joined.slice(0, -1)
|
||||
return joined
|
||||
}
|
||||
Reference in New Issue
Block a user