This commit is contained in:
神仙 2025-01-03 00:32:57 +08:00
parent 10a2c19cdf
commit 72f4c591ce
9 changed files with 35 additions and 19 deletions

View File

@ -13,6 +13,7 @@ export declare interface ModuleConfig {
author?: string;
updateTime?: string;
demo?: { name: string; component: Component }[] | string;
doc?: string;
options?: {
[key: string]: any;
};

View File

@ -45,6 +45,8 @@
flex: 1;
.tag {
display: flex;
flex-wrap: wrap;
margin-bottom: 10px;
.el-tag {
@ -89,6 +91,11 @@
justify-content: space-between;
padding: 10px;
height: 30px;
.el-button {
font-size: 12px;
height: 28px;
}
}
&.is-add {

View File

@ -47,17 +47,14 @@
</div>
<div class="f">
<el-button round @click="toDetail(item)">详情</el-button>
<el-button type="danger" round @click="toDel(item, index)"
>卸载</el-button
>
<cl-switch v-model="item.status" @change="onStatusChange(item)" />
<cl-flex1 />
<cl-switch
v-model="item.status"
@change="onStatusChange(item)"
></cl-switch>
<el-button type="danger" round @click="toDel(item, index)"
>卸载</el-button
>
<el-button round @click="toDetail(item)">详情</el-button>
</div>
</div>
</el-col>

View File

@ -44,13 +44,18 @@
<div class="f">
<cl-flex1 />
<el-button
v-if="item.demo && !isEmpty(item.demo)"
round
@click="det.open(item)"
>
<el-button round @click="det.open(item)" v-if="item.demo">
示例
</el-button>
<el-button
type="success"
round
@click="det.openDoc(item.doc)"
v-if="item.doc"
>
文档
</el-button>
</div>
</div>
</el-col>
@ -63,6 +68,7 @@
:key="index"
:label="item.name"
:name="index"
:lazy="index != 0"
>
<component :is="item.component" />
</el-tab-pane>
@ -140,6 +146,10 @@ const det = reactive({
})
);
}
},
openDoc(url: string) {
window.open(url);
}
});
</script>

View File

@ -17,6 +17,7 @@ export default (): Merge<ModuleConfig, CrudOptions> => {
version: '1.1.2',
updateTime: '2024-12-31',
demo: '/demo/crud',
doc: 'https://vue.cool-admin.com/src/guide/plugins/crud.html',
// 组件全注册
components: Object.values(import.meta.glob('./components/**/*.{vue,tsx}')),

View File

@ -9,7 +9,7 @@ export default (): ModuleConfig => {
author: 'COOL',
version: '1.0.0',
updateTime: '2024-07-22',
demo: 'https://echarts.apache.org/examples/zh/index.html',
doc: 'https://echarts.apache.org/examples/zh/index.html',
install(app) {
app.component('v-chart', VueECharts);
}

View File

@ -13,10 +13,10 @@ export default (): ModuleConfig => {
component: () => import('./demo/base.vue')
}
],
doc: 'https://www.npmjs.com/package/monaco-editor',
components: [
// 依赖偏大现用于“ai编码页面”如不需要请注释组件
// 代码编辑器 https://www.npmjs.com/package/monaco-editor
() => import('./components/monaco.vue')
]
};

View File

@ -2,8 +2,8 @@ import type { ModuleConfig } from '/@/cool';
export default (): ModuleConfig => {
return {
label: '富文本编辑器',
description: '基于 wangEditor 封装的富文本编辑器', // https://www.wangeditor.com
label: 'Wang 编辑器',
description: '基于 wangEditor 封装的富文本编辑器',
author: 'COOL',
version: '1.0.0',
updateTime: '2024-02-01',
@ -13,7 +13,7 @@ export default (): ModuleConfig => {
component: () => import('./demo/base.vue')
}
],
doc: 'https://www.wangeditor.com',
components: [() => import('./components/wang.vue')]
};
};

View File

@ -10,7 +10,7 @@ export default (): ModuleConfig => {
author: 'COOL',
version: '1.0.0',
updateTime: '2024-07-22',
demo: 'https://element-plus.org/zh-CN/component/overview.html',
doc: 'https://element-plus.org/zh-CN/component/overview.html',
install(app) {
app.use(ElementPlus);
}