mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-06 18:36:55 +08:00
feat: 更新配置和组件以支持选择项功能, 开始手柄映射功能编写
- 在DynamicForm.vue中新增select组件支持 - 在VTsuruConfigTypes.ts中添加可选的条件显示属性 - 更新vite.config.mts以集成自定义SVGO插件 - 在components.d.ts中添加NDescriptionsItem组件声明 - 更新路由配置以包含obs_store模块
This commit is contained in:
@@ -11,17 +11,62 @@ import oxlintPlugin from 'vite-plugin-oxlint';
|
||||
import svgLoader from 'vite-svg-loader';
|
||||
import { VineVitePlugin } from 'vue-vine/vite';
|
||||
|
||||
// 自定义SVGO插件,删除所有名称以sodipodi:和inkscape:开头的元素
|
||||
const removeSodipodiInkscape = {
|
||||
name: 'removeSodipodiInkscape',
|
||||
description: '删除所有名称以sodipodi:和inkscape:开头的元素',
|
||||
fn: () => {
|
||||
return {
|
||||
element: {
|
||||
enter: (node, parentNode) => {
|
||||
// 检查元素名称是否以sodipodi:或inkscape:开头
|
||||
if (node.name && (node.name.startsWith('sodipodi:') || node.name.startsWith('inkscape:'))) {
|
||||
// 从父节点的children数组中过滤掉当前节点
|
||||
parentNode.children = parentNode.children.filter(child => child !== node);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
vue({
|
||||
script: { propsDestructure: true, defineModel: true },
|
||||
include: [/\.vue$/, /\.md$/],
|
||||
template: {
|
||||
compilerOptions: { isCustomElement: (tag) => tag.startsWith('yt-') }
|
||||
compilerOptions: {
|
||||
isCustomElement: (tag) => {
|
||||
return tag.includes(':') || tag.startsWith('yt-');
|
||||
}
|
||||
}
|
||||
}
|
||||
}),
|
||||
vueJsx(),
|
||||
svgLoader(),
|
||||
svgLoader({
|
||||
svgoConfig: {
|
||||
plugins: [
|
||||
{
|
||||
name: 'preset-default',
|
||||
params: {
|
||||
overrides: {
|
||||
removeEditorsNSData: false,
|
||||
}
|
||||
}
|
||||
},
|
||||
removeSodipodiInkscape,
|
||||
"convertStyleToAttrs",
|
||||
"removeUselessDefs",
|
||||
"removeUselessStrokeAndFill",
|
||||
"removeUnusedNS",
|
||||
"removeEmptyText",
|
||||
"removeEmptyContainers",
|
||||
"removeViewBox",
|
||||
"cleanupIds",
|
||||
]
|
||||
}
|
||||
}),
|
||||
Markdown({
|
||||
/* options */
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user