diff --git a/.gitignore b/.gitignore
index dd5adcc5836224df88faf223b04fb0b62254241b..9dc207ff7f622a3d4f1d72dcb17f817a97715b6c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,4 @@ yarn-error.log
.vscode
devui/vue-devui.ts
devui/theme/theme.scss
+docs/.vitepress/config/sidebar.ts
diff --git a/devui-cli/commands/create.js b/devui-cli/commands/create.js
index 5d44628f34493bcff3f64753df47dc8d5a41e19e..91433ada765ab462e4ed653fca4eecaf3aa28150 100644
--- a/devui-cli/commands/create.js
+++ b/devui-cli/commands/create.js
@@ -1,5 +1,10 @@
const logger = require('../shared/logger')
-const { bigCamelCase, resolveDirFilesInfo, parseExportByFileInfo, parseComponentInfo } = require('../shared/utils')
+const {
+ bigCamelCase,
+ resolveDirFilesInfo,
+ parseExportByFileInfo,
+ parseComponentInfo
+} = require('../shared/utils')
const fs = require('fs-extra')
const { resolve } = require('path')
const {
@@ -8,6 +13,7 @@ const {
TESTS_DIR_NAME,
COMPONENT_PARTS_MAP,
INDEX_FILE_NAME,
+ DOCS_FILE_NAME,
VUE_DEVUI_FILE,
VUE_DEVUI_IGNORE_DIRS,
VUE_DEVUI_FILE_NAME,
@@ -29,7 +35,8 @@ const {
createDirectiveTemplate,
createServiceTemplate,
createIndexTemplate,
- createTestsTemplate
+ createTestsTemplate,
+ createDocumentTemplate
} = require('../templates/component')
const { createVueDevuiTemplate } = require('../templates/vue-devui')
const ora = require('ora')
@@ -64,17 +71,17 @@ exports.create = async (cwd) => {
switch (type) {
case CREATE_SUPPORT_TYPE_MAP.component:
params = await inquirer.prompt([typeName(), typeTitle(), selectCategory(), selectParts()])
- params.hasComponent = params.parts.includes(COMPONENT_PARTS_MAP.get('component'))
- params.hasDirective = params.parts.includes(COMPONENT_PARTS_MAP.get('directive'))
- params.hasService = params.parts.includes(COMPONENT_PARTS_MAP.get('service'))
+ params.hasComponent = params.parts.includes('component')
+ params.hasDirective = params.parts.includes('directive')
+ params.hasService = params.parts.includes('service')
await createComponent(params, cwd)
break
case CREATE_SUPPORT_TYPE_MAP['vue-devui']:
+ // 创建 devui/vue-devui.ts
await createVueDevui(params, cwd)
- break
- case CREATE_SUPPORT_TYPE_MAP['vitepress/sidebar']:
- await createVitepressSidebar(params, cwd)
+ // 创建 docs/.vitepress/config/sidebar.ts
+ await createVitepressSidebar()
break
default:
break
@@ -93,6 +100,7 @@ async function createComponent(params = {}) {
const typesName = kebabCase(name) + '-types'
const directiveName = kebabCase(name) + '-directive'
const serviceName = kebabCase(name) + '-service'
+ const testName = kebabCase(name) + '.spec'
const _params = {
...params,
@@ -100,7 +108,8 @@ async function createComponent(params = {}) {
typesName,
directiveName,
serviceName,
- styleName
+ styleName,
+ testName
}
const componentTemplate = createComponentTemplate(_params)
@@ -109,12 +118,15 @@ async function createComponent(params = {}) {
const directiveTemplate = createDirectiveTemplate(_params)
const serviceTemplate = createServiceTemplate(_params)
const indexTemplate = createIndexTemplate(_params)
- // TODO: 增加测试模板
+ // 增加测试模板
const testsTemplate = createTestsTemplate(_params)
+ // 增加文档模板
+ const docTemplate = createDocumentTemplate(_params)
const componentDir = resolve(DEVUI_DIR, componentName)
const srcDir = resolve(componentDir, 'src')
const testsDir = resolve(DEVUI_DIR, componentName, TESTS_DIR_NAME)
+ const docsDir = resolve(SITES_COMPONENTS_DIR, componentName)
if (fs.pathExistsSync(componentDir)) {
logger.error(`${bigCamelCase(componentName)} 组件目录已存在!`)
@@ -126,7 +138,17 @@ async function createComponent(params = {}) {
try {
await Promise.all([fs.mkdirs(componentDir), fs.mkdirs(srcDir), fs.mkdirs(testsDir)])
- const writeFiles = [fs.writeFile(resolve(componentDir, INDEX_FILE_NAME), indexTemplate)]
+ const writeFiles = [
+ fs.writeFile(resolve(componentDir, INDEX_FILE_NAME), indexTemplate),
+ fs.writeFile(resolve(testsDir, `${testName}.ts`), testsTemplate),
+ ]
+
+ if (!fs.existsSync(docsDir)) {
+ fs.mkdirSync(docsDir)
+ writeFiles.push(fs.writeFile(resolve(docsDir, DOCS_FILE_NAME), docTemplate))
+ } else {
+ logger.warning(`\n${bigCamelCase(componentName)} 组件文档已存在:${resolve(docsDir, DOCS_FILE_NAME)}`)
+ }
if (hasComponent || hasService) {
writeFiles.push(fs.writeFile(resolve(srcDir, `${typesName}.ts`), typesTemplate))
@@ -184,12 +206,7 @@ async function createVueDevui(params, { ignoreParseError }) {
}
}
-async function createVitepressSidebar(params, { cover }) {
- if (fs.pathExistsSync(VITEPRESS_SIDEBAR_FILE) && !cover) {
- logger.warning(`${VITEPRESS_SIDEBAR_FILE_NAME} 文件已存在!`)
- process.exit(0)
- }
-
+async function createVitepressSidebar() {
const fileInfo = resolveDirFilesInfo(DEVUI_DIR, VUE_DEVUI_IGNORE_DIRS)
const componentsInfo = []
diff --git a/devui-cli/inquirers/component.js b/devui-cli/inquirers/component.js
index 226bb7edbc93933fc4c1314cad7a8ee86d3c7165..355a2b09470c21a9c0f78df8314393d67da0f72d 100644
--- a/devui-cli/inquirers/component.js
+++ b/devui-cli/inquirers/component.js
@@ -42,11 +42,7 @@ exports.selectParts = () => ({
name: 'parts',
type: 'checkbox',
message: '(必填)请选择包含部件,将自动生成部件文件:',
- choices: [
- COMPONENT_PARTS_MAP.get('component'),
- COMPONENT_PARTS_MAP.get('directive'),
- COMPONENT_PARTS_MAP.get('service')
- ],
+ choices: COMPONENT_PARTS_MAP,
default: [],
validate: (value) => {
if (value.length === 0) {
diff --git a/devui-cli/shared/constant.js b/devui-cli/shared/constant.js
index a46948ae82adfe999d8d9ea96b01fd290ed11340..d3f2804da3da7f3965a9f9c065fc1712b7141a33 100644
--- a/devui-cli/shared/constant.js
+++ b/devui-cli/shared/constant.js
@@ -7,6 +7,7 @@ exports.DEVUI_DIR = resolve(this.CWD, 'devui')
exports.DEVUI_NAMESPACE = 'd'
exports.TESTS_DIR_NAME = '__tests__'
exports.INDEX_FILE_NAME = 'index.ts'
+exports.DOCS_FILE_NAME = 'index.md'
exports.VUE_DEVUI_IGNORE_DIRS = ['shared', 'style']
exports.VUE_DEVUI_FILE_NAME = 'vue-devui.ts'
exports.VUE_DEVUI_FILE = resolve(this.DEVUI_DIR, this.VUE_DEVUI_FILE_NAME)
@@ -20,16 +21,24 @@ exports.VITEPRESS_SIDEBAR_FILE = resolve(this.VITEPRESS_DIR, `config/${this.VITE
// 这里的分类顺序将会影响最终生成的页面侧边栏顺序
exports.VITEPRESS_SIDEBAR_CATEGORY = ['通用', '导航', '反馈', '数据录入', '数据展示', '布局']
-exports.COMPONENT_PARTS_MAP = new Map([
- ['component', 'component(组件)'],
- ['directive', 'directive(指令)'],
- ['service', 'service(服务)']
-])
+exports.COMPONENT_PARTS_MAP = [
+ {
+ name: 'component(组件)',
+ value: 'component'
+ },
+ {
+ name: 'directive(指令)',
+ value: 'directive'
+ },
+ {
+ name: 'service(服务)',
+ value: 'service'
+ }
+]
exports.CREATE_SUPPORT_TYPE_MAP = Object.freeze({
component: 'component',
'vue-devui': 'vue-devui',
- 'vitepress/sidebar': 'vitepress/sidebar',
'theme-variable': 'theme-variable',
})
exports.CREATE_SUPPORT_TYPES = Object.keys(this.CREATE_SUPPORT_TYPE_MAP)
diff --git a/devui-cli/templates/component.js b/devui-cli/templates/component.js
index 77c07c66bb89135937008e1246a14067b2653dcf..8f376f876d92c7fed9b7d65fe42a76df8ed81f15 100644
--- a/devui-cli/templates/component.js
+++ b/devui-cli/templates/component.js
@@ -2,6 +2,7 @@ const { DEVUI_NAMESPACE } = require('../shared/constant')
const { camelCase } = require('lodash')
const { bigCamelCase } = require('../shared/utils')
+// 创建组件模板
exports.createComponentTemplate = ({ styleName, componentName, typesName }) => `\
import './${styleName}.scss'
@@ -13,16 +14,14 @@ export default defineComponent({
props: ${camelCase(componentName)}Props,
emits: [],
setup(props: ${bigCamelCase(componentName)}Props, ctx) {
- return {}
- },
- render() {
- const {} = this
-
- return
+ return (
+
+ )
}
})
`
+// 创建类型声明模板
exports.createTypesTemplate = ({ componentName }) => `\
import type { PropType, ExtractPropTypes } from 'vue'
@@ -35,6 +34,7 @@ export const ${camelCase(componentName)}Props = {
export type ${bigCamelCase(componentName)}Props = ExtractPropTypes
`
+// 创建指令模板
exports.createDirectiveTemplate = () => `\
// can export function.
export default {
@@ -47,7 +47,7 @@ export default {
unmounted() { }
}
`
-
+// 创建server模板
exports.createServiceTemplate = ({ componentName, typesName, serviceName }) => `\
import { ${bigCamelCase(componentName)}Props } from './${typesName}'
@@ -58,12 +58,14 @@ const ${bigCamelCase(serviceName)} = {
export default ${bigCamelCase(serviceName)}
`
+// 创建scss模板
exports.createStyleTemplate = ({ componentName }) => `\
.${DEVUI_NAMESPACE}-${componentName} {
//
}
`
+// 创建index模板
exports.createIndexTemplate = ({
title,
category,
@@ -86,15 +88,13 @@ exports.createIndexTemplate = ({
const getPartStr = (state, str) => (state ? str : '')
- const importStr =
- getPartStr(hasComponent, importComponentStr) +
- getPartStr(hasDirective, importDirectiveStr) +
- getPartStr(hasService, importServiceStr)
+ const importStr = getPartStr(hasComponent, importComponentStr) +
+ getPartStr(hasDirective, importDirectiveStr) +
+ getPartStr(hasService, importServiceStr)
- const installStr =
- getPartStr(hasComponent, installComponentStr) +
- getPartStr(hasDirective, installDirectiveStr) +
- getPartStr(hasService, installServiceStr)
+ const installStr = getPartStr(hasComponent, installComponentStr) +
+ getPartStr(hasDirective, installDirectiveStr) +
+ getPartStr(hasService, installServiceStr)
return `\
import type { App } from 'vue'\
@@ -125,5 +125,89 @@ export default {
`
}
-exports.createTestsTemplate = () => `\
+// 创建测试模板
+exports.createTestsTemplate = ({
+ componentName,
+ directiveName,
+ serviceName,
+ hasComponent,
+ hasDirective,
+ hasService
+}) => `\
+import { mount } from '@vue/test-utils';
+import { ${[
+ hasComponent ? bigCamelCase(componentName) : null,
+ hasDirective ? bigCamelCase(directiveName) : null,
+ hasService ? bigCamelCase(serviceName) : null
+ ]
+ .filter((p) => p !== null)
+ .join(', ')} } from '../index';
+
+describe('${componentName} test', () => {
+ it('${componentName} init render', async () => {
+ // todo
+ })
+})
+`
+
+// 创建文档模板
+exports.createDocumentTemplate = ({
+ componentName,
+ title
+}) => `\
+# ${bigCamelCase(componentName)} ${title}
+
+// todo 组件描述
+
+### 何时使用
+
+// todo 使用时机描述
+
+
+### 基本用法
+// todo 用法描述
+:::demo // todo 展开代码的内部描述
+
+\`\`\`vue
+
+ {{ msg }}
+
+
+
+
+
+\`\`\`
+
+:::
+
+### d-${componentName}
+
+d-${componentName} 参数
+
+| 参数 | 类型 | 默认 | 说明 | 跳转 Demo | 全局配置项 |
+| ---- | ---- | ---- | ---- | --------- | --------- |
+| | | | | | |
+| | | | | | |
+| | | | | | |
+
+d-${componentName} 事件
+
+| 事件 | 类型 | 说明 | 跳转 Demo |
+| ---- | ---- | ---- | --------- |
+| | | | |
+| | | | |
+| | | | |
+
`
diff --git a/devui-cli/templates/vitepress-sidebar.js b/devui-cli/templates/vitepress-sidebar.js
index 81e1dbe6faae3aefd9fe8990e599491df6985622..ee079340e486e227daea5c8190784cbeea83c7ad 100644
--- a/devui-cli/templates/vitepress-sidebar.js
+++ b/devui-cli/templates/vitepress-sidebar.js
@@ -10,11 +10,11 @@ function buildCategoryOptions(text, children = []) {
return { text, children }
}
-exports.createVitepressSidebarTemplate = (componentsInfo) => {
+exports.createVitepressSidebarTemplate = (componentsInfo = []) => {
const rootNav = { text: '快速开始', link: '/' }
const categoryMap = VITEPRESS_SIDEBAR_CATEGORY.reduce((map, cate) => map.set(cate, []), new Map())
- ;(componentsInfo || []).forEach((info) => {
+ componentsInfo.forEach((info) => {
if (categoryMap.has(info.category)) {
categoryMap.get(info.category).push(buildComponentOptions(info.title, info.name, info.status))
} else {
diff --git a/devui/loading/doc/api-cn.md b/devui/loading/doc/api-cn.md
deleted file mode 100644
index c928711e6e8cef5f5291ae8c82df44dc45ba246a..0000000000000000000000000000000000000000
--- a/devui/loading/doc/api-cn.md
+++ /dev/null
@@ -1,84 +0,0 @@
-# 如何使用
-
-在 module 中引入:
-
-```ts
-import { LoadingModule } from 'ng-devui/loading';
-```
-
-在页面中使用:
-
-```html
-
-
-```
-
-# dLoading
-
-## dLoading 参数
-
-| 参数 | 类型 | 默认 | 说明 | 跳转 Demo |
-| :----------------: | :---------------------------: | :--------------------: | :-------------------------------------------------------------------- | ------------------------------------------ |
-| loading | [`LoadingType`](#loadingtype) | -- | 可选,控制 loading 状态 | [基本用法](demo#basic-usage) |
-| message | `string` | -- | 可选,loading 时的提示信息 | [多 promise](demo#multi-promise) |
-| loadingTemplateRef | `TemplateRef` | -- | 可选,自定义 loading 模板 | [自定义样式](demo#custom-style) |
-| backdrop | `boolean` | -- | 可选,loading 时是否显示遮罩 | [基本用法](demo#basic-usage) |
-| showLoading | `boolean` | -- | 可选,手动启动和关闭 loading 状态,与`loading`参数不能同时使用 | [使用 showLoading 控制](demo#show-loading) |
-| positionType | `string` | 'relative' | 可选,指定`dLoading`宿主元素的定位类型,取值与 css position 属性一致。 | [使用 showLoading 控制](demo#show-loading) |
-| view | `{top?:string,left?:string}` | {top:'50%',left:'50%'} | 可选,调整 loading 的显示位置,相对于宿主元素的顶部距离与左侧距离 | [基本用法](demo#basic-usage) |
-| zIndex | `number` | -- | 可选,loading加载提示的 z-index 值 | [基本用法](demo#basic-usage) |
-
-### LoadingType
-
-```ts
-export type LoadingType = Observable | Promise | Array> | Array> | Subscription | undefined;
-```
-
-# LoadingService
-
-在 component 中引入:
-
-```ts
-import { LoadingService } from 'ng-devui/loading';
-```
-
-在 component 里的 constructor 中声明:
-
-```ts
-constructor( private loadingService: LoadingService ) {}
-```
-
-在页面中使用:
-
-```html
-click me show full screen loading!
-在openFullScreen函数中调用loadingService.open(),打开loading 加载,并且获得返回值是一个实例,该实例调用close(), 关闭loading加载。
-```
-
-```ts
- // 举个例子:const dm = document.querySelector('#me');
- // 举个例子:@ViewChild('loadingTemplateRef1', { static: true }) loadingTemplateRef1: TemplateRef;
- this.loadingService.open({
- target: dm,
- loadingTemplateRef: loadingTemplateRef1,
- backdrop: true,
- message: 'One moment please...',
- positionType: 'relative',
- view: {
- top: '50%',
- left: '50%'
- }
- });
-```
-
-## LoadingService 参数
-
-| 参数 | 类型 | 默认 | 说明 | 跳转 Demo |
-| :----------------: | :--------------------------: | :--------------------: | :------------------------------------------------------------------ | ---------------------------------------------- |
-| target | `Element` | document.body | 可选,Loading 需要覆盖的 DOM 节点 | [服务方式调用](demo#full-screen) |
-| message | `string` | -- | 可选,loading 时的提示信息 | [服务方式调用](demo#full-screen) |
-| loadingTemplateRef | `TemplateRef` | -- | 可选,自定义 loading 模板 | [服务方式调用](demo#full-screen) |
-| backdrop | `boolean` | true | 可选,loading 时是否显示遮罩 | [服务方式调用](demo#full-screen) |
-| positionType | `'static' \| 'relative' \| 'absolute' \| 'fixed' \|'sticky'` | 'relative' | 可选,指定`dLoading`宿主元素的定位类型, |[服务方式调用](demo#full-screen)
-| view | `{top?:string,left?:string}` | {top:'50%',left:'50%'} | 可选,调整 loading 的显示位置,相对于宿主元素的顶部距离与左侧距离 | [服务方式调用](demo#full-screen) |
-| zIndex | `number` | -- | 可选,弹出框 z-index 值 | [服务方式调用](demo#full-screen) |
\ No newline at end of file
diff --git a/devui/loading/doc/api-en.md b/devui/loading/doc/api-en.md
deleted file mode 100644
index 1ab182b5c978031b5d68a875027fe76dab434786..0000000000000000000000000000000000000000
--- a/devui/loading/doc/api-en.md
+++ /dev/null
@@ -1,84 +0,0 @@
-# How to use
-
-Import into module
-
-```ts
-import { LoadingModule } from 'ng-devui/loading';
-```
-
-In the page
-
-```html
-
-
-```
-
-# dLoading
-
-## dLoading Parameters
-
-| Parameter | Type | Default | Description | Jump to Demo |
-| :----------------: | :---------------------------: | :---------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
-| loading | [`LoadingType`](#loadingtype) | -- | Optional. Controlling the loading status | [Basic Usage](demo#basic-usage) |
-| message | `string` | -- | Optional. Prompt message during loading | [Multipromise](demo#multi-promise) |
-| loadingTemplateRef | `TemplateRef` | -- | Optional. Custom loading template | [Custom Style](demo#custom-style) |
-| backdrop | `boolean` | -- | Optional. Indicating whether to display the mask during loading | [Basic Usage](demo#basic-usage) |
-| showLoading | `boolean` | -- | Optional. This parameter is used to manually enable or disable the loading status. This parameter cannot be used together with the `loading` parameter | [Using ShowLoading](demo#show-loading) |
-| positionType | `string` | 'relative' | Optional. This parameter specifies the positioning type of the `dLoading` host element. The value is the same as that of the css position attribute | [Using ShowLoading](demo#show-loading) |
-| view | `{top?:string,left?:string}` | {top: '50%',left:'50%'} | Optional. Adjust the loading display position, that is, the distance between the top and left of the host element | [Basic Usage](demo#basic-usage) |
-| zIndex | `number` | -- | Optional. Z-index value in the loading displayed. | [Basic Usage](demo#basic-usage) |
-
-### LoadingType
-
-```ts
-export type LoadingType = Observable | Promise | Array> | Array> | Subscription | undefined;
-```
-
-# LoadingService
-
-Import into component
-
-```ts
-import { LoadingService } from 'ng-devui/loading';
-```
-
-In the constructor of component, declare:
-
-```ts
-constructor( private loadingService: LoadingService ) {}
-```
-
-In the page
-
-```html
-click me show full screen loading!
-Invoke loadingService.open() in the openFullScreen function to enable loading. The return value is an instance. The instance invokes close() to disable loading.
-```
-
-```ts
-// For example, const dm = document.querySelector('#me');
-// For Example: @ViewChild('loadingTemplateRef1', {static: true}) loadingTemplateRef1: TemplateRef;
- this.loadingService.open({
- target: dm,
- loadingTemplateRef: loadingTemplateRef1,
- backdrop: true,
- message: 'One moment please...',
- positionType: 'relative',
- view: {
- top: '50%',
- left: '50%'
- }
- });
-```
-
-## LoadingService Parameter
-
-| Parameter | Type | Default | Description | Jump to Demo |
-| :----------------: | :--------------------------: | :--------------------: | :------------------------------------------------------------------ | ---------------------------------------------- |
-| target | `Element` | document.body | Optional. Loads the DOM nodes to be covered. | [Service function](demo#full-screen) |
-| message | `string` | -- | Optional. Prompt message during loading | [Service function](demo#full-screen) |
-| loadingTemplateRef | `TemplateRef` | -- | Optional. Custom loading template | [Service function](demo#full-screen) |
-| backdrop | `boolean` | true | Optional. Indicating whether to display the mask during loading | [Service function](demo#full-screen) |
-| positionType | `'static' \| 'relative' \| 'absolute' \| 'fixed' \|'sticky'` | 'relative' | Optional. This parameter specifies the positioning type of the `dLoading` host element. |[Service function](demo#full-screen)
-| view | `{top?:string,left?:string}` | {top: '50%',left:'50%'} | Optional. Adjust the loading display position, that is, the distance between the top and left of the host element | [Service function](demo#full-screen) |
-| zIndex | `number` | -- | Optional. Z-index value in the loading displayed. | [Service function](demo#full-screen) |
\ No newline at end of file
diff --git a/devui/loading/index.ts b/devui/loading/index.ts
index eea65dc9521ff0ad584c29525237ff6c432e6c7b..a1d0f1b5d7cd5fd48a2106f0f9aa655551b0c3d3 100644
--- a/devui/loading/index.ts
+++ b/devui/loading/index.ts
@@ -3,6 +3,9 @@ import Loading from './src/directive'
import LoadingService from './src/service'
export default {
+ title: 'Loading 加载提示',
+ category: '反馈',
+ status: '已完成',
install(app: App): void {
app.directive('dLoading', Loading)
app.config.globalProperties.$loadingService = LoadingService
diff --git a/devui/pagination/index.ts b/devui/pagination/index.ts
index 074ec4ab2c71f986b49d2c2037810d24aa8a9a50..fa7e383c57436c38e33ce3f8c4bebc116df9507b 100644
--- a/devui/pagination/index.ts
+++ b/devui/pagination/index.ts
@@ -10,6 +10,7 @@ export { Pagination }
export default {
title: 'Pagination 分页',
category: '导航',
+ status: '已完成',
install(app: App): void {
app.use(Pagination as any)
}
diff --git a/devui/quadrant-diagram/src/components/axis/index.tsx b/devui/quadrant-diagram/src/components/axis/index.tsx
index 8929a29847ad0425bb715f98fb8fefce02f6aa76..b4b25b9f80a2d54ee46f95eea34b0b1cfa5600b5 100644
--- a/devui/quadrant-diagram/src/components/axis/index.tsx
+++ b/devui/quadrant-diagram/src/components/axis/index.tsx
@@ -2,7 +2,7 @@ import { defineComponent, toRefs, onMounted, ExtractPropTypes, reactive, ref, wa
import { IViewConfigs, IAxisConfigs } from '../../../type'
import { AXIS_TITLE_SPACE } from '../../../config'
import { quadrantDiagramAxisProps, QuadrantDiagramAxisProps } from './types'
-import { debounce } from 'lodash'
+import { debounce } from 'lodash-es'
import './index.scss'
diff --git a/devui/search/hooks/use-search-keydown.ts b/devui/search/hooks/use-search-keydown.ts
index 16926736c38e050c0ee7322f77b122282d9d0b4a..7e69826d50ccdd417949fffb17d3924ef013c451 100644
--- a/devui/search/hooks/use-search-keydown.ts
+++ b/devui/search/hooks/use-search-keydown.ts
@@ -3,7 +3,7 @@
*/
import { SetupContext, Ref, } from 'vue'
import { KeydownReturnTypes } from '../src/search-types'
-import { debounce } from 'lodash'
+import { debounce } from 'lodash-es'
const KEYS_MAP = {
enter: 'Enter'
} as const
diff --git a/docs/.vitepress/config/sidebar.ts b/docs/.vitepress/config/sidebar.ts
index d9d3e0cd6d0677ed85d836ce2bdac68d06e0b426..00f650f7c5bb1a875d5b5a12b8aac4e38fa72d79 100644
--- a/docs/.vitepress/config/sidebar.ts
+++ b/docs/.vitepress/config/sidebar.ts
@@ -1,4 +1,4 @@
-const sidebar = {
+export default {
'/': [
{ text: '快速开始', link: '/' },
{
@@ -96,5 +96,3 @@ const sidebar = {
},
]
}
-
-export default sidebar
diff --git a/package.json b/package.json
index cfe0a4f4cb07bd6817c42a2273999bb99bae4f26..852d231e9deaa641095436e9b1622058be02bee0 100644
--- a/package.json
+++ b/package.json
@@ -37,8 +37,9 @@
"generate:theme": "node ./devui-cli/index.js generate:theme",
"copy": "cp package.json build && cp README.md build && cp devui/theme/theme.scss build/theme",
"clean:cli": "npm uninstall -g devui-cli & npm uninstall -g vue-devui",
- "cli:create": "node ./devui-cli/index.js create",
- "predev": "node ./devui-cli/index.js create -t vue-devui --ignore-parse-error"
+ "cli:create": "node ./devui-cli/index.js create -t component",
+ "predev": "node ./devui-cli/index.js create -t vue-devui --ignore-parse-error",
+ "prebuild": "node ./devui-cli/index.js create -t vue-devui --ignore-parse-error"
},
"dependencies": {
"@devui-design/icons": "^1.3.0",