diff --git a/devui-cli/templates/vue-devui.js b/devui-cli/templates/vue-devui.js
index 97d665d390161a8836901a7d10d4bc15a1be1e49..c6def01b3867c322248f3e06ce151b9f4d15b30e 100644
--- a/devui-cli/templates/vue-devui.js
+++ b/devui-cli/templates/vue-devui.js
@@ -35,7 +35,7 @@ export {
export default {
version: '${VERSION}',
- install(app: App) {
+ install(app: App): void {
installs.forEach((p) => app.use(p as any))
}
}
diff --git a/devui/accordion/demo/accordion-demo.tsx b/devui/accordion/demo/accordion-demo.tsx
deleted file mode 100644
index b39252ff123cfb75e8a5abfbb9d28a38c16d6292..0000000000000000000000000000000000000000
--- a/devui/accordion/demo/accordion-demo.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { defineComponent } from 'vue'
-
-export default defineComponent({
- name: 'd-accordion-demo',
- props: {
- },
- setup(props, ctx) {
- return () => {
- return
devui-accordion-demo
- }
- }
-})
\ No newline at end of file
diff --git a/devui/accordion/demo/accordion.route.ts b/devui/accordion/demo/accordion.route.ts
deleted file mode 100644
index ca347814f2eb8ce2b306c9e1e2f6aac074d939de..0000000000000000000000000000000000000000
--- a/devui/accordion/demo/accordion.route.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import AccordionDemoComponent from './accordion-demo'
-import DevUIApiComponent from '../../shared/devui-api/devui-api'
-
-import ApiCn from '../doc/api-cn.md'
-import ApiEn from '../doc/api-en.md'
-const routes = [
- { path: '', redirectTo: 'demo' },
- { path: 'demo', component: AccordionDemoComponent},
- { path: 'api', component: DevUIApiComponent, meta: {
- 'zh-cn': ApiCn,
- 'en-us': ApiEn
- }}
-]
-
-export default routes
diff --git a/devui/accordion/doc/api-cn.md b/devui/accordion/doc/api-cn.md
deleted file mode 100644
index e99775072ed05da5bdd742d3be093d275d4b4bda..0000000000000000000000000000000000000000
--- a/devui/accordion/doc/api-cn.md
+++ /dev/null
@@ -1,193 +0,0 @@
-# 如何使用
-
-在 module 中引入:
-
-```typescript
-import { AccordionModule } from 'ng-devui/accordion';
-```
-
-在页面中使用:
-
-```html
-
-```
-
-## Accordion
-
-### d-accordion 参数
-
-| 参数 | 类型 | 默认 | 说明 | 跳转 Demo |
-| :----------------: | :---------------------------------------------------: | :--------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | -------------------------------------------------------------- |
-| data | `Array \| AccordionMenuType` | -- | 必选,数据源,可以自定义数组或者使用预设的`AccordionMenuType` | [基本用法](demo#basic-usage) |
-| titleKey | `string` | 'title' | 可选,标题的属性名,item[titleKey]类型为`string`,为标题显示内容 | [改变键值](demo#change-values) |
-| loadingKey | `string` | 'loading' | 可选,子菜单是否加载中的判断属性名,item[loadingKey]类型为`boolean` | [改变键值](demo#change-values) |
-| childrenKey | `string` | 'children' | 可选,子菜单的属性名,item[childrenKey]类型为`Array` | [改变键值](demo#change-values) |
-| disabledKey | `string` | 'disabled' | 可选,是否禁用的属性名,item[disabledKey]类型为`boolean` | [改变键值](demo#change-values) |
-| activeKey | `string` | 'active' | 可选,子菜单是否激活的属性名,item[activeKey]类型为`boolean` | [改变键值](demo#change-values) |
-| openKey | `string` | 'open' | 可选,菜单是否展开的属性名,item[openKey]类型为`boolean` | [改变键值](demo#change-values) |
-| restrictOneOpen | `boolean` | false | 可选,限制一级菜单同时只能打开一个, 默认不限制 | [基本用法](demo#basic-usage) |
-| menuItemTemplate | `TemplateRef` | 内置 | 可选, 可展开菜单内容条模板,可用变量值见下 | [使用模板](demo#using-templates) |
-| itemTemplate | `TemplateRef` | 内置 | 可选,可点击菜单内容条模板,可用变量值见下 | [使用模板](demo#using-templates) |
-| noContentTemplate | `TemplateRef` | 内置 | 可选,没有内容的时候使用自定义模板,可用变量值见下 | [使用模板](demo#using-templates) |
-| loadingTemplate | `TemplateRef` | 内置 | 可选,加载中使用自定义模板,可用变量值见下 | [使用模板](demo#using-templates) |
-| innerListTemplate | `TemplateRef` | 内置 | 可选,子列表内容完全自定义,用做折叠面板,可用变量值见下 | [使用模板](demo#using-templates) |
-| linkType | `'routerLink'\|'hrefLink'\|'dependOnLinkTypeKey'\|''` | '' | 可选,`'routerLink'`为路由场景;`'hrefLink'`为外部链接场景;`'dependOnLinkTypeKey'`为动态路由或外部链接场景;`''`为默认非链接类型(无法右键打开新标签页) | [内置路由和链接类型](demo#use-built-in-routing-and-link-types) |
-| linkTypeKey | `string` | 'linkType' | 可选,链接内容的类型的 key 值,用于 linkType 为`'dependOnLinkTypeKey'`时指定对象链接类型属性名,item[linkTypeKey]类型为`'routerLink'\|'hrefLink'\| string`,其中`'routerLink'`为路由链接,`'hrefLink'`为外部链接,其他为默认非链接类型 |
-| linkKey | `string` | 'link' | 可选,链接内容的 key,用于 linkType 为连接类型记非`''`时,链接的取值的属性值,item[linkKey]为路由地址或者超链接地址 |
-| linkTargetKey | `string` | 'target' | 可选,链接目标窗口的 key,用于链接类型,item[linkTargetKey]为单个链接的目标窗口 |
-| linkDefaultTarget | `string` | '\_self' | 可选,不设置 target 的时候 target 默认值为`'_self'`,用于链接类型, 取值等同于 a 链接的 target 属性 | [内置路由和链接类型](demo#use-built-in-routing-and-link-types) |
-| autoOpenActiveMenu | `boolean` | false | 可选,是否自动展开带有活跃子项的菜单 | [复合层级和自动展开](demo#compound-level-and-auto-expand) |
-| accordionType | `'normal'\|'embed'` | 'normal' | 可选,菜单形式是普通(带阴影)还是内嵌(不带阴影) | [基本用法](demo#basic-usage) |
-| showAnimation | `boolean` | true | 可选,是否展示动画 | [内置路由和链接类型](demo#use-built-in-routing-and-link-types) |
-
-### d-accordion 事件
-
-| 事件 | 类型 | 说明 | 跳转 Demo |
-| :--------------: | :-----------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------: | ---------------------------- |
-| menuToggle | `EventEmitter<`[`AccordionMenuToggleEvent`](#accordionmenutoggleevent)`>` | 可选,可展开菜单展开事件,返回对象里属性 item 为点击的对象数据,open 为 true 则将要展开 false 则将要关闭, parent 为父对象数据,event 为点击事件的原生事件 | [基本用法](demo#basic-usage) |
-| itemClick | `EventEmitter<`[`AccordionItemClickEvent`](#accordionitemclickevent)`>` | 可选,可点击菜单点击事件,返回对象里属性 item 为点击的对象数据,preActive 对象为上一次展开的对象, parent 为父对象数据,event 为点击事件的原生事件 | [基本用法](demo#basic-usage) |
-| activeItemChange | `EventEmitter` | 可选,子项切换的时候会发出新激活的子项的数据 | [基本用法](demo#basic-usage) |
-
-### AccordionMenuType 定义
-
-```typescript
-/* 基础数据类型 */
-type AccordionMenuItemLinkType = 'routerLink' | 'hrefLink' | string;
-export interface AccordionBase {
- title: string;
- disabled?: boolean;
- [prop: string]: any;
-}
-interface IAccordionActiveable {
- active?: boolean;
-}
-interface IAccordionFoldable {
- open?: boolean;
- loading?: boolean;
- children?: Array;
-}
-
-interface IAccordionLinkable {
- link?: string;
- target?: boolean;
- linkType?: AccordionMenuItemLinkType;
-}
-export interface AccordionBaseItem extends AccordionBase, IAccordionActiveable {}
-export interface AccordionBaseMenu extends AccordionBase, IAccordionFoldable {}
-
-export interface AccordionLinkableItem extends AccordionBase, IAccordionActiveable, IAccordionLinkable {}
-export interface AccordionMenuItem extends AccordionBase, IAccordionActiveable, IAccordionFoldable, IAccordionLinkable {}
-
-export type AccordionMenuType = Array;
-
-/* 通用公共配置数据类型 */
-interface AccordionMenuKeyGroup {
- titleKey?: string;
- activeKey?: string;
- disabledKey?: string;
- openKey?: string;
- loadingKey?: string;
- childrenKey?: string;
- linkKey?: string;
- linkTargetKey?: string;
- linkTypeKey?: string;
-}
-
-type AccordionTemplateRefArray = 'itemTemplate' | 'menuItemTemplate' | 'noContentTemplate' | 'loadingTemplate' | 'innerListTemplate';
-type AccordionTemplateRefGroup = {
- [p in AccordionTemplateRefArray]: TemplateRef;
-};
-interface AccordionConfigOptions {
- restrictOneOpen?: boolean;
- autoOpenActiveMenu?: boolean;
- showNoContent?: boolean;
- linkDefaultTarget?: string;
- i18nText: any;
- linkType: 'routerLink' | 'hrefLink' | 'dependOnLinkTypeKey' | '';
-}
-export interface AccordionOptions extends AccordionConfigOptions, AccordionMenuKeyGroup, AccordionTemplateRefGroup {}
-```
-
-## AccordionMenuToggleEvent
-
-``` typescript
-export type AccordionMenuToggleEvent = {
- item: any;
- open: boolean;
- parent: any;
- event: MouseEvent;
-};
-```
-
-## AccordionItemClickEvent
-
-``` typescript
-export type AccordionItemClickEvent = {
- item: any;
- prevActiveItem?: any;
- parent: any;
- event: MouseEvent;
-};
-```
-
-### 模板可以用变量值
-
-#### 变量使用方法
-
-```html
-{{myitem}}
-```
-
-#### menuItemTemplate 可用变量值
-
-| 变量 | 类型 | 变量含义说明 |
-| :----------------: | :--------: | :-----------------------------------------------: |
-| item | `any` | 可展开类型菜单数据 |
-| deepth | `number` | 表示嵌套结构层级 |
-| parent | `any` | 所属父级菜单数据 |
-| ~~~titleKey~~~ | `string` | `已经废弃`~~~组件的 titleKey 值~~~ |
-| ~~~disabledKey~~~ | `string` | `已经废弃`~~~组件的 disabledKey 值~~~ |
-| ~~~openKey~~~ | `string` | `已经废弃`~~~组件的 openKey 值~~~ |
-| ~~~menuToggleFn~~~ | `Function` | `已经废弃`~~~参数应为 item,表示一级菜单被点击~~~ |
-
-#### itemTemplate 可用变量值
-
-| 变量 | 类型 | 变量含义说明 |
-| :---------------: | :--------: | :-----------------------------------------------: |
-| item | `any` | 可点击类型菜单数据 |
-| deepth | `number` | 值表示嵌套结构层级 |
-| parent | `any` | 所属父级菜单数据 |
-| ~~~titleKey~~~ | `string` | `已经废弃`~~~ 组件的 titleKey 值~~~ |
-| ~~~disabledKey~~~ | `string` | `已经废弃`~~~ 组件的 disabledKey 值~~~ |
-| ~~~activeKey~~~ | `string` | `已经废弃`~~~ 组件的 activeKey 值~~~ |
-| ~~~itemClickFn~~~ | `Function` | `已经废弃`~~~参数应为 item,表示二级菜单被点击~~~ |
-
-#### noContentTemplate 可用变量值
-
-| 变量 | 类型 | 变量含义说明 |
-| :----: | :------: | :----------------: |
-| item | `any` | 父级菜单单个数据 |
-| deepth | `number` | 值表示嵌套结构层级 |
-
-#### loadingTemplate 可用变量值
-
-| 变量 | 类型 | 变量含义说明 |
-| :--------------: | :------: | :------------------------: |
-| item | `any` | 父级菜单单个数据 |
-| deepth | `number` | 值表示嵌套结构层级 |
-| ~~~loadingKey~~~ | `string` | ~~~组件的 loadingKey 值~~~ |
-
-#### innerListTemplate 可用变量值
-
-| 变量 | 类型 | 变量含义说明 |
-| :---------------: | :--------: | :----------------------------------------------------------------: |
-| item | `any` | 父级菜单单个数据 |
-| deepth | `number` | 值表示嵌套结构层级 |
-| ~~~titleKey~~~ | `string` | `已经废弃`~~~组件的 titleKey 值~~~ |
-| ~~~loadingKey~~~ | `string` | `已经废弃`~~~组件的 loadingKey 值~~~ |
-| ~~~childrenKey~~~ | `string` | `已经废弃`~~~组件的 childrenKey 值~~~ |
-| ~~~disabledKey~~~ | `string` | `已经废弃`~~~组件的 disabledKey 值~~~ |
-| ~~~openKey~~~ | `string` | `已经废弃`~~~组件的 openKey 值~~~ |
-| ~~~activeKey~~~ | `string` | `已经废弃`~~~组件的 activeKey 值,用二级菜单~~~ |
-| menuToggleFn | `Function` | 参数应为 item,表示菜单被展开,可选参数 event,原始事件 |
-| itemClickFn | `Function` | 参数应为可点击菜单的 item,表示菜单被点击,可选参数 event,原始事件 |
diff --git a/devui/accordion/doc/api-en.md b/devui/accordion/doc/api-en.md
deleted file mode 100644
index e6467537d0eea5b76a05c9e600dc1c8320403e63..0000000000000000000000000000000000000000
--- a/devui/accordion/doc/api-en.md
+++ /dev/null
@@ -1,189 +0,0 @@
-# How to use
-
-Import into module:
-
-```typescript
-import { AccordionModule } from ' ng-devui/accordion';
-```
-
-On the page:
-
-```html
-
-```
-
-## Accordion
-
-### d-accordion parameter
-
-| Parameter | Type | Default | Description | Jump to Demo |
-| :----------------: | :----------------------------------------------------: | :--------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | -------------------------------------------------------------------------- |
-| data | `Array \| AccordionMenuType` | -- | Required. Data source. You can customize an array or use the preset `AccordionMenuType` | [Basic usage](demo#basic-usage) |
-| titleKey | `string` | 'title' | Optional. Title attribute name. The type of item[titleKey] is `string`, indicating the title content. | [Change key value](demo#change-values) |
-| loadingKey | `string` | 'loading' | Optional. attribute name for determining whether a submenu is loaded. The type of item[loadingKey] is `boolean` | [Change key value](demo#change-values) |
-| childrenKey | `string` | 'children' | Optional. Submenu attribute name. The type of item[childrenKey] is `Array` | [Change key value](demo#change-values) |
-| disabledKey | `string` | 'disabled' | Optional. indicating whether to disable the attribute. The type of item[disabledKey] is `boolean` | [Change key value](demo#change-values) |
-| activeKey | `string` | 'active' | Optional. indicating whether a submenu is activated. The type of item[activeKey] is `boolean` | [Change key value](demo#change-values) |
-| openKey | `string` | 'open' | Optional. indicating whether a menu is expanded. The type of item[openKey] is `boolean` | [Change key value](demo#change-values) |
-| restrictOneOpen | `boolean` | false | Optional. Only one level-1 menu can be opened at a time. By default, there is no restriction. | [Basic usage](demo#basic-usage) |
-| menuItemTemplate | `TemplateRef` | Built-in | Optional. It can expand the menu content bar template. The available variable values are as follows. | [Using a Template](demo#using-templates) |
-| itemTemplate | `TemplateRef` | Built-in | Optional. The menu content bar template can be clicked. The available variable values are as follows: | [Using a Template](demo#using-templates) |
-| noContentTemplate | `TemplateRef` | Built-in | Optional. If there is no content, use a customized template. The available variable values are as follows: | [Using a Template](demo#using-templates) |
-| loadingTemplate | `TemplateRef` | Built-in | Optional. A customized template is used for loading. The available variable values are as follows | [Using a Template](demo#using-templates) |
-| innerListTemplate | `TemplateRef` | Built-in | Optional. The sublist content is customized and used as a folding panel. The available variable values are as follows. | [Using a Template](demo#using-templates) |
-| linkType | `'routerLink'\|'hrefLink'\|'dependOnLinkTypeKey'\|'''` | '' | Optional. `routerLink'` indicates the routing scenario. `hrefLink'` indicates the external link scenario. `dependOnLinkTypeKey'` indicates the dynamic routing or external link scenario. `''` is the default non-link type (you cannot right-click to open a new tab page) | [Built-in route and link type](demo#use-built-in-routing-and-link-types) |
-| linkTypeKey | `string` | 'linkType' | Optional. Key value of the link type, which is used to specify the object link type attribute name when linkType is set to `'dependOnLinkTypeKey'`. The value of item[linkTypeKey] is `'routerLink'\|'hrefLink'\| string`, in the preceding information, `routerLink'` indicates a route link, `hrefLink'` indicates an external link, and other values are default non-link types. |
-| linkKey | `string` | 'link' | Optional. Key of the link content, which is used to set the value of the link value when linkType is not set to ````. item[linkKey] indicates the route address or hyperlink address. |
-| linkTargetKey | `string` | 'target' | Optional. Key of the target window to be linked, which is used for the link type. item[linkTargetKey] indicates the target window of a single link. |
-| linkDefaultTarget | `string` | '\_self' | Optional. If target is not set, the default value of target is `'\_self'`, which is used for the link type and its value is the same as that of target attribute of link a. | [Built-in route and link type](demo#use-built-in-routing-and-link-types) |
-| autoOpenActiveMenu | `boolean` | false | Optional. Whether to automatically expand menus with active subitems | [Composite Hierarchy and Auto Expand](demo#compound-level-and-auto-expand) |
-| accordionType | `normal ' \| 'embed'` | 'normal' | Optional. The menu format is common (with shadow) or embedded (without shadow). | [Basic usage](demo#basic-usage) |
-| showAnimation | `boolean` | true | Optional. Indicating whether to display animations. | [Built-in route and link type](demo#use-built-in-routing-and-link-types) |
-
-### d-accordion event
-
-| Event | Type | Description | Jump to Demo |
-| :--------------: | :-----------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | ------------------------------- |
-| menuToggle | `EventEmitter<`[`AccordionMenuToggleEvent`](#accordionmenutoggleevent)`>` | Optional. The menu can be expanded. In the returned object, the attribute item is the object data clicked. If open is true, the object will be expanded. If open is false, the object will be closed. If parent is the parent object data. Event is the native event of the click event. | [Basic usage](demo#basic-usage) |
-| itemClick | `EventEmitter<`[`AccordionItemClickEvent`](#accordionitemclickevent)`>` | Optional. It can click a menu event. In the returned object, the attribute item is the object data of the clicked object, the preActive object is the object expanded last time, the parent object is the data of the parent object, and the event is the native event of the click event. | [Basic usage](demo#basic-usage) |
-| activeItemChange | `EventEmitter` | Optional. Data of the newly activated sub-item is sent when the sub-item is switched. | [Basic usage](demo#basic-usage) |
-
-### AccordionMenuType Definition
-
-```typescript
-/* Basic data type */
-type AccordionMenuItemLinkType = 'routerLink' | 'hrefLink' | string;
-export interface AccordionBase {
- title: string;
- disabled?: boolean;
- [prop: string]: any;
-}
-interface IAccordionActiveable {
- active?: boolean;
-}
-interface IAccordionFoldable {
- open?: boolean;
- loading?: boolean;
- children?: Array;
-}
-interface IAccordionLinkable {
- link?: string;
- target?: boolean;
- linkType?: AccordionMenuItemLinkType;
-}
-export interface AccordionBaseItem extends AccordionBase, IAccordionActiveable {}
-export interface AccordionBaseMenu extends AccordionBase, IAccordionFoldable {}
-export interface AccordionLinkableItem extends AccordionBase, IAccordionActiveable, IAccordionLinkable {}
-export interface AccordionMenuItem extends AccordionBase, IAccordionActiveable, IAccordionFoldable, IAccordionLinkable {}
-export type AccordionMenuType = Array;
-
-/* Common configuration data type */
-interface AccordionMenuKeyGroup {
- titleKey?: string;
- activeKey?: string;
- disabledKey?: string;
- openKey?: string;
- loadingKey?: string;
- childrenKey?: string;
- linkKey?: string;
- linkTargetKey?: string;
- linkTypeKey?: string;
-}
-type AccordionTemplateRefArray = 'itemTemplate' | 'menuItemTemplate' | 'noContentTemplate' | 'loadingTemplate' | 'innerListTemplate';
-type AccordionTemplateRefGroup = {
- [p in AccordionTemplateRefArray]: TemplateRef;
-};
-interface AccordionConfigOptions {
- restrictOneOpen?: boolean;
- autoOpenActiveMenu?: boolean;
- showNoContent?: boolean;
- linkDefaultTarget?: string;
- i18nText: any;
- linkType: 'routerLink' | 'hrefLink' | 'dependOnLinkTypeKey' | '';
-}
-export interface AccordionOptions extends AccordionConfigOptions, AccordionMenuKeyGroup, AccordionTemplateRefGroup {}
-```
-
-## AccordionMenuToggleEvent
-
-```typescript
-export type AccordionMenuToggleEvent = {
- item: any;
- open: boolean;
- parent: any;
- event: MouseEvent;
-};
-```
-
-## AccordionItemClickEvent
-
-```typescript
-export type AccordionItemClickEvent = {
- item: any;
- prevActiveItem?: any;
- parent: any;
- event: MouseEvent;
-};
-```
-
-### Templates can use variable values.
-
-#### Variable Usage
-
-```html
-{{myitem}}
-```
-
-#### menuItemTemplate Available variable values
-
-| Variable | Type | Variable Description |
-| :----------------: | :--------: | :------------------------------------------------------------------------------------------: |
-| item | `any` | Expandable menu data |
-| deepth | `number` | Indicates the nested structure level. |
-| parent | `any` | Parent menu data |
-| ~~~titleKey~~~ | `string` | Deprecated.~~~ The titleKey value of the component. ~~~ |
-| ~~~disabledKey~~~ | `string` | Deprecated. ~~~ The value of the disabledKey of the component. ~~~ |
-| ~~~openKey~~~ | `string` | Deprecated. ~~~ The openKey value of the component. ~~~ |
-| ~~~menuToggleFn~~~ | `Function` | Deprecated.~~~ The parameter should be item, indicating that the level-1 menu is clicked.~~~ |
-
-#### itemTemplate Available variable values
-
-| Variable | Type | Variable Description |
-| :---------------: | :--------: | :------------------------------------------------------------------------------------------: |
-| item | `any` | Clickable menu data |
-| deepth | `number` | The value indicates the nested structure level. |
-| parent | `any` | Parent menu data |
-| ~~~titleKey~~~ | `string` | Deprecated.~~~ The titleKey value of the component ~~~ |
-| ~~~disabledKey~~~ | `string` | Deprecated.~~~ The value of the disabledKey of the component ~~~ |
-| ~~~activeKey~~~ | `string` | Deprecated.~~~ The activeKey value of the component ~~~ |
-| ~~~itemClickFn~~~ | `Function` | Deprecated. ~~~The parameter should be item, indicating that the level-2 menu is clicked.~~~ |
-
-#### noContentTemplate Available variable value
-
-| Variable | Type | Variable Description |
-| :------: | :------: | :---------------------------------------------: |
-| item | `any` | Parent menu single data |
-| deepth | `number` | The value indicates the nested structure level. |
-
-#### loadingTemplate Available variable values
-
-| Variable | Type | Variable Description |
-| :---------------------: | :--------------: | :---------------------------------------------: |
-| item | `any` | Parent menu single data |
-| deepth | `number` | The value indicates the nested structure level. |
-| LoadingKey value of the | ~~~loadingKey~~~ | `string` | ~~~ component ~~~ |
-
-#### InnerListTemplate Available Variable Values
-
-| Variable | Type | Variable Description |
-| :---------------: | :--------: | :------------------------------------------------------------------------------------------------------------------------------------------------------: |
-| item | `any` | Parent menu single data |
-| deepth | `number` | The value indicates the nested structure level. |
-| ~~~titleKey~~~ | `string` | Deprecated.~~~The titleKey value of the component ~~~ |
-| ~~~loadingKey~~~ | `string` | Deprecated.~~~ The loading key value of the component ~~~ |
-| ~~~childrenKey~~~ | `string` | Deprecated.~~~ The value of childrenKey of the component ~~~ |
-| ~~~disabledKey~~~ | `string` | Deprecated.~~~ The value of the disabledKey of the component ~~~ |
-| ~~~openKey~~~ | `string` | Deprecated.~~~ The openKey value of the component ~~~ |
-| ~~~activeKey~~~ | `string` | Deprecated. ~~~ The activeKey value of the component Use the level-2 menu ~~~ |
-| menuToggleFn | `Function` | The parameter should be item, indicating that the menu is expanded. The optional parameter event, original event, is used. |
-| itemClickFn | `Function` | The parameter must be an item of a menu that can be clicked, indicating that the menu is clicked. The optional parameter event, original event, is used. |
diff --git a/devui/accordion/index.ts b/devui/accordion/index.ts
index 9c97a7600d257739b338cf5bca265ef5b3e4d4d0..f6641c7ad0d2e2c6acc90e6d2728236b95dab8d4 100644
--- a/devui/accordion/index.ts
+++ b/devui/accordion/index.ts
@@ -1,10 +1,16 @@
-import { App } from 'vue'
-import Accordion from './accordion'
+import type { App } from 'vue'
+import Accordion from './src/accordion'
-Accordion.install = function(Vue: App) {
- Vue.component(Accordion.name, Accordion)
-};
+Accordion.install = function(app: App) {
+ app.component(Accordion.name, Accordion)
+}
-Accordion.version = '0.0.1'
+export { Accordion }
-export default Accordion
+export default {
+ title: 'Accordion 手风琴',
+ category: '导航',
+ install(app: App): void {
+ app.use(Accordion as any)
+ }
+}
diff --git a/devui/accordion/accordion-item.tsx b/devui/accordion/src/accordion-item.tsx
similarity index 76%
rename from devui/accordion/accordion-item.tsx
rename to devui/accordion/src/accordion-item.tsx
index 150a364d0894acf6a607dba4d21b073dea3e3719..77389aa8537918cf67f72656a0f211d425e647a7 100644
--- a/devui/accordion/accordion-item.tsx
+++ b/devui/accordion/src/accordion-item.tsx
@@ -1,11 +1,11 @@
import { defineComponent } from 'vue'
export default defineComponent({
- name: 'd-accordion-item',
+ name: 'DAccordionItem',
props: {
},
- setup(props, ctx) {
+ setup() {
return () => {
return d-accordion-item
}
diff --git a/devui/accordion/accordion-list.tsx b/devui/accordion/src/accordion-list.tsx
similarity index 91%
rename from devui/accordion/accordion-list.tsx
rename to devui/accordion/src/accordion-list.tsx
index adec789b6c04888830f53499d5c00644ec77a37f..362cae3e585c1af33208f82104f3fe57a8903fb7 100644
--- a/devui/accordion/accordion-list.tsx
+++ b/devui/accordion/src/accordion-list.tsx
@@ -5,12 +5,18 @@ export default defineComponent({
name: 'DAccordionList',
inheritAttrs: false,
props: {
- data: Array as () => Array,
+ data: {
+ type: Array as () => Array,
+ default: null
+ },
deepth: {
type: Number,
default: 0
},
- parent: Object as () => AccordionMenuItem,
+ parent: {
+ type: Object as () => AccordionMenuItem,
+ default: null
+ },
innerListTemplate: Boolean,
},
setup(props, ctx) {
diff --git a/devui/accordion/accordion-menu.tsx b/devui/accordion/src/accordion-menu.tsx
similarity index 76%
rename from devui/accordion/accordion-menu.tsx
rename to devui/accordion/src/accordion-menu.tsx
index 5aaa91e60a8b060628f5daf7e5d245f051b6943c..c5280a3b4d5a3355d8f445327de69a98828020db 100644
--- a/devui/accordion/accordion-menu.tsx
+++ b/devui/accordion/src/accordion-menu.tsx
@@ -1,11 +1,11 @@
import { defineComponent } from 'vue'
export default defineComponent({
- name: 'd-accordion-menu',
+ name: 'DAccordionMenu',
props: {
},
- setup(props, ctx) {
+ setup() {
return () => {
return d-accordion-menu
}
diff --git a/devui/accordion/accordion.scss b/devui/accordion/src/accordion.scss
similarity index 96%
rename from devui/accordion/accordion.scss
rename to devui/accordion/src/accordion.scss
index dfe0519c1c37d63bc47425b4585afd139912f1b1..a6f4317d37ece561d874963ff04c5c8bbca90256 100644
--- a/devui/accordion/accordion.scss
+++ b/devui/accordion/src/accordion.scss
@@ -1,8 +1,8 @@
-@import '../style/mixins/index';
-@import '../style/theme/color';
-@import '../style/theme/font';
-@import '../style/theme/shadow';
-@import '../style/theme/corner';
+@import '../../style/mixins/index';
+@import '../../style/theme/color';
+@import '../../style/theme/font';
+@import '../../style/theme/shadow';
+@import '../../style/theme/corner';
:host {
display: block;
diff --git a/devui/accordion/accordion.tsx b/devui/accordion/src/accordion.tsx
similarity index 60%
rename from devui/accordion/accordion.tsx
rename to devui/accordion/src/accordion.tsx
index 062d44a79f56d0547ec85d69559cf63580ea7ce0..9935f71d21e52aa811e6db1ac5dafa6284bdbbd8 100644
--- a/devui/accordion/accordion.tsx
+++ b/devui/accordion/src/accordion.tsx
@@ -1,12 +1,15 @@
-import { defineComponent } from 'vue'
+import { defineComponent, reactive } from 'vue'
import AccordionList from './accordion-list'
import { AccordionMenuType } from './accordion.type'
import './accordion.scss'
export default defineComponent({
- name: 'd-accordion',
+ name: 'DAccordion',
props: {
- data: Array as () => Array | AccordionMenuType,
+ data: {
+ type: Array as () => Array | AccordionMenuType,
+ default: null
+ },
/* Key值定义, 用于自定义数据结构 */
titleKey: { type : String, default: 'title' }, // 标题的key,item[titleKey]类型为string,为标题显示内容
loadingKey: { type : String, default: 'loading' }, // 子菜单动态加载item[loadingKey]类型为boolean
@@ -16,23 +19,35 @@ export default defineComponent({
openKey: { type : String, default: 'open' }, // 菜单是否打开
/* 菜单模板 */
- menuItemTemplate: { type: String }, // 可展开菜单内容条模板
- itemTemplate: { type: String }, // 可点击菜单内容条模板
+ menuItemTemplate: { type: String, default: '' }, // 可展开菜单内容条模板
+ itemTemplate: { type: String, default: '' }, // 可点击菜单内容条模板
- menuToggle: Function as unknown as () => ((event: MouseEvent) => void), // 可展开菜单展开事件
- itemClick: Function as unknown as () => ((event: MouseEvent) => void), // 可点击菜单点击事件
- activeItemChange: Function as unknown as () => ((event: MouseEvent) => void),
+ menuToggle: {
+ type: Function as unknown as () => ((event: MouseEvent) => void),
+ default: null
+ }, // 可展开菜单展开事件
+ itemClick: {
+ type: Function as unknown as () => ((event: MouseEvent) => void),
+ default: null
+ }, // 可点击菜单点击事件
+ activeItemChange: {
+ type: Function as unknown as () => ((event: MouseEvent) => void),
+ default: null
+ },
/** 高级选项和模板 */
restrictOneOpen: { type: Boolean, default: false }, // 限制一级菜单同时只能打开一个
autoOpenActiveMenu: { type: Boolean, default: false }, // 自动展开活跃菜单
showNoContent: { type: Boolean, default: true }, // 没有内容的时候是否显示没有数据
- noContentTemplate: { type: String }, // 没有内容的时候使用自定义模板
- loadingTemplate: { type: String }, // 加载中使用自定义模板
- innerListTemplate: { type: String }, // 可折叠菜单内容完全自定义,用做折叠面板
+ noContentTemplate: { type: String, default: '' }, // 没有内容的时候使用自定义模板
+ loadingTemplate: { type: String, default: '' }, // 加载中使用自定义模板
+ innerListTemplate: { type: String, default: '' }, // 可折叠菜单内容完全自定义,用做折叠面板
/* 内置路由/链接/动态判断路由或链接类型 */
- linkType: { type: String as () => 'routerLink' | 'hrefLink' | 'dependOnLinkTypeKey' | '' | string, default: '' },
+ linkType: {
+ type: String as () => 'routerLink' | 'hrefLink' | 'dependOnLinkTypeKey' | '' | string,
+ default: ''
+ },
linkTypeKey: { type: String, default: 'linkType' }, // linkType为'dependOnLinkTypeKey'时指定对象linkType定义区
linkKey: { type: String, default: 'link' }, // 链接内容的key
linkTargetKey: { type: String, default: 'target' }, // 链接目标窗口的key
@@ -40,8 +55,8 @@ export default defineComponent({
accordionType: { type: String as () => 'normal' | 'embed', default: 'normal' },
},
- setup(props, ctx) {
- const { data, accordionType } = props
+ setup(props) {
+ const { data, accordionType } = reactive(props)
return () => {
return