diff --git a/packages/devui-vue/devui/read-tip/index.ts b/packages/devui-vue/devui/read-tip/index.ts index 4ccae88c9e3e2ca7e7087dda6a48be9147312326..ec9f38284e984447f730470488729d827ca22cfc 100644 --- a/packages/devui-vue/devui/read-tip/index.ts +++ b/packages/devui-vue/devui/read-tip/index.ts @@ -10,7 +10,7 @@ export { ReadTip, } export default { title: 'ReadTip 阅读提示', category: '反馈', - status: '已完成', + status: '100%', install(app: App): void { app.use(ReadTip as any) } diff --git a/packages/devui-vue/docs/components/read-tip/index.md b/packages/devui-vue/docs/components/read-tip/index.md index 7742abd8a8b516baec60d12e0dc2f738b0713332..9d8571c966491a81c452a7a385284766b777ec58 100644 --- a/packages/devui-vue/docs/components/read-tip/index.md +++ b/packages/devui-vue/docs/components/read-tip/index.md @@ -262,7 +262,6 @@ const readTipOptions = { ### 异步获取数据 -通过设置selector选择需要显示readtip的元素,传入title和content设置显示的内容。 :::demo ```vue @@ -315,11 +314,11 @@ function getDataFromDB ({ element, rule }) { d-read-tip 参数 -| 参数 | 类型 | 默认 | 说明 | 跳转 Demo | 全局配置项 | -| -------------------- | ------------------ | ---- | ------------------------------- | ---------------------- | ---------- | -| readTipOptions | ReadTipOptions | -- | 必选,配置提示选项 | [基本用法](#基本用法) | -- | -| readTipOptions.rules | ReadTipRules | -- | 必选,配置 readtip 内容 | [基本用法](#基本用法) | -- | -| contentTemplate | `TemplateRef` | -- | 可选,传入模板显示 readtip 内容 | [传入模板显示内容](#传入模板显示内容) | -- | +| 参数 | 类型 | 默认 | 说明 | 跳转 Demo | 全局配置项 | +| -------------------- | ------------------ | ---- | ------------------------------- | ----------------------------------------------- | ---------- | +| readTipOptions | ReadTipOptions | -- | 必选,配置提示选项 | [基本用法](#基本用法) | -- | +| readTipOptions.rules | ReadTipRules | -- | 必选,配置 readtip 内容 | [包括多个提示的readtip](#包括多个提示的readtip) | -- | +| contentTemplate | `TemplateRef` | -- | 可选,传入模板显示 readtip 内容 | [传入模板显示内容](#传入模板显示内容) | -- | diff --git a/packages/devui-vue/docs/en-US/components/read-tip/index.md b/packages/devui-vue/docs/en-US/components/read-tip/index.md new file mode 100644 index 0000000000000000000000000000000000000000..47d8b0af0ee3e3606ca5aaf47c509fbf3cef7f1a --- /dev/null +++ b/packages/devui-vue/docs/en-US/components/read-tip/index.md @@ -0,0 +1,357 @@ +# ReadTip reading tips + +Reading notification component. + +### When To Use + +When you need to prompt for specific content in the html document. + + +### Basic Usage +Set selector to select the element to be displayed in the readtip, and transfer title and content to set the content to be displayed. +:::demo + +```vue + + + + + +``` + +::: + +### Include Multiple Readtip +Set the readtip display mode for different elements when multiple rules are transferred. +:::demo + +```vue + + + + + +``` + +::: + + + + +### Display Content with Template +You can specify the content to be displayed by importing template. When importing template, you do not need to specify title and content. +:::demo + +```vue + + + + + +``` + +::: + +### Get Data Asynchronous + +:::demo + +```vue + + + + + +``` + +::: + +### d-read-tip + +d-read-tip parameters + +| Parameter | Parameter | Parameter | Parameter | Jump to Demo | Global Config | +| -------------------- | ------------------ | ---- | ------------------------------- | ---------------------- | ---------- | +| readTipOptions | ReadTipOptions | -- | Required. Set readtip options. | [Basic Usage](#Basic Usage) | -- | +| readTipOptions.rules | ReadTipRules | -- | Option. Set the content of readtip | [Include Multiple Readtip](#Include Multiple Readtip) | -- | +| contentTemplate | `TemplateRef` | -- | Options. Using template to customize content | [Display Content with Template](#Display Content with Template) | -- | + + + +``` +export interface ReadTipOptions { + trigger?: 'hover' | 'click'; // default is hover + showAnimate?: boolean; // default is false + mouseenterTime?: number; // default is 100 + mouseleaveTime?: number; // default is 100 + position?: PositionType | PositionType[]; // default is 'top' + overlayClassName?: string; // default is '' + appendToBody?: boolean; // defualt is true + rules: ReadTipRules; +} +export type ReadTipRules = ReadTipRule | ReadTipRule[]; + +export interface ReadTipRule { + key?: string; + selector: string; + trigger?: 'hover' | 'click'; // can inherit from ReadTipOptions + title?: string; + content?: string; + showAnimate?: boolean; // can inherit from ReadTipOptions + mouseenterTime?: number; // can inherit from ReadTipOptions + mouseleaveTime?: number; // can inherit from ReadTipOptions + position?: PositionType | PositionType[]; // can inherit from ReadTipOptions + overlayClassName?: string; // can inherit from ReadTipOptions + appendToBody?: boolean; // can inherit from ReadTipOptions + //customData should be used with template. The context of template is customData so that you can customize your template + dataFn?: ({ + element, + rule: ReadTipRule, + }) => Observable<{ title?: string; content?: string; template?: TemplateRef; customData?: any }>; +} +``` +