diff --git a/.eslintrc.js b/.eslintrc.js index 44b3a559b..a02787fbd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -10,6 +10,8 @@ module.exports = { order: [['script', 'template'], 'style'] } ], + 'vue/attribute-hyphenation': 'off', + 'vue/v-on-event-hyphenation': 'off', 'vue/order-in-components': 'off', 'vue/component-name-in-template-casing': 'off', 'vue/custom-event-name-casing': 'off', @@ -21,6 +23,7 @@ module.exports = { 'vue/comma-dangle': 'off', 'vue/prefer-template': 'off', 'vue/no-unused-refs': 'off', + 'vue/require-component-is': 'off', 'vue/singleline-html-element-content-newline': 'off', 'curly': 'off', 'sort-imports': 'off', diff --git a/.gitignore b/.gitignore index aac6a3092..c430c001d 100644 --- a/.gitignore +++ b/.gitignore @@ -61,3 +61,9 @@ packages/theme/src/theme/*-theme/component.js pnpm-lock.yaml gulp/bundle.json + +# 本地构建的saas相关资源文件 +examples/sites/public/tiny-vue*.js +examples/sites/public/tiny-vue*.mjs +examples/sites/public/tailwind.css +examples/sites/public/index.css \ No newline at end of file diff --git a/examples/docs/newsrc/App.vue b/examples/docs/newsrc/App.vue index 10d1f4df4..19489c4d1 100644 --- a/examples/docs/newsrc/App.vue +++ b/examples/docs/newsrc/App.vue @@ -4,17 +4,23 @@
是否省略显示,该属性默认为false
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'ellipsis' + }, + { + name: 'menus', + type: 'Array', + defaultValue: '50', + desc: { + 'zh-CN': '列表数组
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'ellipsis' + }, + { + name: 'visible', + type: 'Boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '上划列表显示隐藏,该属性默认为false
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'ellipsis' + } + ], + events: [ + { + name: 'click', + type: 'Function()', + defaultValue: '', + desc: { + 'zh-CN': '设置组件点击列表项时触发的回调函数
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'clickfn' + } + ], + methods: [ + { + name: 'visibleHandle', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '菜单列表隐藏方法
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'slot-item' + } + ], + slots: [ + { + name: 'action', + defaultValue: '', + desc: { + 'zh-CN': '自定义操作项内容
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'slot-action' + }, + { + mode: [] + } + ] + } + ] +} diff --git a/examples/sites/demos/apis/alert.js b/examples/sites/demos/apis/alert.js new file mode 100644 index 000000000..8ef9c2987 --- /dev/null +++ b/examples/sites/demos/apis/alert.js @@ -0,0 +1,295 @@ +export default { + mode: ['pc', 'mobile', 'mobile-first'], + apis: [ + { + name: 'alert', + type: 'component', + props: [ + { + name: 'center', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '文字是否居中', + 'en-US': 'Whether the text is centered' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'center', + mobileDemo: 'center', + mfDemo: '' + }, + { + name: 'closable', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '警告是否可以关闭', + 'en-US': 'Set whether alarms can be disabled.' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'custom-close', + mobileDemo: 'custom-close', + mfDemo: '' + }, + { + name: 'close-text', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '关闭按钮自定义文本', + 'en-US': 'Customized text of the close button' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'custom-close', + mobileDemo: 'custom-close', + mfDemo: '' + }, + { + name: 'custom-class', + type: 'string', + defaultValue: "'customClass'", + desc: { + 'zh-CN': '自定义类名', + 'en-US': 'Customization class name' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'custom-class', + mfDemo: '' + }, + { + name: 'description', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '警告的提示内容', + 'en-US': 'Set the warning prompt content' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'basic-usage', + mobileDemo: 'custom-close', + mfDemo: '' + }, + { + name: 'icon', + type: 'Component', + defaultValue: '', + desc: { + 'zh-CN': '传入图标组件自定义警告的图标,默认会根据 type 值自动使用对应图标', + 'en-US': + 'The icon for the custom warning of the incoming icon component will be automatically used based on the type value by default' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'icon', + mobileDemo: 'icon', + mfDemo: '' + }, + { + name: 'scrolling', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '是否开启描述文字在鼠标 hover 时滚动显示的动画。', + 'en-US': + 'Indicates whether to enable the animation of the description text scrolling when the mouse hovers.' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'show-foldable', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '展示带标题可折叠样式。', + 'en-US': 'Shows collapsible styles with titles.' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'show-icon', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '是否显示图标', + 'en-US': 'Display icon' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'show-icon', + mfDemo: '' + }, + { + name: 'single-line', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '描述内容是否一行显示,超出显示...,默认值为 false。', + 'en-US': 'Indicates whether the description is displayed in one line. The default value is false.' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'size', + type: "'normal' | 'large'", + defaultValue: "'normal'", + desc: { + 'zh-CN': '警告的尺寸大小', + 'en-US': 'Set the size of the warning' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'size', + mobileDemo: 'size', + mfDemo: '' + }, + { + name: 'target', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '挂载容器的ref值,通过该属性可以让组件展示在对应容器的顶部', + 'en-US': + 'Mounted container reference, this property allows the component to be displayed at the top of the corresponding container.' + }, + mode: ['mobile'], + mobileDemo: 'target' + }, + { + name: 'title', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '警告的标题,在 size 为 large 时有效,默认会根据 type 自动设置', + 'en-US': + 'Set the warning title. This parameter is valid only when size is set to large. By default, the alarm title is automatically set based on type.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'title', + mfDemo: '' + }, + { + name: 'type', + typeAnchorName: 'IType', + type: 'IType', + defaultValue: "'info'", + desc: { + 'zh-CN': '警告的类型', + 'en-US': 'Set the alarm type' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'basic-usage', + mobileDemo: 'size', + mfDemo: '' + } + ], + events: [ + { + name: 'close', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '关闭 alert 时触发的事件', + 'en-US': 'Event triggered when the alert function is disabled' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'custom-close', + mobileDemo: 'custom-close', + mfDemo: '' + }, + { + name: 'handleHeaderClick', + type: 'Function()', + defaultValue: '', + desc: { + 'zh-CN': '标题点击事件,设置 show-foldable 为 true 时有效。', + 'en-US': 'Title click event. This parameter is valid only when show-foldable is set to true.' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ], + methods: [ + { + name: 'close', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '隐藏组件', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'handleHeaderClick', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '标题点击事件,设置 show-foldable 为 true 时有效', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ], + slots: [ + { + name: 'close', + defaultValue: '', + desc: { + 'zh-CN': '自定义关闭内容,当 closable 属性为 false 时有效', + 'en-US': '' + }, + mode: ['pc'], + pcDemo: 'custom-close' + }, + { + name: 'default', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '组件默认插槽,当 size 设置为 large 后有效', + 'en-US': 'The default slot for the component is valid when size is set to large' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'slot-default', + mobileDemo: 'slot-default', + mfDemo: '' + }, + { + name: 'description', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '提示内容', + 'en-US': 'Prompt Content' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + }, + { + name: 'title', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '标题的内容,当 size 设置为 large 后有效', + 'en-US': 'The content of the title is valid when size is set to large' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'title', + mfDemo: '' + } + ] + } + ], + types: [ + { + name: 'IType', + type: 'type', + code: ` +type IType = 'success' | 'warning' | 'info' | 'error' | 'simple' +` + } + ] +} diff --git a/examples/sites/demos/apis/amount.js b/examples/sites/demos/apis/amount.js new file mode 100644 index 000000000..50d600afa --- /dev/null +++ b/examples/sites/demos/apis/amount.js @@ -0,0 +1,226 @@ +export default { + mode: ['pc', 'mobile-first'], + apis: [ + { + name: 'amount', + type: 'component', + props: [ + { + name: 'currency', + type: 'string', + defaultValue: '该属性的默认值为 CNY', + desc: { + 'zh-CN': '', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'custom-currency', + mfDemo: 'custom-currency' + }, + { + name: 'date', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '设置弹出框内显示日期框。值可设置为 string 或者 Date() 类型。', + 'en-US': + 'Set the date box to be displayed in the pop-up box. The value can be of the string or Date() type.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'set-date', + mfDemo: 'set-date' + }, + { + name: 'digits', + type: 'number', + defaultValue: '该属性的默认值为 2', + desc: { + 'zh-CN': '设置小数点位数,默认为 2 位。', + 'en-US': 'Set the number of decimal places. The default value is two.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'digits-maxlen', + mfDemo: 'digits-maxlen' + }, + { + name: 'disabled', + type: 'boolean', + defaultValue: '该属性的默认值为 false', + desc: { + 'zh-CN': '设置是否禁用,默认为 false。', + 'en-US': 'Whether to disable the function. The default value is false.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'amount-disable', + mfDemo: 'amount-disable' + }, + { + name: 'fetchCurrency', + type: 'Function', + defaultValue: '', + desc: { + 'zh-CN': '自定义金额组件的请求服务接口,fetchCurrency返回一个Promise对象 ', + 'en-US': + 'Request service interface of the customized amount component. fetchCurrency returns a Promise object.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'custom-service', + mfDemo: 'custom-service' + }, + { + name: 'fields', + type: 'object', + defaultValue: '', + desc: { + 'zh-CN': '自定义金额组件数据映射,在没有使用框架服务时必填', + 'en-US': + 'Customized amount component data mapping. This parameter is mandatory when the framework service is not used.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'custom-service', + mfDemo: 'custom-service' + }, + { + name: 'format', + type: 'object', + defaultValue: '', + desc: { + 'zh-CN': + "数字格式化置项,可配置如下字段:;{\n fraction: 4, // 保留小数位数\n rounding: 0, // 舍入点,0-9之间的数字,如配置为7时则为6舍7入,默认为5(四舍五入);配置为0或>9将会进行截取\n prefix: '$', // 前置标识\n groupSize: 3, // 整数部分分组间隔,即第一个分组位数\n secondaryGroupSize: 2, // 整数部分第二级分组间隔,不设置或为0时 自动取groupSize\n groupSeparator: ',', // 整数部分分组分隔符\n decimalSeparator: '.', // 小数点符号\n fractionGroupSize: 0, // 小数部分分组间隔\n fractionGroupSeparator: ' ', // 小数分组分隔符\n suffix: '@' // 后置标识\n }", + 'en-US': + "Number formatting configuration item. The following fields can be configured:; {\n fraction: 4, //Retain the number of decimal places. \n rounding: 0, //Round the number between 0 and 9. For example, if the value is set to 7, the value is rounded off to 6. The default value is 5 (rounded off). If this parameter is set to 0 or greater than 9, truncation is performed. \n prefix: '$', //Front identifier. \n groupSize: 3, //Integer part grouping interval, that is, the number of bits of the first grouping. \n secondaryGroupSize: 2, //Integer part second-level grouping interval. If this parameter is not set or is set to 0, the value of groupSize is automatically used. \n groupSeparator: ',', //Integer part grouping separator. \n decimalSeparator:' ', / / Decimal point symbol \n fractionGroupSize: 0, // Decimal part grouping interval \n fractionGroupSeparator: '', / / Decimal grouping separator \n suffix: '@' / / Post identifier \n}" + }, + mode: ['pc', 'mobile-first'], + pcDemo: '', + mfDemo: '' + }, + { + name: 'max-len', + type: 'number', + defaultValue: '该属性的默认值为 15', + desc: { + 'zh-CN': '整数位最大长度,默认为 15 位。', + 'en-US': 'Maximum integer length. The default value is 15 characters.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'digits-maxlen', + mfDemo: 'digits-maxlen' + }, + { + name: 'negative', + type: 'boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否可为负数,默认为 true ,可设为负数。', + 'en-US': + 'Indicates whether the value can be a negative number. The default value is true. The value can be a negative number.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: '', + mfDemo: '' + }, + { + name: 'num-allow-empty', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '设置数值允许为空', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'placeholder', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '当数据为空时的占位符', + 'en-US': 'Placeholder when data is empty' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'custom-service', + mfDemo: 'custom-service' + }, + { + name: 'popper-append-to-body', + type: 'boolean', + defaultValue: '该属性的默认值为 true', + desc: { + 'zh-CN': + '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)', + 'en-US': + 'Indicates whether to insert the pop-up box to the body element. When a fault occurs in the dialog box that is displayed, you can set this attribute to false (for details, see the select component).' + }, + mode: ['pc', 'mobile-first'], + pcDemo: '', + mfDemo: '' + }, + { + name: 'popper-class', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '为 popper 添加类名(可参考 popover 组件)', + 'en-US': 'Add a class name for the popper. For details, see the popover component.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: '', + mfDemo: '' + }, + { + name: 'rounding', + type: 'boolean', + defaultValue: '', + desc: { + 'zh-CN': '控制输入金额四舍五入。', + 'en-US': 'Controls the rounding of the input amount.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'digits-maxlen', + mfDemo: 'digits-maxlen' + }, + { + name: 'size', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '设置组件大小', + 'en-US': 'Set the component size' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'size', + mfDemo: 'size' + }, + { + name: 'value', + type: 'string , number', + defaultValue: '', + desc: { + 'zh-CN': '设置金额组件的值。', + 'en-US': 'Set the value of the amount component.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'digits-maxlen', + mfDemo: 'digits-maxlen' + } + ], + events: [ + { + name: 'change', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '当组件的值发生变化时会触发该事件。', + 'en-US': 'This event is triggered when the value of a component changes.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'set-date', + mfDemo: 'set-date' + } + ], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/anchor.js b/examples/sites/demos/apis/anchor.js new file mode 100644 index 000000000..589f78bdb --- /dev/null +++ b/examples/sites/demos/apis/anchor.js @@ -0,0 +1,120 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'anchor', + type: 'component', + props: [ + { + name: 'container-id', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': + '用于单页面 hash 路由模式时指定滚动容器的 id 值,id 为空时则滚动容器默认为 HTML 文档的根节点 body 元素', + 'en-US': + 'When used in single page hash routing mode, specify the id value of the scrolling container. If the id is empty, the scrolling container defaults to the body element of the root node of the HTML document' + }, + mode: ['pc'], + pcDemo: 'set-container' + }, + { + name: 'is-affix', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '固定模式', + 'en-US': 'Fixed mode' + }, + mode: ['pc'], + pcDemo: 'is-affix' + }, + { + name: 'links', + typeAnchorName: 'ILink', + type: 'ILink[]', + defaultValue: '', + desc: { + 'zh-CN': '导航数据配置项,可通过 children 嵌套', + 'en-US': 'Navigation data configuration items can be nested through children' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'mark-class', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '自定义滚动的目标元素类名', + 'en-US': 'Class name of the customized scrolling target element' + }, + mode: ['pc'], + pcDemo: 'set-container' + }, + { + name: 'type', + type: "'line' | 'dot'", + defaultValue: "'line'", + desc: { + 'zh-CN': '锚点类型', + 'en-US': 'Anchor type' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + } + ], + events: [ + { + name: 'change', + type: '(hash: string) => void', + defaultValue: '', + desc: { + 'zh-CN': '锚点链接改变事件', + 'en-US': 'Anchor link change event' + }, + mode: ['pc'], + pcDemo: 'change' + }, + { + name: 'link-click', + type: '(event: Event, currentLink: {link: string, title: string}) => void', + defaultValue: '', + desc: { + 'zh-CN': '锚点点击事件', + 'en-US': 'Anchor click event' + }, + mode: ['pc'], + pcDemo: 'set-container' + }, + { + name: 'on-change', + type: '(hash: string) => void', + defaultValue: '', + desc: { + 'zh-CN': '使用 change 代替;[deprecated v3.12.0 废弃,v3.17.0 移除;移除原因:命名规范]', + 'en-US': + 'use change instead [deprecated v3.12.0 abandoned, v3.17.0 removed; reason for removal: naming convention]' + }, + mode: ['pc'], + pcDemo: 'change' + } + ], + methods: [], + slots: [] + } + ], + types: [ + { + name: 'ILink', + type: 'interface', + code: ` +interface ILink { + key: string // 锚点的key值 + link: string // 导航的hash值 + title: string // 锚点标题 + children: ILink[] // 子锚点 +}` + } + ] +} diff --git a/examples/sites/demos/apis/area.js b/examples/sites/demos/apis/area.js new file mode 100644 index 000000000..54cbf80cc --- /dev/null +++ b/examples/sites/demos/apis/area.js @@ -0,0 +1,176 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'area', + type: 'component', + props: [ + { + name: 'disabled', + type: 'boolean', + defaultValue: '', + desc: { + 'zh-CN': '禁用输入框;默认为 false', + 'en-US': 'Disable the text box. The default value is false' + }, + mode: ['pc'], + pcDemo: 'disabled' + }, + { + name: 'fetch-jcr', + type: 'Function', + defaultValue: '', + desc: { + 'zh-CN': '自定义获取片区 JCR 的服务', + 'en-US': 'User-defined service for obtaining regional JCRs' + }, + mode: ['pc'], + pcDemo: 'custom-service' + }, + { + name: 'fetch-office', + type: 'Function', + defaultValue: '', + desc: { + 'zh-CN': '自定义获取办事处 Office 的服务', + 'en-US': 'User-defined Office service' + }, + mode: ['pc'], + pcDemo: 'custom-service' + }, + { + name: 'fetch-region', + type: 'Function', + defaultValue: '', + desc: { + 'zh-CN': '自定义获取地区部 Region 的服务', + 'en-US': 'Obtain the service of a region.' + }, + mode: ['pc'], + pcDemo: 'custom-service' + }, + { + name: 'fetch-rep', + type: 'Function', + defaultValue: '', + desc: { + 'zh-CN': '自定义获取代表处 Rep 的服务', + 'en-US': 'Obtain services of rep offices and rep offices.' + }, + mode: ['pc'], + pcDemo: 'custom-service' + }, + { + name: 'modelValue / v-model', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '设置片区默认值', + 'en-US': 'Set the default value of a region.' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'placeholder', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '当数据为空时的占位符', + 'en-US': 'Placeholder when data is empty' + }, + mode: ['pc'], + pcDemo: 'custom-service' + }, + { + name: 'popper-append-to-body', + type: 'boolean', + defaultValue: '该属性的默认值为 true', + desc: { + 'zh-CN': + '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)', + 'en-US': + 'Indicates whether to insert the pop-up box to the body element. If a fault occurs in locating the fault in the dialog box that is displayed, set this parameter to false (for details, see the select component)' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'popper-class', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '为 popper 添加类名(可参考 popover 组件)', + 'en-US': 'Add a class name for the popper. For details, see the popover component.' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'props', + type: 'object', + defaultValue: '', + desc: { + 'zh-CN': + "自定义服务时,设置数据的映射字段;默认为 {label: 'name_cn',// 显示文本对应的字段 value: 'org_id'// 值对应的字段}", + 'en-US': + "Set the data mapping field when customizing a service. The default value is {label:'name_cn', //Display the field corresponding to the text value:'org_id' //Display the field corresponding to the value}" + }, + mode: ['pc'], + pcDemo: 'custom-service' + }, + { + name: 'size', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '设置组件大小,可设置值为:medium,small,mini', + 'en-US': 'Set the component size. The options are medium, small, and mini.' + }, + mode: ['pc'], + pcDemo: 'size' + } + ], + events: [ + { + name: 'change-office', + type: 'Function(value, vm)', + defaultValue: '', + desc: { + 'zh-CN': 'Office 的值发生变化时会触发该事件;回调参数为 改变的值;value: 改变后的值, vm: Area组件实例', + 'en-US': + 'This event is triggered when the value of Office changes. The callback parameter is the changed value. value: new value, vm: Area component instance' + }, + mode: ['pc'], + pcDemo: 'area-events' + }, + { + name: 'change-region', + type: 'Function(value, vm)', + defaultValue: '', + desc: { + 'zh-CN': 'Region 的值发生变化时会触发该事件;回调参数为 改变的值;value: 改变后的值, vm: Area组件实例', + 'en-US': + 'This event is triggered when the value of a region changes. The callback parameter is the changed value. value: new value, vm: Area component instance' + }, + mode: ['pc'], + pcDemo: 'area-events' + }, + { + name: 'change-rep', + type: 'Function(value, vm)', + defaultValue: '', + desc: { + 'zh-CN': 'Rep 的值发生变化时会触发该事件;回调参数为 改变的值;value: 改变后的值, vm: Area组件实例', + 'en-US': + 'This event is triggered when the value of Rep changes. The callback parameter is the changed value. value: new value, vm: Area component instance' + }, + mode: ['pc'], + pcDemo: 'area-events' + } + ], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/autocomplete.js b/examples/sites/demos/apis/autocomplete.js new file mode 100644 index 000000000..3ab4467eb --- /dev/null +++ b/examples/sites/demos/apis/autocomplete.js @@ -0,0 +1,325 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'autocomplete', + type: 'component', + props: [ + { + name: 'clearable', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否可清空', + 'en-US': 'Whether to clear data' + }, + mode: ['pc'], + pcDemo: 'clearable' + }, + { + name: 'debounce', + type: 'number', + defaultValue: '300', + desc: { + 'zh-CN': '获取输入建议的去抖延时', + 'en-US': 'Obtain the recommended input dejitter delay.' + }, + mode: ['pc'], + pcDemo: 'debounce' + }, + { + name: 'disabled', + type: 'boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否禁用', + 'en-US': 'Whether to disabled' + }, + mode: ['pc'], + pcDemo: 'disabled' + }, + { + name: 'display-only', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '设置只读', + 'en-US': 'Set read-only' + }, + mode: ['pc'], + pcDemo: 'display-only' + }, + { + name: 'fetch-suggestions', + typeAnchorName: 'IAutocompleteFetchSuggestions', + type: 'IAutocompleteFetchSuggestions', + defaultValue: '', + desc: { + 'zh-CN': '返回输入建议的方法,仅当你的输入建议数据 resolve 时,通过调用 callback 来返回它', + 'en-US': + 'This method is used to return input suggestions. It is returned by calling callback only when your input suggestions are resolved.' + }, + mode: ['pc'], + pcDemo: 'remote-search' + }, + { + name: 'hide-loading', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否隐藏远程加载时的加载图标', + 'en-US': 'Whether to hide the loading icon during remote loading' + }, + mode: ['pc'], + pcDemo: 'hide-loading' + }, + { + name: 'highlight-first-item', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否默认突出显示远程搜索建议中的第一项', + 'en-US': 'Whether to highlight the first item in remote search suggestions by default' + }, + mode: ['pc'], + pcDemo: 'highlight-first-item' + }, + { + name: 'label', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '等价于原生 input aria-label 属性', + 'en-US': 'Equiphorus input aria-label attribute' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'name', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': 'input 元素的原生属性', + 'en-US': 'Native attributes of the input element' + }, + mode: ['pc'] + }, + { + name: 'placeholder', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '输入框占位文本', + 'en-US': 'Placeholder text in the text box' + }, + mode: ['pc'], + pcDemo: 'hide-loading' + }, + { + name: 'placement', + typeAnchorName: 'IAutocompletePlacement', + type: 'IAutocompletePlacement', + defaultValue: "'bottom-start'", + desc: { + 'zh-CN': '菜单弹出位置', + 'en-US': 'Menu pop-up position' + }, + mode: ['pc'], + pcDemo: 'placement' + }, + { + name: 'popper-append-to-body', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '是否将下拉列表插入至 body 元素。在下拉列表的定位出现问题时,可将该属性设置为 false', + 'en-US': + 'Indicates whether to insert the drop-down list into the body element. When a fault occurs in locating the drop-down list, you can set this attribute to false' + }, + mode: ['pc'], + pcDemo: 'popper-class' + }, + { + name: 'popper-class', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '下拉列表的类名', + 'en-US': 'Class name of the Autocomplete drop-down list box' + }, + mode: ['pc'], + pcDemo: 'popper-class' + }, + { + name: 'prefix-icon', + type: 'Component', + defaultValue: '', + desc: { + 'zh-CN': '输入框头部图标', + 'en-US': 'Icon on the header of the text box' + }, + mode: ['pc'], + pcDemo: 'custom-icon' + }, + { + name: 'select-when-unmatched', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '在输入没有任何匹配建议的情况下,按下回车是否触发 select 事件', + 'en-US': + 'Indicates whether to trigger the select event when pressing Enter when the input does not have any matching suggestions.' + }, + mode: ['pc'], + pcDemo: 'select-event' + }, + { + name: 'size', + type: "'medium' | 'small' | 'mini'", + defaultValue: '', + desc: { + 'zh-CN': '设置组件大小', + 'en-US': 'Set the component size.' + }, + mode: ['pc'], + pcDemo: 'size' + }, + { + name: 'suffix-icon', + type: 'Component', + defaultValue: '', + desc: { + 'zh-CN': '输入框尾部图标', + 'en-US': 'Icon at the end of the text box' + }, + mode: ['pc'], + pcDemo: 'custom-icon' + }, + { + name: 'trigger-on-focus', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '是否在输入框 focus 时显示建议列表', + 'en-US': 'Whether to display the suggestion list when the text box is focused' + }, + mode: ['pc'], + pcDemo: 'no-trigger-on-focus' + }, + { + name: 'v-model', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '必填值,输入绑定值', + 'en-US': 'This parameter is mandatory. Enter a bound value.' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'value-key', + type: 'string', + defaultValue: "'value'", + desc: { + 'zh-CN': '在输入建议对象中,用于显示和匹配输入的键名', + 'en-US': 'In the Input Suggestion object, key names for displaying and matching inputs' + }, + mode: ['pc'], + pcDemo: 'value-key' + } + ], + events: [ + { + name: 'select', + typeAnchorName: 'IAutocompleteSuggestionItem', + type: '(selection: IAutocompleteSuggestionItem) => void', + defaultValue: '', + desc: { + 'zh-CN': '点击选中建议项时触发,回调参数为 fetch-suggestions 中传入的项', + 'en-US': + 'Triggered when you click to select a suggestion item. The callback parameter is the item passed in fetch-suggestions' + }, + mode: ['pc'], + pcDemo: 'select-event' + } + ], + methods: [], + slots: [ + { + name: 'append', + defaultValue: '', + desc: { + 'zh-CN': '输入框后置内容', + 'en-US': 'Content after the text box' + }, + mode: ['pc'], + pcDemo: 'slot' + }, + { + name: 'default', + defaultValue: '', + desc: { + 'zh-CN': + '下拉列表项插槽,插槽参数: arg: { slotScope: IAutocompleteSuggestionItem }, 其中 slotScope 是 fetch-suggestions 中传入的项', + 'en-US': + 'Drop-down list item slot, slot parameter: arg: { slotScope: IAutocompleteSuggestionItem }, where slotScope is the item passed in fetch-suggestions' + }, + mode: ['pc'], + pcDemo: 'slot' + }, + { + name: 'prefix', + defaultValue: '', + desc: { + 'zh-CN': '输入框头部内容', + 'en-US': 'Content in the text box header' + }, + mode: ['pc'], + pcDemo: 'slot' + }, + { + name: 'prepend', + defaultValue: '', + desc: { + 'zh-CN': '输入框前置内容', + 'en-US': 'Pre-content in the text box' + }, + mode: ['pc'], + pcDemo: 'slot' + }, + { + name: 'suffix', + defaultValue: '', + desc: { + 'zh-CN': '输入框尾部内容', + 'en-US': 'Content at the end of the text box' + }, + mode: ['pc'], + pcDemo: 'slot' + } + ] + } + ], + types: [ + { + name: 'IAutocompleteSuggestionItem', + type: 'type', + code: `interface IAutocompleteSuggestionItem { + [key: string]: string | undefined + value?: string +}` + }, + { + name: 'IAutocompletePlacement', + type: 'type', + code: `type IAutocompletePlacement = "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end"` + }, + { + name: 'IAutocompleteFetchSuggestions', + type: 'type', + code: `type IAutocompleteFetchSuggestions = (queryString: string, callback: (suggestions: IAutocompleteSuggestionItem[]) => void) => void` + } + ] +} diff --git a/examples/sites/demos/apis/avatar.js b/examples/sites/demos/apis/avatar.js new file mode 100644 index 000000000..3b4f39d97 --- /dev/null +++ b/examples/sites/demos/apis/avatar.js @@ -0,0 +1,113 @@ +export default { + mode: ['mobile'], + apis: [ + { + name: 'avatar', + type: 'component', + props: [ + { + name: 'alt', + type: 'Function', + defaultValue: '', + desc: { + 'zh-CN': '设置图片的备用文字描述
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'avatar-src-set' + }, + { + name: 'error', + type: 'Function()', + defaultValue: '', + desc: { + 'zh-CN': '设置img 标签的 onerror 函数
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'avatar-src-set' + }, + { + name: 'fit', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '设置图片的 object-fit
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'avatar-src-set' + }, + { + name: 'icon', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': '设置显示内容为icon
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'avatar-src-set' + }, + { + name: 'shape', + type: 'String', + defaultValue: 'circle', + desc: { + 'zh-CN': '该属性的可选值为 circle | square
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'avatar-src-set' + }, + { + name: 'size', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '该属性的可选值为 large|medium|small
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'avatar-size' + }, + { + name: 'src', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '设置图片链接地址
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'avatar-src-set' + }, + { + name: 'src-set', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '设置源图容器
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'avatar-src-set' + } + ], + events: [], + methods: [], + slots: [ + { + name: 'default', + defaultValue: '', + desc: { + 'zh-CN': '组件默认插槽
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'avatar-src-set' + } + ] + } + ] +} diff --git a/examples/sites/demos/apis/badge.js b/examples/sites/demos/apis/badge.js new file mode 100644 index 000000000..566238641 --- /dev/null +++ b/examples/sites/demos/apis/badge.js @@ -0,0 +1,209 @@ +export default { + mode: ['pc', 'mobile', 'mobile-first'], + apis: [ + { + name: 'badge', + type: 'component', + props: [ + { + name: 'badge-class', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '自定义标记的类名', + 'en-US': 'Class name for custom tags' + }, + mode: ['pc'], + pcDemo: 'badge-class' + }, + { + name: 'data', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '文本内容', + 'en-US': 'Set Text Content' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + }, + { + name: 'hidden', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否隐藏标记', + 'en-US': 'Whether to hide badge' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'dynamic-hidden', + mobileDemo: 'hidden', + mfDemo: '' + }, + { + name: 'href', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '指定跳转的目标页面地址', + 'en-US': 'Specify the URL of the target page.' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'link', + mobileDemo: 'href-target', + mfDemo: '' + }, + { + name: 'is-dot', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否以小圆点的形式来显示标记', + 'en-US': 'Set whether to display the badge in the form of small dots' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'is-dot', + mobileDemo: 'is-dot', + mfDemo: '' + }, + { + name: 'is-mini', + type: 'Boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '设置小尺寸,该属性默认为false
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'is-mini' + }, + { + name: 'max', + type: 'number', + defaultValue: '', + desc: { + 'zh-CN': + "指定徽章显示的最大值,如果实际获取的徽章值超过该最大值,则以最大值后接一个 '+' 的形式显示徽章数,要求 value 是 number 类型", + 'en-US': + 'Specifies the maximum number of badges to be displayed. If the actual badge value exceeds the maximum value, the number of badges is displayed in the format of "+". The value must be of the number type.' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'max', + mobileDemo: 'is-mini', + mfDemo: '' + }, + { + name: 'offset', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '设置标记位置的偏移量', + 'en-US': 'Set the offset of the marker position, see demo for details' + }, + mode: ['pc'], + pcDemo: 'offset' + }, + { + name: 'show-Left', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '设置是否向左展示,仅对圆点生效。', + 'en-US': 'Indicates whether to display the dots to the left. This parameter is valid only for dots.' + }, + mode: ['mobile-first'], + mfDemo: 'type-left' + }, + { + name: 'target', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '点击标记时链接到目标页面的跳转方式,仅在 href 属性存在时使用', + 'en-US': + 'Set the jump method for linking to the target page when clicking on the tag, only used when the href attribute exists' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'link', + mobileDemo: 'href-target', + mfDemo: '' + }, + { + name: 'type', + typeAnchorName: 'IPtype', + type: 'IPtype', + defaultValue: "'danger'", + desc: { + 'zh-CN': '标记的类型', + 'en-US': 'Set the type of badge' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'type', + mfDemo: '' + }, + { + name: 'v-model', + type: 'String / Number', + defaultValue: '', + desc: { + 'zh-CN': '绑定值', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'value', + type: 'number | string', + defaultValue: '', + desc: { + 'zh-CN': '相关数据条目数', + 'en-US': 'Set the number of related data entries' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'basic-usage', + mobileDemo: 'content', + mfDemo: '' + } + ], + events: [], + methods: [], + slots: [ + { + name: 'content', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '消息提示内容', + 'en-US': 'Message Content' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'slot-content', + mobileDemo: 'content', + mfDemo: '' + }, + { + name: 'default', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '默认插槽,有data属性时,默认插槽不生效', + 'en-US': 'Default slot. When there is a data attribute, the default slot is not valid' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'slot-default', + mobileDemo: 'content', + mfDemo: '' + } + ] + } + ], + types: [ + { + name: 'IPtype', + type: 'type', + code: `type IPtype = 'primary' | 'success' | 'warning' | 'danger' | 'info'` + } + ] +} diff --git a/examples/sites/demos/apis/breadcrumb.js b/examples/sites/demos/apis/breadcrumb.js new file mode 100644 index 000000000..67c67368c --- /dev/null +++ b/examples/sites/demos/apis/breadcrumb.js @@ -0,0 +1,194 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'breadcrumb', + type: 'component', + props: [ + { + name: 'options', + typeAnchorName: 'IOptionsItem', + type: 'IOptionsItem[]', + defaultValue: '', + desc: { + 'zh-CN': '单独使用 Breadcrumb,通过 option 配置生成面包屑', + 'en-US': 'Use Breadcrumb alone to generate bread crumbs through option configuration' + }, + mode: ['pc'], + pcDemo: 'options' + }, + { + name: 'separator', + type: 'string', + defaultValue: '>', + desc: { + 'zh-CN': '分隔符', + 'en-US': 'Separator' + }, + mode: ['pc'], + pcDemo: 'separator' + }, + { + name: 'separator-icon', + type: 'vueComponent', + defaultValue: '', + desc: { + 'zh-CN': '图标分隔符', + 'en-US': 'Icon separator' + }, + mode: ['pc'], + pcDemo: 'separator' + }, + { + name: 'size', + type: 'string', + defaultValue: "'medium'", + desc: { + 'zh-CN': '设置面包屑尺寸大小', + 'en-US': 'Set breadcrumb size' + }, + mode: ['pc'], + pcDemo: 'size' + }, + { + name: 'text-field', + type: 'string', + defaultValue: 'label', + desc: { + 'zh-CN': '指定面包屑的显示键值,结合 options 使用', + 'en-US': 'Specify the display key value for bread crumbs, used in conjunction with options' + }, + mode: ['pc'], + pcDemo: 'options' + } + ], + events: [ + { + name: 'select', + typeAnchorName: 'ISelectValue', + type: '(value: ISelectValue) => void', + defaultValue: '', + desc: { + 'zh-CN': '点击 BreadcrumbItem 时触发', + 'en-US': 'This event is triggered when BreadcrumbItem is clicked.' + }, + mode: ['pc'], + pcDemo: 'options' + } + ], + methods: [], + slots: [] + }, + { + name: 'breadcrumb-item', + type: 'component', + props: [ + { + name: 'label', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '定义面包屑的显示文本', + 'en-US': 'Define the breadcrumb display text' + }, + mode: ['pc'], + pcDemo: 'base' + }, + { + name: 'replace', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '在使用 to 进行路由跳转时,启用 replace 将不会向 浏览器历史记录 history 里添加新记录', + 'en-US': 'When using to for routing jump, enabling replace will not add new records to the browser history' + }, + mode: ['pc'], + pcDemo: 'slot-default' + }, + { + name: 'size', + type: 'string', + defaultValue: "'medium'", + desc: { + 'zh-CN': '设置面包屑尺寸大小', + 'en-US': 'Set breadcrumb size' + }, + mode: ['pc'], + pcDemo: 'size' + }, + { + name: 'to', + typeAnchorName: 'IOptionsItemTo', + type: 'string | IOptionsItemTo', + defaultValue: '', + desc: { + 'zh-CN': '路由跳转对象,同 vue-router 的 to', + 'en-US': 'Route redirection object, which is the same as to of vue-router' + }, + mode: ['pc'], + pcDemo: 'slot-default' + } + ], + events: [ + { + name: 'select', + typeAnchorName: 'ISelectValue', + type: '(value: ISelectValue) => void', + defaultValue: '', + desc: { + 'zh-CN': '点击 BreadcrumbItem 时触发', + 'en-US': 'This event is triggered when BreadcrumbItem is clicked.' + }, + mode: ['pc'], + pcDemo: 'base' + } + ], + methods: [], + slots: [ + { + name: 'default', + defaultValue: '', + desc: { + 'zh-CN': '默认插槽', + 'en-US': 'Default slot' + }, + mode: ['pc'], + pcDemo: 'slot-default' + } + ] + } + ], + types: [ + { + name: 'IOptionsItemTo', + type: 'interface', + code: ` +interface IOptionsItemTo { + path: string +}` + }, + { + name: 'IOptionsItem', + type: 'interface', + code: ` +interface IOptionsItem { + label?: string + to?: IOptionsItemTo + replace?: boolean + [customProp: string]: string +}` + }, + { + name: 'ISelectValue', + type: 'interface', + code: ` +interface ISelectValue { + event: Event + link: HTMLElement + option: IOptionsItem + replace: boolean + to?: IOptionsItemTo +}` + } + ] +} diff --git a/examples/sites/demos/apis/bulletin-board.js b/examples/sites/demos/apis/bulletin-board.js new file mode 100644 index 000000000..45d3f5ab8 --- /dev/null +++ b/examples/sites/demos/apis/bulletin-board.js @@ -0,0 +1,95 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'bulletin-board', + type: 'component', + props: [ + { + name: 'active-name', + type: 'string', + defaultValue: '1', + desc: { + 'zh-CN': "默认显示第1栏,可选'1' '2' '3'等", + 'en-US': 'By default, column 1 is displayed. You can select 1, 2, or 3.' + }, + mode: ['pc'], + pcDemo: 'active-name' + }, + { + name: 'data', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': 'tab-item 数据;tab-item 数据', + 'en-US': 'tab-item data; tab-item data' + }, + mode: ['pc'], + pcDemo: 'base' + }, + { + name: 'icon', + type: 'object , string', + defaultValue: '', + desc: { + 'zh-CN': 'tab-item中第一条信息的字体图标;tab-item中第一条信息的字体图标', + 'en-US': + 'Font icon of the first information in tab-item; Font icon of the first piece of information in tab-item' + }, + mode: ['pc'], + pcDemo: 'icon' + }, + { + name: 'more-link', + type: 'object', + defaultValue: '', + desc: { + 'zh-CN': + "更多按钮跳转地址,show-more 为true 的时候生效;moreLink: { url: 'localhost:3000/', // 跳转地址,url 和 route 属性二选一,url优先级高 route: 'Alert', // 跳转路由,url 和 route 属性二选一,url优先级高 target: '_blank', // 跳转方式 text: '更多' // 链接文本 }", + 'en-US': + "More button redirection URL. This parameter is valid only when show-more is set to true. moreLink: {url:'localhost:3000/', //Redirection address. Either the URL or route attribute must be selected. The URL has a higher priority. route:'Alert', //Redirection route. Either the URL or route attribute must be selected. URL has a high priority target: '_blank', //Redirection mode text: 'More' //Link text}" + }, + mode: ['pc'], + pcDemo: 'more-link' + }, + { + name: 'show-more', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '是否显示更多按钮,默认显示,需要与 more-link 同时使用', + 'en-US': + 'Indicates whether to display the More button. The More button is displayed by default and must be used together with more-link.' + }, + mode: ['pc'], + pcDemo: 'more-link' + }, + { + name: 'tab-title', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': 'tab栏数据', + 'en-US': 'Data in the tab column' + }, + mode: ['pc'], + pcDemo: 'tab-title' + }, + { + name: 'title', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '公告牌的标题', + 'en-US': 'Billboard title' + }, + mode: ['pc'], + pcDemo: 'title' + } + ], + events: [], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/button-group.js b/examples/sites/demos/apis/button-group.js new file mode 100644 index 000000000..5e9c7b4e9 --- /dev/null +++ b/examples/sites/demos/apis/button-group.js @@ -0,0 +1,199 @@ +export default { + mode: ['pc', 'mobile-first'], + apis: [ + { + name: 'button-group', + type: 'component', + props: [ + { + name: 'border', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '是否显示边框线', + 'en-US': 'Remove button border.' + }, + mode: ['pc'], + pcDemo: 'border' + }, + { + name: 'data', + typeAnchorName: 'IButtonGroupData', + type: 'IButtonGroupData[]', + defaultValue: '', + desc: { + 'zh-CN': '按钮组数据', + 'en-US': 'button group data' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + }, + { + name: 'disabled', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否被禁用按钮组', + 'en-US': 'Sets whether the button group is disabled' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'disabled', + mfDemo: '' + }, + { + name: 'modelValue / v-model', + type: 'number | string', + defaultValue: '', + desc: { + 'zh-CN': '默认选中按钮的值', + 'en-US': 'Default value of the selected button' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'plain', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否朴素按钮', + 'en-US': 'Indicates whether the button is a simple button' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'plain', + mfDemo: '' + }, + { + name: 'show-edit', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否显示编辑按钮,只有在显示更多的情况下生效', + 'en-US': + 'Whether to display the edit button. This parameter takes effect only when more buttons are displayed' + }, + mode: ['pc'], + pcDemo: 'show-edit' + }, + { + name: 'show-more', + type: 'number', + defaultValue: '', + desc: { + 'zh-CN': '当超过给定的按钮数量时显示更多按钮', + 'en-US': 'Show more buttons when the given number of buttons is exceeded' + }, + mode: ['pc'], + pcDemo: 'show-more' + }, + { + name: 'size', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '按钮组尺寸大小', + 'en-US': 'Set the component size' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'size', + mfDemo: '' + }, + { + name: 'text-field', + type: 'string', + defaultValue: "'text'", + desc: { + 'zh-CN': '按钮显示文字的字段值', + 'en-US': 'Field value of the button displayed text' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'text-value-field', + mfDemo: '' + }, + { + name: 'v-model', + type: 'Number / String', + defaultValue: '', + desc: { + 'zh-CN': '默认选中按钮的值', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'value-field', + type: 'string', + defaultValue: "'value'", + desc: { + 'zh-CN': '按钮选中值的字段值', + 'en-US': 'Field value of the button value' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'text-value-field', + mfDemo: '' + } + ], + events: [ + { + name: 'change', + type: '(value: string | number) => void', + defaultValue: '', + desc: { + 'zh-CN': '当选中按钮发生改变时触发', + 'en-US': 'Set the callback function triggered when the selected button is changed' + }, + mode: ['pc'], + pcDemo: 'change-event' + }, + { + name: 'edit', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '当编辑按钮被点击时触发', + 'en-US': 'Set the callback function triggered when the edit button is clicked' + }, + mode: ['pc'], + pcDemo: 'show-edit' + } + ], + methods: [], + slots: [ + { + name: 'default', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '默认插槽,自定义按钮组内容', + 'en-US': 'button group content' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'slot-default', + mfDemo: '' + } + ] + } + ], + types: [ + { + name: 'IButtonGroupData', + type: 'interface', + code: ` +interface IButtonGroupData { + text: string // 显示文本 + value: number | number // 选中的值 + disabled?: boolean // 是否禁用 + // 配置选块角标 + sup?: { + text: string // 角标文本 + class?: string // 角标的自定义class + slot?: string // 自定义插槽名称,提供后可在button-group内使用对应的插槽自定义角标内容 + icon?: Component // 传入图标组件 + } +} +` + } + ] +} diff --git a/examples/sites/demos/apis/button.js b/examples/sites/demos/apis/button.js new file mode 100644 index 000000000..2d3840472 --- /dev/null +++ b/examples/sites/demos/apis/button.js @@ -0,0 +1,245 @@ +export default { + mode: ['pc', 'mobile', 'mobile-first'], + apis: [ + { + name: 'button', + type: 'component', + props: [ + { + name: 'autofocus', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否默认聚焦', + 'en-US': 'Whether to focus by default' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'autofocus', + mfDemo: '' + }, + { + name: 'banner', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '设置通栏按钮', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'circle', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否圆形按钮', + 'en-US': 'Round button' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + }, + { + name: 'custom-class', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '设置 custom-class 属性定制按钮样式', + 'en-US': 'Set the custom-class attribute to customize the button style' + }, + mode: ['mobile-first'], + mfDemo: 'button-class' + }, + { + name: 'disabled', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否被禁用按钮', + 'en-US': 'Sets whether the button is disabled' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'dynamic-disabled', + mobileDemo: 'disabled', + mfDemo: '' + }, + { + name: 'ghost', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否幽灵按钮', + 'en-US': 'Is ghost button' + }, + mode: ['pc'], + pcDemo: 'ghost' + }, + { + name: 'href', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '通过设置 href 属性可跳转到指定页面', + 'en-US': 'Set the href attribute to jump to a specified page' + }, + mode: ['mobile-first'], + mfDemo: 'link' + }, + { + name: 'icon', + type: 'Component', + defaultValue: '', + desc: { + 'zh-CN': '按钮左侧展示的图标,接收为Icon组件', + 'en-US': 'The icon displayed by the button is received as an Icon component' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'icon', + mobileDemo: 'icon', + mfDemo: '' + }, + { + name: 'loading', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否加载中状态', + 'en-US': 'Loading status' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'loading', + mobileDemo: 'loading', + mfDemo: '' + }, + { + name: 'native-type', + type: "'button' | 'submit' | 'reset'", + defaultValue: "'button'", + desc: { + 'zh-CN': '对应按钮原生 type 属性', + 'en-US': 'Set the button native type attribute' + }, + mode: ['pc', 'mobile-first'], + pcDemo: '', + mfDemo: '' + }, + { + name: 'plain', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否朴素按钮', + 'en-US': 'Simple button' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + }, + { + name: 'reset-time', + type: 'number', + defaultValue: '1000', + desc: { + 'zh-CN': '设置按钮禁用时间,防止重复提交,单位毫秒', + 'en-US': 'Set the button disable time, in milliseconds, to prevent repeated submission' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'reset-time', + mobileDemo: 'reset-time', + mfDemo: '' + }, + { + name: 'round', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否圆角按钮', + 'en-US': 'Whether to round the corner button' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + }, + { + name: 'size', + type: "'large' | 'medium' | 'small' | 'mini'", + defaultValue: '', + desc: { + 'zh-CN': '定义按钮尺寸', + 'en-US': 'Define the button size' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'size', + mobileDemo: 'size', + mfDemo: '' + }, + { + name: 'text', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '按钮显示的文本', + 'en-US': 'Set the text displayed by the button' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'text', + mobileDemo: 'base', + mfDemo: '' + }, + { + name: 'type', + typeAnchorName: 'IButtonType', + type: 'IButtonType', + defaultValue: '', + desc: { + 'zh-CN': '展示按钮不同的状态,设置为text则展示为文本按钮', + 'en-US': 'Display different states of buttons, set to text to display as text buttons' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'basic-usage', + mobileDemo: 'base', + mfDemo: '' + } + ], + events: [ + { + name: 'click', + type: '(event: PointEvent) => void', + defaultValue: '', + desc: { + 'zh-CN': '当按钮被点击时触发的回调函数', + 'en-US': 'Sets the callback function triggered when a button is clicked' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'click', + mobileDemo: 'event', + mfDemo: '' + } + ], + methods: [], + slots: [ + { + name: 'default', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '默认插槽,自定义按钮展示内容', + 'en-US': 'Default slot' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'image', + mobileDemo: '', + mfDemo: '' + } + ] + } + ], + types: [ + { + name: 'IButtonType', + type: 'interface', + code: `type IButtonType = 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'` + } + ] +} diff --git a/examples/sites/demos/apis/calendar-bar.js b/examples/sites/demos/apis/calendar-bar.js new file mode 100644 index 000000000..f7aff9d88 --- /dev/null +++ b/examples/sites/demos/apis/calendar-bar.js @@ -0,0 +1,59 @@ +export default { + mode: ['mobile-first'], + apis: [ + { + name: 'calendarBar', + type: 'component', + props: [ + { + name: 'cascaderPosition', + type: 'Object', + defaultValue: '{}', + desc: { + 'zh-CN': '改变年月选择的位置', + 'en-US': 'Change the location of the year and month selection' + }, + mode: ['mobile-first'], + mfDemo: 'cascader-position' + }, + { + name: 'config', + type: 'Object', + defaultValue: '{}', + desc: { + 'zh-CN': '传入用户日期配置信息', + 'en-US': 'Transfer the user date configuration information.' + }, + mode: ['mobile-first'], + mfDemo: 'marked' + }, + { + name: 'v-model', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '数据绑定', + 'en-US': 'Data Binding' + }, + mode: ['mobile-first'], + mfDemo: 'marked' + } + ], + events: [], + methods: [ + { + name: 'expand', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '日历栏展开或收起时触发的事件', + 'en-US': 'Event triggered when the calendar bar expands or collapses' + }, + mode: ['mobile-first'], + mfDemo: 'expand' + } + ], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/calendar-view.js b/examples/sites/demos/apis/calendar-view.js new file mode 100644 index 000000000..bc1ee9bb1 --- /dev/null +++ b/examples/sites/demos/apis/calendar-view.js @@ -0,0 +1,293 @@ +export default { + mode: ['pc', 'mobile-first'], + apis: [ + { + name: 'calendar-view', + type: 'component', + props: [ + { + name: 'day-times', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '配置时间线模式下所展示的时间范围,默认为[8,18],可配范围[0,23]。', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'calendar-timeline-range', + mfDemo: 'calendar-timeline-range' + }, + { + name: 'disabled', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '日期禁用', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'calendar-disabled-day', + mfDemo: 'calendar-disabled-day' + }, + { + name: 'events', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '日程事件', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'calendar-event', + mfDemo: 'calendar-event' + }, + { + name: 'height', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '日历高度', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: '', + mfDemo: '' + }, + { + name: 'mark-color', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '点标记的颜色', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'calendar-day-mark', + mfDemo: 'calendar-day-mark' + }, + { + name: 'mode', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '显示模式,可选值有 timeline-时间线模式、schedule-日程模式、month-月模式,默认为月模式。', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'calendar-mode', + mfDemo: 'calendar-mode' + }, + { + name: 'modes', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '模式组,显示模式任意组合', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'calendar-mode', + mfDemo: 'calendar-mode' + }, + { + name: 'month', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '日历当前显示月份', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: 'basic-usage' + }, + { + name: 'multi-select', + type: 'boolean', + defaultValue: '', + desc: { + 'zh-CN': '日期多选', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'multi-select', + mfDemo: 'multi-select' + }, + { + name: 'set-day-bg-color', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '设置日期背景色', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'custom-day-bg-color', + mfDemo: 'custom-day-bg-color' + }, + { + name: 'show-mark', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '显示点标记', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'calendar-day-mark', + mfDemo: 'calendar-day-mark' + }, + { + name: 'show-new-schedule', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '显示新增日程按钮', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: 'basic-usage' + }, + { + name: 'v-model', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '绑定值,默认为空', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'year', + type: 'number', + defaultValue: '', + desc: { + 'zh-CN': '日历当前显示年份', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: 'basic-usage' + } + ], + events: [ + { + name: 'month-change', + desc: { + 'zh-CN': '月改变事件', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'calendar-event', + mfDemo: 'calendar-event' + }, + { + name: 'new-schedule', + desc: { + 'zh-CN': '新增日程按钮点击事件', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'calendar-schedule-slot', + mfDemo: 'calendar-schedule-slot' + }, + { + name: 'next-week-click', + desc: { + 'zh-CN': '下一周按钮点击事件', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'calendar-event', + mfDemo: 'calendar-event' + }, + { + name: 'prev-week-click', + desc: { + 'zh-CN': '上一周按钮点击事件', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'calendar-event', + mfDemo: 'calendar-event' + }, + { + name: 'selected-date-change', + desc: { + 'zh-CN': '选中日期改变事件', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'multi-select', + mfDemo: 'multi-select' + }, + { + name: 'week-change', + desc: { + 'zh-CN': '周改变事件', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'calendar-event', + mfDemo: 'calendar-event' + }, + { + name: 'year-change', + desc: { + 'zh-CN': '年改变事件', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'calendar-event', + mfDemo: 'calendar-event' + } + ], + methods: [], + slots: [ + { + name: 'header', + desc: { + 'zh-CN': '头部插槽', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'calendar-schedule-slot', + mfDemo: 'calendar-schedule-slot' + }, + { + name: 'timeline', + desc: { + 'zh-CN': '时间线插槽,有timeline1-timeline7 7个插槽', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'calendar-schedule-slot', + mfDemo: 'calendar-schedule-slot' + }, + { + name: 'tool', + desc: { + 'zh-CN': '工具栏插槽', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'calendar-schedule-slot', + mfDemo: 'calendar-schedule-slot' + }, + { + name: 'weekday', + desc: { + 'zh-CN': '日程插槽,有weekday1-weekday7 7个插槽', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'calendar-schedule-slot', + mfDemo: 'calendar-schedule-slot' + } + ] + } + ] +} diff --git a/examples/sites/demos/apis/calendar.js b/examples/sites/demos/apis/calendar.js new file mode 100644 index 000000000..84becc583 --- /dev/null +++ b/examples/sites/demos/apis/calendar.js @@ -0,0 +1,104 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'calendar', + type: 'component', + props: [ + { + name: 'events', + typeAnchorName: 'eventLists', + type: 'eventLists[]', + defaultValue: '', + desc: { + 'zh-CN': '事件列表', + 'en-US': 'Event List' + }, + mode: ['pc'], + pcDemo: 'dynamic-add-schedule' + }, + { + name: 'mode', + type: "'month' | 'year'", + defaultValue: "'month'", + desc: { + 'zh-CN': '日历显示模式', + 'en-US': 'Display mode. The value can be month or year. The default value is month.' + }, + mode: ['pc'], + pcDemo: 'calendar-mode' + }, + { + name: 'month', + type: 'number', + defaultValue: '', + desc: { + 'zh-CN': '指定月份,默认当前月份', + 'en-US': 'Specified month. The default value is the current month.' + }, + mode: ['pc'], + pcDemo: 'custom-day-cell' + }, + { + name: 'show-selected', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否显示选中的日期', + 'en-US': 'Display the selected date.' + }, + mode: ['pc'], + pcDemo: 'show-selected-date' + }, + { + name: 'year', + type: 'number', + defaultValue: '', + desc: { + 'zh-CN': '指定年份,默认当前年份', + 'en-US': 'Specified year. The default year is this year.' + }, + mode: ['pc'], + pcDemo: 'custom-day-cell' + } + ], + events: [], + methods: [], + slots: [ + { + name: 'day', + defaultValue: '', + desc: { + 'zh-CN': '日期单元格插槽', + 'en-US': 'Date Cell Slot' + }, + mode: ['pc'], + pcDemo: 'custom-day-cell' + }, + { + name: 'tool', + defaultValue: '', + desc: { + 'zh-CN': '日历工具栏插槽', + 'en-US': 'Calendar Toolbar Slot' + }, + mode: ['pc'], + pcDemo: 'custom-calendar-toolbar' + } + ] + } + ], + types: [ + { + name: 'eventLists', + type: 'interface', + code: ` + interface eventLists [{ + time: 1534297845236, // 指定需要展示事件的日期 + title: '消息', // 指定事件标题 + content: '这是一条消息', // 指定事件的具体内容 + type: 'info' // 事件主题类型,包括 warning、error、info、success。 + }]` + } + ] +} diff --git a/examples/sites/demos/apis/card.js b/examples/sites/demos/apis/card.js new file mode 100644 index 000000000..0f842dbe5 --- /dev/null +++ b/examples/sites/demos/apis/card.js @@ -0,0 +1,249 @@ +export default { + mode: ['mobile-first'], + apis: [ + { + name: 'Card', + type: 'component', + props: [ + { + name: 'auto-width', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '卡片的宽度是否自动撑开,设置后将不再给卡片设置固定宽度', + 'en-US': + 'Indicates whether the card width is automatically expanded. After the setting, the card width is not fixed.' + }, + mode: ['mobile-first'], + mfDemo: 'card-auto-width' + }, + { + name: 'check-type', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '设置卡片单选、多选,单选/radio;多选/checkbox,需同时设置 label。', + 'en-US': + 'Set single-choice, multiple-choice, single-choice, and radio. Multi-choice/checkbox. You need to set the label at the same time.' + }, + mode: ['mobile-first'], + mfDemo: 'check-type-checkbox' + }, + { + name: 'custom-class', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '卡片的class', + 'en-US': 'Class of the card' + }, + mode: ['mobile-first'], + mfDemo: 'card-custom-class' + }, + { + name: 'disabled', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '卡片禁用', + 'en-US': 'Card disabled' + }, + mode: ['mobile-first'], + mfDemo: 'card-disabled' + }, + { + name: 'height', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '卡片内容区域的高度', + 'en-US': 'Height of the card content area' + }, + mode: ['mobile-first'], + mfDemo: 'card-height' + }, + { + name: 'icon-more', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': '更多按钮图标,可传入一个svg图标对象进行替换', + 'en-US': 'More button icons can be replaced by a svg icon object.' + }, + mode: ['mobile-first'], + mfDemo: 'card-icon-more' + }, + { + name: 'label', + type: 'String / Number', + defaultValue: '', + desc: { + 'zh-CN': 'checkbox或radio的label', + 'en-US': 'Checkbox or radio label.' + }, + mode: ['mobile-first'], + mfDemo: 'card-label' + }, + { + name: 'options', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '操作按钮配置', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'size', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '尺寸,支持large、medium、small、mini 4个尺寸,默认值为medium', + 'en-US': 'Size. The options are large, medium, small, and mini. The default value is medium.' + }, + mode: ['mobile-first'], + mfDemo: 'card-size' + }, + { + name: 'src', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '图片或者视频的地址', + 'en-US': 'Address of a picture or video.' + }, + mode: ['mobile-first'], + mfDemo: 'card-src' + }, + { + name: 'status', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '卡片状态,支持 success、warning、alerting、danger 4 种状态', + 'en-US': 'Card status. The value can be success, warning, alerting, or dangerous.' + }, + mode: ['mobile-first'], + mfDemo: 'card-status' + }, + { + name: 'title', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '卡片的标题', + 'en-US': 'The title of the card.' + }, + mode: ['mobile-first'], + mfDemo: 'card-title' + }, + { + name: 'type', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '设置卡片类型,支持 text、image、video、logo 4 种类型。', + 'en-US': 'Set the card type. The options are text, image, video, and logo.' + }, + mode: ['mobile-first'], + mfDemo: 'card-type' + }, + { + name: 'v-model', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '绑定值,默认为空', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ], + events: [ + { + name: 'change', + type: 'Function()', + defaultValue: '', + desc: { + 'zh-CN': '组件选中/取消选中事件', + 'en-US': 'Component check/uncheck event' + }, + mode: ['mobile-first'], + mfDemo: 'card-events' + }, + { + name: 'icon-click', + type: 'Function()', + defaultValue: '', + desc: { + 'zh-CN': '操作栏按钮点击事件', + 'en-US': 'Operation bar button click event' + }, + mode: ['mobile-first'], + mfDemo: 'card-events' + } + ], + methods: [], + slots: [ + { + name: 'default', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '组件默认插槽', + 'en-US': 'Component Default Slot' + }, + mode: ['mobile-first'], + mfDemo: 'slot' + }, + { + name: 'footer', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '组件默认插槽', + 'en-US': 'Component Default Slot' + }, + mode: ['mobile-first'], + mfDemo: 'slot' + }, + { + name: 'title', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '标题插槽', + 'en-US': 'Header Slot' + }, + mode: ['mobile-first'], + mfDemo: 'slot' + }, + { + name: 'title-left', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '标题左侧插槽', + 'en-US': 'Header Left Slot' + }, + mode: ['mobile-first'], + mfDemo: 'slot' + }, + { + name: 'title-right', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '标题右侧插槽', + 'en-US': 'Header right slot' + }, + mode: ['mobile-first'], + mfDemo: 'slot' + } + ] + } + ] +} diff --git a/examples/sites/demos/apis/carousel.js b/examples/sites/demos/apis/carousel.js new file mode 100644 index 000000000..2a460ab08 --- /dev/null +++ b/examples/sites/demos/apis/carousel.js @@ -0,0 +1,262 @@ +export default { + mode: ['pc', 'mobile-first'], + apis: [ + { + name: 'carousel', + type: 'component', + props: [ + { + name: 'arrow', + type: 'string', + defaultValue: "该属性的默认值为 'hover'", + desc: { + 'zh-CN': '切换箭头的显示效果,该属性的可选值为 always / hover / never', + 'en-US': 'Switch the display effect of arrows,The optional values for this attribute are always/hover/never' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'up-down-carousel', + mfDemo: '' + }, + { + name: 'aspect-ratio', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '宽高比,默认为16:2。', + 'en-US': 'Aspect ratio. The default value is 16:2.' + }, + mode: ['mobile-first'], + mfDemo: 'aspect-ratio' + }, + { + name: 'autoplay', + type: 'boolean', + defaultValue: '该属性的默认值为 false', + desc: { + 'zh-CN': '是否自动切换', + 'en-US': 'Whether to automatically switch' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'autoplay', + mfDemo: '' + }, + { + name: 'height', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '走马灯的高度', + 'en-US': 'The height of the lantern' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'indicator-trigger', + mfDemo: '' + }, + { + name: 'indicator-position', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '指示器的位置。该属性的可选值为 outside / none', + 'en-US': 'The position of the indicator. The optional values for this attribute are outside/none' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'indicator-trigger', + mfDemo: '' + }, + { + name: 'indicator-style', + type: 'String', + defaultValue: '该属性的可选值为 light/dark ,默认为light。', + desc: { + 'zh-CN': '指示器的样式。', + 'en-US': 'The style of the indicator.' + }, + mode: ['mobile-first'], + mfDemo: 'indicator-style' + }, + { + name: 'initial-index', + type: 'number', + defaultValue: '该属性的默认值为 0', + desc: { + 'zh-CN': '初始状态激活的幻灯片的索引,从 0 开始', + 'en-US': 'Index of slides activated in initial state, starting from 0' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'manual-play', + mfDemo: '' + }, + { + name: 'interval', + type: 'number', + defaultValue: '该属性的默认值为 3000', + desc: { + 'zh-CN': '自动切换的时间间隔,单位为毫秒', + 'en-US': 'The time interval for automatic switching, in milliseconds' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'play-interval', + mfDemo: '' + }, + { + name: 'loop', + type: 'boolean', + defaultValue: '该属性的默认值为 true', + desc: { + 'zh-CN': '是否循环显示', + 'en-US': 'Whether to display in a loop' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'close-loop', + mfDemo: '' + }, + { + name: 'show-title', + type: 'boolean', + defaultValue: '该属性的默认值为 false', + desc: { + 'zh-CN': '是否显示标题', + 'en-US': 'Is the title displayed' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'show-title', + mfDemo: '' + }, + { + name: 'trigger', + type: 'string', + defaultValue: "该属性的默认值为 'hover'", + desc: { + 'zh-CN': '指示器的触发方式,默认为 hover。该属性的可选值为 click', + 'en-US': + 'The triggering method of the indicator is hover by default. The optional value for this attribute is click' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'indicator-trigger', + mfDemo: '' + }, + { + name: 'type', + type: 'string', + defaultValue: "该属性的默认值为 'horizontal'", + desc: { + 'zh-CN': '走马灯的类型,该属性的可选值为 horizontal / vertical / card', + 'en-US': 'The type of horse lantern,The optional values for this attribute are horizontal/vertical/card' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'card-mode', + mfDemo: '' + } + ], + events: [ + { + name: 'change', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '幻灯片切换时触发', + 'en-US': 'Trigger during slide transition' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'carousel-events', + mfDemo: '' + } + ], + methods: [ + { + name: 'next', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '切换至下一张幻灯片', + 'en-US': 'Switch to the next slide' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'manual-play', + mfDemo: '' + }, + { + name: 'prev', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '切换至上一张幻灯片', + 'en-US': 'Switch to the previous slide' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'manual-play', + mfDemo: '' + }, + { + name: 'setActiveItem', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '手动切换幻灯片', + 'en-US': 'Manually switch slides' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'manual-play', + mfDemo: '' + } + ], + slots: [ + { + name: 'default', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '默认插槽', + 'en-US': 'Default slot' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'manual-play', + mfDemo: '' + } + ] + }, + { + name: 'carousel-item', + type: 'component', + props: [ + { + name: 'name', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '幻灯片名称', + 'en-US': 'Slide Name' + }, + mode: ['pc'], + pcDemo: 'manual-play' + }, + { + name: 'title', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '幻灯片标题', + 'en-US': 'Slide Title' + }, + mode: ['pc'], + pcDemo: 'show-title' + } + ], + events: [], + methods: [], + slots: [ + { + name: 'default', + defaultValue: '', + desc: { + 'zh-CN': '默认插槽', + 'en-US': 'Default slot' + }, + mode: ['pc'], + pcDemo: 'manual-play' + } + ] + } + ] +} diff --git a/examples/sites/demos/apis/cascader-mobile.js b/examples/sites/demos/apis/cascader-mobile.js new file mode 100644 index 000000000..58e3febbe --- /dev/null +++ b/examples/sites/demos/apis/cascader-mobile.js @@ -0,0 +1,305 @@ +export default { + mode: ['mobile-first'], + apis: [ + { + name: 'cascader-mobile', + type: 'component', + props: [ + { + name: 'children-field', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '子集字段,默认值为 children ', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '列表数据', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'ellipsis', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否超出一行隐藏并显示省略号,默认值为 false ', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'mask', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否显示遮罩层,默认值为 true', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'node-config', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': + "节点配置,默认值为 { lazy: false, load: null, isLeaf: 'leaf', afterLoad: null, checkStrictly: false } ", + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'placeholder', + type: 'String / Array', + defaultValue: '', + desc: { + 'zh-CN': + '导航占位文本信息,设置为字符串类型表示每个导航节点的占位文本信息,设置为数组类型时,每个数组下标索引对应导航节点的顺序设置占位文本信息', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'search-config', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': '搜索配置,默认值为 { options: [], searchMethod: null, openSearchSlot: false }', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'show-header', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否显示头部,默认值为 true', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'text-field', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': 'text 文本字段,默认值为 label', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'text-field2', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '第二个 text 文本字段,一般用于附属文本', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'text-field3', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '第三个 text 文本字段,一般用于描述文本', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'text-split', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '文本信息分隔符,默认值为 ”; “ ', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'title', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '面板标题', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'v-model', + type: 'Number / String / Array', + defaultValue: '', + desc: { + 'zh-CN': '绑定值', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'value-field', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': 'value 唯一键字段,默认值为 id ', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'visible', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否弹出面板', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ], + events: [ + { + name: 'click', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '点击选项时触发', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'close', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '关闭面板时触发', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'confirm', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '确认时触发', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'node-expand', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '展开子节点时触发', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'search-click', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '搜索列表选中项时触发', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'update:text', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '绑定值改变时触发', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'update:visible', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '面板显隐时触发', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ], + methods: [ + { + name: 'close', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '关闭面板', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ], + slots: [ + { + name: 'default', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '选项插槽', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'search-item', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '搜索选项插槽,设置 :search-config="{ openSearchSlot: true, ... }" 时有效', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ] + } + ] +} diff --git a/examples/sites/demos/apis/cascader-panel.js b/examples/sites/demos/apis/cascader-panel.js new file mode 100644 index 000000000..7a6a391a3 --- /dev/null +++ b/examples/sites/demos/apis/cascader-panel.js @@ -0,0 +1,328 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'cascader-panel', + type: 'component', + props: [ + { + name: 'modelValue / v-model', + typeAnchorName: 'ICascaderPanelNodePropValue', + type: 'ICascaderPanelNodePropValue', + defaultValue: '', + desc: { + 'zh-CN': '选中项绑定值, 其类型由 props.multiple、props.emitPath 共同决定', + 'en-US': 'Select an item binding value whose type is determined by both props.multiple and props.emitPath' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'options', + typeAnchorName: 'ICascaderPanelData', + type: 'ICascaderPanelData[]', + defaultValue: '', + desc: { + 'zh-CN': '可选项数据源,键名可通过 Props 属性配置', + 'en-US': 'Optional data source. The key name can be configured through the Props attribute.' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'props', + typeAnchorName: 'ICascaderPanelConfig', + type: 'ICascaderPanelConfig', + defaultValue: '', + desc: { + 'zh-CN': '配置选项,具体见 ICascaderPanelConfig 表 ', + 'en-US': 'Configuration options. For details, see the ICascaderPanelConfig table.' + }, + mode: ['pc'], + pcDemo: 'cascader-panel-props' + } + ], + events: [ + { + name: 'change', + typeAnchorName: 'ICascaderPanelNodePropValue', + type: '(value: ICascaderPanelNodePropValue) => void', + defaultValue: '', + desc: { + 'zh-CN': '当选中节点变化时触发; 回调参数为 选中节点的值', + 'en-US': + 'This event is triggered when the selected node changes. arg: The callback parameter is the value of the selected node (array type).' + }, + mode: ['pc'], + pcDemo: 'change' + }, + { + name: 'expand-change', + typeAnchorName: 'ICascaderPanelNodeValue', + type: '(value: ICascaderPanelNodeValue[]) => void', + defaultValue: '', + desc: { + 'zh-CN': '当展开节点发生变化时触发; 回调参数为 各父级选项值组成的数组 (Array 类型)', + 'en-US': + 'This event is triggered when the expanded node changes. arg: The callback parameter is an array (Array type) consisting of parent option values.' + }, + mode: ['pc'], + pcDemo: 'change' + } + ], + methods: [ + { + name: 'clearCheckedNodes', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '清空选中的节点', + 'en-US': 'Clear selected nodes.' + }, + mode: ['pc'], + pcDemo: 'change' + }, + { + name: 'getCheckedNodes', + typeAnchorName: 'ICascaderPanelNode', + type: '(leafOnly: boolean = false) => ICascaderPanelNode[]', + defaultValue: '', + desc: { + 'zh-CN': '获取选中的节点;参数为 (leafOnly) 是否只是获取子节点,默认值为 false', + 'en-US': + 'Obtain the selected node. The parameter (leafOnly) indicates whether to obtain only subnodes. The default value is false' + }, + mode: ['pc'], + pcDemo: 'change' + } + ], + slots: [ + { + name: 'default', + defaultValue: '', + desc: { + 'zh-CN': + '自定义备选项的节点内容,参数为 { node: ICascaderPanelNode, data: ICascaderPanelData },分别为当前节点的 Node 对象和数据', + 'en-US': + 'User-defined candidate node content. The parameter is {node, data}, which indicates the node object and data of the current node.' + }, + mode: ['pc'], + pcDemo: 'custom-option-content' + } + ] + }, + { + name: 'ICascaderPanelConfig ', + type: 'component', + props: [ + { + name: 'checkStrictly', + type: 'boolean', + defaultValue: ' false', + desc: { + 'zh-CN': '是否严格的遵守父子节点不互相关联', + 'en-US': + 'Whether to strictly comply with the principle that parent and child nodes are not associated with each other' + }, + mode: ['pc'] + }, + { + name: 'children', + type: 'string', + defaultValue: "'children'", + desc: { + 'zh-CN': '指定选项的子选项为选项对象的某个属性值', + 'en-US': 'Specifies that the sub-option of an option is an attribute value of the option object.' + }, + mode: ['pc'], + pcDemo: 'cascader-panel-props' + }, + { + name: 'disabled', + type: 'string', + defaultValue: "'disabled'", + desc: { + 'zh-CN': '指定选项的禁用为选项对象的某个属性值', + 'en-US': 'Specify that an option is disabled as an attribute value of the option object.' + }, + mode: ['pc'], + pcDemo: 'cascader-panel-props' + }, + { + name: 'emitPath', + type: 'boolean', + defaultValue: ' true', + desc: { + 'zh-CN': + '在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值', + 'en-US': + 'Indicates whether to return an array consisting of the values of menus at different levels of the selected node when the selected node is changed. If this parameter is set to false, only the value of the selected node is returned.' + }, + mode: ['pc'] + }, + { + name: 'expandTrigger', + type: "'click' | 'hover'", + defaultValue: "'click'", + desc: { + 'zh-CN': '次级菜单的展开方式', + 'en-US': 'The expansion mode of the secondary menu' + }, + mode: ['pc'] + }, + { + name: 'label', + type: 'string', + defaultValue: "'label'", + desc: { + 'zh-CN': '指定选项标签为选项对象的某个属性值', + 'en-US': 'Specify that the option label is an attribute value of the option object.' + }, + mode: ['pc'], + pcDemo: 'cascader-panel-props' + }, + { + name: 'lazy', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否动态加载子节点,需与 lazyLoad 方法结合使用', + 'en-US': + 'Whether to dynamically load subnodes. This parameter must be used together with the lazyLoad method.' + }, + mode: ['pc'] + }, + { + name: 'lazyLoad', + typeAnchorName: 'ICascaderPanelLazyLoad', + type: 'ICascaderPanelLazyLoad', + defaultValue: '', + desc: { + 'zh-CN': + '加载动态数据的方法,仅在 lazy 为 true 时有效;参数说明: node 为当前点击的节点,resolve 为数据加载完成的回调(必须调用)', + 'en-US': + 'Method for loading dynamic data. This parameter is valid only when lazy is set to true. Parameter description: node indicates the currently clicked node. resolve indicates the callback after data loading is complete (mandatory).' + }, + mode: ['pc'] + }, + { + name: 'leaf', + type: 'string', + defaultValue: "'leaf'", + desc: { + 'zh-CN': '指定选项的叶子节点的标志位为选项对象的某个属性值', + 'en-US': 'The flag bit of the leaf node of the specified option is an attribute value of the option object.' + }, + mode: ['pc'], + pcDemo: 'cascader-panel-props' + }, + { + name: 'multiple', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否多选', + 'en-US': 'Whether to select multiple options' + }, + mode: ['pc'] + }, + { + name: 'value', + type: 'string', + defaultValue: "'value'", + desc: { + 'zh-CN': '指定选项的值为选项对象的某个属性值', + 'en-US': 'The value of an option is the value of an attribute of the option object.' + }, + mode: ['pc'], + pcDemo: 'cascader-panel-props' + } + ], + events: [], + methods: [], + slots: [] + } + ], + types: [ + { + name: 'ICascaderPanelNodeValue', + type: 'type', + code: `type ICascaderPanelNodeValue = string | number` + }, + { + name: 'ICascaderPanelNodePropValue', + type: 'type', + code: ` +type ICascaderPanelNodePropValue = + | ICascaderPanelNodeValue + | ICascaderPanelNodeValue[] + | ICascaderPanelNodeValue[][]` + }, + { + name: 'ICascaderPanelData', + type: 'type', + code: ` +type ICascaderPanelData = { + value?: ICascaderPanelNodeValue + label?: string + children?: ICascaderPanelData[] + disabled?: boolean + leaf?: boolean + [key: string]: ICascaderPanelNodeValue | ICascaderPanelData[] | string | boolean | undefined +}` + }, + { + name: 'ICascaderPanelConfig', + type: 'interface', + code: ` +interface ICascaderPanelConfig { + emitPath: boolean + expandTrigger: 'click' | 'hover' + hoverThreshold: number + checkStrictly?: boolean + multiple?: boolean + lazy: boolean + lazyLoad: ( + node: ICascaderPanelNode, + resolve: (dataList: ICascaderPanelData[]) => void + ) => void + value: string + label: string + children: string + disabled: string + leaf: string +}` + }, + { + name: 'ICascaderPanelNode', + type: 'type', + code: ` +type ICascaderPanelNode = { + parent: ICascaderPanelNode | null + level: number + data: ICascaderPanelData + config: ICascaderPanelConfig + uid: number + value: ICascaderPanelNodeValue + label: string + pathNodes: Node[] + path: ICascaderPanelNodeValue[] + pathLabels: string[] + loaded: boolean + loading: boolean + hasChildren: boolean + children: Node[] + checked?: boolean + indeterminate?: boolean + root?: boolean +}` + }, + { + name: 'ICascaderPanelLazyLoad', + type: 'type', + code: ` +type ICascaderPanelLazyLoad = (node: ICascaderPanelNode, resolve: (dataList: ICascaderPanelData[]) => void) => void + ` + } + ] +} diff --git a/examples/sites/demos/apis/cascader-select.js b/examples/sites/demos/apis/cascader-select.js new file mode 100644 index 000000000..4123f8c87 --- /dev/null +++ b/examples/sites/demos/apis/cascader-select.js @@ -0,0 +1,115 @@ +export default { + mode: ['mobile-first'], + apis: [ + { + name: 'cascader-select', + type: 'component', + props: [ + { + name: 'cycle-roll', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '打开选项循环滚动功能,默认值为 false', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'disabled', + type: 'Function', + defaultValue: '', + desc: { + 'zh-CN': + '数组选项禁用,此方法的第一个参数是可见选项的当前值,其它参数是组件当前聚焦值,返回 true 则禁用选项', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'options', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '传入组件的数据', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'text-color', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': '文字颜色', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'text-field', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': 'options选项中label的替代名称', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'value-field', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': 'options选项中value的替代名称', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'value-type', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': 'options选项中id的类型', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'visible', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '显示级联选择面板,默认值为false', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ], + events: [ + { + name: 'update:visible', + type: '', + defaultValue: '', + desc: { + 'zh-CN': 'visible改变事件', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/cascader-view.js b/examples/sites/demos/apis/cascader-view.js new file mode 100644 index 000000000..716e86808 --- /dev/null +++ b/examples/sites/demos/apis/cascader-view.js @@ -0,0 +1,595 @@ +export default { + mode: ['mobile-first'], + apis: [ + { + name: 'CalendarView', + type: 'component', + props: [ + { + name: 'children-field', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '子集字段,默认值为 children ', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'custom-class', + type: 'String / Object / Array', + defaultValue: '', + desc: { + 'zh-CN': '自定义 class 样式', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '列表数据', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'day-times', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '配置时间线模式下所展示的时间范围,默认为[8,18],可配范围[0,23]。', + 'en-US': + 'Time range displayed in timeline mode. The default value range is [8, 18]. The value range is [0, 23].' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + mode: [] + }, + { + name: 'ellipsis', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否超出一行隐藏并显示省略号,默认值为 false ', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'emit-path', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '通过设置 `emit-path` 属性值为 `false` 不显示值路径,默认值为 `true` 显示值路径', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'events', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '日程事件', + 'en-US': 'Scheduled Events' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'height', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '日历高度', + 'en-US': 'Calendar height' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'lock-scroll', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': '弹出面板是否锁定浏览器滚动条,默认值为 true', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'mark-color', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '点标记的颜色', + 'en-US': 'Color of the dot marker' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'mask', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否显示遮罩层,默认值为 true', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'mode', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '显示模式,可选值有 timeline-时间线模式、schedule-日程模式、month-月模式,默认为月模式。', + 'en-US': + 'Display mode. The options are timeline-timeline, schedule-schedule, and month-month. The default value is month.' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'modes', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '模式组,显示模式任意组合', + 'en-US': 'Pattern group, any combination of display patterns' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'month', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '日历当前显示月份', + 'en-US': 'The calendar currently displays the month' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'multi-select', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '日期多选', + 'en-US': 'Multiple Dates' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'node-config', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': + "节点配置,默认值为 { lazy: false, load: null, isLeaf: 'leaf', afterLoad: null, checkStrictly: false } ", + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'search-config', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': '搜索配置,默认值为 { options: [], searchMethod: null, openSearchSlot: false }', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'set-day-bg-color', + type: 'Function', + defaultValue: '', + desc: { + 'zh-CN': '设置日期背景色', + 'en-US': 'Set Date Background Color' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'show-header', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否显示头部,默认值为 true', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'show-mark', + type: 'Function', + defaultValue: '', + desc: { + 'zh-CN': '显示点标记', + 'en-US': 'Show Point Markers' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'show-new-schedule', + type: 'Function', + defaultValue: '', + desc: { + 'zh-CN': '显示新增日程按钮', + 'en-US': 'Show the button for adding a schedule' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'text-field', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': 'text 文本字段,默认值为 label', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'text-field2', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '第二个 text 文本字段,一般用于附属文本', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'text-field3', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '第三个 text 文本字段,一般用于描述文本', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'text-split', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '文本信息分隔符,默认值为 ”; “ ', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'title', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '面板标题', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'v-model', + type: 'Number / String / Array', + defaultValue: '', + desc: { + 'zh-CN': '绑定值', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'value-field', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': 'value 唯一键字段,默认值为 id ', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'visible', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否弹出面板', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'year', + type: 'Number', + defaultValue: '', + desc: { + 'zh-CN': '日历当前显示年份', + 'en-US': 'Calendar Current Display Year' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ], + events: [ + { + name: 'click', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '点击选项时触发', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'close', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '关闭面板时触发', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'confirm', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '确认时触发', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'month-change', + type: 'Function()', + defaultValue: '', + desc: { + 'zh-CN': '月改变事件', + 'en-US': 'Month Change Event' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'new-schedule', + type: 'Function()', + defaultValue: '', + desc: { + 'zh-CN': '新增日程按钮点击事件', + 'en-US': 'Event for adding a schedule button.' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'next-week-click', + type: 'Function()', + defaultValue: '', + desc: { + 'zh-CN': '下一周按钮点击事件', + 'en-US': 'Next week button click event' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'node-expand', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '展开子节点时触发', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'prev-week-click', + type: 'Function()', + defaultValue: '', + desc: { + 'zh-CN': '上一周按钮点击事件', + 'en-US': 'Button click event of the previous week' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'search-click', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '搜索列表选中项时触发', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'selected-date-change', + type: 'Function()', + defaultValue: '', + desc: { + 'zh-CN': '选中日期改变事件', + 'en-US': 'Select Date Change Event' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'update:text', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '绑定值改变时触发', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'update:visible', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '面板显隐时触发', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'week-change', + type: 'Function()', + defaultValue: '', + desc: { + 'zh-CN': '周改变事件', + 'en-US': 'Week Change Event' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'year-change', + type: 'Function()', + defaultValue: '', + desc: { + 'zh-CN': '年改变事件', + 'en-US': 'Year Change Event' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ], + methods: [ + { + name: 'clean', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '清空除所有选中项,requiredSelectedList 必选项不会被清空', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'close', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '关闭面板', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ], + slots: [ + { + name: 'default', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '选项插槽', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'header', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '头部插槽', + 'en-US': 'Head slot' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'search-item', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '搜索选项插槽,设置 :search-config="{ openSearchSlot: true, ... }" 时有效', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'timeline', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '时间线插槽,有timeline1-timeline7 7个插槽', + 'en-US': 'Timeline slots, with 7 slots timeline1-timeline7' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'tool', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '工具栏插槽', + 'en-US': 'Toolbar Slot' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'weekday', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '日程插槽,有weekday1-weekday7 7个插槽', + 'en-US': 'Schedule slots, with 7 slots weekday1-weekday7' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ] + } + ] +} diff --git a/examples/sites/demos/apis/cascader.js b/examples/sites/demos/apis/cascader.js new file mode 100644 index 000000000..c6c123ff7 --- /dev/null +++ b/examples/sites/demos/apis/cascader.js @@ -0,0 +1,602 @@ +export default { + mode: ['pc', 'mobile-first'], + apis: [ + { + name: 'cascader', + type: 'component', + props: [ + { + mode: [] + }, + { + name: 'before-filter', + type: '(value: string) => boolean | Promise', + defaultValue: '', + desc: { + 'zh-CN': '筛选之前的钩子,参数为输入的值,若返回 false 或者返回 Promise 且被 reject,则停止筛选', + 'en-US': + 'Hook before filtering. The parameter is the input value. If false is returned or Promise is returned and rejected, the filtering stops.' + }, + mode: ['pc'], + pcDemo: 'filter-method' + }, + { + name: 'blank', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': "shape='filter' 时生效,设置过滤器模式背景为透明", + 'en-US': "Takes effect when shape='filter' and sets the filter mode background to transparent" + }, + mode: ['pc'], + pcDemo: 'filter-mode' + }, + { + name: 'clearable', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否支持清空选项', + 'en-US': 'Whether to support the clear option' + }, + mode: ['pc'], + pcDemo: 'clearable' + }, + { + name: 'collapse-tags', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '多选模式下是否折叠 Tag', + 'en-US': 'Whether to collapse tags in multi-choice mode' + }, + mode: ['pc'], + pcDemo: 'collapse-tags' + }, + { + name: 'debounce', + type: 'number', + defaultValue: '300', + desc: { + 'zh-CN': '搜索关键词输入的去抖延迟,单位毫秒', + 'en-US': 'Dejitter delay of the search keyword, in milliseconds.' + }, + mode: ['pc'], + pcDemo: 'filterable' + }, + { + name: 'disabled', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否禁用', + 'en-US': 'Disable' + }, + mode: ['pc'], + pcDemo: 'disabled-items' + }, + { + name: 'filter-method', + typeAnchorName: 'ICascaderPanelNode', + type: '(node: ICascaderPanelNode, keyword: string) => boolean', + defaultValue: '', + desc: { + 'zh-CN': + '自定义搜索逻辑,第一个参数是节点 node,第二个参数是搜索关键词 keyword,通过返回布尔值表示是否命中', + 'en-US': + 'Customize the search logic. The first parameter is node, and the second parameter is keyword. A boolean value is returned to indicate whether the search is hit.' + }, + mode: ['pc'], + pcDemo: 'filter-method' + }, + { + name: 'filterable', + type: 'boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否可搜索选项', + 'en-US': 'Whether to search for options' + }, + mode: ['pc'], + pcDemo: 'filterable' + }, + { + name: 'label', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': "shape='filter' 时生效,可传入 label 显示标题", + 'en-US': "Take effect when shape='filter', and label can be passed to display the title" + }, + mode: ['pc'], + pcDemo: 'filter-mode' + }, + { + name: 'level-title', + type: 'string[]', + defaultValue: '[]', + desc: { + 'zh-CN': '小屏时,为组件每一级数据指定级联标题', + 'en-US': 'On a small screen, specify a cascade title for each level of data of the component' + }, + mode: ['mobile-first'] + }, + { + name: 'modelValue / v-model', + typeAnchorName: 'ICascaderPanelNodeValue', + type: 'ICascaderPanelNodePropValue', + defaultValue: '', + desc: { + 'zh-CN': '选中项绑定值, 其类型由 props.multiple、props.emitPath 共同决定', + 'en-US': + 'Binding value of the selected item, its type is determined by props.multiple, props.emitPath together.' + }, + mode: ['pc'], + pcDemo: 'clearable' + }, + { + name: 'options', + typeAnchorName: 'ICascaderPanelData', + type: 'ICascaderPanelData[]', + defaultValue: '', + desc: { + 'zh-CN': '可选项数据源,键名可通过 Props 属性配置', + 'en-US': 'Optional data source. The key name can be configured through the Props attribute.' + }, + mode: ['pc'], + pcDemo: 'disabled-items' + }, + { + name: 'placeholder', + type: 'string', + defaultValue: "'请选择'", + desc: { + 'zh-CN': '输入框占位文本', + 'en-US': 'Placeholder text in the text box' + }, + mode: ['pc'], + pcDemo: 'filterable' + }, + { + name: 'popper-append-to-body', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': + '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)', + 'en-US': + 'Indicates whether to insert a pop-up box to the body element. If an error occurs in locating a fault in the dialog box that is displayed, set this attribute to false (for details, see the select component).' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'popper-class', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '为 popper 添加类名(可参考 popover 组件)', + 'en-US': 'Add a class name for the popper. For details, see the popover component.' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'props', + typeAnchorName: 'ICascaderPanelConfig', + type: 'ICascaderPanelConfig', + defaultValue: '', + desc: { + 'zh-CN': '配置选项,具体见 ICascaderPanelConfig 表', + 'en-US': 'Configuration options. For details, see the ICascaderPanelConfig table.' + }, + mode: ['pc'], + pcDemo: 'props-children' + }, + { + name: 'separator', + type: 'string', + defaultValue: "'/'", + desc: { + 'zh-CN': '选项分隔符', + 'en-US': 'Option separator' + }, + mode: ['pc'], + pcDemo: 'clearable1' + }, + { + name: 'shape', + type: "'filter'", + defaultValue: '', + desc: { + 'zh-CN': "通过 shape='filter' 属性切换至过滤器模式", + 'en-US': "Use the shape='filter' attribute to switch to filter mode" + }, + mode: ['pc'], + pcDemo: 'filter-mode' + }, + { + name: 'show-all-levels', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '输入框中是否显示选中值的完整路径', + 'en-US': 'Whether to display the full path of the selected value in the text box' + }, + mode: ['pc'], + pcDemo: 'show-all-levels' + }, + { + name: 'show-header', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '小屏时,是否显示标题', + 'en-US': 'Whether to display the title on a small screen' + }, + mode: ['mobile-first'] + }, + { + name: 'size', + type: "'medium' | 'small' | 'mini'", + defaultValue: '', + desc: { + 'zh-CN': '尺寸', + 'en-US': 'Dimension;' + }, + mode: ['pc'], + pcDemo: 'size' + }, + { + name: 'tip', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': "shape='filter' 时生效,可传入 tip 显示提示信息", + 'en-US': "This parameter is valid when shape='filter'. You can enter tip to display prompt information" + }, + mode: ['pc'], + pcDemo: 'filter-mode' + }, + { + name: 'title', + type: 'string', + defaultValue: "''", + desc: { + 'zh-CN': '小屏时,弹窗顶部的标题名字', + 'en-US': 'On a small screen, pop up the title name at the top of the window' + }, + mode: ['mobile-first'] + } + ], + events: [ + { + name: 'blur', + type: '(event: FocusEvent) => void', + defaultValue: '', + desc: { + 'zh-CN': '当失去焦点时触发', + 'en-US': 'This event is triggered when the focus is lost.' + }, + mode: ['pc'], + pcDemo: 'events' + }, + { + name: 'change', + typeAnchorName: 'ICascaderPanelNodePropValue', + type: '(value: ICascaderPanelNodePropValue) => void', + defaultValue: '', + desc: { + 'zh-CN': '当选中节点变化时触发', + 'en-US': 'This event is triggered when the selected node changes.' + }, + mode: ['pc'], + pcDemo: 'events' + }, + { + name: 'expand-change', + typeAnchorName: 'ICascaderPanelNodeValue', + type: '(value: ICascaderPanelNodeValue[]) => void', + defaultValue: '', + desc: { + 'zh-CN': '当展开节点发生变化时触发', + 'en-US': + 'This event is triggered when the expanded node changes. arg: The callback parameter is an array (Array type) consisting of parent option values.' + }, + mode: ['pc'], + pcDemo: 'events' + }, + { + name: 'focus', + type: '(event: FocusEvent) => void', + defaultValue: '', + desc: { + 'zh-CN': '当获得焦点时触发', + 'en-US': 'This event is triggered when the focus is obtained.' + }, + mode: ['pc'], + pcDemo: 'events' + }, + { + name: 'remove-tag', + typeAnchorName: 'ICascaderPanelNodeValue', + type: '(removeValue: ICascaderPanelNodeValue[]) => void', + defaultValue: '', + desc: { + 'zh-CN': '在多选模式下,移除Tag时触发', + 'en-US': 'In multi-choice mode, this event is triggered when a tag is removed.' + }, + mode: ['pc'], + pcDemo: 'default-multiple' + }, + { + name: 'visible-change', + type: '(visible: boolean) => void', + defaultValue: '', + desc: { + 'zh-CN': '下拉框出现/隐藏时触发', + 'en-US': 'This event is triggered when the drop-down list box is displayed or hidden.' + }, + mode: ['pc'], + pcDemo: 'events' + } + ], + methods: [ + { + name: 'getCheckedNodes', + typeAnchorName: 'ICascaderPanelNode', + type: '(leafOnly: boolean = false) => ICascaderPanelNode[]', + defaultValue: '', + desc: { + 'zh-CN': '获取选中的节点', + 'en-US': 'Obtain the selected node' + }, + mode: ['pc'], + pcDemo: 'events' + } + ], + slots: [ + { + name: 'default', + defaultValue: '', + desc: { + 'zh-CN': + '自定义备选项的节点内容,参数为 { node: ICascaderPanelNode, data: ICascaderPanelData },分别为当前节点的 Node 对象和数据', + 'en-US': + 'User-defined candidate node content. The parameter is {node, data}, which indicates the node object and data of the current node.' + }, + mode: ['pc'] + }, + { + name: 'empty', + defaultValue: '', + desc: { + 'zh-CN': '无匹配选项时的内容', + 'en-US': 'Content when no matching option is found' + }, + mode: ['pc'], + pcDemo: 'filterable' + } + ] + }, + { + name: 'ICascaderPanelConfig ', + type: 'component', + props: [ + { + name: 'checkStrictly', + type: 'boolean', + defaultValue: ' false', + desc: { + 'zh-CN': '是否严格的遵守父子节点不互相关联', + 'en-US': + 'Whether to strictly comply with the principle that parent and child nodes are not associated with each other' + }, + mode: ['pc'], + pcDemo: 'check-strictly' + }, + { + name: 'children', + type: 'string', + defaultValue: "'children'", + desc: { + 'zh-CN': '指定选项的子选项为选项对象的某个属性值', + 'en-US': 'Specifies that the sub-option of an option is an attribute value of the option object.' + }, + mode: ['pc'], + pcDemo: 'props-children' + }, + { + name: 'disabled', + type: 'string', + defaultValue: "'disabled'", + desc: { + 'zh-CN': '指定选项的禁用为选项对象的某个属性值', + 'en-US': 'Specify that an option is disabled as an attribute value of the option object.' + }, + mode: ['pc'], + pcDemo: 'disabled-items' + }, + { + name: 'emitPath', + type: 'boolean', + defaultValue: ' true', + desc: { + 'zh-CN': + '在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值', + 'en-US': + 'Indicates whether to return an array consisting of the values of menus at different levels of the selected node when the selected node is changed. If this parameter is set to false, only the value of the selected node is returned.' + }, + mode: ['pc'], + pcDemo: 'events' + }, + { + name: 'expandTrigger', + type: "'click' | 'hover'", + defaultValue: "'click'", + desc: { + 'zh-CN': '次级菜单的展开方式', + 'en-US': 'The expansion mode of the secondary menu' + }, + mode: ['pc'], + pcDemo: 'expand-trigger' + }, + { + name: 'label', + type: 'string', + defaultValue: "'label'", + desc: { + 'zh-CN': '指定选项标签为选项对象的某个属性值', + 'en-US': 'Specify that the option label is an attribute value of the option object.' + }, + mode: ['pc'], + pcDemo: 'props-children' + }, + { + name: 'lazy', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否动态加载子节点,需与 lazyLoad 方法结合使用', + 'en-US': + 'Whether to dynamically load subnodes. This parameter must be used together with the lazyLoad method.' + }, + mode: ['pc'], + pcDemo: 'auto-load' + }, + { + name: 'lazyLoad', + typeAnchorName: 'ICascaderPanelLazyLoad', + type: 'ICascaderPanelLazyLoad', + defaultValue: '', + desc: { + 'zh-CN': + '加载动态数据的方法,仅在 lazy 为 true 时有效;参数说明: node 为当前点击的节点,resolve 为数据加载完成的回调(必须调用)', + 'en-US': + 'Method for loading dynamic data. This parameter is valid only when lazy is set to true. Parameter description: node indicates the currently clicked node. resolve indicates the callback after data loading is complete (mandatory).' + }, + mode: ['pc'], + pcDemo: 'auto-load' + }, + { + name: 'leaf', + type: 'string', + defaultValue: "'leaf'", + desc: { + 'zh-CN': '指定选项的叶子节点的标志位为选项对象的某个属性值', + 'en-US': 'The flag bit of the leaf node of the specified option is an attribute value of the option object.' + }, + mode: ['pc'], + pcDemo: 'props-children' + }, + { + name: 'multiple', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否多选', + 'en-US': 'Whether to select multiple options' + }, + mode: ['pc'], + pcDemo: 'default-multiple' + }, + { + name: 'value', + type: 'string', + defaultValue: "'value'", + desc: { + 'zh-CN': '指定选项的值为选项对象的某个属性值', + 'en-US': 'The value of an option is the value of an attribute of the option object.' + }, + mode: ['pc'], + pcDemo: 'props-children' + } + ], + events: [], + methods: [], + slots: [] + } + ], + types: [ + { + name: 'ICascaderPanelNodeValue', + type: 'type', + code: `type ICascaderPanelNodeValue = string | number` + }, + { + name: 'ICascaderPanelNodePropValue', + type: 'type', + code: ` +type ICascaderPanelNodePropValue = + | ICascaderPanelNodeValue + | ICascaderPanelNodeValue[] + | ICascaderPanelNodeValue[][]` + }, + { + name: 'ICascaderPanelData', + type: 'type', + code: ` +type ICascaderPanelData = { + value?: ICascaderPanelNodeValue + label?: string + children?: ICascaderPanelData[] + disabled?: boolean + leaf?: boolean + [key: string]: ICascaderPanelNodeValue | ICascaderPanelData[] | string | boolean | undefined +}` + }, + { + name: 'ICascaderPanelConfig', + type: 'interface', + code: ` +interface ICascaderPanelConfig { + emitPath: boolean + expandTrigger: 'click' | 'hover' + hoverThreshold: number + checkStrictly?: boolean + multiple?: boolean + lazy: boolean + lazyLoad: ( + node: ICascaderPanelNode, + resolve: (dataList: ICascaderPanelData[]) => void + ) => void + value: string + label: string + children: string + disabled: string + leaf: string +}` + }, + { + name: 'ICascaderPanelNode', + type: 'type', + code: ` +type ICascaderPanelNode = { + parent: ICascaderPanelNode | null + level: number + data: ICascaderPanelData + config: ICascaderPanelConfig + uid: number + value: ICascaderPanelNodeValue + label: string + pathNodes: Node[] + path: ICascaderPanelNodeValue[] + pathLabels: string[] + loaded: boolean + loading: boolean + hasChildren: boolean + children: Node[] + checked?: boolean + indeterminate?: boolean + root?: boolean +}` + }, + { + name: 'ICascaderPanelLazyLoad', + type: 'type', + code: ` +type ICascaderPanelLazyLoad = (node: ICascaderPanelNode, resolve: (dataList: ICascaderPanelData[]) => void) => void + ` + } + ] +} diff --git a/examples/sites/demos/apis/cell.js b/examples/sites/demos/apis/cell.js new file mode 100644 index 000000000..479b6fc3c --- /dev/null +++ b/examples/sites/demos/apis/cell.js @@ -0,0 +1,58 @@ +export default { + mode: ['mobile-first'], + apis: [ + { + name: 'Cell', + type: 'component', + props: [ + { + name: 'data', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '数据', + 'en-US': 'data' + }, + mode: ['mobile-first'], + mfDemo: 'basic-usage' + }, + { + name: 'disabled', + type: 'Boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '禁用', + 'en-US': 'disabled' + }, + mode: ['mobile-first'], + mfDemo: 'disabled' + }, + { + name: 'icon', + type: 'Object', + defaultValue: '{}', + desc: { + 'zh-CN': '设置图标', + 'en-US': 'Set icon' + }, + mode: ['mobile-first'], + mfDemo: 'icon' + }, + { + name: 'placeholder', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '占位文本', + 'en-US': 'Placeholder Text' + }, + mode: ['mobile-first'], + mfDemo: 'placeholder' + } + ], + events: [], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/chart.js b/examples/sites/demos/apis/chart.js new file mode 100644 index 000000000..86e35bf41 --- /dev/null +++ b/examples/sites/demos/apis/chart.js @@ -0,0 +1,285 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'chart', + type: 'component', + props: [ + { + name: 'cancel-resize-check', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否禁用 resize 时的容器检测', + 'en-US': 'Whether to disable container detection during resize' + }, + mode: ['pc'], + pcDemo: 'chart/question#question-base' + }, + { + name: 'change-delay', + type: 'number', + defaultValue: "'0'", + desc: { + 'zh-CN': '属性修改触发图表重绘回调的延迟', + 'en-US': 'Delay for triggering chart redrawing callback after attribute modification' + }, + mode: ['pc'], + pcDemo: 'chart/question#question-base' + }, + { + name: 'data', + type: 'object', + defaultValue: '', + desc: { + 'zh-CN': '数据由指标和维度组成,“维度” 指的是数据的属性,“指标” 是量化衡量标准', + 'en-US': + 'Data consists of indicators and dimensions. Dimension refers to data attributes, and indicator refers to quantitative measurement standards.' + }, + mode: ['pc'], + pcDemo: 'chart' + }, + { + name: 'events', + type: 'object', + defaultValue: '', + desc: { + 'zh-CN': '事件绑定', + 'en-US': 'Event binding' + }, + mode: ['pc'], + pcDemo: 'chart-events' + }, + { + name: 'extend', + typeAnchorName: 'chart#IChartProps', + type: 'IChartProps', + defaultValue: '', + desc: { + 'zh-CN': 'echarts 的配置项', + 'en-US': 'Configuration items of echarts' + }, + mode: ['pc'], + pcDemo: 'chart' + }, + { + name: 'height', + type: 'string', + defaultValue: "'400px'", + desc: { + 'zh-CN': '设置图表容器的高度。', + 'en-US': 'Set the height of the chart container.' + }, + mode: ['pc'], + pcDemo: 'chart/attributes-demo#props-demo10' + }, + { + name: 'init-options', + type: 'object', + defaultValue: '', + desc: { + 'zh-CN': 'init 附加参数', + 'en-US': 'Init Additional Parameters' + }, + mode: ['pc'], + pcDemo: 'chart/attributes-demo#props-demo10' + }, + { + name: 'judge-width', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否处理生成图表时的宽度问题', + 'en-US': 'Do you want to process the width issue when generating charts?' + }, + mode: ['pc'], + pcDemo: 'chart-events' + }, + { + name: 'legend-visible', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '是否显示图例', + 'en-US': 'Display legend' + }, + mode: ['pc'], + pcDemo: 'chart/attributes-demo#props-demo10' + }, + { + name: 'not-set-unchange', + type: 'array', + defaultValue: '', + desc: { + 'zh-CN': '未发生变化时不参加 setOption 的属性', + 'en-US': 'The setOption attribute does not change.' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'resize-delay', + type: 'number', + defaultValue: "'200'", + desc: { + 'zh-CN': '窗口 resize 事件回调的延迟', + 'en-US': 'Delay of the window resize event callback' + }, + mode: ['pc'], + pcDemo: 'chart/attributes-demo#props-demo10' + }, + { + name: 'resizeable', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '是否处理窗口 resize 事件', + 'en-US': 'Whether to process the window resize event' + }, + mode: ['pc'], + pcDemo: 'chart/question#question-base' + }, + { + name: 'set-option-opts', + type: 'boolean | object', + defaultValue: 'true', + desc: { + 'zh-CN': 'echarts setOption 的第二个参数', + 'en-US': 'Echarts setOption second parameter' + }, + mode: ['pc'], + pcDemo: '' + }, + { + mode: [] + }, + { + name: 'theme', + type: 'object', + defaultValue: '', + desc: { + 'zh-CN': '自定义主题名称。;自定义主题对象。', + 'en-US': 'User-defined theme name. ;User-defined theme object.' + }, + mode: ['pc'], + pcDemo: 'chart#base' + }, + { + name: 'theme-name', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '自定义主题名称,如果设置了 theme-name, 则 theme 无效', + 'en-US': 'User-defined theme name. If theme-name is set, the theme is invalid.' + }, + mode: ['pc'], + pcDemo: 'chart#base' + }, + { + name: 'tooltip-visible', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '是否显示提示框', + 'en-US': 'Display dialog box' + }, + mode: ['pc'], + pcDemo: 'chart/attributes-demo#props-demo10' + }, + { + name: 'width', + type: 'string', + defaultValue: "'auto'", + desc: { + 'zh-CN': '设置图表容器的宽度。', + 'en-US': 'Set the width of the chart container.' + }, + mode: ['pc'], + pcDemo: 'chart/attributes-demo#props-demo10' + }, + { + name: 'width-change-delay', + type: 'number', + defaultValue: "'300'", + desc: { + 'zh-CN': '容器宽度变化的延迟', + 'en-US': 'Container width change delay' + }, + mode: ['pc'], + pcDemo: 'chart/question#question-base' + } + ], + events: [], + methods: [], + slots: [] + } + ], + types: [ + { + name: 'IChartProps', + type: 'interface', + code: ` +interface IChartProps { + afterConfig: () => void + afterSetOption: () => void + afterSetOptionOnce: () => void + animation: object + axisPointer: object | array + backgroundColor: object | string + beforeConfig: () => void + brush: object | array + cancelResizeCheck: boolean + changeDelay: number // 默认值 0 + colorMode: string + colors: array + data: object | array + dataEmpty: boolean + dataZoom: object | array + events: object + extend: object + geo: object | array + graphic: object | array + grid: object | array + height: string // 默认值 '400px' + initOptions: object + judgeWidth: boolean // 默认值 false + legend: object | array + legendPosition: string + legendVisible: boolean // 默认值 true + loading: boolean + markArea: object + markLine: object + markPoint: object + notSetUnchange: array + radar: object + resizeDelay: number // 默认值 200 + resizeable: boolean // 默认值 true + series: object | array + setOptionOpts: boolean | object // 默认值 true + settings: object + textStyle: object | array + theme: object + themeName: object | string + timeline: object | array + title: object | array + toolbox: object | array + tooltip: object + tooltipFormatter: () => void + tooltipVisible: boolean // 默认值 true + visualMap: object | array + width: string // 默认值 'auto' + widthChangeDelay: number // 默认值 300 + xAxis: object | array + yAxis: object | array +}` + }, + { + name: 'IChartSettings', + type: 'interface', + code: ` +interface IChartSettings { + type: string // 图表类型,可选值' bar ',' histogram ',' line ',' pie ',' ring ',' funnel ',' radar ',' waterfall ' +}` + } + ] +} diff --git a/examples/sites/demos/apis/checkbox.js b/examples/sites/demos/apis/checkbox.js new file mode 100644 index 000000000..a699ade3e --- /dev/null +++ b/examples/sites/demos/apis/checkbox.js @@ -0,0 +1,529 @@ +export default { + mode: ['pc', 'mobile', 'mobile-first'], + apis: [ + { + name: 'checkbox', + type: 'component', + props: [ + { + name: 'border', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否显示边框', + 'en-US': 'Display border' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'border', + mfDemo: '' + }, + { + name: 'checked', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否默认勾选', + 'en-US': 'Currently selected' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'checked', + mobileDemo: '', + mfDemo: '' + }, + { + name: 'disabled', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否禁用', + 'en-US': 'Disable' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'indeterminate', + mobileDemo: 'disabled', + mfDemo: '' + }, + { + name: 'display-only', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '是否开启组件 display-only 只显示模式,默认值为 false', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'false-label', + type: 'string | number', + defaultValue: '', + desc: { + 'zh-CN': '没有选中时的值', + 'en-US': 'Value when no option is selected' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'text', + mobileDemo: 'custom-value', + mfDemo: '' + }, + { + name: 'icon-position', + type: 'String', + defaultValue: 'center', + desc: { + 'zh-CN': "图标与文本的对齐方式,可选值:'center' | 'top'
", + 'en-US': "Alignment of icon and text, optional value: 'center' | 'top'
" + }, + mode: ['mobile'], + mobileDemo: 'icon-position' + }, + { + name: 'indeterminate', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '设置 indeterminate 状态,只负责样式控制', + 'en-US': 'Sets the indeterminate state and controls only the style.' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'indeterminate', + mobileDemo: 'indeterminate', + mfDemo: '' + }, + { + name: 'label', + type: 'string | number | boolean', + defaultValue: '', + desc: { + 'zh-CN': '选中状态的值(只有在 checkbox-group 中或者绑定对象类型为 array 时有效)', + 'en-US': + 'Selected value (This parameter is valid only when checkbox-group or the bound object type is array)' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'checkbox-group', + mobileDemo: 'basic-usage', + mfDemo: '' + }, + { + name: 'modelValue / v-model', + type: 'string | number | boolean', + defaultValue: '', + desc: { + 'zh-CN': '绑定值', + 'en-US': 'Bound Value' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'name', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '原生 name 属性', + 'en-US': 'Native name attribute' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'basic-usage', + mobileDemo: '', + mfDemo: '' + }, + { + name: 'shape', + type: "'filter'", + defaultValue: '', + desc: { + 'zh-CN': '过滤器模式', + 'en-US': 'Filter mode' + }, + mode: ['pc'], + pcDemo: 'shape' + }, + { + name: 'size', + type: "'medium' | 'small' | 'mini'", + defaultValue: '', + desc: { + 'zh-CN': 'checkbox 的尺寸,仅在 border 为真时有效', + 'en-US': 'Checkbox size. This parameter is valid only when border is set to true' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'size', + mfDemo: '' + }, + { + name: 'text', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '复选框显示的文本', + 'en-US': 'Text displayed in the check box' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'description', + mfDemo: '' + }, + { + name: 'true-label', + type: 'string | number', + defaultValue: '', + desc: { + 'zh-CN': '选中时的值', + 'en-US': 'Value when selected' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'text', + mobileDemo: 'custom-value', + mfDemo: '' + }, + { + name: 'v-model', + type: 'String / Number / Boolean', + defaultValue: '', + desc: { + 'zh-CN': '绑定值', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'v-model / modelValue', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '绑定值
', + 'en-US': 'value
' + }, + mode: ['mobile'], + mobileDemo: 'basic-usage' + } + ], + events: [ + { + name: 'change', + type: '(value: string | number | boolean) => void', + defaultValue: '', + desc: { + 'zh-CN': '当绑定值变化时触发的事件', + 'en-US': 'This event is triggered when the binding value changes' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'checkbox-events', + mobileDemo: 'event-change', + mfDemo: '' + } + ], + methods: [], + slots: [ + { + name: 'default', + type: '', + defaultValue: '', + desc: { + 'zh-CN': 'checkbox的内容', + 'en-US': 'Checkbox content' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'checkbox-slot', + mobileDemo: '', + mfDemo: '' + } + ] + }, + { + name: 'checkbox-group', + type: 'component', + props: [ + { + name: 'disabled', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否禁用', + 'en-US': 'Disable' + }, + mode: ['pc'], + pcDemo: 'indeterminate' + }, + { + name: 'fill', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '按钮形式的 checkbox 激活时的填充色和边框色', + 'en-US': 'Fill color and border color when the checkbox in button mode is activated' + }, + mode: ['pc'], + pcDemo: 'custom-color' + }, + { + name: 'max', + type: 'number', + defaultValue: '', + desc: { + 'zh-CN': '可被勾选的 checkbox 的最大数量', + 'en-US': 'Maximum number of checkboxes that can be selected' + }, + mode: ['pc'], + pcDemo: 'min-max' + }, + { + name: 'min', + type: 'number', + defaultValue: '', + desc: { + 'zh-CN': '可被勾选的 checkbox 的最小数量', + 'en-US': 'Minimum number of checkboxes that can be selected' + }, + mode: ['pc'], + pcDemo: 'min-max' + }, + { + name: 'modelValue / v-model', + type: 'string[] | number[]', + defaultValue: '', + desc: { + 'zh-CN': '绑定值', + 'en-US': 'Bound Value' + }, + mode: ['pc'], + pcDemo: 'checkbox-group' + }, + { + name: 'options', + typeAnchorName: 'ICheckboxGroupOptions', + type: 'ICheckboxGroupOptions[]', + defaultValue: '', + desc: { + 'zh-CN': 'checkbox-group 子项配置列表', + 'en-US': 'Checkbox component list' + }, + mode: ['pc'], + pcDemo: 'group-options' + }, + { + name: 'shape', + type: "'filter'", + defaultValue: '', + desc: { + 'zh-CN': '过滤器模式', + 'en-US': 'Filter mode' + }, + mode: ['pc'], + pcDemo: 'shape' + }, + { + name: 'size', + type: "'medium' | 'small' | 'mini'", + defaultValue: '', + desc: { + 'zh-CN': '多选框组尺寸,仅对按钮形式的 checkbox 或带有边框的 checkbox 有效', + 'en-US': + 'Size of the check box group. This parameter is valid only for the check box with buttons or borders' + }, + mode: ['pc'], + pcDemo: 'size' + }, + { + name: 'text-color', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '按钮形式的 checkbox 激活时的文本颜色', + 'en-US': 'Text color when the checkbox in button mode is activated' + }, + mode: ['pc'], + pcDemo: 'custom-color' + }, + { + name: 'type', + type: "'button' | 'checkbox'", + defaultValue: "'checkbox'", + desc: { + 'zh-CN': ' 复选框组子项组件类型,需配合 options 属性使用', + 'en-US': 'Checkbox component type' + }, + mode: ['pc'], + pcDemo: 'group-options' + }, + { + name: 'vertical', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '设置组件排列方式,设置复选框是否垂直排列', + 'en-US': 'Set the component arrangement mode. Sets whether the check boxes are arranged vertically' + }, + mode: ['pc'], + pcDemo: 'vertical-checkbox' + } + ], + events: [ + { + name: 'change', + type: '(value: string[] |number[]) => void', + defaultValue: '', + desc: { + 'zh-CN': '当绑定值变化时触发的事件', + 'en-US': 'This event is triggered when the binding value changes.' + }, + mode: ['pc'], + pcDemo: 'checkbox-events' + } + ], + methods: [], + slots: [ + { + name: 'default', + defaultValue: '', + desc: { + 'zh-CN': 'checkbox-group 选项组', + 'en-US': 'Checkbox Option Group' + }, + mode: ['pc'], + pcDemo: 'checkbox-group' + } + ] + }, + { + name: 'checkbox-button', + type: 'component', + props: [ + { + name: 'checked', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否默认勾选', + 'en-US': 'Currently selected' + }, + mode: ['pc'], + pcDemo: 'checked' + }, + { + name: 'disabled', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否禁用', + 'en-US': 'Is disabled' + }, + mode: ['pc'], + pcDemo: 'indeterminate' + }, + { + name: 'events', + typeAnchorName: 'ICheckboxGroupOptions', + type: 'ICheckboxGroupOptions.events', + defaultValue: '', + desc: { + 'zh-CN': '原生事件', + 'en-US': 'Native event' + }, + mode: ['pc'], + pcDemo: 'group-options' + }, + { + name: 'false-label', + type: 'string | number', + defaultValue: '', + desc: { + 'zh-CN': '没有选中时的值', + 'en-US': 'Value when no option is selected' + }, + mode: ['pc'], + pcDemo: 'text' + }, + { + name: 'label', + type: 'string | number | boolean', + defaultValue: '', + desc: { + 'zh-CN': '选中状态的值(只有在 checkbox-group 中或者绑定对象类型为array时有效)', + 'en-US': + 'Value in the selected state (This parameter is valid only when checkbox-group or the bound object type is array.) The optional value of this attribute is medium-' + }, + mode: ['pc'], + pcDemo: 'checkbox-group' + }, + { + name: 'modelValue / v-model', + type: 'string | number | boolean', + defaultValue: '', + desc: { + 'zh-CN': '绑定值', + 'en-US': 'Bound Value' + }, + mode: ['pc'], + pcDemo: 'checkbox-button' + }, + { + name: 'name', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '原生 name 属性', + 'en-US': 'Native name attribute' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'text', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '复选框文本', + 'en-US': 'Text' + }, + mode: ['pc'], + pcDemo: 'description' + }, + { + name: 'true-label', + type: 'string | number', + defaultValue: '', + desc: { + 'zh-CN': '选中时的值', + 'en-US': 'Value when selected' + }, + mode: ['pc'], + pcDemo: 'text' + } + ], + events: [], + methods: [], + slots: [ + { + name: 'default', + defaultValue: '', + desc: { + 'zh-CN': 'checkbox-button 的内容', + 'en-US': 'Checkbox-button content' + }, + mode: ['pc'], + pcDemo: 'description' + } + ] + } + ], + types: [ + { + name: 'ICheckboxGroupOptions', + type: 'interface', + code: ` +interface ICheckboxGroupOptions { + label: string // 选中时对应的值 + text?: number // 描述文本 + disabled?: boolean // 是否禁用 + checked?: boolean // 是否默认选中 + events?: { + click?: (e: Event) => void // 点击事件 + change?: (e: Event) => void // change事件 + } +}` + } + ] +} diff --git a/examples/sites/demos/apis/checkboxgroup.js b/examples/sites/demos/apis/checkboxgroup.js new file mode 100644 index 000000000..4a3888beb --- /dev/null +++ b/examples/sites/demos/apis/checkboxgroup.js @@ -0,0 +1,80 @@ +export default { + mode: ['mobile'], + apis: [ + { + name: 'CheckboxGroup', + type: 'component', + props: [ + { + name: 'disabled', + type: 'Boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否禁用,该属性默认为false
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'disabled' + }, + { + name: 'max', + type: 'Number', + defaultValue: '', + desc: { + 'zh-CN': '可被勾选的 checkbox 的最大数量
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'min-max' + }, + { + name: 'min', + type: 'Number', + defaultValue: '', + desc: { + 'zh-CN': '可被勾选的 checkbox 的最小数量
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'min-max' + }, + { + name: 'value / v-model', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '绑定值
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'dedisabled' + }, + { + name: 'vertical', + type: 'Boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否竖向模式
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'vertical' + } + ], + events: [ + { + name: 'change', + defaultValue: '', + desc: { + 'zh-CN': '当绑定值变化时触发的事件,该事件可获取更新后的值
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'event-change' + } + ], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/collapse.js b/examples/sites/demos/apis/collapse.js new file mode 100644 index 000000000..86e8c6fbf --- /dev/null +++ b/examples/sites/demos/apis/collapse.js @@ -0,0 +1,193 @@ +export default { + mode: ['pc', 'mobile-first'], + apis: [ + { + name: 'collapse', + type: 'component', + props: [ + { + name: 'accordion', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否手风琴模式', + 'en-US': 'In accordion mode' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'accordion', + mfDemo: '' + }, + { + name: 'before-close', + type: '(item: Component, activeNames: string | number | Array) => boolean', + defaultValue: '', + desc: { + 'zh-CN': '阻止折叠面板切换', + 'en-US': 'Do not close the folding panel.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'before-close', + mfDemo: '' + }, + { + name: 'modelValue / v-model', + type: 'string | number | Array', + defaultValue: '', + desc: { + 'zh-CN': '当前激活的面板。如果是手风琴模式,绑定值类型需要为 string | number,否则为 Array', + 'en-US': + 'Currently activated panel (In accordion mode, the binding value type must be string. Otherwise, the binding value type is array.)' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'v-model', + type: 'String / Array /Number', + defaultValue: '', + desc: { + 'zh-CN': '当前激活的面板(如果是手风琴模式,绑定值类型需要为string,否则为array)', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ], + events: [ + { + name: 'change', + type: '(activeNames: string | number | Array) => void', + defaultValue: '', + desc: { + 'zh-CN': '当前激活面板改变时触发。如果是手风琴模式,参数 activeNames 类型为 string | number,否则为 Array', + 'en-US': + 'Triggered when the current active panel changes. (In accordion mode, the type of activeNames is string. Otherwise, the type of activeNames is array.)' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'events', + mfDemo: '' + } + ], + methods: [], + slots: [ + { + name: 'default', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '默认插槽', + 'en-US': 'Default slot' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'disable', + mfDemo: '' + }, + { + name: 'icon', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '展开收起icon插槽', + 'en-US': 'Expand and collapse icon slot' + }, + mode: ['mobile-first'], + mfDemo: 'slot-icon' + } + ] + }, + { + name: 'collapse-item', + type: 'component', + props: [ + { + name: 'disabled', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否禁用', + 'en-US': 'Disable' + }, + mode: ['pc'], + pcDemo: 'disable' + }, + { + name: 'name', + type: 'string | number', + defaultValue: '', + desc: { + 'zh-CN': '唯一标志符', + 'en-US': 'Unique identifier' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'title', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '面板标题', + 'en-US': 'Panel Title' + }, + mode: ['pc'], + pcDemo: 'title' + }, + { + name: 'title-right', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '自定义面板标题右侧内容', + 'en-US': '' + }, + mode: ['pc'], + pcDemo: 'title' + } + ], + events: [], + methods: [], + slots: [ + { + name: 'default', + defaultValue: '', + desc: { + 'zh-CN': '默认插槽', + 'en-US': 'Default slot' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'icon', + defaultValue: '', + desc: { + 'zh-CN': '展开折叠 icon 图标', + 'en-US': 'Expand and collapse the icon.' + }, + mode: ['pc'], + pcDemo: 'icon' + }, + { + name: 'title', + defaultValue: '', + desc: { + 'zh-CN': '标题', + 'en-US': 'Title' + }, + mode: ['pc'], + pcDemo: 'title' + }, + { + name: 'title-right', + defaultValue: '', + desc: { + 'zh-CN': '自定义面板标题右侧内容', + 'en-US': '' + }, + mode: ['pc'], + pcDemo: 'title' + } + ] + } + ] +} diff --git a/examples/sites/demos/apis/color-picker.js b/examples/sites/demos/apis/color-picker.js new file mode 100644 index 000000000..f9b2fa9d4 --- /dev/null +++ b/examples/sites/demos/apis/color-picker.js @@ -0,0 +1,93 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'color-picker', + type: 'component', + props: [ + { + name: 'alpha', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否启用alpha选择', + 'en-US': 'enable alpha select or not' + }, + mode: ['pc'], + pcDemo: 'enable-alpha' + }, + { + name: 'history', + type: 'string[] | undefined', + defaultValue: 'undefined', + desc: { + 'zh-CN': '启用历史记录', + 'en-US': 'enable history or not' + }, + mode: ['pc'], + pcDemo: 'history' + }, + { + name: 'predefine', + type: 'string[] | undefined', + defaultValue: 'undefined', + desc: { + 'zh-CN': '启用预定义颜色', + 'en-US': 'enable predefine or not' + }, + mode: ['pc'], + pcDemo: 'predefine' + }, + { + name: 'size', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '定义color-picker尺寸;该属性的可选值为 large / medium / small / mini', + 'en-US': + 'Define color-picker dimensions; The optional values for this attribute are large/medium/small/mini' + }, + mode: ['pc'], + pcDemo: 'size' + }, + { + name: 'visible', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否默认显示color-select', + 'en-US': 'Is color select displayed by default' + }, + mode: ['pc'], + pcDemo: 'default-visible' + } + ], + events: [ + { + name: 'cancel', + type: '()=>void', + defaultValue: '', + desc: { + 'zh-CN': '按下取消或点击外部的时触发该事件', + 'en-US': 'When click cancel or click out-side will trigger cancel event' + }, + mode: ['pc'], + pcDemo: 'event' + }, + { + name: 'confirm', + type: '(hex:string) => void', + defaultValue: '', + desc: { + 'zh-CN': '按下确认时触发该事件', + 'en-US': 'When click confirm will trigger confirm event' + }, + mode: ['pc'], + pcDemo: 'event' + } + ], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/color-select-panel.js b/examples/sites/demos/apis/color-select-panel.js new file mode 100644 index 000000000..a41c53d95 --- /dev/null +++ b/examples/sites/demos/apis/color-select-panel.js @@ -0,0 +1,90 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'color select panel', + type: 'component', + props: [ + { + name: 'alpha', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否启用alpha选择', + 'en-US': 'enable alpha select or not' + }, + mode: ['pc'], + pcDemo: 'alpha' + }, + { + name: 'history', + type: 'string[] | undefined', + defaultValue: 'undefined', + desc: { + 'zh-CN': '时候启用历史记录', + 'en-US': 'enable history or not' + }, + mode: ['pc'], + pcDemo: 'history' + }, + { + name: 'predefine', + type: 'string[] | undefined', + defaultValue: 'undefined', + desc: { + 'zh-CN': '时候启用历史记录', + 'en-US': 'enable predefine or not' + }, + mode: ['pc'], + pcDemo: 'predefine' + }, + { + name: 'visible', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否默认显示color select panel', + 'en-US': 'Is color select panel displayed by default' + }, + mode: ['pc'] + } + ], + events: [ + { + name: 'cancel', + type: '()=>void', + defaultValue: '', + desc: { + 'zh-CN': '按下取消或点击外部的时触发该事件', + 'en-US': 'When click cancel or click out-side will trigger cancel event' + }, + mode: ['pc'], + pcDemo: 'event' + }, + { + name: 'color-update', + type: '(color:Color) => void', + defaultValue: '', + desc: { + 'zh-cn': '当颜色更新的时候会触发该事件,包括:点击预定义颜色、点击历史记录', + 'en-US': 'when click predefine color or history, will trigger color-update event' + }, + mode: ['pc'] + }, + { + name: 'confirm', + type: '(hex:string) => void', + defaultValue: '', + desc: { + 'zh-CN': '按下确认时触发该事件', + 'en-US': 'When click confirm will trigger confirm event' + }, + mode: ['pc'], + pcDemo: 'event' + } + ], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/color.js b/examples/sites/demos/apis/color.js new file mode 100644 index 000000000..9d84aaf3b --- /dev/null +++ b/examples/sites/demos/apis/color.js @@ -0,0 +1,13 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'color', + type: 'component', + props: [], + events: [], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/column-list-item.js b/examples/sites/demos/apis/column-list-item.js new file mode 100644 index 000000000..89a2eef51 --- /dev/null +++ b/examples/sites/demos/apis/column-list-item.js @@ -0,0 +1,272 @@ +export default { + mode: ['mobile-first'], + apis: [ + { + name: 'ColumnListItem', + type: 'component', + props: [ + { + name: 'auto-width', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '卡片的宽度是否自动撑开,设置后将不再给卡片设置固定宽度', + 'en-US': + 'Indicates whether the card width is automatically expanded. After the setting, the card width is not fixed.' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'custom-class', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '用户自定义class,可覆盖组件默认class', + 'en-US': 'User-defined class, which can overwrite the default class of the component.' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'disabled', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '卡片禁用勾选', + 'en-US': 'Card Disable Check' + }, + mode: ['mobile-first'], + mfDemo: 'icon-disabled' + }, + { + name: 'flex-basis', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '设置内容插槽的宽度,最多能传入 4 个值,支持百分比,固定宽度及固有的尺寸关键词,默认为 auto。', + 'en-US': + 'Set the width of the content slot. A maximum of four values can be transferred. The percentage, fixed width, and inherent size keywords are supported. The default value is auto.' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'flex-grow', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '设置每一项在 flex 容器中分配剩余空间的相对比例,默认为 [1, 1, 1, 1]。', + 'en-US': + 'Indicates the relative proportion of the remaining space allocated to each item in the flex container. The default value is [1, 1, 1, 1].' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'icon-more', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': '更多按钮图标,可传入一个svg图标对象进行替换', + 'en-US': 'More button icons can be replaced by a svg icon object.' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'image', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '图片地址', + 'en-US': 'Picture Address' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'label', + type: 'String / Number', + defaultValue: '', + desc: { + 'zh-CN': 'checkbox或radio的label', + 'en-US': 'Checkbox or radio label' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'options', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '操作按钮配置', + 'en-US': 'Operation Button Configuration' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'round', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '通过 round 设置是否展示圆形', + 'en-US': 'Use round to set whether to display a circle.' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'show-checkbox', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '显示checkbox按钮', + 'en-US': 'Show the checkbox button' + }, + mode: ['mobile-first'], + mfDemo: 'show-checkbox' + }, + { + name: 'show-radio', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '显示radio按钮', + 'en-US': 'Show radio button' + }, + mode: ['mobile-first'], + mfDemo: 'show-radio' + }, + { + name: 'size', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '尺寸,支持medium、small 2个尺寸,默认值为medium', + 'en-US': 'Indicates the size. The options are medium and small. The default value is medium.' + }, + mode: ['mobile-first'], + mfDemo: 'size' + }, + { + name: 'type', + type: 'String', + defaultValue: 'card', + desc: { + 'zh-CN': '组件类型,可选值有list | card,默认为 card', + 'en-US': 'Component type. The options are list and card. The default value is card.' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'v-model', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '双向数据绑定', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ], + events: [ + { + name: 'change', + type: 'Function()', + defaultValue: '', + desc: { + 'zh-CN': '组件选中/取消选中事件', + 'en-US': 'Component check/uncheck event' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'icon-click', + type: 'Function()', + defaultValue: '', + desc: { + 'zh-CN': '操作栏按钮点击事件', + 'en-US': 'Operation bar button click event' + }, + mode: ['mobile-first'], + mfDemo: 'icon-click-event' + } + ], + methods: [], + slots: [ + { + name: 'column1', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '内容插槽1', + 'en-US': 'Content Slot 1' + }, + mode: ['mobile-first'], + mfDemo: 'content-slot' + }, + { + name: 'column2', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '内容插槽2', + 'en-US': 'Content Slot 2' + }, + mode: ['mobile-first'], + mfDemo: 'content-slot' + }, + { + name: 'column3', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '内容插槽3', + 'en-US': 'Content Slot 3' + }, + mode: ['mobile-first'], + mfDemo: 'content-slot' + }, + { + name: 'column4', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '内容插槽4', + 'en-US': 'Content Slot 4' + }, + mode: ['mobile-first'], + mfDemo: 'content-slot' + }, + { + name: 'image', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '图片插槽', + 'en-US': 'Picture Slot' + }, + mode: ['mobile-first'], + mfDemo: 'image-operate-slot' + }, + { + name: 'operate', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '操作栏插槽', + 'en-US': 'Action Bar Slots' + }, + mode: ['mobile-first'], + mfDemo: 'image-operate-slot' + } + ] + } + ] +} diff --git a/examples/sites/demos/apis/company.js b/examples/sites/demos/apis/company.js new file mode 100644 index 000000000..6ac2d5c13 --- /dev/null +++ b/examples/sites/demos/apis/company.js @@ -0,0 +1,116 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'company', + type: 'component', + props: [ + { + name: 'clearable', + type: 'boolean', + defaultValue: '该属性的默认值为 true', + desc: { + 'zh-CN': '是否显示清除按钮;是否可清空', + 'en-US': 'Whether to display the Clear button; Clearable' + }, + mode: ['pc'], + pcDemo: 'custom-show-num' + }, + { + name: 'disabled', + type: 'boolean', + defaultValue: '该属性的默认值为 false', + desc: { + 'zh-CN': '禁用', + 'en-US': 'Disabled' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'fetchCompany', + type: 'Function', + defaultValue: '', + desc: { + 'zh-CN': '自定义公司查询接口,fetchCompany返回一个Promise对象', + 'en-US': 'The fetchCompany interface returns a Promise object.' + }, + mode: ['pc'], + pcDemo: 'custom-service' + }, + { + name: 'fields', + type: 'object', + defaultValue: '', + desc: { + 'zh-CN': '自定义公司数据映射,未使用框架服务时必填', + 'en-US': + 'Customized company data mapping. This parameter is mandatory when the framework service is not used.' + }, + mode: ['pc'], + pcDemo: 'custom-service' + }, + { + name: 'max', + type: 'number', + defaultValue: '该属性的默认值为 1000', + desc: { + 'zh-CN': '原生属性,设置最大值', + 'en-US': 'Native attribute. Set the maximum value.' + }, + mode: ['pc'], + pcDemo: 'custom-show-num' + }, + { + name: 'modelValue / v-model', + type: 'string , number', + defaultValue: '', + desc: { + 'zh-CN': '设置下拉框的值。', + 'en-US': 'Set the value of the drop-down list box.' + }, + mode: ['pc'], + pcDemo: 'custom-show-num' + }, + { + name: 'placeholder', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '设置输入框内的提示占位文本。', + 'en-US': 'Set the placeholder text in the text box.' + }, + mode: ['pc'], + pcDemo: 'custom-service' + }, + { + name: 'popper-append-to-body', + type: 'boolean', + defaultValue: '该属性的默认值为 true', + desc: { + 'zh-CN': + '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)', + 'en-US': + 'Indicates whether to insert the pop-up box to the body element. If a fault occurs in locating the fault in the dialog box that is displayed, you can set this attribute to false (for details, see the select component).' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'popper-class', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '为 popper 添加类名(可参考 popover 组件)', + 'en-US': 'Add a class name for the popper. For details, see the popover component.' + }, + mode: ['pc'], + pcDemo: '' + } + ], + events: [], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/config-provider.js b/examples/sites/demos/apis/config-provider.js new file mode 100644 index 000000000..baa95059b --- /dev/null +++ b/examples/sites/demos/apis/config-provider.js @@ -0,0 +1,48 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'config-provider', + type: 'component', + props: [ + { + name: 'design', + type: 'ConfigProviderProps', + defaultValue: '', + desc: { + 'zh-CN': '规范,可以通过该属于定制一些自定义的交互规范', + 'en-US': 'Standardization can be achieved by customizing some custom interaction specifications' + }, + mode: ['pc'], + pcDemo: 'base' + }, + { + name: 'direction', + type: "'ltr' | 'rtl'", + defaultValue: 'ltr', + desc: { + 'zh-CN': '文字排版方向', + 'en-US': 'Text layout direction' + }, + mode: ['pc'], + pcDemo: 'text-direct' + }, + { + name: 'tag', + type: 'object', + defaultValue: "{enable: true,name: 'div'}", + desc: { + 'zh-CN': '是否被元素包裹, 如果是vue2且没有一个单一节点, 组件会自动创建一个div', + 'en-US': + 'Whether it is wrapped by elements, if it is Vue2 and there is no single node, the component will automatically create a div' + }, + mode: ['pc'], + pcDemo: 'tag' + } + ], + events: [], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/container.js b/examples/sites/demos/apis/container.js new file mode 100644 index 000000000..db79a5257 --- /dev/null +++ b/examples/sites/demos/apis/container.js @@ -0,0 +1,160 @@ +export default { + mode: ['pc', 'mobile'], + apis: [ + { + name: 'container', + type: 'component', + props: [ + { + name: 'aside-width', + type: 'number | string', + defaultValue: '200', + desc: { + 'zh-CN': '左侧宽度', + 'en-US': 'Left width' + }, + mode: ['pc'], + pcDemo: 'custom-with-height' + }, + { + name: 'footer-height', + type: 'number | string', + defaultValue: '60', + desc: { + 'zh-CN': '底部高度', + 'en-US': 'Height at the bottom' + }, + mode: ['pc'], + pcDemo: 'custom-with-height' + }, + { + name: 'header-height', + type: 'number | string', + defaultValue: '60', + desc: { + 'zh-CN': '头部高度', + 'en-US': 'Head height' + }, + mode: ['pc'], + pcDemo: 'custom-with-height' + }, + { + name: 'left-width', + type: 'number | string', + defaultValue: '60', + desc: { + 'zh-CN': '左侧宽度', + 'en-US': 'Left width' + }, + mode: ['mobile'], + mobileDemo: 'custom-width' + }, + { + name: 'pattern', + typeAnchorName: 'IContainerPattern', + type: 'IContainerPattern', + defaultValue: '"default"', + desc: { + 'zh-CN': '版型类型', + 'en-US': 'Measurement type' + }, + mode: ['pc', 'mobile'], + pcDemo: 'basic-usage', + mobileDemo: 'basic-usaage' + }, + { + name: 'right-width', + type: 'number | string', + defaultValue: '44', + desc: { + 'zh-CN': '右侧宽度', + 'en-US': 'right width' + }, + mode: ['mobile'], + mobileDemo: 'custom-width' + } + ], + events: [], + methods: [], + slots: [ + { + name: 'aside', + defaultValue: '', + desc: { + 'zh-CN': '侧边内容插槽', + 'en-US': 'Side Content Slot' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'center', + defaultValue: '', + desc: { + 'zh-CN': '中部内容插槽', + 'en-US': 'Renter Slot' + }, + mode: ['mobile'], + mobileDemo: 'basic-usage' + }, + { + name: 'default', + defaultValue: '', + desc: { + 'zh-CN': '主要内容插槽', + 'en-US': 'Main Content Slot' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'footer', + defaultValue: '', + desc: { + 'zh-CN': '底部内容插槽', + 'en-US': 'Bottom Content Slot' + }, + mode: ['pc'], + pcDemo: 'classic' + }, + { + name: 'header', + defaultValue: '', + desc: { + 'zh-CN': '头部内容插槽', + 'en-US': 'Header Content Slot' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'left', + defaultValue: '', + desc: { + 'zh-CN': '左侧内容插槽', + 'en-US': 'Title Slot' + }, + mode: ['mobile'], + mobileDemo: 'basic-usage' + }, + { + name: 'right', + defaultValue: '', + desc: { + 'zh-CN': '右侧内容插槽', + 'en-US': 'Right Slot' + }, + mode: ['mobile'], + mobileDemo: 'basic-usage' + } + ] + } + ], + types: [ + { + name: 'IContainerPattern', + type: 'interface', + code: `type IContainerPattern = 'default' | 'simple' | 'legend' | 'classic' | 'fashion'` + } + ] +} diff --git a/examples/sites/demos/apis/country.js b/examples/sites/demos/apis/country.js new file mode 100644 index 000000000..9544ca0c1 --- /dev/null +++ b/examples/sites/demos/apis/country.js @@ -0,0 +1,105 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'country', + type: 'component', + props: [ + { + name: 'clearable', + type: 'boolean', + defaultValue: '该属性的默认值为 true', + desc: { + 'zh-CN': '是否显示清除按钮;是否可清空', + 'en-US': 'Whether to display the Clear button; Clearable' + }, + mode: ['pc'], + pcDemo: 'custom-service' + }, + { + name: 'disabled', + type: 'boolean', + defaultValue: '该属性的默认值为 false', + desc: { + 'zh-CN': '禁用', + 'en-US': 'Disabled' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'fetchCountry', + type: 'Function', + defaultValue: '', + desc: { + 'zh-CN': '自定义国家查询接口,返回一个Promise对象,未使用框架服务时必填', + 'en-US': + 'The user-defined country query interface returns a Promise object. This parameter is mandatory when the framework service is not used.' + }, + mode: ['pc'], + pcDemo: 'custom-service' + }, + { + name: 'fields', + type: 'object', + defaultValue: '', + desc: { + 'zh-CN': '自定义数据映射,未使用框架服务时必填', + 'en-US': 'Customized data mapping. This parameter is mandatory when the framework service is not used.' + }, + mode: ['pc'], + pcDemo: 'custom-service' + }, + { + name: 'modelValue / v-model', + type: 'string , number', + defaultValue: '', + desc: { + 'zh-CN': '设置下拉框的值。', + 'en-US': 'Set the value of the drop-down list box.' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'placeholder', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '设置输入框内的提示占位文本。', + 'en-US': 'Set the placeholder text in the text box.' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'popper-append-to-body', + type: 'boolean', + defaultValue: '该属性的默认值为 true', + desc: { + 'zh-CN': + '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)', + 'en-US': + 'Indicates whether to insert the pop-up box to the body element. If a fault occurs in locating the fault in the dialog box that is displayed, you can set this attribute to false (for details, see the select component).' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'popper-class', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '为 popper 添加类名(可参考 popover 组件)', + 'en-US': 'Add a class name for the popper. For details, see the popover component.' + }, + mode: ['pc'], + pcDemo: '' + } + ], + events: [], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/credit-card-form.js b/examples/sites/demos/apis/credit-card-form.js new file mode 100644 index 000000000..49738cd1d --- /dev/null +++ b/examples/sites/demos/apis/credit-card-form.js @@ -0,0 +1,98 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'credit-card-form', + type: 'component', + props: [ + { + name: 'background-image', + type: 'string , object', + defaultValue: '', + desc: { + 'zh-CN': '设置卡片的背景图片;', + 'en-US': 'Set the background image of the card.' + }, + mode: ['pc'], + pcDemo: 'background-image' + }, + { + name: 'form-data', + type: 'object', + defaultValue: + "// 该属性的默认值为 \n{cardCvv: '', cardName: '', cardYear: '', cardMonth: '', cardNumber: ''}", + desc: { + 'zh-CN': '设置信用卡显示数据', + 'en-US': 'Setting Credit Card Display Data' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + } + ], + events: [ + { + name: 'input-card-cvv', + defaultValue: '', + desc: { + 'zh-CN': '输入 cvv 时触发的事件', + 'en-US': 'CVV input event triggered' + }, + mode: ['pc'], + pcDemo: 'credit-card-form-events' + }, + { + name: 'input-card-month', + defaultValue: '', + desc: { + 'zh-CN': '选择月时触发的事件', + 'en-US': 'Event triggered when a month is selected' + }, + mode: ['pc'], + pcDemo: 'credit-card-form-events' + }, + { + name: 'input-card-name', + defaultValue: '', + desc: { + 'zh-CN': '输入卡持有者时触发的事件', + 'en-US': 'Event triggered when a card holder is entered' + }, + mode: ['pc'], + pcDemo: 'credit-card-form-events' + }, + { + name: 'input-card-number', + defaultValue: '', + desc: { + 'zh-CN': '输入卡号时触发的事件', + 'en-US': 'Event triggered when a card number is entered' + }, + mode: ['pc'], + pcDemo: 'credit-card-form-events' + }, + { + name: 'input-card-year', + defaultValue: '', + desc: { + 'zh-CN': '选择年时触发的事件', + 'en-US': 'Event triggered when the year is selected' + }, + mode: ['pc'], + pcDemo: 'credit-card-form-events' + }, + { + name: 'submit', + defaultValue: '', + desc: { + 'zh-CN': '提交时触发的事件', + 'en-US': 'Event triggered upon submission' + }, + mode: ['pc'], + pcDemo: 'credit-card-form-events' + } + ], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/crop.js b/examples/sites/demos/apis/crop.js new file mode 100644 index 000000000..43805a2c1 --- /dev/null +++ b/examples/sites/demos/apis/crop.js @@ -0,0 +1,483 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'crop', + type: 'component', + props: [ + { + name: 'aspect-ratio', + type: 'number', + defaultValue: '', + desc: { + 'zh-CN': '裁剪框的宽高比;默认为 16 / 9', + 'en-US': 'Aspect-to-height ratio of the crop box; The default value is 16 / 9' + }, + mode: ['pc'], + pcDemo: 'aspect-ratio' + }, + { + name: 'auto-crop', + type: 'boolean', + defaultValue: '', + desc: { + 'zh-CN': '初始化时,是否自动显示裁剪框;默认为 true', + 'en-US': + 'Indicates whether to automatically display the crop box during initialization. The default value is true' + }, + mode: ['pc'], + pcDemo: 'auto-crop-area' + }, + { + name: 'auto-crop-area', + type: 'number', + defaultValue: '', + desc: { + 'zh-CN': '定义自动裁剪面积大小(百分比);默认为 0.8', + 'en-US': 'Defines the automatic cropping area size (percentage). The default value is 0.8' + }, + mode: ['pc'], + pcDemo: 'auto-crop-area' + }, + { + name: 'background', + type: 'boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否显示容器的网格背景;默认为 true', + 'en-US': 'Whether to display the grid background of the container; The default value is true' + }, + mode: ['pc'], + pcDemo: 'no-background' + }, + { + name: 'center', + type: 'boolean', + defaultValue: '', + desc: { + 'zh-CN': '裁剪框是否在图片正中心;默认为 true', + 'en-US': 'Whether the cropping frame is in the center of the image; The default value is true' + }, + mode: ['pc'], + pcDemo: 'aspect-ratio' + }, + { + name: 'crop-type', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '设置图片裁剪后返回的类型,可配置为 blob 和 base64,默认为 base64', + 'en-US': + 'Type of the image that is returned after cropping. The value can be blob or base64. The default value is base64' + }, + mode: ['pc'], + pcDemo: 'get-cropped-canvas' + }, + { + name: 'cropvisible', + type: 'boolean', + defaultValue: '', + desc: { + 'zh-CN': '设置裁剪弹框是否可见;默认为 false', + 'en-US': 'Set whether the cropping dialog box is visible. The default value is false' + }, + mode: ['pc'], + pcDemo: 'min-crop-box-width-height' + }, + { + name: 'drag-mode', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': + "定义 cropper 的拖拽模式;默认为 'crop';'crop': 可以产生一个新的裁剪框 3 。'move':只可以移动图片 3 。'none': 什么也不处理", + 'en-US': + "Defines the drag mode of the cropper. The default value is'crop'. 'Crop': A new crop box 3 can be generated. 'move': Only image 3 can be moved. 'none': no action is required" + }, + mode: ['pc'], + pcDemo: 'drag-mode' + }, + { + name: 'guides', + type: 'boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否在裁剪框上方显示虚线;默认为 true', + 'en-US': 'Whether to display dotted lines above the crop box; The default value is true' + }, + mode: ['pc'], + pcDemo: 'no-guides' + }, + { + name: 'max-size', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '设置待裁剪图片的最大大小,默认为 1M ;默认为 1M', + 'en-US': + 'Set the maximum size of the image to be cropped. The default value is 1 MB. The default value is 1M' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'min-container-height', + type: 'number', + defaultValue: '', + desc: { + 'zh-CN': '容器的最小高度;默认为 300', + 'en-US': 'Minimum height of a container; The default value is 300' + }, + mode: ['pc'], + pcDemo: 'min-crop-box-width-height' + }, + { + name: 'min-container-width', + type: 'number', + defaultValue: '', + desc: { + 'zh-CN': '容器的最小宽度;默认为 652', + 'en-US': 'Minimum width of a container; The default value is 652' + }, + mode: ['pc'], + pcDemo: 'min-crop-box-width-height' + }, + { + name: 'min-crop-box-height', + type: 'number', + defaultValue: '', + desc: { + 'zh-CN': '裁剪层的最小高度;默认为 0', + 'en-US': 'Minimum height of the crop layer; The default value is 0' + }, + mode: ['pc'], + pcDemo: 'min-crop-box-width-height' + }, + { + name: 'min-crop-box-width', + type: 'number', + defaultValue: '', + desc: { + 'zh-CN': '裁剪层的最小宽度;默认为 0', + 'en-US': 'Minimum width of the cropping layer; The default value is 0' + }, + mode: ['pc'], + pcDemo: 'min-crop-box-width-height' + }, + { + name: 'modal', + type: 'boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否显示图片上方裁剪框下方的黑色模态;默认为 true', + 'en-US': + 'Whether to display the black mode below the cropping box above the image; The default value is true' + }, + mode: ['pc'], + pcDemo: 'no-modal' + }, + { + name: 'movable', + type: 'boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否允许可以移动后面的图片;默认为 true', + 'en-US': 'Indicates whether the image can be moved. The default value is true' + }, + mode: ['pc'], + pcDemo: 'drag-mode' + }, + { + name: 'preview', + type: 'boolean', + defaultValue: '', + desc: { + 'zh-CN': '设置裁剪区域图片是否可预览,默认为 false', + 'en-US': 'Specifies whether images in the cropping area can be previewed. The default value is false' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'quality', + type: 'number', + defaultValue: '', + desc: { + 'zh-CN': '设置图片裁剪后的压缩比例,值在 0-1 之间,默认为 0.92', + 'en-US': + 'Set the compression ratio of the cropped image. The value ranges from 0 to 1. The default value is 0.92' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'rotatable', + type: 'boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否允许旋转图像;默认为 true', + 'en-US': 'Indicates whether images can be rotated. The default value is true' + }, + mode: ['pc'], + pcDemo: 'replace-image' + }, + { + name: 'src', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '默认裁剪的源图片', + 'en-US': 'Default cropped source image' + }, + mode: ['pc'], + pcDemo: 'no-background' + }, + { + name: 'view-mode', + type: 'number', + defaultValue: '', + desc: { + 'zh-CN': + '定义 cropper 的视图模式;默认为 0;0:没有限制,3 可以移动到 2 外。1:3 只能在 2 内移动。2:2 图片不全部铺满 1 (即缩小时可以有一边出现空隙)。3:2 图片填充整个 1', + 'en-US': + 'Defines the view mode of the cropper. The default value is 0. 0: no restriction. The value 3 can be moved out of the value 2. 1:3 can only be moved within 2. The 2:2 picture is not completely covered with 1 (i.e., there may be gaps on one side when the picture is zoomed out). 3: 2 The image fills the entire 1' + }, + mode: ['pc'], + pcDemo: 'view-mode' + }, + { + name: 'wheel-zoom-ratio', + type: 'number', + defaultValue: '', + desc: { + 'zh-CN': '用鼠标移动图像时,定义缩放比例;默认为 0.1', + 'en-US': 'Define the scaling ratio when moving the image with the mouse. The default value is 0.1' + }, + mode: ['pc'], + pcDemo: 'wheel-zoom-ratio' + }, + { + name: 'zoom-on-wheel', + type: 'boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否可以通过滚动鼠标滚轮来缩放图像;默认为 true', + 'en-US': + 'Specifies whether you can zoom in or out an image by scrolling the mouse wheel. The default value is true' + }, + mode: ['pc'], + pcDemo: 'zoom-on-wheel' + }, + { + name: 'zoomable', + type: 'boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否允许放大图像;默认为 true', + 'en-US': 'Whether to allow image zooming in; The default value is true' + }, + mode: ['pc'], + pcDemo: 'replace-image' + } + ], + events: [ + { + name: 'crop', + type: 'Function(value)', + defaultValue: '', + desc: { + 'zh-CN': '当画布(图像包装器)或裁剪框发生改变时触发;回调参数为 (event: Event),原生事件', + 'en-US': + 'Triggered when the canvas (image wrapper) or crop box changes; The callback parameter is (event: Event), native event' + }, + mode: ['pc'], + pcDemo: 'event-about-crop' + }, + { + name: 'cropdata', + type: 'Function(data)', + defaultValue: '', + desc: { + 'zh-CN': 'cropdata 事件回调函数中可以拿到裁剪后的数据,默认为 base64 数据', + 'en-US': + 'The tailored data can be obtained from the cropdata event callback function. The default value is Base64 data' + }, + mode: ['pc'], + pcDemo: 'event-about-crop' + }, + { + name: 'cropend', + defaultValue: '', + desc: { + 'zh-CN': '当画布(图像包装器)或剪切框发生变化结束时触发;回调参数为 (event: Event)', + 'en-US': + 'Triggered when the canvas (image wrapper) or clipping box changes. The callback parameter is (event: Event)' + }, + mode: ['pc'], + pcDemo: 'event-about-crop' + }, + { + name: 'cropmove', + defaultValue: '', + desc: { + 'zh-CN': '当画布(图像包装器)或剪切框正在发生变化时触发;回调参数为 (event: Event)', + 'en-US': + 'Triggered when the canvas (image wrapper) or clipping box is changing; The callback parameter is (event: Event)' + }, + mode: ['pc'], + pcDemo: 'event-about-crop' + }, + { + name: 'cropstart', + defaultValue: '', + desc: { + 'zh-CN': '当画布(图像包装器)或剪切框开始发生变化时触发;回调参数为 (event: Event)', + 'en-US': + 'Triggered when the canvas (image wrapper) or clipping box starts to change; The callback parameter is (event: Event)' + }, + mode: ['pc'], + pcDemo: 'event-about-crop' + }, + { + name: 'ready', + defaultValue: '', + desc: { + 'zh-CN': '当一个 cropper 实例完全构建时触发', + 'en-US': 'This event is triggered when a cropper instance is completely built' + }, + mode: ['pc'], + pcDemo: 'event-ready' + } + ], + methods: [ + { + name: 'clear', + defaultValue: '', + desc: { + 'zh-CN': '清除裁切框', + 'en-US': 'Clear the cropping box' + }, + mode: ['pc'], + pcDemo: 'get-data' + }, + { + name: 'destroy', + defaultValue: '', + desc: { + 'zh-CN': '销毁 cropper 并从图像中删除整个 cropper', + 'en-US': 'Destroy the cropper and delete the entire cropper from the image' + }, + mode: ['pc'], + pcDemo: 'event-ready' + }, + { + name: 'disable', + defaultValue: '', + desc: { + 'zh-CN': '禁用裁切框(裁切框不可移动)', + 'en-US': 'Disable the cropping box (the cropping box cannot be moved)' + }, + mode: ['pc'], + pcDemo: 'crop-meth' + }, + { + name: 'enable', + defaultValue: '', + desc: { + 'zh-CN': '启用裁切框', + 'en-US': 'Enable the cropping box' + }, + mode: ['pc'], + pcDemo: 'event-ready' + }, + { + name: 'getCanvasData', + defaultValue: '', + desc: { + 'zh-CN': '获取画布 Canvas(图像包装器)位置和大小数据;返回的数据类型为 object', + 'en-US': + 'Obtain the position and size of the canvas Canvas (image wrapper). The returned data type is object' + }, + mode: ['pc'], + pcDemo: 'get-image-data' + }, + { + name: 'getContainerData', + defaultValue: '', + desc: { + 'zh-CN': '获取 container 容器大小数据;返回的数据类型为 object', + 'en-US': 'Obtain the container size data. The returned data type is object' + }, + mode: ['pc'], + pcDemo: 'get-container-data' + }, + { + name: 'getCropBoxData', + defaultValue: '', + desc: { + 'zh-CN': '获取剪切框的位置和大小数据;返回的数据类型为 object', + 'en-US': 'Obtain the position and size of the clip box. The returned data type is object' + }, + mode: ['pc'], + pcDemo: 'get-crop-box-data' + }, + { + name: 'getCroppedCanvas', + defaultValue: '', + desc: { + 'zh-CN': + '获取裁剪后的图片数据;.getCroppedCanvas().toDataURL():转成 base64 图片;.getCroppedCanvas().toBlob():生成 Blob 图片数据', + 'en-US': + 'Obtain the cropped image data. .getCroppedCanvas().toDataURL(): Convert the image to a Base64 image. .getCroppedCanvas().toBlob(): Generate Blob image data' + }, + mode: ['pc'], + pcDemo: 'get-cropped-canvas' + }, + { + name: 'getData', + defaultValue: '', + desc: { + 'zh-CN': + '获取最终裁剪的区域位置和大小数据(根据原始图像的自然大小);参数为 (rounded) ,默认 false,设置 true 可以获取其所有数据;返回的数据类型为 object', + 'en-US': + 'Obtain the position and size of the final cropped region (based on the natural size of the original image). The parameter is rounded. The default value is false. If this parameter is set to true, all data can be obtained. The returned data type is object' + }, + mode: ['pc'], + pcDemo: 'get-data' + }, + { + name: 'getImageData', + defaultValue: '', + desc: { + 'zh-CN': '获取图像 image 位置、大小和其他相关数据;返回的数据类型为 object', + 'en-US': 'Obtain the image position, size, and other related data. The returned data type is object' + }, + mode: ['pc'], + pcDemo: 'get-image-data' + }, + { + name: 'replace', + defaultValue: '', + desc: { + 'zh-CN': '替换图像的 src 并重新构建 cropper;参数为 图片 URL', + 'en-US': 'Replace the image src and rebuild the cropper. The parameter is the image URL' + }, + mode: ['pc'], + pcDemo: 'replace-image' + }, + { + name: 'setAspectRatio', + defaultValue: '', + desc: { + 'zh-CN': '改变裁切框的宽高比;参数为(aspectRatio),类型 number,是一个正数', + 'en-US': + 'Change the aspect ratio of the cutting frame; The parameter is (aspectRatio) and the type is number. The value is a positive number' + }, + mode: ['pc'], + pcDemo: 'aspect-ratio' + } + ], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/currency.js b/examples/sites/demos/apis/currency.js new file mode 100644 index 000000000..ea24a3b4e --- /dev/null +++ b/examples/sites/demos/apis/currency.js @@ -0,0 +1,148 @@ +export default { + mode: ['pc', 'mobile-first'], + apis: [ + { + name: 'currency', + type: 'component', + props: [ + { + name: 'clearable', + type: 'boolean', + defaultValue: '该属性的默认值为 true', + desc: { + 'zh-CN': '是否显示清除按钮;是否可清空', + 'en-US': 'Whether to display the Clear button; Clearable' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'custom-service', + mfDemo: '' + }, + { + name: 'disabled', + type: 'Boolen', + defaultValue: '该属性的默认值为 false', + desc: { + 'zh-CN': '禁用', + 'en-US': 'Disabled' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'disable-currency', + mfDemo: '' + }, + { + name: 'fetch-currency', + type: 'Function', + defaultValue: '', + desc: { + 'zh-CN': '自定义金额查询接口,返回一个Promise对象', + 'en-US': 'The user-defined amount query interface returns a Promise object.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'custom-service', + mfDemo: '' + }, + { + name: 'fields', + type: 'object', + defaultValue: '', + desc: { + 'zh-CN': '自定义数据映射,在没有使用框架服务时必填', + 'en-US': 'User-defined data mapping. This parameter is mandatory when the framework service is not used.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'custom-service', + mfDemo: '' + }, + { + name: 'modelValue / v-model', + type: 'string , number', + defaultValue: '', + desc: { + 'zh-CN': '设置下拉框的值。', + 'en-US': 'Set the value of the drop-down list box.' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'placeholder', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '设置输入框内的提示占位文本。', + 'en-US': 'Set the prompt placeholder text in the text box.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'disable-currency', + mfDemo: '' + }, + { + name: 'popper-append-to-body', + type: 'boolean', + defaultValue: '该属性的默认值为 true', + desc: { + 'zh-CN': + '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)', + 'en-US': + 'Indicates whether to insert the pop-up box to the body element. If an error occurs in locating a fault in the dialog box that is displayed, set this attribute to false (for details, see the select component).' + }, + mode: ['pc', 'mobile-first'], + pcDemo: '', + mfDemo: '' + }, + { + name: 'popper-class', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '为 popper 添加类名(可参考 popover 组件)', + 'en-US': 'Add a class name for the popper. For details, see the popover component.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: '', + mfDemo: '' + }, + { + name: 'size', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '输入框尺寸,只在 type!="textarea" 时有效;该属性的可选值为 medium / small / mini', + 'en-US': + 'Size of the text box. This parameter is valid only when type!="textarea". The optional values of this attribute are medium / small / mini' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'size', + mfDemo: '' + }, + { + name: 'v-model', + type: 'String / Number', + defaultValue: '', + desc: { + 'zh-CN': '设置下拉框的值', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ], + events: [ + { + name: 'change', + type: '', + defaultValue: '', + desc: { + 'zh-CN': + 'arg1:{Any|Array 单选并且未指定渲染类型时,是选中项的值字段,此时没有arg2参数;多选并且未指定渲染类型时,是选中项值字段组成的数组,此时没有arg2参数;单选并且渲染类型为树或者表格时,是选中项对象,此时没有arg2参数;多选并且渲染类型为树或者表格时,是选中项对象值字段组成的数组,此时有arg2参数;},arg2:{Array 多选并且渲染类型为树或者表格时,是选中项对象组成的数组}', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/date-picker-mobile.js b/examples/sites/demos/apis/date-picker-mobile.js new file mode 100644 index 000000000..45ed0dd89 --- /dev/null +++ b/examples/sites/demos/apis/date-picker-mobile.js @@ -0,0 +1,161 @@ +export default { + mode: ['mobile-first'], + apis: [ + { + name: 'date-picker-mobile', + type: 'component', + props: [ + { + name: 'lock-scroll', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '弹出面板是否锁定浏览器滚动条,默认值为 true', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'picker-options', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': + '日期选择器特有的选项,该属性的默认值为 { disabledDate: null },其中 disabledDate 可以设置日期范围限制', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'title', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '面板标题', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'type', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '组件类型,默认值为 date', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'v-model', + type: 'Number, String, Array, Date', + defaultValue: '', + desc: { + 'zh-CN': '绑定值', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'visible', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否弹出面板', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ], + events: [ + { + name: 'click', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '选择日期时触发', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'confirm', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '面板确认时触发', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'time-confirm', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '时间面板确认时触发', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'update:visible', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '显示或隐藏面板时触发', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ], + methods: [ + { + name: 'confirm', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '确认并关闭面板', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'formatDate(date, dateFormat)', + type: '', + defaultValue: '', + desc: { + 'zh-CN': "日期格式化方法,例如:formatDate('2022/11/30', 'yyyy年MM月dd日')", + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ], + slots: [ + { + name: 'default', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '日期单元格插槽,参数:data 当前日期数据', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ] + } + ] +} diff --git a/examples/sites/demos/apis/date-picker.js b/examples/sites/demos/apis/date-picker.js new file mode 100644 index 000000000..997233cd0 --- /dev/null +++ b/examples/sites/demos/apis/date-picker.js @@ -0,0 +1,631 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'date-picker', + type: 'component', + props: [ + { + name: 'align', + type: "'left' | 'center' | 'right'", + defaultValue: "'left'", + desc: { + 'zh-CN': '日期选择面板和输入框的对齐方式', + 'en-US': 'Alignment of the date selection panel and the input box' + }, + mode: ['pc'], + pcDemo: 'align' + }, + { + name: 'clear-icon', + type: 'Component', + defaultValue: 'IconOperationfaild', + desc: { + 'zh-CN': '自定义清空图标', + 'en-US': '' + }, + mode: ['pc'], + pcDemo: 'clear' + }, + { + name: 'clearable', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '是否显示清除按钮', + 'en-US': 'Display Clear Button' + }, + mode: ['pc'], + pcDemo: 'clear' + }, + { + name: 'default-time', + type: 'string | string[]', + defaultValue: "'00:00:00' | ['00:00:00', '00:00:00']", + desc: { + 'zh-CN': + 'type="datetime" 时,default-time 是一个字符串,用于设置选择一个日期后,时间输入框中的默认值;{\n currentPage: 1,\n pageSize: 10,\n pageSizes: [10, 20, 30, 40, 50, 100],\n total: 0,\n layout: 'total, prev, pager, next, jumper'\n}", + desc: { + 'zh-CN': '使用表格展示数据时,属性 pagerOp 用于配置 Pager 分页组件的属性,分页事件已透传', + 'en-US': + 'Indicates whether the DialogBox itself is inserted into the body. This attribute must be specified and set to true for nested Dialogs.' + }, + mode: ['pc'], + pcDemo: 'nest-grid-multi' + }, + { + name: 'popseletor', + type: 'string', + defaultValue: "'grid'", + desc: { + 'zh-CN': "弹窗内展示数据的组件类型,目前支持:'grid' / 'tree'", + 'en-US': 'Indicates whether to enable the pop-up slide-out function. The default value is false.' + }, + mode: ['pc'], + pcDemo: 'nest-grid-multi' + }, + { + name: 'remote-search', + type: '() => Promise', + defaultValue: '', + desc: { + 'zh-CN': '使用表格展示数据时,配置表格分页查询操作函数;使用树展示数据时,配置通过pid查询所有子数据的方法', + 'en-US': 'Whether to disable the scroll bar when a log is displayed.' + }, + mode: ['pc'], + pcDemo: 'nest-grid-mult' + }, + { + name: 'selected-box-op', + typeAnchorName: 'ISelectedBoxOption', + type: 'ISelectedBoxOption', + defaultValue: '{}', + desc: { + 'zh-CN': '使用表格展示数据时,属性 selectedBoxOp 用于配置 SelectedBox 已选栏组件的属性,已选栏插槽已透传', + 'en-US': 'Indicates whether to display the pop-up header. The default value is true.' + }, + mode: ['pc'], + pcDemo: 'nest-grid-mult' + }, + { + name: 'show-pager', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '使用表格展示数据时,是否显示分页组件', + 'en-US': 'Pop-up dialog box title.' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'show-selected-box', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '使用表格展示数据时,是否显示已选栏组件', + 'en-US': + 'Height between the pop-up box and the top of the window. The default value is 15% of the screen height.' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'text-field', + type: 'string', + defaultValue: "'label'", + desc: { + 'zh-CN': '数据项的显示值字段', + 'en-US': 'Wideness of the dialog box that is displayed.' + }, + mode: ['pc'], + pcDemo: 'nest-grid-multi' + }, + { + name: 'text-split', + type: 'string', + defaultValue: "'/'", + desc: { + 'zh-CN': '多选时用于拼接数据项的 label 字段 ', + 'en-US': 'Customized configuration pop-up window class name' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'tree-op', + typeAnchorName: 'ITreeOption', + type: 'ITreeOption', + defaultValue: '{}', + desc: { + 'zh-CN': '使用树展示数据时,树组件的配置对象', + 'en-US': 'When using a tree to display data, the configuration object of the tree component' + }, + mode: ['pc'], + pcDemo: 'nest-tree-multi' + }, + { + name: 'value-field', + type: 'string', + defaultValue: "'id'", + desc: { + 'zh-CN': '数据项的选中值字段', + 'en-US': 'Selected value fields for data items' + }, + mode: ['pc'], + pcDemo: 'nest-grid-multi' + }, + { + name: 'value-split', + type: 'string', + defaultValue: "';'", + desc: { + 'zh-CN': '多选时用于拼接数据项的选中值', + 'en-US': 'The selected value used for concatenating data items during multiple selection' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'visible', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '控制弹出框显示与关闭', + 'en-US': 'Control pop-up display and closing' + }, + mode: ['pc'], + pcDemo: 'nest-grid-multi' + } + ], + events: [ + { + name: 'before-page-change', + typeAnchorName: 'IBeforeChangeParam', + type: '(beforeChangeParam:IBeforeChangeParam) => void', + defaultValue: '', + desc: { + 'zh-CN': '透传子组件 Pager 的 before-page-change 事件', + 'en-US': 'Before page change event of the transparent sub component Pager' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'change', + typeAnchorName: 'IChangeParam', + type: '(changeParam:IChangeParam) => void', + defaultValue: '', + desc: { + 'zh-CN': '监听弹窗选择的值发生变化的事件', + 'en-US': 'Event where the value selected in the monitoring pop-up changes' + }, + mode: ['pc'], + pcDemo: 'nest-grid-multi' + }, + { + name: 'close', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '透传子组件 DialogBox 的 close 事件', + 'en-US': 'Close event for transparent sub component DialogBox' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'closed', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '透传子组件 DialogBox 的 closed 事件', + 'en-US': 'The closed event of the transparent sub component DialogBox' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'current-change', + type: '(currentPage: number) => void', + defaultValue: '', + desc: { + 'zh-CN': '透传子组件 Pager 的 current-change 事件', + 'en-US': 'The current change event of the transparent sub component Pager' + }, + mode: ['pc'], + pcDemo: 'nest-grid-multi' + }, + { + name: 'drag-end', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '透传子组件 DialogBox 的 drag-end 事件', + 'en-US': 'The drag end event of the transparent sub component DialogBox' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'drag-move', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '透传子组件 DialogBox 的 drag-move 事件', + 'en-US': 'The drag move event of the transparent sub component DialogBox' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'drag-start', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '透传子组件 DialogBox 的 drag-start 事件', + 'en-US': 'The drag start event of the transparent sub component DialogBox' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'next-click', + type: '(currentPage: number) => void', + defaultValue: '', + desc: { + 'zh-CN': '透传子组件 Pager 的 next-click 事件', + 'en-US': 'Next click event for transparent sub component Pager' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'open', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '透传子组件 DialogBox 的 open 事件', + 'en-US': 'Open event for transparent sub component DialogBox' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'opened', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '透传子组件 DialogBox 的 opened 事件', + 'en-US': 'The opened event of the transparent sub component DialogBox' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'prev-click', + type: '(currentPage: number) => void', + defaultValue: '', + desc: { + 'zh-CN': '透传子组件 Pager 的 prev-click 事件', + 'en-US': '' + }, + mode: ['pc'], + pcDemo: 'The pre click event of the transparent sub component Pager' + }, + { + name: 'size-change', + type: '(pageSize: number) => void', + defaultValue: '', + desc: { + 'zh-CN': '透传子组件 Pager 的 size-change 事件', + 'en-US': 'The size change event of the transparent sub component Pager' + }, + mode: ['pc'], + pcDemo: 'nest-grid-multi' + } + ], + methods: [ + { + name: 'queryGridData', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '使用表格展示数据时,加载表格数据的方法', + 'en-US': 'The method of loading table data when using tables to display data' + }, + mode: ['pc'], + pcDemo: 'nest-grid-multi' + } + ], + slots: [ + { + name: 'button', + type: 'Slot', + defaultValue: '', + desc: { + 'zh-CN': '使用表格展示数据时,自定义已选栏的自定义按钮区域', + 'en-US': 'When displaying data in a table, customize the custom button area of the selected column' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'clear', + type: 'Slot', + defaultValue: '', + desc: { + 'zh-CN': '使用表格展示数据时,自定义已选栏的清空按钮区域', + 'en-US': 'When displaying data in a table, customize the clear button area of the selected column' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'close', + type: 'Slot', + defaultValue: '', + desc: { + 'zh-CN': '使用表格展示数据时,自定义已选栏的选项的删除按钮', + 'en-US': 'Customize the delete button for the selected column options when displaying data in a table' + }, + mode: ['pc'], + pcDemo: 'nest-tree-multi' + }, + { + name: 'footer', + type: 'Slot', + defaultValue: '', + desc: { + 'zh-CN': '自定义弹窗底部', + 'en-US': 'Custom Pop Up Bottom' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'option', + type: 'Slot', + defaultValue: '', + desc: { + 'zh-CN': '使用表格展示数据时,自定义已选栏的选项', + 'en-US': 'Customize options for selected columns when displaying data in a table' + }, + mode: ['pc'], + pcDemo: 'nest-tree-multi' + }, + { + name: 'search', + type: 'Slot', + defaultValue: '', + desc: { + 'zh-CN': '使用表格展示数据时,自定义搜索区域', + 'en-US': 'Customize the search area when displaying data in a table' + }, + mode: ['pc'], + pcDemo: 'nest-grid-multi' + }, + { + name: 'select', + type: 'Slot', + defaultValue: '', + desc: { + 'zh-CN': '使用表格展示数据时,自定义已选栏的已选提示区域', + 'en-US': 'When displaying data in a table, customize the selected prompt area for the selected column' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'title', + type: 'Slot', + defaultValue: '', + desc: { + 'zh-CN': '自定义弹窗标题', + 'en-US': 'Custom pop-up title' + }, + mode: ['pc'], + pcDemo: '' + } + ] + } + ], + types: [ + { + name: 'IDialogOption', + type: 'interface', + code: ` +interface IDialogOption { + // 设置弹出框距离窗口顶部的高度,默认为 15vh + top: string, + // 弹出框的宽度,默认 500px + width: string + // 弹出框标题 + title: string + beforeClose: () => boolean + // 自定义配置弹窗类名 + dialogClass: string +} +` + }, + { + name: 'IGridOption', + type: 'interface', + code: ` +interface IGridOption { + // 表格列配置 + columns: IColumnConfig[] + // 表格列数据 + data: [] + // 表格多选配置 + selectConfig: { + // 翻页操作是否保留历史选择数据 + reserve: boolean + // 嵌套表格多选时,设置默认表格选中的数据 + checkRowKeys: Array
是否可以通过点击遮罩层关闭弹窗,默认为 true ,可以在标签上设置:close-on-click-modal="false"不能通过点击遮罩层关闭弹窗。
', + 'en-US': 'Is show left arrow' + }, + mode: ['mobile'], + mobileDemo: 'close-on-click-modal' + }, + { + name: 'lock-scroll', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': 'Dialog弹出时是否禁用滚动条,该属性默认为true
', + 'en-US': 'Is show right arrow' + }, + mode: ['mobile'], + mobileDemo: 'lock-scroll' + }, + { + name: 'modal-append-to-body', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': + '遮罩层是否应用到 body 上,为 false 时遮罩层会应用到 DialogBox 的父元素上,该属性默认为true
', + 'en-US': 'Is show right text' + }, + mode: ['mobile'], + mobileDemo: 'slot-title' + }, + { + name: 'show-header', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否显示弹窗头部 header,默认值为 true 。
', + 'en-US': 'Is show left text' + }, + mode: ['mobile'], + mobileDemo: 'show-header' + }, + { + mode: [] + }, + { + name: 'visible', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '控制弹出框显示与关闭
', + 'en-US': 'set main-title' + }, + mode: ['mobile'], + mobileDemo: 'with-input' + } + ], + events: [ + { + mode: [] + }, + { + name: 'close', + type: 'Function()', + defaultValue: '', + desc: { + 'zh-CN': 'Dialog 关闭的回调
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'events-open-close' + }, + { + name: 'confirm', + type: 'Function()', + defaultValue: '', + desc: { + 'zh-CN': 'Dialog 确定按钮的的回调
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'cancel-confirm' + }, + { + name: 'open', + type: 'Function()', + defaultValue: '', + desc: { + 'zh-CN': 'Dialog 打开的回调
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'events-open-close' + } + ], + methods: [], + slots: [ + { + name: 'default', + defaultValue: '', + desc: { + 'zh-CN': 'Dialog 的内容
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'slot-title' + }, + { + name: 'footer', + defaultValue: '', + desc: { + 'zh-CN': 'Dialog 按钮操作区的内容
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'slot-footer' + }, + { + name: 'title', + defaultValue: '', + desc: { + 'zh-CN': 'Dialog 标题区的内容
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'slot-title' + } + ] + } + ] +} diff --git a/examples/sites/demos/apis/divider.js b/examples/sites/demos/apis/divider.js new file mode 100644 index 000000000..885cfdca9 --- /dev/null +++ b/examples/sites/demos/apis/divider.js @@ -0,0 +1,93 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'divider', + type: 'component', + props: [ + { + name: 'border-style', + type: 'string', + defaultValue: "'solid'", + desc: { + 'zh-CN': '设置分隔线的样式,该属性的可选值为 solid / dashed', + 'en-US': 'Set the style of the separator line, with optional values of solid/dashed for this property' + }, + mode: ['pc'], + pcDemo: 'custom-style' + }, + { + name: 'color', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '设置分隔线的颜色', + 'en-US': 'Set the color of the divider.' + }, + mode: ['pc'], + pcDemo: 'custom-style' + }, + { + name: 'content-background-color', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '设置分割线文案的背景颜色', + 'en-US': 'Set the background color of the divider content' + }, + mode: ['pc'], + pcDemo: 'custom-style' + }, + { + name: 'content-color', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '设置分隔线文案的颜色', + 'en-US': 'Set the color of the divider content' + }, + mode: ['pc'], + pcDemo: 'custom-style' + }, + { + name: 'content-position', + type: 'string', + defaultValue: "'center'", + desc: { + 'zh-CN': '设置分隔线文案的位置,该属性的可选值为 left / center / right', + 'en-US': + 'Set the position of the separator text, with optional values of left/center/right for this attribute' + }, + mode: ['pc'], + pcDemo: 'content-position' + }, + { + name: 'direction', + type: 'string', + defaultValue: "'horizontal'", + desc: { + 'zh-CN': '设置分隔线的方向,该属性的可选值为 horizontal / vertical', + 'en-US': + 'Set the direction of the divider; the possible values for this property are "horizontal" or "vertical"' + }, + mode: ['pc'], + pcDemo: 'direction' + } + ], + events: [], + methods: [], + slots: [ + { + name: 'default', + defaultValue: '', + desc: { + 'zh-CN': '默认插槽', + 'en-US': 'Default slot' + }, + mode: ['pc'], + pcDemo: 'content-position' + } + ] + } + ] +} diff --git a/examples/sites/demos/apis/drawer.js b/examples/sites/demos/apis/drawer.js new file mode 100644 index 000000000..c80638970 --- /dev/null +++ b/examples/sites/demos/apis/drawer.js @@ -0,0 +1,295 @@ +export default { + mode: ['pc', 'mobile-first'], + apis: [ + { + name: 'drawer', + type: 'component', + props: [ + { + name: 'before-close', + type: '(type) => boolean', + defaultValue: '', + desc: { + 'zh-CN': '弹窗关闭前的回调,返回 false 会阻止弹窗关闭', + 'en-US': 'hook before close the drawer, and block close when return false' + }, + mode: ['pc'], + pcDemo: 'before-close' + }, + { + name: 'custom-class', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '自定义 class 样式', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'dragable', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '控制抽屉开启或关闭宽度拖拽功能', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'dragable', + mfDemo: '' + }, + { + name: 'flex', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': '是否开启 flex 盒子布局,开启后内容区域元素自适应撑开高度,默认值为 false', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'lock-scroll', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': '弹出面板是否锁定浏览器滚动条,默认值为 true', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'mask', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '控制遮罩层显示隐藏 ', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'mask', + mfDemo: '' + }, + { + name: 'mask-closable', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '默认弹窗打开后,可以单击遮罩层关闭弹窗,设置 mask-closable 为 false 后将禁用该功能', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'mask-closable', + mfDemo: '' + }, + { + name: 'placement', + type: "'left' | 'right' | 'top' | 'bottom' ", + defaultValue: "'right'", + desc: { + 'zh-CN': '添加 placement 属性设置抽屉的方向', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'placement', + mfDemo: '' + }, + { + name: 'show-close', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '控制关闭图标显示', + 'en-US': '' + }, + mode: ['pc'], + pcDemo: 'show-close' + }, + { + name: 'show-footer', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '控制底部显示', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'show-footer', + mfDemo: '' + }, + { + name: 'show-header', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '控制头部显示', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'show-header', + mfDemo: '' + }, + { + name: 'title', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '面板标题', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'visible', + type: 'boolean', + defaultValue: '', + desc: { + 'zh-CN': '控制抽屉显示与关闭', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + }, + { + name: 'width', + type: 'string', + defaultValue: "'500px'", + desc: { + 'zh-CN': '设置抽屉的宽度', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'width', + mfDemo: '' + }, + { + name: 'z-index', + type: 'number', + defaultValue: '2000', + desc: { + 'zh-CN': '自定义堆叠顺序(对于某些特殊场景,比如被遮挡时可能会用到)', + 'en-US': '' + }, + mode: ['pc'], + pcDemo: 'z-index' + } + ], + events: [ + { + name: 'close', + type: '()=> void', + defaultValue: '', + desc: { + 'zh-CN': '关闭抽屉事件', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'close-event', + mfDemo: '' + }, + { + name: 'confirm', + type: '()=> void', + defaultValue: '', + desc: { + 'zh-CN': '确认事件,设置 :show-footer="true" 时有效', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'confirm-event', + mfDemo: '' + }, + { + name: 'update:visible', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '面板显隐时触发', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ], + methods: [ + { + name: 'close', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '关闭面板', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'confirm', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '确认并关闭面板', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ], + slots: [ + { + name: 'default', + type: '--', + defaultValue: '', + desc: { + 'zh-CN': '默认插槽', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'default-slot', + mfDemo: '' + }, + { + name: 'footer', + type: '--', + defaultValue: '', + desc: { + 'zh-CN': '底部插槽', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'footer-slot', + mfDemo: '' + }, + { + name: 'header', + type: '--', + defaultValue: '', + desc: { + 'zh-CN': '头部插槽', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'header-slot', + mfDemo: '' + }, + { + name: 'header-right', + type: '--', + defaultValue: '', + desc: { + 'zh-CN': '头部右侧插槽', + 'en-US': '' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'header-right-slot', + mfDemo: '' + } + ] + } + ] +} diff --git a/examples/sites/demos/apis/drop-roles.js b/examples/sites/demos/apis/drop-roles.js new file mode 100644 index 000000000..6fd5c92f5 --- /dev/null +++ b/examples/sites/demos/apis/drop-roles.js @@ -0,0 +1,117 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'drop-roles', + type: 'component', + props: [ + { + name: 'fetchCurrentRole', + type: 'object', + defaultValue: '', + desc: { + 'zh-CN': '自定义获取当前用户角色接口,未使用框架服务时必填', + 'en-US': + 'User-defined interface for obtaining the role of the current user. This parameter is mandatory when the framework service is not used.' + }, + mode: ['pc'], + pcDemo: 'custom-service' + }, + { + name: 'fetchRole', + type: 'object', + defaultValue: '', + desc: { + 'zh-CN': '自定义获取角色列表接口,未使用框架服务时必填', + 'en-US': + 'User-defined API for obtaining the role list. This parameter is mandatory when the framework service is not used.' + }, + mode: ['pc'], + pcDemo: 'custom-service' + }, + { + name: 'fields', + type: 'object', + defaultValue: '', + desc: { + 'zh-CN': '自定义数据映射,未使用框架服务时必填', + 'en-US': 'Customized data mapping. This parameter is mandatory when the framework service is not used.' + }, + mode: ['pc'], + pcDemo: 'custom-service' + }, + { + name: 'modelValue / v-model', + type: 'string , number', + defaultValue: '', + desc: { + 'zh-CN': '设置文本显示的值。;绑定值', + 'en-US': 'Sets the text display value. ;Bound Value' + }, + mode: ['pc'], + pcDemo: 'change-role-event' + }, + { + name: 'placeholder', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '设置输入框内的提示占位文本。', + 'en-US': 'Set the placeholder text in the text box.' + }, + mode: ['pc'], + pcDemo: 'custom-service' + }, + { + name: 'popper-append-to-body', + type: 'boolean', + defaultValue: '该属性的默认值为 true', + desc: { + 'zh-CN': + '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)', + 'en-US': + 'Indicates whether to insert a pop-up box to the body element. If a fault occurs in locating the fault in the dialog box that is displayed, you can set this attribute to false (for details, see the select component).' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'popper-class', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '为 popper 添加类名(可参考 popover 组件)', + 'en-US': 'Add a class name for the popper. For details, see the popover component.' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'size', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '设置组件大小', + 'en-US': 'Set the component size' + }, + mode: ['pc'], + pcDemo: 'size' + } + ], + events: [ + { + name: 'change', + defaultValue: '', + desc: { + 'zh-CN': '当前角色切换后触发', + 'en-US': 'This event is triggered after the current role is switched.' + }, + mode: ['pc'], + pcDemo: 'change-role-event' + } + ], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/drop-times.js b/examples/sites/demos/apis/drop-times.js new file mode 100644 index 000000000..a4f481278 --- /dev/null +++ b/examples/sites/demos/apis/drop-times.js @@ -0,0 +1,127 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'drop-times', + type: 'component', + props: [ + { + name: 'disabled', + type: 'boolean', + defaultValue: ' false', + desc: { + 'zh-CN': '禁用状态', + 'en-US': 'Disabled state' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'end', + type: 'number', + defaultValue: ' 1440', + desc: { + 'zh-CN': '结束时间,以分钟计算', + 'en-US': 'End time, in minutes. The default value is 1440.' + }, + mode: ['pc'], + pcDemo: 'start-end-step' + }, + { + name: 'modelValue / v-model', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '绑定值', + 'en-US': 'Set the component size. The value can be medium, small, or mini.' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'placeholder', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '设置输入框内的提示占位文本', + 'en-US': 'Set the prompt placeholder text in the text box.' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'popper-append-to-body', + type: 'boolean', + defaultValue: ' true', + desc: { + 'zh-CN': + '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)', + 'en-US': 'Bound Value' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'popper-class', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '为 DropTimes 下拉弹框添加的 class 类名', + 'en-US': + 'Indicates whether to insert the pop-up box to the body element. If a fault occurs in locating the fault in the dialog box that is displayed, you can set this attribute to false (for details, see the select component).' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'size', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '输入框尺寸', + 'en-US': 'Class name added to the DropTimes drop-down list box' + }, + mode: ['pc'], + pcDemo: 'size' + }, + { + name: 'start', + type: 'number', + defaultValue: ' 0', + desc: { + 'zh-CN': '开始时间,以分钟计算', + 'en-US': 'Start time, in minutes. The default value is 0.' + }, + mode: ['pc'], + pcDemo: 'start-end-step' + }, + { + name: 'step', + type: 'number', + defaultValue: ' 15', + desc: { + 'zh-CN': '间隔时间,以分钟计算', + 'en-US': 'Interval, in minutes. The default value is 15.' + }, + mode: ['pc'], + pcDemo: 'start-end-step' + } + ], + events: [ + { + name: 'change', + type: '(value: string) => void', + defaultValue: '', + desc: { + 'zh-CN': '下拉切换当前时间后触发该事件', + 'en-US': 'This event is triggered after the current time is switched by the pull-down button.' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + } + ], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/dropdown.js b/examples/sites/demos/apis/dropdown.js new file mode 100644 index 000000000..cf2a6975b --- /dev/null +++ b/examples/sites/demos/apis/dropdown.js @@ -0,0 +1,540 @@ +export default { + mode: ['pc', 'mobile-first'], + apis: [ + { + name: 'dropdown', + type: 'component', + props: [ + { + name: 'border', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否展示边框。默认为 false。在 split-button 属性为 false 时生效', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'disabled', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否禁用', + 'en-US': 'Is it disabled' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'disabled', + mfDemo: '' + }, + { + name: 'hide-on-click', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '点击菜单项后是否收起菜单。默认点击后收起', + 'en-US': 'Whether to collapse the menu after clicking on the menu item. Collapse after clicking by default' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'hide-on-click', + mfDemo: '' + }, + { + name: 'hide-timeout', + type: 'number', + defaultValue: '150', + desc: { + 'zh-CN': '延时多久收起下拉菜单,单位毫秒。注意:仅在 trigger 为 hover 时有效', + 'en-US': + 'How long is the delay in retracting the pull-down menu, in milliseconds. Note: Only valid when trigger is hover' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'trigger', + mfDemo: '' + }, + { + name: 'inherit-width', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '下拉弹框的最小宽度是否继承触发源的宽度,默认不继承', + 'en-US': + 'Whether the minimum width of the dropdown pop-up inherit the width of the trigger source.It is not inherited by default' + }, + mode: ['pc'], + pcDemo: 'inherit-width' + }, + { + name: 'menu-options', + typeAnchorName: 'IMenuOption', + type: 'IMenuOption', + defaultValue: + '\n{\n options:[],\n textField:"label",\n popperClass:"",\n placement:"bottom-end"\n}\n', + desc: { + 'zh-CN': '配置式且只使用 tiny-dropdown 组件时使用', + 'en-US': 'Used when configuring and only using the tiny dropdown component' + }, + mode: ['pc'], + pcDemo: 'options' + }, + { + name: 'round', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否展示圆角。默认为 false。在 border 属性为 true 时生效', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'show-icon', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '是否显示下拉触发源图标', + 'en-US': 'Is the dropdown trigger source icon displayed' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'show-icon', + mfDemo: '' + }, + { + name: 'show-self-icon', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '更多图标下拉菜单。默认值:false', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'show-timeout', + type: 'number', + defaultValue: '250', + desc: { + 'zh-CN': '延时多久展开下拉菜单,单位毫秒。注意:仅在 trigger 为 hover 时有效', + 'en-US': + 'How long is the delay to expand the drop-down menu, in milliseconds. Note: Only valid when trigger is hover' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'trigger', + mfDemo: '' + }, + { + name: 'single-button', + type: 'Boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '下拉触发元素呈现为按钮组。', + 'en-US': 'The drop-down trigger element is rendered as a button group.' + }, + mode: ['mobile-first'], + mfDemo: 'button-dropdown' + }, + { + name: 'size', + type: '"medium" | "small" | "mini"', + defaultValue: '', + desc: { + 'zh-CN': '菜单尺寸。注意:只在 split-button为 true 的情况下生效', + 'en-US': 'Menu size. Note: Only takes effect when split-button is true' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'size', + mfDemo: '' + }, + { + name: 'split-button', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '下拉触发元素呈现为按钮', + 'en-US': 'Dropdown trigger elements are presented as button groups' + }, + mode: ['pc'], + pcDemo: 'split-button' + }, + { + name: 'suffix-icon', + type: 'Component', + defaultValue: '', + desc: { + 'zh-CN': '下拉触发源图标', + 'en-US': 'Dropdown trigger source icon' + }, + mode: ['pc'], + pcDemo: 'show-icon' + }, + { + name: 'tabindex', + type: 'number', + defaultValue: '0', + desc: { + 'zh-CN': '初始化触发元素的原生属性 tabindex', + 'en-US': 'Initialize the native attribute tabindex of the triggering element' + }, + mode: ['pc', 'mobile-first'], + pcDemo: '', + mfDemo: '' + }, + { + name: 'title', + type: 'string', + defaultValue: "'下拉菜单'", + desc: { + 'zh-CN': '自定义触发源的文本', + 'en-US': 'Text for custom trigger source' + }, + mode: ['pc'], + pcDemo: 'options' + }, + { + name: 'trigger', + type: "'hover' | 'click'", + defaultValue: "'hover'", + desc: { + 'zh-CN': '触发下拉的方式', + 'en-US': 'Trigger the dropdown method' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'trigger', + mfDemo: '' + }, + { + name: 'type', + typeAnchorName: 'IButtonType', + type: 'IButtonType', + defaultValue: '', + desc: { + 'zh-CN': '按钮类型。注意:只在 split-button 为 true 的情况下有效', + 'en-US': 'Button type. Note: Only valid if split button is true' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'split-button', + mfDemo: '' + }, + { + name: 'visible-arrow', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '下拉弹框是否显示箭头,默认不显示', + 'en-US': 'Indicates whether to display arrows. The default value is not displayed' + }, + mode: ['pc'], + pcDemo: 'visible-arrow' + } + ], + events: [ + { + name: 'button-click', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '监听左侧按钮点击事件,仅 split-button 为 true 时生效', + 'en-US': 'Listen for the left button click event, only effective when split-button is true' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'events', + mfDemo: '' + }, + { + name: 'item-click', + typeAnchorName: 'IItemClickParam', + type: '(data:IItemClickParam) => void', + defaultValue: '', + desc: { + 'zh-CN': '监听点击菜单项事件', + 'en-US': 'Listen for menu item click events' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'events', + mfDemo: '' + }, + { + name: 'visible-change', + type: '(status:boolean) => void', + defaultValue: '', + desc: { + 'zh-CN': '监听下拉框的显示或隐藏状态', + 'en-US': 'Monitor the display or hidden status of the dropdown box' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'events', + mfDemo: '' + } + ], + methods: [], + slots: [ + { + name: 'default', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '自定义触发源文本区域。 注意: 必须是一个元素或者或者组件', + 'en-US': 'Customize the trigger source text area. Note: must be an element or component' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + }, + { + name: 'dropdown', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '自定义下拉列表区域,通常使用 tiny-dropdown-menu 组件', + 'en-US': 'Customize the dropdown list area, usually using the tiny dropdown menu component' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + } + ] + }, + { + name: 'dropdown-menu', + type: 'component', + props: [ + { + name: 'custom-class', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '设置弹出下拉自定义样式。', + 'en-US': 'Set the custom style of the pop-up drop-down list.' + }, + mode: ['mobile-first'] + }, + { + name: 'max-height', + type: 'Number | String', + defaultValue: '400', + desc: { + 'zh-CN': '设置下拉最大高度。', + 'en-US': 'Sets the maximum pull-down height. ' + }, + mode: ['mobile-first'], + mfDemo: 'max-height' + }, + { + name: 'multi-stage', + type: 'Boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '设置二级下拉菜单。', + 'en-US': 'Sets the level-2 drop-down list. ' + }, + mode: ['mobile-first'], + mfDemo: 'multi-stage' + }, + { + name: 'options', + typeAnchorName: 'IItemData', + type: 'IItemData []', + defaultValue: '[]', + desc: { + 'zh-CN': '通过配置式设置菜单项的属性', + 'en-US': 'Setting menu item properties through configuration' + }, + mode: ['pc'], + pcDemo: 'options' + }, + { + name: 'placement', + typeAnchorName: 'IPlacementType', + type: 'IPlacementType', + defaultValue: "'bottom-end'", + desc: { + 'zh-CN': '菜单弹出位置', + 'en-US': 'Menu pop-up location ' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'popper-class', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '下拉弹框的类名,用于自定义样式', + 'en-US': 'The class name of the dropdown pop-up box, used for customizing styles' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'text-field', + type: 'string', + defaultValue: "'label'", + desc: { + 'zh-CN': '菜单项文本的字段,结合 options 属性使用', + 'en-US': 'The field of menu item text, used in conjunction with the options attribute' + }, + mode: ['pc'], + pcDemo: 'options' + } + ], + events: [], + methods: [], + slots: [ + { + name: 'default', + defaultValue: '', + desc: { + 'zh-CN': '下拉弹框区域,通常使用 tiny-dropdown-item 组件', + 'en-US': 'Dropdown the pop-up area, usually using the tiny-dropdown item component' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + } + ] + }, + { + name: 'dropdown-item', + type: 'component', + props: [ + { + name: 'disabled', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否禁用', + 'en-US': 'Is it disabled' + }, + mode: ['pc'], + pcDemo: 'disabled' + }, + { + name: 'divided', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否显示分割线', + 'en-US': 'Show split lines' + }, + mode: ['pc'], + pcDemo: 'events' + }, + { + name: 'icon', + type: 'Component', + defaultValue: '', + desc: { + 'zh-CN': '内嵌图标', + 'en-US': 'Embedded icon' + }, + mode: ['pc'], + pcDemo: 'events' + }, + { + name: 'item-data', + typeAnchorName: 'IItemData', + type: 'IItemData', + defaultValue: '', + desc: { + 'zh-CN': '菜单项的配置信息', + 'en-US': 'Configuration information for menu items' + }, + mode: ['pc'], + pcDemo: 'events' + }, + { + name: 'label', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '菜单项的文本', + 'en-US': 'Text for menu items' + }, + mode: ['pc'], + pcDemo: 'events' + }, + { + name: 'level', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '设置二级下拉菜单标志', + 'en-US': 'Sets the level-2 drop-down menu flag.' + }, + mode: ['mobile-first'] + } + ], + events: [], + methods: [], + slots: [ + { + name: 'default', + defaultValue: '', + desc: { + 'zh-CN': '菜单项文本区域', + 'en-US': 'Menu item text area' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + } + ] + } + ], + types: [ + { + name: 'IMenuOption', + type: 'interface', + code: ` +interface IMenuOption { + options: IItemData[] + textField?: string + popperClass?: string + placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' +} +` + }, + { + name: 'IItemClickParam', + type: 'interface', + code: ` +interface IItemClickParam { + itemData: IItemData + // dropdownItem 组件的实例 + vm: { + selected: boolean + textField: string + tipPosition: string + $el: HTMLElement + } +} +` + }, + { + name: 'IItemData', + type: 'interface', + code: ` +interface IItemData { + label?: string + disabled?: boolean + divided?: boolean +} +` + }, + { + name: 'IButtonType', + type: 'type', + code: ` +type IButtonType = 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text' +` + }, + { + name: 'IPlacementType', + type: 'type', + code: ` +type IPlacementType = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' +` + } + ] +} diff --git a/examples/sites/demos/apis/dropdownmenu.js b/examples/sites/demos/apis/dropdownmenu.js new file mode 100644 index 000000000..3eb15a5b8 --- /dev/null +++ b/examples/sites/demos/apis/dropdownmenu.js @@ -0,0 +1,239 @@ +export default { + mode: ['mobile'], + apis: [ + { + name: 'DropdownMenu', + type: 'component', + props: [ + { + name: 'active-color', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '
标题和选项的选中态颜色
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'activeColor' + }, + { + name: 'close-on-click-outside', + type: 'Boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '设置点击外部元素后关闭菜单,默认问true
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'closeOnClickOutside' + }, + { + name: 'close-on-click-overlay', + type: 'Boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '设置点击遮罩层后关闭菜单,默认为true设置点击遮罩层后关闭菜单,默认为true
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'closeOnClickOverlay' + }, + { + name: 'direction', + type: 'String', + defaultValue: 'down', + desc: { + 'zh-CN': '设置弹出框弹出框展开方向,默认为down
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'direction' + }, + { + name: 'duration', + type: 'Number', + defaultValue: '', + desc: { + 'zh-CN': '设置弹出框的动画时长
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'duration' + }, + { + name: 'overlay', + type: 'Boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '设置是否显示遮罩层,默认为true
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'overlay' + } + ], + events: [], + methods: [], + slots: [ + { + name: 'default', + defaultValue: '', + desc: { + 'zh-CN': '定义菜单内容
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'slot' + } + ] + }, + { + name: 'DropdownItem', + type: 'component', + props: [ + { + name: 'disabled', + type: 'Boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '设置是否禁用,默认为false
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'disabled' + }, + { + name: 'icon', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '设置菜单选项项左侧icon
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'icon' + }, + { + name: 'options', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '设置选项数据
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'screen-funnel' + }, + { + name: 'title', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '菜单项标题
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'screen-funnel' + }, + { + name: 'title-class', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '标题类名
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'title-class' + }, + { + name: 'type', + type: 'String', + defaultValue: 'selection', + desc: { + 'zh-CN': '设置菜单项类型,可选值为 filter | sort | selection,默认值为 selection
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'title-class' + }, + { + name: 'value', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '当前选中项对应的 value,可以通过v-model双向绑定
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'activeColor' + } + ], + events: [ + { + name: 'change', + defaultValue: '', + desc: { + 'zh-CN': '点击选项时触发,type为 selection 时启用
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'event' + }, + { + name: 'close', + defaultValue: '', + desc: { + 'zh-CN': '关闭菜单时触发
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'event' + }, + { + name: 'open', + defaultValue: '', + desc: { + 'zh-CN': '打开菜单时触发
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'event' + } + ], + methods: [], + slots: [ + { + name: 'default', + defaultValue: '', + desc: { + 'zh-CN': '定义菜单内容
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'slot' + }, + { + name: 'icon', + defaultValue: '', + desc: { + 'zh-CN': '当type为selection时选项左侧内容
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'slot' + }, + { + name: 'title', + defaultValue: '', + desc: { + 'zh-CN': '当type为selection时选项内容
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'slot' + } + ] + } + ] +} diff --git a/examples/sites/demos/apis/espace.js b/examples/sites/demos/apis/espace.js new file mode 100644 index 000000000..b1323bac9 --- /dev/null +++ b/examples/sites/demos/apis/espace.js @@ -0,0 +1,26 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'espace', + type: 'component', + props: [ + { + name: 'data', + type: 'Array , object', + defaultValue: '', + desc: { + 'zh-CN': '设置组件数据,数组对象中包含选项有 type、value、icon。type 的可选择值有:im、sip、mailto', + 'en-US': + 'Sets component data. The array object contains the options type, value, and icon. The value of type can be im, sip, or mailto' + }, + mode: ['pc'], + pcDemo: 'support-open-espace' + } + ], + events: [], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/exception.js b/examples/sites/demos/apis/exception.js new file mode 100644 index 000000000..7647c46a8 --- /dev/null +++ b/examples/sites/demos/apis/exception.js @@ -0,0 +1,172 @@ +export default { + mode: ['mobile', 'mobile-first'], + apis: [ + { + name: 'Exception', + type: 'component', + props: [ + { + name: 'buttonText', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '按钮文字/p>', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'buttonText' + }, + { + name: 'component-page', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '设置组件级空态', + 'en-US': 'Set component-level empty state' + }, + mode: ['mobile-first'], + mfDemo: 'component-empty' + }, + { + name: 'exception-class', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '设置自定义类', + 'en-US': 'Setting Custom Classes' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'exceptionClass', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '
自定义缺省页类名
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'exceptionClass' + }, + { + name: 'imageUrl', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '自定义图片
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'buttonText' + }, + { + name: 'message', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '主图片文字,在图片下方
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'message' + }, + { + name: 'page-empty', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '设置页面级空态', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'sub-message', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '设置二级标题', + 'en-US': 'Set Level-2 Title' + }, + mode: ['mobile-first'], + mfDemo: 'sub-message' + }, + { + name: 'subMessage', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '副文本内容,在描述文字的下方
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'subMessage' + }, + { + name: 'type', + type: 'String', + defaultValue: 'nodata', + desc: { + 'zh-CN': + '设置缺省页类型,默认为nodata,可选值有 weaknet || noperm || busy || build || weaknet || pcview
', + 'en-US': 'display different button' + }, + mode: ['mobile', 'mobile-first'], + mobileDemo: 'type', + mfDemo: 'page-empty' + } + ], + events: [ + { + name: 'click', + type: 'Function()', + defaultValue: '', + desc: { + 'zh-CN': '点击按钮时触发,type 为 nodata 时启用
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'message' + } + ], + methods: [], + slots: [ + { + name: 'content', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '设置内容
', + 'en-US': 'Click' + }, + mode: ['mobile', 'mobile-first'], + mobileDemo: 'mobileexception', + mfDemo: 'content-slot' + }, + { + name: 'default', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '默认插槽', + 'en-US': 'Default Slot' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'footer', + defaultValue: '', + desc: { + 'zh-CN': '设置底部内容
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'mobileexception' + } + ] + } + ] +} diff --git a/examples/sites/demos/apis/fall-menu.js b/examples/sites/demos/apis/fall-menu.js new file mode 100644 index 000000000..712791ae7 --- /dev/null +++ b/examples/sites/demos/apis/fall-menu.js @@ -0,0 +1,76 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'fall-menu', + type: 'component', + props: [ + { + name: 'data', + type: 'object | object[]', + defaultValue: '', + desc: { + 'zh-CN': '设置瀑布菜单的数据。', + 'en-US': 'Set the waterfall menu data. ;Set the data of the waterfall menu.' + }, + mode: ['pc'], + pcDemo: 'data-resource' + } + ], + events: [], + methods: [], + slots: [ + { + name: 'left', + defaultValue: '', + desc: { + 'zh-CN': '自定义左侧切换图标', + 'en-US': 'Customize the switch icon on the left.' + }, + mode: ['pc'], + pcDemo: 'custom-slider-icon' + }, + { + name: 'level1', + defaultValue: '', + desc: { + 'zh-CN': '自定义一级菜单', + 'en-US': 'User-defined level-1 menu' + }, + mode: ['pc'], + pcDemo: 'custom-menuitem' + }, + { + name: 'level2', + defaultValue: '', + desc: { + 'zh-CN': '自定义二级菜单', + 'en-US': 'Customized level-2 menu' + }, + mode: ['pc'], + pcDemo: 'custom-menuitem' + }, + { + name: 'level3', + defaultValue: '', + desc: { + 'zh-CN': '自定义三级菜单', + 'en-US': 'Customized Level-3 Menu' + }, + mode: ['pc'], + pcDemo: 'custom-menuitem' + }, + { + name: 'right', + defaultValue: '', + desc: { + 'zh-CN': '自定义右侧切换图标', + 'en-US': 'Customize the switch icon on the right.' + }, + mode: ['pc'], + pcDemo: 'custom-slider-icon' + } + ] + } + ] +} diff --git a/examples/sites/demos/apis/file-upload.js b/examples/sites/demos/apis/file-upload.js new file mode 100644 index 000000000..ed8d9c2a4 --- /dev/null +++ b/examples/sites/demos/apis/file-upload.js @@ -0,0 +1,1088 @@ +export default { + mode: ['pc', 'mobile', 'mobile-first'], + apis: [ + { + name: 'file-upload', + type: 'component', + props: [ + { + name: 'accept', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '限制文件类型(thumbnail-mode 模式下此参数无效)', + 'en-US': 'Restrict the types of files. This parameter is invalid in thumbnail-mode mode' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'accept-file-image', + mobileDemo: 'accept-file-image', + mfDemo: '' + }, + { + name: 'action', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '上传的地址,必填参数', + 'en-US': 'The address for uploading files, required parameter' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'basic-usage', + mobileDemo: 'accept-file', + mfDemo: '' + }, + { + name: 'auto-upload', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '是否在选取文件后立即进行上传', + 'en-US': 'Whether to upload a file immediately after it is selected' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'manual-upload', + mobileDemo: 'manual-upload', + mfDemo: '' + }, + { + name: 'before-add-file', + type: '(callback: () => void) => void', + defaultValue: '', + desc: { + 'zh-CN': + '文件选择之前的钩子,若返回 false 或者返回 Promise 且被 reject,则停止添加文件。如果不用以上 2 种方式,也可以通过执行参数中的回调函数继续进行上传【3.13.0版本新增】', + 'en-US': + 'If false is returned or Promise is returned and rejected, the system stops adding files. If the preceding two methods are not used, you can continue the upload by executing the callback function in the parameter [Added in 3.13.0]' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'custom-prefix', + mfDemo: '' + }, + { + name: 'before-remove', + typeAnchorName: 'IFile', + type: '(file: IFile, fileList: IFile[]) => boolean | Promise', + defaultValue: '', + desc: { + 'zh-CN': + '删除文件前的钩子,参数为上传的文件和文件列表,若返回 false 或者返回 Promise 且被 reject,则停止删除', + 'en-US': + 'Hook before deleting files. The parameters are the uploaded files and file list. If false is returned or Promise is returned and rejected, the deletion stops' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'prevent-delete-file', + mobileDemo: 'custom-prefix', + mfDemo: '' + }, + { + name: 'before-upload', + typeAnchorName: 'IFile', + type: '(file: IFile) => boolean | Promise', + defaultValue: '', + desc: { + 'zh-CN': '上传文件之前的钩子,参数为上传的文件,若返回 false 或者返回 Promise 且被 reject,则停止上传', + 'en-US': + 'Hook before uploading a file. The parameter is the file to be uploaded. If false is returned or Promise is returned and rejected, the upload stops' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'before-upload-limit', + mobileDemo: 'custom-prefix', + mfDemo: '' + }, + { + name: 'buttons', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '设置组件基本按钮禁用或启用。
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: '' + }, + { + name: 'cache-token', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': + '使用 EDM 时,可配置是否缓存token(存在多个file-upload时,若配置cache-token为false,token会调用多次。否则,只调用一次)', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'custom-class', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '自定义class', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data', + typeAnchorName: 'IData', + type: 'IData', + defaultValue: '', + desc: { + 'zh-CN': '上传时附带的额外参数,参数自定义', + 'en-US': 'Extra parameters attached during upload, parameter customization' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'basic-usage', + mobileDemo: 'data', + mfDemo: '' + }, + { + name: 'disabled', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否禁用', + 'en-US': 'Is it disabled' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'disabled', + mobileDemo: 'dynamic-disable', + mfDemo: '' + }, + { + name: 'display', + type: 'Boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '显示删除文件功能,该属性默认为true
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'manual-upload' + }, + { + name: 'display-only', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '文件上传模式,通过 display-only 设置组件是否只读', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'download', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': '配置 EDM 下载功能所需的参数,例如:edm:{download:{token:()=>{}}},token为鉴权token', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'drag', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否启用拖拽上传', + 'en-US': 'Whether to enable drag-and-drop upload' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'drag-upload', + mfDemo: '' + }, + { + name: 'edm', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': '使用 EDM 的上传下载预览功能,可在该对象里边配置上传、下载、预览功能的参数', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'encrypt-config', + typeAnchorName: 'IEncryptConfig', + type: 'IEncryptConfig', + defaultValue: '', + desc: { + 'zh-CN': '设置水印和加密弹窗', + 'en-US': 'Setting the watermark and encryption pop-up window' + }, + mode: ['pc'], + pcDemo: 'encrypt-config' + }, + { + name: 'ext-icons', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': '设置自定义文件类型图标,根据扩展名定义,默认由组件内部提供。
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'placeholder' + }, + { + name: 'file-icon-list', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '配置文件上传显示的图标路径,未配置会默认显示组件内部配置图标
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'file-icon-list' + }, + { + name: 'file-list', + typeAnchorName: 'IFileListItem', + type: 'IFileListItem[]', + defaultValue: '', + desc: { + 'zh-CN': '上传的文件列表', + 'en-US': 'List of uploaded files' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'upload-file-list', + mobileDemo: 'upload-file-list', + mfDemo: '' + }, + { + name: 'file-size', + type: 'Number | Array', + defaultValue: '', + desc: { + 'zh-CN': '限制文件大小,单位为 KB;当为 Number 类型时,小于该值停止上传;为数组时[min,max] 设置上传范围', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'file-title', + type: 'String', + defaultValue: '附件', + desc: { + 'zh-CN': '头部标题,该属性默认为‘附件’
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'file-title' + }, + { + name: 'header-show', + type: 'Boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '是否显示头部,该属性默认为true
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'header-show' + }, + { + name: 'headers', + typeAnchorName: 'IHeaders', + type: 'IHeaders', + defaultValue: '', + desc: { + 'zh-CN': '设置上传的请求头部;通过设置 headers 为头部请求信息', + 'en-US': 'Set the upload request header. You can set headers to the header request information' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'upload-request', + mobileDemo: 'upload-request', + mfDemo: '' + }, + { + name: 'http-request', + type: '() => Promise', + defaultValue: '', + desc: { + 'zh-CN': '覆盖默认的上传行为,可以自定义上传的实现; 由于 TinyVue 官网为 Mock 上传不能执行上传', + 'en-US': + 'Overwrite the default upload behavior. You can customize the upload implementation. The upload cannot be performed because the TinyVue official website uses Mock upload' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'http-request', + mobileDemo: 'upload-http-request', + mfDemo: '' + }, + { + name: 'hwh5', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': '在we码小程序中,可配置 hwh5属性 进行原生的上传和下载', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'is-folder-title', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': + '配置为 true,则在文件列表模式(show-file-list为true),hover文件名时,展示对应的文件路径,没有文件路径则只展示文件名', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'is-hidden', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '达到最大上传个数时,是否隐藏上传按钮,默认不隐藏', + 'en-US': + 'Whether to hide the upload button when the number of uploaded files reaches the maximum. By default, the button is not hidden' + }, + mode: ['pc'], + pcDemo: 'max-file-count' + }, + { + name: 'isFolder', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': + '配置为 true,启用 EDM 上传文件夹的功能,最多只能上传 5 层;{edm:upload:{isFolder:true,token:()=>{}}}', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'limit', + type: 'number', + defaultValue: '', + desc: { + 'zh-CN': '最大允许上传个数', + 'en-US': 'Maximum number of files that can be uploaded' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'max-file-count', + mobileDemo: 'upload-limit', + mfDemo: '' + }, + { + name: 'list-option', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': 'EDM文件列表模式下,配置更新和删除文件的功能', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'list-type', + typeAnchorName: 'IListType', + type: 'IListType', + defaultValue: "'text'", + desc: { + 'zh-CN': '文件列表的类型', + 'en-US': 'File list type' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'upload-file-list-thumb', + mobileDemo: 'file-picture-card', + mfDemo: '' + }, + { + name: 'max_file_count', + type: 'Number', + defaultValue: 'Infinity', + desc: { + 'zh-CN': '设置文件上传数量的最大值,默认无限制,要大于0的正整数。
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: '' + }, + { + name: 'max-name-length', + type: 'number', + defaultValue: '20', + desc: { + 'zh-CN': '列表项的文件名最大字符数,默认超出20个字符隐藏', + 'en-US': + 'The maximum number of characters in the file name of a list item, which is hidden if it exceeds 20 characters by default' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'paste-upload', + mfDemo: '' + }, + { + name: 'merge-service', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '配置 merge-service 为 true 且开启多文件上传走默认服务会将多个上传服务合并为一个服务上传', + 'en-US': + 'If merge-service is set to true and multiple files are uploaded using the default service, multiple upload services are combined into one service' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'mergeService', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '配置 mergeService 为true 且开启多文件上传走默认服务会将多个上传服务合并为一个服务上传', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'mini-mode', + type: 'Boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '设置 mini 模式。
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'mini-mode' + }, + { + name: 'mode', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '气泡上传,在 list-type 为默认值 text 时,设置 mode 为 bubble 时进行气泡模式的上传', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'multiple', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否支持多选文件', + 'en-US': 'Specifies whether multiple files can be selected' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'multiple-file', + mobileDemo: 'multiple-file', + mfDemo: '' + }, + { + name: 'name', + type: 'string', + defaultValue: "'file'", + desc: { + 'zh-CN': '上传的文件字段名', + 'en-US': 'Field name of the uploaded file' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'upload-file-list-slot', + mobileDemo: 'data', + mfDemo: '' + }, + { + name: 'open-download-file', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否开启点击下载文件,默认不开启', + 'en-US': 'Whether to enable file download by clicking. By default, this function is disabled' + }, + mode: ['pc'], + pcDemo: 'upload-file-list' + }, + { + name: 'packageToken', + type: 'Function', + defaultValue: '', + desc: { + 'zh-CN': '配置 EDM 批量打包下载的 token;配置结构为 edm:{download:packageToken:()=>{}},返回一个 Promise', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'paramsWhitelist', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': + "配置 EDM 单文件下载参数白名单(默认会携带docId,wmType,docVersion),若需携带其他参数,需配置paramsWhitelist,例如:edm:{download:{paramsWhitelist: ['paramA', 'paramB']}},", + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'paste-upload', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否启用粘贴键快捷上传功能【3.11.0版本新增】', + 'en-US': 'Is the paste key quick upload function enabled [New in version 3.11.0]' + }, + mode: ['pc'], + pcDemo: 'paste-upload' + }, + { + name: 'preivew', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': + "配置 EDM 预览功能所需的参数,例如:edm:{preview:{plugin:util.default,previewUrl:./_index.html?appid=应用Id,packageName: 'jslib',token:()=>{}}}", + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 're-upload-tip', + type: '(count: number) => string', + defaultValue: '', + desc: { + 'zh-CN': '自定义重新上传的左侧提示文字,需要与 re-uploadable 搭配使用【3.12.0版本新增】', + 'en-US': + 'Customize the left prompt for re uploading, which needs to be used in conjunction with re-uploadable [added in version 3.12.0]' + }, + mode: ['pc'], + pcDemo: 'custom-upload-tip' + }, + { + name: 're-uploadable', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否启用重新上传功能【3.12.0版本新增】', + 'en-US': 'Is the re upload function enabled [New in version 3.12.0]' + }, + mode: ['pc'], + pcDemo: 'custom-upload-tip' + }, + { + name: 'show-file-list', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '是否显示已上传文件列表', + 'en-US': 'Whether to display the list of uploaded files' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'upload-file-list', + mobileDemo: 'upload-user-head', + mfDemo: '' + }, + { + name: 'show-name', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '上传请求参数,默认为 false', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'show-title', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '配置 show-title 为 false 隐藏标题,默认为 true', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'size', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '为单个按钮且按钮为TinyVue的Button组件时生效,值可设置为:medium,small,mini
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'size' + }, + { + name: 'source-type', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '数据源类型', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'success-statistics', + type: 'Boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '文件上传成功数量展示,该属性默认为true
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: '' + }, + { + name: 'thumb-option', + typeAnchorName: 'IThumbOption', + type: 'IThumbOption', + defaultValue: '', + desc: { + 'zh-CN': '文件列表的显示类型为 thumb 时的相关配置', + 'en-US': 'Related configurations when the display type of the file list is thumb' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'upload-file-list-thumb', + mfDemo: '' + }, + { + name: 'title', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '通过 title 可自定义标题', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'token', + type: 'Function', + defaultValue: '', + desc: { + 'zh-CN': '使用 EDM 上传下载预览所需的token,返回值为 Promise', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'type', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '文本,该属性默认为select
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: '' + }, + { + name: 'updateId', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': 'EDM 需要更新文档的 docId', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'upload', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': '配置 EDM 上传功能所需的参数,例如:edm:{upload:{token:()=>{}}}', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'upload-icon', + type: 'Boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '是否显示头部文件上传按钮,该属性默认为true
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'data' + }, + { + name: 'with-credentials', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '支持发送 cookie 凭证信息', + 'en-US': 'Cookie credential information can be sent' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'upload-request', + mobileDemo: 'with-credentials', + mfDemo: '' + } + ], + events: [ + { + name: 'change', + typeAnchorName: 'IFile', + type: '(file: IFile, fileList: IFile[]) => void', + defaultValue: '', + desc: { + 'zh-CN': '文件状态改变时触发的事件,添加文件、上传成功和上传失败时都会被触发', + 'en-US': + 'The event triggered when the file status changes, including adding a file, successfully uploading, and failing to upload, will be triggered' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'upload-events', + mobileDemo: 'upload-events', + mfDemo: '' + }, + { + name: 'download', + type: 'function(arg1, arg2)', + defaultValue: '', + desc: { + 'zh-CN': '文件下载时触发的事件', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'drop-error', + typeAnchorName: 'IFile', + type: '(file: IFile) => void', + defaultValue: '', + desc: { + 'zh-CN': '拖拽文件失败时触发的事件,开启拖拽时有效; file 为上传失败文件信息', + 'en-US': + 'Event triggered when dragging a file fails, effective when dragging is enabled; File is the information of the failed upload file' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'drag-upload', + mfDemo: '' + }, + { + name: 'error', + typeAnchorName: 'IFile', + type: '(message: ProgressEvent, file: IFile, fileList: IFile[]) => void', + defaultValue: '', + desc: { + 'zh-CN': + '文件上传失败时触发的事件; message 为错误信息事件对象,file 为当前上传失败文件信息,fileList 为上传成功 file 数组', + 'en-US': + 'Event triggered when file upload fails; Message is the error message event object, file is the current upload failure file information, and fileList is the upload success file array' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'upload-events', + mobileDemo: 'upload-events', + mfDemo: '' + }, + { + name: 'exceed', + typeAnchorName: 'IFile', + type: '(files: File | File[], fileList: IFile[]) => void', + defaultValue: '', + desc: { + 'zh-CN': '文件超出个数限制时触发的事件; files 为上传的文件', + 'en-US': 'Event triggered when the number of files exceeds the limit; Files are uploaded files' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'upload-events', + mobileDemo: 'upload-events', + mfDemo: '' + }, + { + name: 'hash-progress', + type: '(percentage: number) => void', + defaultValue: '', + desc: { + 'zh-CN': '文件上传生成 hash 值触发的事件; percentage 为生成的进度值', + 'en-US': 'Event triggered by file upload to generate hash value; percentage is the generated progress value' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'upload-events', + mfDemo: '' + }, + { + name: 'preview', + typeAnchorName: 'IFile', + type: '(file: IFile) => void', + defaultValue: '', + desc: { + 'zh-CN': '点击文件列表中已上传的文件时触发的事件', + 'en-US': 'Event triggered when clicking on an uploaded file in the file list' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'upload-events', + mobileDemo: 'upload-events', + mfDemo: '' + }, + { + name: 'progress', + typeAnchorName: 'IFile', + type: '(message: ProgressEvent, file: IFile) => void', + defaultValue: '', + desc: { + 'zh-CN': '文件上传时触发的事件; message 为进度条事件对象', + 'en-US': 'Event triggered during file upload; Message is the progress bar event object' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'upload-events', + mobileDemo: 'upload-events', + mfDemo: '' + }, + { + name: 'remove', + typeAnchorName: 'IFile', + type: '(file: IFile) => void', + defaultValue: '', + desc: { + 'zh-CN': '从文件列表移除文件时触发的事件; file 为当前移除的文件信息', + 'en-US': + 'Event triggered when removing a file from the file list; File is the information of the currently removed file' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'upload-events', + mobileDemo: 'upload-events', + mfDemo: '' + }, + { + name: 'success', + typeAnchorName: 'IFile', + type: '(res: ProgressEvent, file: IFile, fileList: IFile[]) => void', + defaultValue: '', + desc: { + 'zh-CN': + '文件上传成功时触发的事件; res 为上传成功后的响应信息事件对象,file 为当前上传的文件,fileList 为所有上传文件数组', + 'en-US': + 'Event triggered when the file is successfully uploaded; Res is the response information event object after successful upload, file is the current uploaded file, and fileList is an array of all uploaded files' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'upload-events', + mobileDemo: 'upload-events', + mfDemo: '' + } + ], + methods: [ + { + name: 'abort', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '取消上传请求', + 'en-US': 'Cancel the upload request' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'abort-quest', + mobileDemo: 'event', + mfDemo: '' + }, + { + name: 'abortDownload', + type: '', + defaultValue: '', + desc: { + 'zh-CN': 'edm 取消下载请求', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'clearFiles', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '清空已上传的文件列表(该方法不支持在 before-upload 中调用)', + 'en-US': 'Clear the list of uploaded files. (This method cannot be invoked in before-upload)' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'clear-files', + mobileDemo: 'clear-files', + mfDemo: '' + }, + { + name: 'downloadFile', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '下载 EDM 文件', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'getNewTabPreviewUrl', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '预览 EDM 文件预览的 Url,返回值为 Promise', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'previewFile', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '预览 EDM 文件', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'submit', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '手动上传文件列表', + 'en-US': 'List of manually uploaded files' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'manual-upload', + mobileDemo: 'manual-upload', + mfDemo: '' + } + ], + slots: [ + { + name: 'file', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '定义文件显示内容', + 'en-US': 'Custom File Display Content' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'upload-file-list-slot', + mfDemo: '' + }, + { + name: 'tip', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '提示说明文字', + 'en-US': 'Prompt Description' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'custom-upload-tip', + mobileDemo: 'custom-upload-tip', + mfDemo: '' + }, + { + name: 'trigger', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '触发文件选择框的内容', + 'en-US': 'Content of the triggering file selection box' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'custom-trigger', + mobileDemo: 'custom-upload-tip', + mfDemo: '' + } + ] + } + ], + types: [ + { + name: 'IData', + type: 'interface', + code: ` +interface IData { + [propsName?: any]: any // 上传参数可自定义 +} + ` + }, + { + name: 'IFile', + type: 'interface', + code: ` +interface IFile { + name: string // 上传文件名 + percentage: string // 上传进度百分比 + raw: File // 原始文件信息 + size: number // 文件大小 + status: string // 上传状态 + uid: string // uid +} + ` + }, + { + name: 'IEncryptConfig', + type: 'interface', + code: ` +interface IEncryptConfig { + enabled: boolean // 是否开启设置,默认关闭 + encrypt: boolean // 是否加密,默认否 + watermark: string // 水印文字,默认为空 +} + ` + }, + { + name: 'IFileListItem', + type: 'interface', + code: ` +interface IFileListItem { + name: string // 文件名 + url: string // 文件url 例如:'https://xxx.cdn.com/xxx.jpg' +} + ` + }, + { + name: 'IHeaders', + type: 'interface', + code: ` +interface IHeaders { + 'Accept-Language'?: string // 比如等于:'en,zh' + Authorization?: string // 比如等于:'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' + [props: string]: any // headers的属性和属性值自定义 +} + ` + }, + { + name: 'IListType', + type: 'type', + code: ` +type IListType = 'text' | 'picture' | 'picture-card' | 'thumb' | 'saas' + ` + }, + { + name: 'IThumbOption', + type: 'interface', + code: ` +interface IThumbOption { + width: number // 弹窗宽度,默认270 + showDownload: boolean // 是否显示下载按钮,默认false + showDel: boolean // 是否显示删除按钮,布尔false + showTooltip: boolean // 文件名超出隐藏显示时是否启用tip,默认false + popperClass: string // 弹窗列表自定义类名 + downloadFile: (file) => void // 点击下载按钮执行函数 + icon: string | Component // 列表结果前 icon ,默认为 'icon-attachment' +} + ` + } + ] +} diff --git a/examples/sites/demos/apis/filter-bar.js b/examples/sites/demos/apis/filter-bar.js new file mode 100644 index 000000000..f7114cbe9 --- /dev/null +++ b/examples/sites/demos/apis/filter-bar.js @@ -0,0 +1,83 @@ +export default { + mode: ['mobile-first'], + apis: [ + { + name: 'FilterBar', + type: 'component', + props: [ + { + name: 'data', + type: 'Array', + defaultValue: '[]', + desc: { + 'zh-CN': '过滤栏列表数据。', + 'en-US': 'Filter bar list data.' + }, + mode: ['mobile-first'], + mfDemo: 'basic-usage' + }, + { + name: 'v-model', + type: 'Array', + defaultValue: '[]', + desc: { + 'zh-CN': '绑定值', + 'en-US': 'Bind Value' + }, + mode: ['mobile-first'], + mfDemo: 'basic-usage' + } + ], + events: [ + { + name: 'click', + type: 'Function()', + defaultValue: '', + desc: { + 'zh-CN': '过滤项点击事件。', + 'en-US': 'Indicates the click event of a filtering item.' + }, + mode: ['mobile-first'], + mfDemo: 'readonly' + } + ], + methods: [ + { + name: 'click(index)', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '过滤项点击方法,index 是当前项索引', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ], + slots: [ + { + name: 'default', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '过滤项插槽。', + 'en-US': 'Filter item slot.' + }, + mode: ['mobile-first'], + mfDemo: 'slot' + }, + { + name: 'icon', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '组件右侧图标插槽。', + 'en-US': 'Icon slot on the right of the component.' + }, + mode: ['mobile-first'], + mfDemo: 'slot' + } + ] + } + ] +} diff --git a/examples/sites/demos/apis/filter-panel.js b/examples/sites/demos/apis/filter-panel.js new file mode 100644 index 000000000..35177477f --- /dev/null +++ b/examples/sites/demos/apis/filter-panel.js @@ -0,0 +1,151 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'filter-panel', + type: 'component', + props: [ + { + name: 'blank', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '将过滤器背景设置为透明', + 'en-US': 'Set Filter Background to Transparent' + }, + mode: ['pc'], + pcDemo: 'tip' + }, + { + mode: [] + }, + { + name: 'disabled', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否禁用', + 'en-US': 'Whether to disable' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'label', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '标题', + 'en-US': 'The title' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'placement', + typeAnchorName: 'popover#IPopperPlacement', + type: 'IPopperPlacement', + defaultValue: "'bottom-start'", + desc: { + 'zh-CN': '下拉面板位置,可选值请参考popover组件的同属性', + 'en-US': + 'Drop down panel position, optional values please refer to the same properties of the popover component' + }, + mode: ['pc'], + pcDemo: 'popper-class' + }, + { + name: 'popper-append-to-body', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '下拉面板是否添加到body元素中', + 'en-US': 'Indicates whether to add the drop-down panel to the body element' + }, + mode: ['pc'], + pcDemo: 'popper-class' + }, + { + name: 'popper-class', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '下拉面板的class', + 'en-US': 'Class in the drop-down panel' + }, + mode: ['pc'], + pcDemo: 'popper-class' + }, + { + name: 'tip', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '标题右侧的提示信息', + 'en-US': 'Message on the right of the title' + }, + mode: ['pc'], + pcDemo: 'tip' + }, + { + name: 'value', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '显示的值', + 'en-US': 'Displayed Values' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + } + ], + events: [ + { + name: 'handle-clear', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '清除按钮点击事件', + 'en-US': 'Clear button click event' + }, + mode: ['pc'], + pcDemo: 'event' + }, + { + name: 'visible-change', + type: '(visible: boolean) => void', + defaultValue: '', + desc: { + 'zh-CN': '下拉面板显示隐藏事件', + 'en-US': 'The drop-down panel displays hidden events' + }, + mode: ['pc'], + pcDemo: 'event' + } + ], + methods: [ + { + name: 'hide', + type: '() => void', + desc: { + 'zh-CN': '隐藏下拉面板的方法', + 'en-US': 'How to hide the drop-down panel' + }, + mode: ['pc'], + pcDemo: 'manual-hide' + } + ], + slots: [ + { + name: 'default', + desc: { + 'zh-CN': '默认插槽', + 'en-US': 'Default Slot' + }, + mode: ['pc'], + pcDemo: 'code' + } + ] + } + ] +} diff --git a/examples/sites/demos/apis/filter.js b/examples/sites/demos/apis/filter.js new file mode 100644 index 000000000..a1f57e9df --- /dev/null +++ b/examples/sites/demos/apis/filter.js @@ -0,0 +1,158 @@ +export default { + mode: ['mobile-first'], + apis: [ + { + name: 'Filter', + type: 'component', + props: [ + { + name: 'column-num', + type: 'Number', + defaultValue: '3', + desc: { + 'zh-CN': '面板每行的列数,默认值为 3。', + 'en-US': 'Number of columns in each row of the panel. The default value is 3.' + }, + mode: ['mobile-first'], + mfDemo: 'column-num' + }, + { + name: 'custom-class', + type: 'Array', + defaultValue: '[]', + desc: { + 'zh-CN': '自定义组件 class 样式。', + 'en-US': 'Customize the class style of the component.' + }, + mode: ['mobile-first'] + }, + { + name: 'data', + type: 'Array', + defaultValue: '[]', + desc: { + 'zh-CN': '过滤列表数据。', + 'en-US': 'Customized text of the close button' + }, + mode: ['mobile-first'], + mfDemo: 'basic-usage' + }, + { + name: 'filter-group', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '过滤组列表', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'filter-value', + type: 'Array', + defaultValue: '[]', + desc: { + 'zh-CN': '过滤组绑定的值。', + 'en-US': 'Indicates the value bound to the filtering group.' + }, + mode: ['mobile-first'], + mfDemo: 'filter-group' + }, + { + name: 'manual', + type: 'Array', + defaultValue: '[]', + desc: { + 'zh-CN': '过滤选项自定义对接外部组件,一般和 panel 面板事件一起使用。', + 'en-US': + 'Filtering options are customized to connect to external components. Generally, the filtering options are used together with panel events.' + }, + mode: ['mobile-first'], + mfDemo: 'manual' + }, + { + name: 'panel-class', + type: 'Array', + defaultValue: '[]', + desc: { + 'zh-CN': '自定义组件面板 class 样式。', + 'en-US': 'Customize the Palette class style.' + }, + mode: ['mobile-first'] + }, + { + name: 'v-model', + type: 'Array', + defaultValue: '[]', + desc: { + 'zh-CN': '绑定值', + 'en-US': 'Bind Value' + }, + mode: ['mobile-first'], + mfDemo: 'basic-usage' + } + ], + events: [ + { + name: 'cancel', + type: 'Function()', + defaultValue: '', + desc: { + 'zh-CN': '关闭面板时触发的事件。', + 'en-US': 'Event triggered when a panel is closed.' + }, + mode: ['mobile-first'] + }, + { + name: 'panel', + type: 'Function()', + defaultValue: '', + desc: { + 'zh-CN': '打开面板时触发的事件。', + 'en-US': 'Event triggered when a panel is opened.' + }, + mode: ['mobile-first'], + mfDemo: 'manual' + } + ], + methods: [], + slots: [ + { + name: 'default', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '过滤项插槽。', + 'en-US': 'Filter item slot.' + }, + mode: ['mobile-first'], + mfDemo: 'slot' + }, + { + name: 'footer', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '面板底部按钮组插槽,提供了 cancel、reset、confirm 方法。', + 'en-US': + 'Button group slot at the bottom of the panel, which provides the cancel, reset, and confirm methods.' + }, + mode: ['mobile-first'], + mfDemo: 'slot' + }, + { + name: 'icon', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '过滤图标插槽,提供了参数 active,index。', + 'en-US': 'Filter icon slot. The active and index parameters are provided.' + }, + mode: ['mobile-first'], + mfDemo: 'slot' + } + ] + } + ] +} diff --git a/examples/sites/demos/apis/floatbar.js b/examples/sites/demos/apis/floatbar.js new file mode 100644 index 000000000..1d81b578d --- /dev/null +++ b/examples/sites/demos/apis/floatbar.js @@ -0,0 +1,24 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'floatbar', + type: 'component', + props: [], + events: [], + methods: [], + slots: [ + { + name: 'default', + defaultValue: '', + desc: { + 'zh-CN': '浮动块内容。', + 'en-US': 'Floating block content.' + }, + mode: ['pc'], + pcDemo: 'custom-style' + } + ] + } + ] +} diff --git a/examples/sites/demos/apis/floating-button.js b/examples/sites/demos/apis/floating-button.js new file mode 100644 index 000000000..c74eb1f3b --- /dev/null +++ b/examples/sites/demos/apis/floating-button.js @@ -0,0 +1,136 @@ +export default { + mode: ['mobile-first'], + apis: [ + { + name: 'FloatingButton', + type: 'component', + props: [ + { + name: 'animated', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '悬浮按钮开启动画', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: 'animated' + }, + { + name: 'background-color', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '悬浮按钮背景颜色', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: 'button-bgcolor' + }, + { + name: 'element-selector', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '悬浮按钮设置可传入的元素类名或者id', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: 'animated' + }, + { + name: 'expand-list', + type: 'IFloatingButtonExpandItem[]', + defaultValue: '[]', + desc: { + 'zh-CN': '拓展按钮接收数据的数组,接收项分为图标 icon 和标题 title ', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: 'expand' + }, + { + name: 'icon', + type: 'Component', + defaultValue: 'IconPlus', + desc: { + 'zh-CN': '自定义悬浮按钮图标', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: 'custom-icon' + }, + { + name: 'is-expand', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否展开拓展按钮', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: 'expand' + }, + { + name: 'mask', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '悬浮按钮遮罩层', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: 'mask' + }, + { + name: 'position', + type: "'left' | 'center' | 'right'", + defaultValue: "'right'", + desc: { + 'zh-CN': '悬浮按钮展示位置', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: 'button-position' + }, + { + name: 'reset-time', + type: 'number', + defaultValue: '0', + desc: { + 'zh-CN': '悬浮按钮防重点击重置时间', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: 'reclick' + }, + { + name: 'vague', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '悬浮按钮模糊层', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: 'mask' + } + ], + events: [ + { + name: 'click', + type: '(event: Event, index: number) => void', + defaultValue: '', + desc: { + 'zh-CN': '悬浮按钮点击触发事件', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: 'event' + } + ], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/flowchart.js b/examples/sites/demos/apis/flowchart.js new file mode 100644 index 000000000..6affcc073 --- /dev/null +++ b/examples/sites/demos/apis/flowchart.js @@ -0,0 +1,635 @@ +export default { + mode: ['pc', 'mobile-first'], + apis: [ + { + name: 'flowchart', + type: 'component', + props: [ + { + name: 'config', + type: 'object', + defaultValue: '', + desc: { + 'zh-CN': '流程图的配置。', + 'en-US': 'The config of flowchart.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + }, + { + name: 'config.align', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '在卡片模式下,节点内部文字的对齐方式,包括居左 left、居中 center', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'config.colors', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': '节点状态颜色映射对象', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'config.extraWidth', + type: 'Number', + defaultValue: '', + desc: { + 'zh-CN': '在多端 dot 模式下,图形预留宽度,用于图形最小宽度计算,适当修改保证图形宽度不被过分挤压', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'config.gap', + type: 'Number', + defaultValue: '', + desc: { + 'zh-CN': '图形节点在垂直方向上的最小间距', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'config.height', + type: 'Number', + defaultValue: '', + desc: { + 'zh-CN': '图形的高度。在多端 dot 模式下,如果高度小于图形计算高度,则使用图形计算高度', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'config.linkEndMinus', + type: 'Number', + defaultValue: '', + desc: { + 'zh-CN': '在 dot 点模式下,连线末端在连线方向上的偏移量,可以用来调整连线末端位置', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'config.nodeLayout', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '在 dot 点模式下,节点内部布局,Label在节点下部居中 up-down、在节点右侧 left-right', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'config.nodeSize', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '在 dot 点模式下,节点图标尺寸,mini/small/medium', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'config.ongoingBackgroundColor', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '在卡片模式下,状态为进行中的节点的背景色', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'config.padding', + type: 'Number', + defaultValue: '', + desc: { + 'zh-CN': '图形的内边距。在 dot 模式自适应宽度时或者自定义布局时失效,只参与图形高度的计算', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'config.popoverPlacement', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '在卡片模式下,节点 tooltip 的位置', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'config.prior', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '在内置连线逻辑中使用,图形连线的优先方向,包括水平 horizontal、垂直 vertical', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'config.showArrow', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '在 dot 点模式下,全局设置连线是否显示箭头', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'config.showOnly', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '在 dot 点模式下,节点只显示图标、只显示标题,icon/title', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'config.status', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': '节点状态名称映射对象', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'config.type', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '设置为 dot 开启点模式', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'config.width', + type: 'Number', + defaultValue: '', + desc: { + 'zh-CN': '图形的宽度。在多端 dot 模式下失效,因为宽度要自适应容器宽度', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data', + type: 'object', + defaultValue: '', + desc: { + 'zh-CN': '流程图数据。', + 'en-US': 'The data of flowchart.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + }, + { + name: 'data.groups', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '多端 dot 模式下,流程图的分组列表', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data.groups[i].fillStyle', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '分组的填充颜色', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data.groups[i].lineDash', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '分组的边框虚线样式', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data.groups[i].nodes', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '分组中的节点名称列表', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data.groups[i].padding', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '分组的上下、左右内边距', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data.groups[i].strokeStyle', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '分组的边框颜色', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data.groups[i].title', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '分组的名称', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data.groups[i].titleClass', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '分组的名称样式 token', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data.groups[i].titlePosition', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '分组的名称位置,支持 top、top-left(顶部中间、顶部居左)', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data.links', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '流程图的连线列表', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data.links[i].from', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '连线起始节点的名称', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data.links[i].fromJoint', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': + '连线在起始节点的连接点。值可以为 bottom、top、left、right,表示从底部中间、顶部中间、左侧中间、右侧中间;值也可以为变体 bottom-1/2、bottom-2/2,表示从底部左半部分中间、底部右半部分中间;值也可以为变体 bottom-1/3、bottom-2/3、bottom-3/3 等', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data.links[i].info', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': '连线的详细信息,包括连线的状态、样式等', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data.links[i].linkOffset', + type: 'Number', + defaultValue: '', + desc: { + 'zh-CN': '在 dot 点模式下,连线起点在连线方向的偏移量,可以用来调整连线起点位置', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data.links[i].showArrow', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '在 dot 点模式下,单独设置连线是否显示箭头', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data.links[i].to', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '连线结束节点的名称', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data.links[i].toJoint', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': + '连线在结束节点的连接点。值可以为 bottom、top、left、right,表示从底部中间、顶部中间、左侧中间、右侧中间;值也可以为变体 bottom-1/2、bottom-2/2,表示从底部左半部分中间、底部右半部分中间;值也可以为变体 bottom-1/3、bottom-2/3、bottom-3/3 等', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data.nodes', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '流程图的节点列表', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data.nodes[i].hidden', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '节点是否隐藏', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data.nodes[i].info', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': '节点的详细信息,包括节点所在的行列、宽高、形状和其它信息', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'data.nodes[i].name', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '节点的名称,用于保证节点的唯一性', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'fetch', + type: 'function', + defaultValue: '', + desc: { + 'zh-CN': '多端 dot 异步流程图 AsyncFlowchart 数据和配置的加载方法。', + 'en-US': 'Multi-terminal dot asynchronous flow chart AsyncFlowchart data and configuration loading method.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + } + ], + events: [ + { + name: 'click-blank', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '点击空白区域时触发。', + 'en-US': 'Triggered when a blank area is clicked.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + }, + { + name: 'click-group', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '点击分组时触发。', + 'en-US': 'Triggered when group is clicked.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + }, + { + name: 'click-link', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '点击连线时触发。', + 'en-US': 'Triggered when a connection is clicked.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + }, + { + name: 'click-node', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '点击节点时触发。', + 'en-US': 'Triggered when a node is clicked.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + } + ], + methods: [ + { + name: 'createConfig', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '流程图组件 Flowchart 的静态方法,用于创建图形基础配置。', + 'en-US': 'Static method of flowchart component Flowchart, used to create basic graphics configuration.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + }, + { + name: 'layout', + type: '', + defaultValue: '', + desc: { + 'zh-CN': + '多端 dot 点模式下用于处理图形的自定义布局,设置在全局配置上,参数为图形宽、高和节点列表,期望获取每个节点的位置。', + 'en-US': + 'Custom layout for processing graphs in multi-end dot point mode, set in the global configuration, the parameters are graph width, height and node list, and it is expected to obtain the position of each node..' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + }, + { + name: 'linkPath', + type: '', + defaultValue: '', + desc: { + 'zh-CN': + '多端 dot 点模式下用于处理图形连线的自定义布局,设置在全局配置上,参数为连线和节点列表,期望获取连线的路径、中点和渐变。连线路径通过水平垂直折线的拐点表示。', + 'en-US': + 'A custom layout used to handle graphics connections in multi-terminal dot point mode. It is set in the global configuration. The parameters are the connection line and node list. It is expected to obtain the path, midpoint and gradient of the connection line. The connection path is represented by the inflection points of horizontal and vertical polylines.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + }, + { + name: 'linkPath[i].method({ afterLink, afterNodes, from, to, api })', + type: '', + defaultValue: '', + desc: { + 'zh-CN': 'afterLink当前连线,afterNodes节点列表,from起点矩形,to终点矩形,api处理矩形的方法集', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'Node', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '多端 dot 点模式下内置的节点组件。', + 'en-US': 'Built-in node component in multi-terminal dot mode.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + }, + { + name: 'refresh', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '在修改配置或数据之后,用于刷新多端异步流程图 AsyncFlowchart 实例的图形。', + 'en-US': + 'Graphics used to refresh a multi-end asynchronous flowchart AsyncFlowchart instance after modifying configuration or data.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + }, + { + name: 'renderInner', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '多端流卡片模式下节点的自定义渲染方法,渲染的内容为卡片内部内容,不包括卡片容器。', + 'en-US': + 'Custom rendering method for nodes in multi-stream card mode. The rendered content is the internal content of the card, excluding the card container.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + }, + { + name: 'renderOuter', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '多端卡片模式下节点的自定义渲染方法,渲染的内容包括卡片容器。', + 'en-US': + 'Custom rendering method for nodes in multi-terminal card mode. The rendered content includes card containers.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + }, + { + name: 'resizeMixin', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '多端 dot 点模式下用于处理图形的水平自适应宽度,后续在点模式的异步流程图中被内置。', + 'en-US': + 'Horizontal adaptive width for processing graphics in multi-terminal dot point mode, which will be built into the asynchronous flow chart in dot mode later.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'basic-usage', + mfDemo: '' + } + ], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/font.js b/examples/sites/demos/apis/font.js new file mode 100644 index 000000000..97342ab53 --- /dev/null +++ b/examples/sites/demos/apis/font.js @@ -0,0 +1,13 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'font', + type: 'component', + props: [], + events: [], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/form.js b/examples/sites/demos/apis/form.js new file mode 100644 index 000000000..56d4cddbf --- /dev/null +++ b/examples/sites/demos/apis/form.js @@ -0,0 +1,666 @@ +export default { + mode: ['pc', 'mobile', 'mobile-first'], + apis: [ + { + name: 'form', + type: 'component', + props: [ + { + name: 'disabled', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否禁用该表单内的所有表单组件,若设置为 true,则表单内组件上的 disabled 属性不再生效', + 'en-US': + 'Whether to disable all components in the form. If this parameter is set to true, the disabled attribute of components in the form does not take effect.' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'form-disabled', + mfDemo: '' + }, + { + name: 'display-only', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否开启仅展示模式', + 'en-US': 'Enable read-only mode through the display only attribute' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'display-only', + mfDemo: '' + }, + { + name: 'form-item', + type: 'Object', + defaultValue: '', + desc: { + 'zh-CN': 'Form 下的 FormItem 组件,请参看 FormItem 的属性配置 Aurora.Widget.Form.FormItem ', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'hide-required-asterisk', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否隐藏必填字段的标签旁边的红色星号,SMB 主题下默认值为true', + 'en-US': + 'Whether to hide the red asterisk next to the label of mandatory fields, The default value for SMB theme is true' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'smb-required', + mfDemo: '' + }, + { + name: 'inline', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '行内布局模式', + 'en-US': 'In-line layout mode' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'form-in-row', + mobileDemo: 'hide-required-asterisk', + mfDemo: '' + }, + { + name: 'inline-message', + type: 'boolean', + defaultValue: '', + desc: { + 'zh-CN': '当 validate-type 设置为 text 时,是否以行内形式展示校验信息(推荐使用 message-type 设置)', + 'en-US': + ' Whether to display the verification information inline form when validate-type is set to text,(It is recommended to use message-type setting)' + }, + mode: ['pc', 'mobile'], + pcDemo: '', + mobileDemo: 'validate' + }, + { + name: 'label-align', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': "当出现必填星号时,标签文本是否对齐,当 label-position 为 'right' 时有效", + 'en-US': 'When a mandatory asterisk appears, is it aligned with the text' + }, + mode: ['pc'], + pcDemo: 'label-align' + }, + { + name: 'label-position', + type: "'right' | 'left' | 'top'", + defaultValue: "'right'", + desc: { + 'zh-CN': '表单中标签的布局位置', + 'en-US': 'Layout position of the label in the form' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'label-position', + mobileDemo: 'label-width', + mfDemo: '' + }, + { + name: 'label-suffix', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '表单中标签后缀', + 'en-US': 'Label suffix in the form' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'form-in-row', + mobileDemo: 'form-label-suffix', + mfDemo: '' + }, + { + name: 'label-width', + type: 'string', + defaultValue: "'80px'", + desc: { + 'zh-CN': '表单中标签占位宽度', + 'en-US': 'Label placeholder width in the form' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'label-position', + mobileDemo: 'label-width', + mfDemo: '' + }, + { + name: 'message-type', + type: "'inline' | 'block'", + defaultValue: '', + desc: { + 'zh-CN': + '当 validate-type 设置为 text 时,配置文本类型错误类型,可配置行内或者块级,不设置则为 absolute 定位', + 'en-US': + 'Configure the text type error type, which can be configured at the inline or block level when validate-type is set to text. The default is absolute positioning' + }, + mode: ['pc'], + pcDemo: 'message-type' + }, + { + name: 'model', + type: '{ [prop: string]: any }', + defaultValue: '', + desc: { + 'zh-CN': '表单数据对象', + 'en-US': 'Form data object' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'form-validation', + mobileDemo: '', + mfDemo: '' + }, + { + name: 'overflow-title', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '标签超长是否显示提示', + 'en-US': 'Does the label display a prompt if it is too long' + }, + mode: ['pc', 'mobile-first'], + pcDemo: 'overflow-title', + mfDemo: '' + }, + { + name: 'popper-options', + typeAnchorName: 'popover#IPopperOption', + type: 'Popover.IPopperOption', + defaultValue: '', + desc: { + 'zh-CN': '校验错误提示配置,透传至 Popover 组件', + 'en-US': 'Verify error prompt configuration and transparently transmit it to Popover component' + }, + mode: ['pc'], + pcDemo: 'popper-options' + }, + { + name: 'rules', + typeAnchorName: 'IFormRules', + type: '{ [prop: string]: IFormRules | IFormRules[] }', + defaultValue: '', + desc: { + 'zh-CN': '表单验证规则', + 'en-US': 'Form validation rule' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'form-validation', + mobileDemo: 'validate', + mfDemo: '' + }, + { + name: 'show-message', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '是否显示校验错误信息', + 'en-US': 'Display verification error information.' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'novalid-tip', + mobileDemo: '', + mfDemo: '' + }, + { + name: 'size', + type: "'medium' | 'small' | 'mini'", + defaultValue: '', + desc: { + 'zh-CN': '表单内组件的尺寸,不设置则为默认尺寸', + 'en-US': 'Controls the size of components in the form' + }, + mode: ['pc'], + pcDemo: 'size' + }, + { + name: 'validate-on-rule-change', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '是否在 rules 属性改变后立即触发一次验证', + 'en-US': 'Whether to trigger a verification immediately after the rules attribute is changed' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'custom-validation-rule', + mobileDemo: '', + mfDemo: '' + }, + { + name: 'validate-position', + typeAnchorName: 'IFormPosition', + type: 'IFormPosition', + defaultValue: "'right'", + desc: { + 'zh-CN': '指定校验提示框显示的位置', + 'en-US': 'Specify the position where the verification dialog box is displayed' + }, + mode: ['pc'], + pcDemo: 'validation-position' + }, + { + name: 'validate-tag', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': 'vue2下面原生html标签支持显示tooltip校验提示信息', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + }, + { + name: 'validate-type', + type: "'tip' | 'text'", + defaultValue: "'tip'", + desc: { + 'zh-CN': '校验类型', + 'en-US': 'Verification type' + }, + mode: ['pc'], + pcDemo: 'validate-type' + } + ], + events: [ + { + name: 'validate', + type: '(prop: string, isValid: boolean, message: string) => void', + defaultValue: '', + desc: { + 'zh-CN': '任一表单项被校验后触发', + 'en-US': 'Triggered after any form item is verified' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'events', + mobileDemo: '', + mfDemo: '' + } + ], + methods: [ + { + name: 'clearValidate', + type: '(prop: string | string[]) => void', + defaultValue: '', + desc: { + 'zh-CN': + '移除表单项的校验结果,可传入待移除的表单项的 prop ,或者 prop 组成的数组,如不传则移除整个表单的校验结果', + 'en-US': + 'The verification result of removing a form item is transferred to the prop attribute of the form item to be removed or an array consisting of prop. If this parameter is not transferred, the verification result of the entire form is removed.' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'form-validate-field', + mobileDemo: 'validate', + mfDemo: '' + }, + { + name: 'resetFields', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '对整个表单进行重置,将所有字段值重置为初始值并移除校验结果', + 'en-US': 'Reset all field values to the initial values and remove the verification result.' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'form-validation', + mobileDemo: 'validate', + mfDemo: '' + }, + { + name: 'validate', + typeAnchorName: 'IFormValidateMethod', + type: 'IFormValidateMethod', + defaultValue: '', + desc: { + 'zh-CN': + '对整个表单进行校验的方法,参数为一个回调函数(该回调函数会在校验结束后被调用,并传入两个参数:1、是否校验成功 2、未通过校验的字段)返回一个 promise', + 'en-US': + 'Method for verifying the entire form. The parameter is a callback function. The callback function will be invoked after the verification is complete and two parameters are transferred: whether the verification is successful and whether the verification fails. If the callback function is not transferred, a promise is returned.' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'form-validation', + mobileDemo: 'validate', + mfDemo: '' + }, + { + name: 'validateField', + typeAnchorName: 'IFormValidateFieldMethod', + type: 'IFormValidateFieldMethod', + defaultValue: '', + desc: { + 'zh-CN': + '对部分表单字段进行校验的方法, 第一个参数为单个 prop 或者 prop 数组,第二个参数是回调函数,每个表单项检验完后会依次调用该回调', + 'en-US': + 'A method for verifying some form fields. The first parameter is a single prop or a prop array, and the second parameter is a callback function. After each form item is verified, the callback will be called in sequence' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'form-validate-field', + mobileDemo: '', + mfDemo: '' + } + ], + slots: [ + { + name: 'default', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '默认插槽,自定义表单内容', + 'en-US': 'Default slot' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'basic-usage', + mobileDemo: '', + mfDemo: '' + }, + { + name: 'label', + type: '', + defaultValue: '', + desc: { + 'zh-CN': '标签文本插槽', + 'en-US': '' + }, + mode: ['mobile-first'], + mfDemo: '' + } + ] + }, + { + name: 'form-item', + type: 'component', + props: [ + { + name: 'error', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '表单项错误文本,设置该值会使表单验证状态变为 error', + 'en-US': 'Form item error text,Setting this value will change the form validation status to error' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'inline-message', + type: 'boolean', + defaultValue: '', + desc: { + 'zh-CN': '是否以行内形式展示校验信息(推荐使用 message-type 设置)', + 'en-US': + 'Whether to display the verification information inline form(It is recommended to use message-type setting) ' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'label', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '标签文本', + 'en-US': 'Label text' + }, + mode: ['pc'], + pcDemo: 'form-validation' + }, + { + name: 'label-width', + type: 'string', + defaultValue: "'80px'", + desc: { + 'zh-CN': '表单域标签的的宽度', + 'en-US': 'Width of the form field label' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'message-type', + type: "'inline' | 'block'", + defaultValue: '', + desc: { + 'zh-CN': '配置文本类型错误类型,可配置行内或者块级,不配置则为 absolute 定位', + 'en-US': + 'Configure the text type error type, which can be configured at the inline or block level. The default is absolute positioning' + }, + mode: ['pc'], + pcDemo: 'message-type' + }, + { + name: 'prop', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '对应表单域 model 字段,如需使用表单校验,该属性是必填的', + 'en-US': + 'Is it mandatory? If not set, it will be automatically generated according to the verification rules' + }, + mode: ['pc'], + pcDemo: 'form-validation' + }, + { + name: 'required', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否必填,如不设置,则会根据校验规则自动生成', + 'en-US': + 'Is it mandatory? If not set, it will be automatically generated according to the verification rules' + }, + mode: ['pc'], + pcDemo: 'form-validation' + }, + { + name: 'rules', + typeAnchorName: 'IFormRules', + type: 'IFormRules', + defaultValue: '', + desc: { + 'zh-CN': '表单项验证规则', + 'en-US': 'Form validation rule' + }, + mode: ['pc'], + pcDemo: 'form-validation' + }, + { + name: 'show-message', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '是否显示校验错误信息', + 'en-US': 'Whether to display verification error information' + }, + mode: ['pc'], + pcDemo: 'novalid-tip' + }, + { + name: 'size', + type: "'medium' | 'small' | 'mini'", + defaultValue: '', + desc: { + 'zh-CN': '用于控制该表单域下组件的尺寸,不设置则为默认尺寸', + 'en-US': 'Controls the size of the component in the form field' + }, + mode: ['pc'], + pcDemo: 'size' + }, + { + name: 'validate-debounce', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否开启校验防抖,在连续输入的情况下,会在最后一次输入结束时才开始校验', + 'en-US': + 'Enable verification anti shake. In the case of continuous input, verification will only begin at the end of the last input' + }, + mode: ['pc'], + pcDemo: 'validate-debounce' + }, + { + name: 'validate-icon', + type: 'Component', + defaultValue: '', + desc: { + 'zh-CN': '校验提示框的图标,类型为组件', + 'en-US': 'Icon for verification prompt box, type is component' + }, + mode: ['pc'], + pcDemo: 'form-validation' + }, + { + name: 'validate-position', + typeAnchorName: 'IFormPosition', + type: 'IFormPosition', + defaultValue: "'top-end'", + desc: { + 'zh-CN': '指定校验提示框显示的位置', + 'en-US': 'Specify the position where the verification dialog box is displayed' + }, + mode: ['pc'], + pcDemo: 'validation-position' + }, + { + name: 'validate-type', + type: "'text' | 'tip'", + defaultValue: "'tip'", + desc: { + 'zh-CN': '校验提示显示类型', + 'en-US': 'Verification prompt display type' + }, + mode: ['pc'], + pcDemo: 'validate-type' + } + ], + events: [], + methods: [ + { + name: 'clearValidate', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '移除该表单项的校验结果', + 'en-US': 'Remove the verification result of the table item.' + }, + mode: ['pc'], + pcDemo: 'form-validation' + }, + { + name: 'resetField', + type: '() => void', + defaultValue: '', + desc: { + 'zh-CN': '对该表单项进行重置,将其值重置为初始值并移除校验结果', + 'en-US': 'Reset the table item to the initial value and remove the verification result.' + }, + mode: ['pc'], + pcDemo: 'form-validate-field' + } + ], + slots: [ + { + name: 'default', + defaultValue: '', + desc: { + 'zh-CN': '默认插槽', + 'en-US': 'Default slot' + }, + mode: ['pc'], + pcDemo: 'size' + }, + { + name: 'label', + defaultValue: '', + desc: { + 'zh-CN': '标签文本的内容', + 'en-US': 'Label text content' + }, + mode: ['pc'], + pcDemo: 'slot-label' + } + ] + } + ], + types: [ + { + name: 'IFormPosition', + type: 'type', + code: ` +type IFormPosition = 'top-start' | 'top' | 'top-end' | 'left-start' | 'left' | 'left-end' | 'right-start' | 'right' | 'right-end' | 'bottom-start' | 'bottom' | 'bottom-end'` + }, + { + name: 'IFormRules', + type: 'interface', + code: ` +// 表单项检验触发时机 +type IFormTrigger = 'change' | 'blur' + +interface IFormRules { + required?: boolean // 是否必填 + message?: number // 校验错误的提示 + // 内置的类型校验 + type?: 'date' | 'dateTime' | 'float' | 'array' | 'string' | 'number' | 'url' | 'time' | 'email' | 'object' | 'boolean' | 'enum' + // 校验触发时机, 默认为 ['change', 'blur'] 两种场景都触发,如果仅在主动调用校验方式时触发,可设置为空数组 []。 + trigger?: IFormTrigger | IFormTrigger[] + // 同步检验函数,调用回调传递错误信息。 + validator?: ( + rule: IFormInnerRule, // from内部处理后的rule + value: any, // 表单model对应的值,根据表单项prop获取 + callback: (e: Error) => void + data: object, // prop和value构造的对象 + options: object // 检验配置,一般不需要用到 + ) => void + // 异步校验函数,resolve则表示校验成功,reject表示校验失败。 + asyncValidator?: ( + rule: IFormInnerRule, + value: any, + callback: (e: Error) => void + data: object, + options: object + ) => Promise是否显示图片切换按钮,该属性默认为false
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'image-full-current' + }, + { + name: 'async-close', + type: 'Boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否开启异步关闭,该属性默认为false
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: '' + }, + { + name: 'close-show', + type: 'Boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否显示关闭按钮,该属性默认为false
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'image-full-current' + }, + { + name: 'image-full-current', + type: 'Boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否全屏显示,该属性默认为false
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'image-full-current' + }, + { + name: 'preview-visible', + type: 'Boolean', + defaultValue: '', + desc: { + 'zh-CN': '设置图片预览显示隐藏
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'image-full-current' + }, + { + name: 'show-index', + type: 'Boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否显示当前图片下标,该属性默认为false
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'slot-index' + }, + { + name: 'start-position', + type: 'Number', + defaultValue: '0', + desc: { + 'zh-CN': '图片预览起始位置索引,该属性默认为0
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'start-position' + }, + { + name: 'tool-show', + type: 'Boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否显示工具栏钮,该属性默认为false
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: '' + }, + { + name: 'url-list', + type: 'Array', + defaultValue: '', + desc: { + 'zh-CN': '配置图片路径
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'image-full-current' + }, + { + name: 'z-index', + type: 'Number', + defaultValue: '2000', + desc: { + 'zh-CN': '设置图片预览的 z-index,该属性默认为2000
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'slot-index' + } + ], + events: [ + { + name: 'change', + defaultValue: '', + desc: { + 'zh-CN': '切换当前图片时触发,{ index:切换时图片索引, url: 切换时图片链接 }
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'events-change-close' + }, + { + name: 'close', + defaultValue: '', + desc: { + 'zh-CN': 'close,{ index: 关闭时图片索引, url: 关闭时图片链接 }
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'events-change-close' + } + ], + methods: [], + slots: [ + { + name: 'index', + defaultValue: '', + desc: { + 'zh-CN': '自定义页码内容
', + 'en-US': 'Click' + }, + mode: ['mobile'], + mobileDemo: 'slot-index' + } + ] + } + ] +} diff --git a/examples/sites/demos/apis/index-bar.js b/examples/sites/demos/apis/index-bar.js new file mode 100644 index 000000000..dfa6a6ca5 --- /dev/null +++ b/examples/sites/demos/apis/index-bar.js @@ -0,0 +1,79 @@ +export default { + mode: ['mobile'], + apis: [ + { + name: 'IndexBar', + type: 'component', + props: [ + { + name: 'indexList', + type: '[]', + defaultValue: '', + desc: { + 'zh-CN': '索引文字列表
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'base' + } + ], + events: [ + { + name: 'change', + type: 'Function(arg1)', + defaultValue: '', + desc: { + 'zh-CN': '\t当前索引改变触发
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'event' + }, + { + name: 'select', + type: 'Function(arg1)', + defaultValue: '', + desc: { + 'zh-CN': '选中新的索引触发
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'event' + } + ], + methods: [], + slots: [ + { + name: 'default', + defaultValue: '', + desc: { + 'zh-CN': '\t自定义内容
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'event' + } + ] + }, + { + name: 'IndexBarAnchor', + type: 'component', + props: [ + { + name: 'index', + type: 'String', + defaultValue: '', + desc: { + 'zh-CN': '索引文字
', + 'en-US': 'display different button' + }, + mode: ['mobile'], + mobileDemo: 'base' + } + ], + events: [], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/infinite-scroll.js b/examples/sites/demos/apis/infinite-scroll.js new file mode 100644 index 000000000..ee98e2aa1 --- /dev/null +++ b/examples/sites/demos/apis/infinite-scroll.js @@ -0,0 +1,70 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'infinite-scroll', + type: 'component', + props: [ + { + name: 'infinite-scroll-delay', + type: 'number', + defaultValue: '200', + desc: { + 'zh-CN': '加载延时,单位为 ms', + 'en-US': 'Loading delay, the unit is millisecond.' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'infinite-scroll-disabled', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否禁用滚动', + 'en-US': 'Whether to disable scrolling. ' + }, + mode: ['pc'], + pcDemo: 'disabled' + }, + { + name: 'infinite-scroll-distance', + type: 'number', + defaultValue: '0', + desc: { + 'zh-CN': '加载触发距离阈值,单位为 px', + 'en-US': 'Threshold of the load triggering distance,the unit is px. ' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'infinite-scroll-immediate', + type: 'boolean', + defaultValue: 'true', + desc: { + 'zh-CN': '是否立即加载,以防初始状态下内容无法撑满容器', + 'en-US': + 'Indicates whether to load the container immediately to prevent the container from being full in the initial state.' + }, + mode: ['pc'], + pcDemo: '' + }, + { + name: 'v-infinite-scroll', + type: 'Function', + defaultValue: '', + desc: { + 'zh-CN': '无限滚动加载指令,指定加载方法', + 'en-US': 'Infinite roll load instruction, specifying the load method.' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + } + ], + events: [], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/input.js b/examples/sites/demos/apis/input.js new file mode 100644 index 000000000..b4eecc802 --- /dev/null +++ b/examples/sites/demos/apis/input.js @@ -0,0 +1,727 @@ +export default { + mode: ['pc', 'mobile', 'mobile-first'], + apis: [ + { + name: 'input', + type: 'component', + props: [ + { + name: 'autocomplete', + type: 'string', + defaultValue: "'off'", + desc: { + 'zh-CN': '原生 autocomplete 属性', + 'en-US': 'Native autocomplete attribute' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: 'native', + mobileDemo: 'native-attributes', + mfDemo: '' + }, + { + name: 'autofocus', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '原生属性,页面加载时,自动获取焦点', + 'en-US': 'Native attribute. The focus is automatically obtained during page loading.' + }, + mode: ['pc', 'mobile', 'mobile-first'], + pcDemo: '', + mobileDemo: 'native-attributes', + mfDemo: '' + }, + { + name: 'autosize', + type: 'boolean | { minRows: number, maxRows: number }', + defaultValue: 'false', + desc: { + 'zh-CN': + '自适应内容高度,只对type="textarea"
有效。可传入对象,如,{ minRows: 2, maxRows: 6 }',
+ 'en-US':
+ 'Adaptive content height. This parameter is valid only for type="textarea"
. Objects can be transferred, for example, {minRows: 2, maxRows: 6}'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'resize',
+ mobileDemo: 'textarea-scalable',
+ mfDemo: ''
+ },
+ {
+ name: 'clearable',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否显示清除按钮,该属性不适用于 type="textarea"
',
+ 'en-US':
+ 'Whether to display the clear button. This attribute is not applicable to type="textarea"
.'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'clearable',
+ mobileDemo: 'clearable',
+ mfDemo: ''
+ },
+ {
+ name: 'cols',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '原生属性,设置宽度,在 type ="textarea" 时有效',
+ 'en-US':
+ 'Native attribute, which is used to set the width. This parameter is valid only when type is "textarea"'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'rows',
+ mobileDemo: 'textarea-rows-cols',
+ mfDemo: ''
+ },
+ {
+ name: 'counter',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否显示字数统计,只在 type = "text" 或 type = "textarea" 时有效',
+ 'en-US':
+ 'Whether to display the word count statistics. This parameter is valid only when type is "text" or type is "textarea"'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'counter',
+ mobileDemo: 'counter',
+ mfDemo: ''
+ },
+ {
+ name: 'custom-class',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置自定义样式',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否禁用',
+ 'en-US': 'Disable'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'native',
+ mobileDemo: 'disabled',
+ mfDemo: ''
+ },
+ {
+ name: 'display-only',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置文本只读态',
+ 'en-US': 'Set the text read-only state'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'display-only',
+ mfDemo: ''
+ },
+ {
+ name: 'display-only-content',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置只读态时的文本内容区,如果没有则会使用 modelVale 的值作为只读文本',
+ 'en-US':
+ "Sets the text content area in the read-only state, if not, modelVale's value is used as the read-only text"
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'display-only',
+ mfDemo: ''
+ },
+ {
+ name: 'form',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '原生属性',
+ 'en-US': 'Native attribute'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'height',
+ type: 'Number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置文本域的最小高度',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'hover-expand',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置文本域鼠标悬浮展开/收起,只对 `type=textarea` 有效,最好搭配 autosize 一起使用',
+ 'en-US':
+ "Set text field mouse hover expansion/collapse, only for 'type=textarea'. It is recommended that this parameter be used together with autosize."
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'resize',
+ mfDemo: ''
+ },
+ {
+ name: 'is-select',
+ type: 'Boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否可下拉选择',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'type-select'
+ },
+ {
+ name: 'label',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '等价于原生 input aria-label 属性',
+ 'en-US': 'Equiphorus input aria-label attribute'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: '',
+ mobileDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'mask',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '启用掩码功能,只在 disabled 和 display-only 状态下生效',
+ 'en-US': 'The mask function takes effect only in the disabled and display-only states'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'mask',
+ mfDemo: ''
+ },
+ {
+ name: 'max',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '原生属性,设置最大值',
+ 'en-US': 'Native attribute, set the maximum value'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'native',
+ mobileDemo: 'native-attributes',
+ mfDemo: ''
+ },
+ {
+ name: 'maxlength',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '原生属性,最大输入长度',
+ 'en-US': 'Native attribute, maximum input length'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'native',
+ mobileDemo: 'counter',
+ mfDemo: ''
+ },
+ {
+ name: 'memory-space',
+ type: 'number',
+ defaultValue: '5',
+ desc: {
+ 'zh-CN': '设置 addMemory 方法中,最大能保存条目的数量',
+ 'en-US': 'Sets the maximum number of entries that can be saved in the addMemory method'
+ },
+ mode: ['pc'],
+ pcDemo: 'method-addMemory'
+ },
+ {
+ name: 'min',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '原生属性,设置最小值',
+ 'en-US': 'Native attribute, which sets the minimum value'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'native',
+ mobileDemo: 'native-attributes',
+ mfDemo: ''
+ },
+ {
+ name: 'minlength',
+ type: 'Number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '原生属性,最小输入长度',
+ 'en-US': 'Native attribute, minimum input length'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'counter'
+ },
+ {
+ name: 'modelValue / v-model',
+ type: 'string | number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置文本的绑定值',
+ 'en-US': 'Sets the binding value of the text'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'name',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '原生 input name 属性',
+ 'en-US': 'Native input name attribute'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: '',
+ mobileDemo: 'native-attributes',
+ mfDemo: ''
+ },
+ {
+ name: 'placeholder',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入框占位文本',
+ 'en-US': 'Enter the place-holder text in the text box'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mobileDemo: 'basic-usage',
+ mfDemo: ''
+ },
+ {
+ name: 'prefix-icon',
+ type: 'Component',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入框头部图标',
+ 'en-US': 'Icon at the head of the input box'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'input-icon',
+ mobileDemo: 'prefix-suffix-icon',
+ mfDemo: ''
+ },
+ {
+ name: 'readonly',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '原生属性,是否只读',
+ 'en-US': 'Native attribute, read-only'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'native',
+ mobileDemo: 'native-attributes',
+ mfDemo: ''
+ },
+ {
+ name: 'resize',
+ type: "'both' | 'horizontal' | 'vertical' | 'none'",
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '控制是否能被用户缩放',
+ 'en-US': 'Whether the user can zoom in or out'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'resize',
+ mfDemo: ''
+ },
+ {
+ name: 'rows',
+ type: 'number',
+ defaultValue: '2',
+ desc: {
+ 'zh-CN': '输入框行数,只对 type="textarea" 有效',
+ 'en-US': 'Number of lines in the input box. This parameter is valid only for type="textarea"'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'rows',
+ mobileDemo: 'textarea-rows-cols',
+ mfDemo: ''
+ },
+ {
+ name: 'select-menu',
+ type: 'Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '下拉选择的选项',
+ 'en-US': 'options of select'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'type-select'
+ },
+ {
+ name: 'show-password',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否显示切换密码图标',
+ 'en-US': 'Whether to display the switchover password icon'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'show-password',
+ mobileDemo: 'show-password',
+ mfDemo: ''
+ },
+ {
+ name: 'show-word-limit',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否显示输入字数统计,只在 type = "text" 或 type = "textarea" 时有效',
+ 'en-US':
+ 'Whether to display the number of input words. This parameter is valid only when type is "text" or type is "textarea"'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'show-word-limit',
+ mobileDemo: 'counter',
+ mfDemo: ''
+ },
+ {
+ name: 'size',
+ type: "'medium' | 'small' | 'mini'",
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入框尺寸,只在 type!="textarea" 时有效',
+ 'en-US': 'Size of the text box. This parameter is valid only when type!="textarea". '
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'size',
+ mfDemo: ''
+ },
+ {
+ name: 'step',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '原生属性,设置输入字段的合法数字间隔',
+ 'en-US': 'Native attribute, which is used to set the valid digit interval of the input field.'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'native',
+ mobileDemo: 'native-attributes',
+ mfDemo: ''
+ },
+ {
+ name: 'suffix-icon',
+ type: 'Component',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入框尾部图标',
+ 'en-US': 'Input box end icon'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'input-icon',
+ mobileDemo: 'prefix-suffix-icon',
+ mfDemo: ''
+ },
+ {
+ name: 'tabindex',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '原生属性,输入框的 tabindex',
+ 'en-US': 'Native attribute, tabindex in the text box'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'tips',
+ type: 'String | Slot',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '提示信息',
+ 'en-US': 'tips under input'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'slots'
+ },
+ {
+ name: 'title',
+ type: 'String | Slot',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义标题',
+ 'en-US': 'custom title'
+ },
+ mode: ['mobile'],
+ mobileDemo: ''
+ },
+ {
+ name: 'type',
+ type: "'text' | 'textarea' | 'password' | InputHTMLAttributes.type",
+ defaultValue: "'text'",
+ desc: {
+ 'zh-CN': '设置 input 框的 type 属性,默认为 "text",可选值 "text","textarea" 和其他 原生 input 的 type 值',
+ 'en-US':
+ 'Set the type attribute of the input box. The default value is "text". The options are "text", "textarea", and type values of other native inputs.'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'type',
+ mobileDemo: 'type',
+ mfDemo: ''
+ },
+ {
+ name: 'v-model',
+ type: 'String / Number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置文本显示的默认值',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'v-model / modelValue',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '绑定值',
+ 'en-US': 'input value'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'basic-usage'
+ },
+ {
+ name: 'validate-event',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '输入时是否触发表单的校验',
+ 'en-US': 'Trigger form verification upon input'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'validate-event',
+ mobileDemo: 'validate-event',
+ mfDemo: ''
+ },
+ {
+ name: 'width',
+ type: 'Number | String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '宽度,取值为数字或元素 width 属性有效值,如果是数字则以 px 为单位',
+ 'en-US':
+ 'width, accepts a numerical value or a valid value for the width property, and if it is a number, it is measured in pixels.'
+ },
+ mode: ['mobile'],
+ mobileDemo: ''
+ }
+ ],
+ events: [
+ {
+ name: 'blur',
+ type: '(event: FocusEvent) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在 Input 失去焦点时触发',
+ 'en-US': 'Trigger when Input loses focus'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'event',
+ mobileDemo: 'events',
+ mfDemo: ''
+ },
+ {
+ name: 'change',
+ type: '(value: string | number) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在 Input 值改变时触发',
+ 'en-US': 'triggered when the input value changes.'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'event',
+ mobileDemo: 'events',
+ mfDemo: ''
+ },
+ {
+ name: 'clear',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在点击由 clearable 属性生成的清空按钮时触发',
+ 'en-US': 'Trigger when the clear button generated by the clearable property is clicked'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'event',
+ mobileDemo: 'events',
+ mfDemo: ''
+ },
+ {
+ name: 'focus',
+ type: '(event: FocusEvent) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在 Input 获得焦点时触发',
+ 'en-US': 'Trigger when Input obtains focus'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'event',
+ mobileDemo: 'events',
+ mfDemo: ''
+ },
+ {
+ name: 'input',
+ type: '(event: InputEvent) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入值时触发事件',
+ 'en-US': 'An event is triggered when a value is entered.'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'event',
+ mobileDemo: 'events',
+ mfDemo: ''
+ }
+ ],
+ methods: [
+ {
+ name: 'addMemory',
+ type: '(value: string) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '历史输入内容的记忆方法',
+ 'en-US': 'Memorization method of historical input content'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'method-addMemory',
+ mfDemo: ''
+ },
+ {
+ name: 'blur',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '使 input 失去焦点',
+ 'en-US': 'The input loses focus.'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'methods',
+ mobileDemo: 'methods',
+ mfDemo: ''
+ },
+ {
+ name: 'focus',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '使 input 获取焦点',
+ 'en-US': 'To enable the input to obtain the focus'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'methods',
+ mobileDemo: 'methods',
+ mfDemo: ''
+ },
+ {
+ name: 'select',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '选中 input 中的文字',
+ 'en-US': 'Select the text in input.'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'methods',
+ mobileDemo: 'methods',
+ mfDemo: ''
+ }
+ ],
+ slots: [
+ {
+ name: 'append',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入框后置内容,只对 type="text" 有效',
+ 'en-US': 'Content at the end of the text box. This field is valid only for type="text"'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'slot',
+ mobileDemo: 'slots',
+ mfDemo: ''
+ },
+ {
+ name: 'prefix',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入框头部内容,只对 type="text" 有效',
+ 'en-US': 'Content in the header of the text box, which is valid only for type="text"'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'slot',
+ mobileDemo: 'slots',
+ mfDemo: ''
+ },
+ {
+ name: 'prepend',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入框前置内容,只对 type="text" 有效',
+ 'en-US': 'Content before the text box, which is valid only for type="text"'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'slot',
+ mobileDemo: 'slots',
+ mfDemo: ''
+ },
+ {
+ name: 'suffix',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入框尾部内容,只对 type="text" 有效',
+ 'en-US': 'The content at the end of the text box is valid only for type="text"'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'slot',
+ mobileDemo: 'slots',
+ mfDemo: ''
+ },
+ {
+ name: 'tips',
+ desc: {
+ 'zh-CN': '提示信息插槽',
+ 'en-US': 'tips slot'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'slots'
+ },
+ {
+ name: 'title',
+ desc: {
+ 'zh-CN': '标题插槽',
+ 'en-US': 'title slot'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'slots'
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/ip-address.js b/examples/sites/demos/apis/ip-address.js
new file mode 100644
index 000000000..228606df5
--- /dev/null
+++ b/examples/sites/demos/apis/ip-address.js
@@ -0,0 +1,147 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'ip-address',
+ type: 'component',
+ props: [
+ {
+ name: 'delimiter',
+ type: 'Component',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置IP段之间的分隔符,默认图标为IconDotIpv4',
+ 'en-US': 'Set the separator between IP segments, default icon is icon-dot-ipv4'
+ },
+ mode: ['pc'],
+ pcDemo: 'delimiter'
+ },
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '设置文本的禁用属性',
+ 'en-US': 'Set the disabled attribute of the text'
+ },
+ mode: ['pc'],
+ pcDemo: 'disabled'
+ },
+ {
+ name: 'readonly',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '设置文本的只读属性',
+ 'en-US': 'Set the read-only attribute of the text'
+ },
+ mode: ['pc'],
+ pcDemo: 'readonly'
+ },
+ {
+ name: 'size',
+ type: "'medium' | 'small' | 'mini'",
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '地址输入框大小',
+ 'en-US': 'Address Input Box Size'
+ },
+ mode: ['pc'],
+ pcDemo: 'size'
+ },
+ {
+ name: 'type',
+ type: "'IPv4' | 'IPv6'",
+ defaultValue: "'IPv4'",
+ desc: {
+ 'zh-CN': '设置 ip 地址输入框的 类型',
+ 'en-US': 'Sets the type attribute in the IpAddress box'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'v-model',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置地址输入框的绑定值',
+ 'en-US': 'Set the binding value of the address input box'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ }
+ ],
+ events: [
+ {
+ name: 'blur',
+ type: '(value: string, index: number) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '文本框失去焦点时触发事件',
+ 'en-US': 'The event is triggered when the text box loses the focus'
+ },
+ mode: ['pc'],
+ pcDemo: 'blur'
+ },
+ {
+ name: 'change',
+ type: '(value: string) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '文本框内容改变后事件',
+ 'en-US': 'Event after changing the content of the text box'
+ },
+ mode: ['pc'],
+ pcDemo: 'change'
+ },
+ {
+ name: 'focus',
+ type: '(value: string, index: number) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '文本框获取焦点时触发事件',
+ 'en-US': 'This event is triggered when a text box obtains the focus'
+ },
+ mode: ['pc'],
+ pcDemo: 'focus'
+ },
+ {
+ name: 'input',
+ type: '(event: InputEvent) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '文本框内容输入时触发事件',
+ 'en-US': 'Trigger event when entering text box content'
+ },
+ mode: ['pc'],
+ pcDemo: 'input'
+ },
+ {
+ name: 'select',
+ type: '(value: string, index: number) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '文本框内容选中时触发事件',
+ 'en-US': 'Trigger event when text box content is selected'
+ },
+ mode: ['pc'],
+ pcDemo: 'select'
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '默认插槽,自定义IP段之间的分隔符',
+ 'en-US': 'Separator between IP address segments'
+ },
+ mode: ['pc'],
+ pcDemo: 'delimiter'
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/label.js b/examples/sites/demos/apis/label.js
new file mode 100644
index 000000000..d96f8905b
--- /dev/null
+++ b/examples/sites/demos/apis/label.js
@@ -0,0 +1,116 @@
+export default {
+ mode: ['mobile'],
+ apis: [
+ {
+ name: 'Label',
+ type: 'component',
+ props: [
+ {
+ mode: []
+ },
+ {
+ name: 'decimal',
+ type: 'number',
+ defaultValue: '2',
+ desc: {
+ 'zh-CN': '小数点的位数
', + 'en-US': 'decimal' + }, + mode: ['mobile'], + mobileDemo: 'decimal' + }, + { + name: 'ellipsis', + type: 'number', + defaultValue: '', + desc: { + 'zh-CN': '支持超出省略号显示的行数
', + 'en-US': 'ellipsis' + }, + mode: ['mobile'], + mobileDemo: 'ellipsis' + }, + { + name: 'is-required', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否添加*号
', + 'en-US': 'is required' + }, + mode: ['mobile'], + mobileDemo: 'required' + }, + { + name: 'label', + type: 'string', + defaultValue: '', + desc: { + 'zh-CN': '文本
', + 'en-US': 'text' + }, + mode: ['mobile'], + mobileDemo: 'base' + }, + { + name: 'limit', + type: 'number', + defaultValue: '', + desc: { + 'zh-CN': '限制文本的字数
', + 'en-US': 'text limit' + }, + mode: ['mobile'], + mobileDemo: 'limit' + }, + { + name: 'position', + type: 'string', + defaultValue: 'left', + desc: { + 'zh-CN': '整行显示时的位置:left,center,right
', + 'en-US': 'position of whole line dispaly' + }, + mode: ['mobile'], + mobileDemo: 'position' + }, + { + name: 'size', + type: 'string', + defaultValue: 'normal', + desc: { + 'zh-CN': '文本大小:large,normal,small,mini
', + 'en-US': 'text size' + }, + mode: ['mobile'], + mobileDemo: 'size' + }, + { + name: 'type', + type: 'string', + defaultValue: 'base', + desc: { + 'zh-CN': '类型 \n base, number
', + 'en-US': 'type' + }, + mode: ['mobile'], + mobileDemo: 'type' + }, + { + name: 'wholeline', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否整行显示
', + 'en-US': 'whole line display' + }, + mode: ['mobile'], + mobileDemo: 'wholeline' + } + ], + events: [], + methods: [], + slots: [] + } + ] +} diff --git a/examples/sites/demos/apis/layout.js b/examples/sites/demos/apis/layout.js new file mode 100644 index 000000000..3ead54a5c --- /dev/null +++ b/examples/sites/demos/apis/layout.js @@ -0,0 +1,244 @@ +export default { + mode: ['pc'], + apis: [ + { + name: 'layout', + type: 'component', + props: [ + { + name: 'cols', + type: 'number', + defaultValue: '12', + desc: { + 'zh-CN': '总栅格数;该属性的可选值为 12 /24 ', + 'en-US': 'Total number of grids; The optional value for this attribute is 12/24' + }, + mode: ['pc'], + pcDemo: 'basic-usage' + }, + { + name: 'tag', + type: 'string', + defaultValue: '"div"', + desc: { + 'zh-CN': '定义 Layout 元素的渲染后的标签,默认为div', + 'en-US': 'Defines the rendered tag of a Layout element, which defaults to div' + }, + mode: ['pc'], + pcDemo: 'tag' + } + ], + events: [], + methods: [], + slots: [] + }, + { + name: 'row', + type: 'component', + props: [ + { + name: 'align', + type: 'string', + defaultValue: '"top"', + desc: { + 'zh-CN': "子项的副轴对齐方向,可取值:'top', 'middle', 'bottom'", + 'en-US': "Alignment of minor axes for child items; values: 'top', 'middle', 'bottom'" + }, + mode: ['pc'], + pcDemo: 'alignment' + }, + { + name: 'flex', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '是否为flex容器', + 'en-US': 'Whether it is a flex container' + }, + mode: ['pc'], + pcDemo: 'alignment' + }, + { + name: 'gutter', + type: 'number', + defaultValue: '0', + desc: { + 'zh-CN': '子项的间隔的像素', + 'en-US': 'The spacing of the child items in pixels' + }, + mode: ['pc'], + pcDemo: 'gutter' + }, + { + name: 'justify', + type: 'string', + defaultValue: '"start"', + desc: { + 'zh-CN': "子项的主轴对齐方向,可取值:'start', 'center', 'end', 'space-between', 'space-around'", + 'en-US': + "Main axis alignment direction for child items; values: 'start', 'center', 'end', 'space-between', 'space-around'" + }, + mode: ['pc'], + pcDemo: 'alignment' + }, + { + name: 'noSpace', + type: 'boolean', + defaultValue: 'false', + desc: { + 'zh-CN': '子项没有间隔,相当于强制gutter=0的情况', + 'en-US': 'Child entries have no spacing, equivalent to forcing gutter=0' + }, + mode: ['pc'], + pcDemo: 'gutter' + }, + { + name: 'order', + type: 'string', + defaultValue: '"asc" | "des"', + desc: { + 'zh-CN': '子项的排序方式。 不设置时,保留子项在模板中的顺序。', + 'en-US': + "Ordering of the child items; values: 'asc', 'des'. When not set, the order of the child items in the template is preserved." + }, + mode: ['pc'], + pcDemo: 'order' + }, + { + name: 'tag', + type: 'string', + defaultValue: '"div"', + desc: { + 'zh-CN': '定义 Row 元素的渲染后的标签,默认为div', + 'en-US': 'Defines the rendered tag of a Row element, which defaults to div' + }, + mode: ['pc'], + pcDemo: 'tag' + } + ], + events: [], + methods: [], + slots: [] + }, + { + name: 'col', + type: 'component', + props: [ + { + name: 'lg', + type: 'number', + defaultValue: '', + desc: { + 'zh-CN': '在响应式宽度 < 1920px 时,该列占用的栅格数',
+ 'en-US': 'The number of grids occupied by the column at the response width < 1920px '
+ },
+ mode: ['pc'],
+ pcDemo: 'responsive-layout'
+ },
+ {
+ name: 'md',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在响应式宽度 < 1200px 时,该列占用的栅格数',
+ 'en-US': 'The number of grids occupied by the column at the response width < 1200px '
+ },
+ mode: ['pc'],
+ pcDemo: 'responsive-layout'
+ },
+ {
+ name: 'move',
+ type: 'number',
+ defaultValue: '0',
+ desc: {
+ 'zh-CN': '子项的右偏移量,是通过 left 属性实现偏移,建议使用 offset 代替',
+ 'en-US':
+ 'The right offset of the child item is offset via the left property; it is recommended to use offset instead'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'no',
+ type: 'number',
+ defaultValue: '0',
+ desc: {
+ 'zh-CN': '子项排序编号',
+ 'en-US': 'Subitems are sorted by number'
+ },
+ mode: ['pc'],
+ pcDemo: 'order'
+ },
+ {
+ name: 'offset',
+ type: 'number',
+ defaultValue: '0',
+ desc: {
+ 'zh-CN': '子项的向右偏移量,是通过 margin-left 属性实现偏移',
+ 'en-US': 'The offset to the right of the child item is achieved using the margin-left property'
+ },
+ mode: ['pc'],
+ pcDemo: 'offset'
+ },
+ {
+ name: 'sm',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在响应式宽度 < 992px 时,该列占用的栅格数',
+ 'en-US': 'The number of grids occupied by the column at the response width < 992px '
+ },
+ mode: ['pc'],
+ pcDemo: 'responsive-layout'
+ },
+ {
+ name: 'span',
+ type: 'number',
+ defaultValue: '12',
+ desc: {
+ 'zh-CN': '子项占据的列数',
+ 'en-US': 'Number of columns occupied by the child'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'tag',
+ type: 'string',
+ defaultValue: '"div"',
+ desc: {
+ 'zh-CN': '定义 Col 元素的渲染后的标签,默认为div',
+ 'en-US': 'Defines the rendered tag of a Col element, which defaults to div'
+ },
+ mode: ['pc'],
+ pcDemo: 'tag'
+ },
+ {
+ name: 'xl',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在响应式宽度 >= 1920px 时,该列占用的栅格数',
+ 'en-US': 'The number of grids occupied by the column at the response width >= 1920px '
+ },
+ mode: ['pc'],
+ pcDemo: 'responsive-layout'
+ },
+ {
+ name: 'xs',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在响应式宽度 < 768px 时,该列占用的栅格数',
+ 'en-US': 'The number of grids occupied by the column at the response width < 768px '
+ },
+ mode: ['pc'],
+ pcDemo: 'responsive-layout'
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: []
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/link-menu.js b/examples/sites/demos/apis/link-menu.js
new file mode 100644
index 000000000..1e3aefa2c
--- /dev/null
+++ b/examples/sites/demos/apis/link-menu.js
@@ -0,0 +1,158 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'link-menu',
+ type: 'component',
+ props: [
+ {
+ name: 'data',
+ type: 'Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置收藏夹菜单的数据',
+ 'en-US': 'Set the data of the favorites menu'
+ },
+ mode: ['pc'],
+ pcDemo: 'data-resource1'
+ },
+ {
+ name: 'default-expand-all',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置打开菜单弹窗时默认是否展开所有节点,默认为 true',
+ 'en-US':
+ 'Whether to expand all nodes by default when a menu pop-up window is opened. The default value is true'
+ },
+ mode: ['pc'],
+ pcDemo: 'menu-items'
+ },
+ {
+ name: 'ellipsis',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '菜单内容超长时省略显示,默认为 true',
+ 'en-US': 'Omitted if the menu content is too long. The default value is true'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-icon1'
+ },
+ {
+ name: 'get-menu-data-sync',
+ type: 'Function',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义菜单数据服务,直接返回数据',
+ 'en-US': 'User-defined menu data service. Data is directly returned'
+ },
+ mode: ['pc'],
+ pcDemo: 'get-menu-data-sync'
+ },
+ {
+ name: 'icon',
+ type: 'object',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义节点展开折叠的图标',
+ 'en-US': 'Customize the icon for expanding and collapsing a node'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-icon'
+ },
+ {
+ name: 'keep-selected-nodes',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '树节点勾选内容后,点击取消按钮,再次打开弹窗是否保留取消前勾选的内容的状态,默认为 true',
+ 'en-US':
+ 'Whether to retain the status of the selected content after selecting content in the tree node, clicking Cancel, and opening the dialog box again. The default value is true'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'max-item',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置可收藏的栏目的最大数量',
+ 'en-US': 'Set the maximum number of columns that can be added to favorites'
+ },
+ mode: ['pc'],
+ pcDemo: 'menu-items'
+ },
+ {
+ name: 'search-icon',
+ type: 'object',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义搜索图标',
+ 'en-US': 'Customize the search icon'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-icon'
+ },
+ {
+ name: 'title',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置收藏夹菜单的标题,默认为空',
+ 'en-US': 'Set the title of the favorites menu. The default value is null'
+ },
+ mode: ['pc'],
+ pcDemo: 'data-resource'
+ },
+ {
+ name: 'wrap',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '菜单内容超长时换行显示,默认为 false',
+ 'en-US': 'The menu content is displayed in a new line when it is too long. The default value is false'
+ },
+ mode: ['pc'],
+ pcDemo: 'data-resource'
+ }
+ ],
+ events: [],
+ methods: [
+ {
+ name: 'hideDialog',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '关闭菜单弹窗',
+ 'en-US': 'Close the menu pop-up window'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-foot'
+ },
+ {
+ name: 'sureNodevalue',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '获取选中的菜单节点并关闭菜单弹窗,同时展示选中的菜单',
+ 'en-US': 'Obtains the selected menu node, closes the menu pop-up window, and displays the selected menu'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-foot'
+ }
+ ],
+ slots: [
+ {
+ name: 'foot',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '菜单弹窗底部插槽',
+ 'en-US': 'Slot at the bottom of the menu pop-up window'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-foot'
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/link.js b/examples/sites/demos/apis/link.js
new file mode 100644
index 000000000..e18d27206
--- /dev/null
+++ b/examples/sites/demos/apis/link.js
@@ -0,0 +1,101 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'link',
+ type: 'component',
+ props: [
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否禁用状态',
+ 'en-US': 'Is disabled'
+ },
+ mode: ['pc'],
+ pcDemo: 'dynamic-disable'
+ },
+ {
+ name: 'href',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '原生 href 属性',
+ 'en-US': 'Native href attribute'
+ },
+ mode: ['pc'],
+ pcDemo: 'config-href'
+ },
+ {
+ name: 'icon',
+ type: 'Component',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '图标组件',
+ 'en-US': 'Icon component'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-icon'
+ },
+ {
+ name: 'type',
+ type: "'primary' | 'success' | 'warning' | 'danger' | 'info'",
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '文本链接类型',
+ 'en-US': 'Text link type'
+ },
+ mode: ['pc'],
+ pcDemo: 'link-style'
+ },
+ {
+ name: 'underline',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否下划线',
+ 'en-US': 'Whether has Underline'
+ },
+ mode: ['pc'],
+ pcDemo: 'focus-no-underline'
+ },
+ {
+ name: 'value',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '显示内容',
+ 'en-US': 'Display value'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '默认插槽',
+ 'en-US': 'Default slot'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-icon'
+ },
+ {
+ name: 'icon',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '图标',
+ 'en-US': 'Icon'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-icon'
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/list.js b/examples/sites/demos/apis/list.js
new file mode 100644
index 000000000..cc935725a
--- /dev/null
+++ b/examples/sites/demos/apis/list.js
@@ -0,0 +1,80 @@
+export default {
+ mode: ['mobile'],
+ apis: [
+ {
+ name: 'List',
+ type: 'component',
+ props: [
+ {
+ name: 'content',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置主文本
',
+ 'en-US': 'Is fixed top'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'double-line'
+ },
+ {
+ mode: []
+ },
+ {
+ name: 'sub-text',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置次文本
',
+ 'en-US': 'Is show right arrow'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'single-line'
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义主文本内容
',
+ 'en-US': 'Is show right arrow'
+ },
+ mode: ['mobile'],
+ mobileDemo: ''
+ },
+ {
+ name: 'description',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义描述内容
',
+ 'en-US': 'Is show right arrow'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'slots'
+ },
+ {
+ name: 'prefix',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义头部内容
',
+ 'en-US': 'Is show right arrow'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'slots'
+ },
+ {
+ name: 'suffix',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义尾部内容
',
+ 'en-US': 'Is show right arrow'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'slots'
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/loading.js b/examples/sites/demos/apis/loading.js
new file mode 100644
index 000000000..2b4816cc1
--- /dev/null
+++ b/examples/sites/demos/apis/loading.js
@@ -0,0 +1,157 @@
+export default {
+ mode: ['pc', 'mobile', 'mobile-first'],
+ apis: [
+ {
+ name: 'loading',
+ type: 'component',
+ props: [
+ {
+ name: 'background',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '遮罩背景色',
+ 'en-US': 'Mask background color'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'background',
+ mfDemo: ''
+ },
+ {
+ name: 'body',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '遮罩层是否在body上,同 v-loading 指令中的 body 修饰符',
+ 'en-US': 'The same as the body modifier in the v-loading instruction'
+ },
+ mode: ['pc', 'mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'customClass',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': 'Loading 的自定义类名',
+ 'en-US': 'User-defined loading class name'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'custom-class',
+ mfDemo: ''
+ },
+ {
+ name: 'fullscreen',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '属性为 true 显示全屏,同 v-loading 指令中的 fullscreen 修饰符',
+ 'en-US': 'Set true to display the full screen. Same as the fullscreen modifier in the v-loading instruction'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'fullscreen',
+ mfDemo: ''
+ },
+ {
+ name: 'lock',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '全屏时是否锁定滚动,同 v-loading 指令中的 lock 修饰符',
+ 'en-US': 'The same as the lock modifier in the v-loading instruction'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'fullscreen',
+ mfDemo: ''
+ },
+ {
+ name: 'size',
+ type: "'medium' | 'small' | 'large'",
+ defaultValue: "'small'",
+ desc: {
+ 'zh-CN': '加载图标尺寸',
+ 'en-US': 'Load icon size'
+ },
+ mode: ['pc'],
+ pcDemo: 'size'
+ },
+ {
+ name: 'spinner',
+ type: 'Component',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义加载图标',
+ 'en-US': 'Customized loading icon class name'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'spinner',
+ mfDemo: ''
+ },
+ {
+ name: 'target',
+ type: 'HTMLElement | string',
+ defaultValue: 'document.body',
+ desc: {
+ 'zh-CN':
+ 'Loading 需要覆盖的 DOM 节点。可传入一个 DOM 对象或字符串;若传入字符串,则会将其作为参数传入 document.querySelector 以获取到对应 DOM 节点',
+ 'en-US':
+ 'Loading the DOM node to be overwritten. A DOM object or character string can be transferred. If a character string is transferred, it is transferred to document.querySelector as a parameter to obtain the corresponding DOM node.'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mobileDemo: 'type',
+ mfDemo: ''
+ },
+ {
+ name: 'text',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '显示在加载图标下方的加载文案',
+ 'en-US': 'Load copy displayed below the load icon'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'loading-tip-text',
+ mfDemo: ''
+ },
+ {
+ name: 'tiny_mode',
+ type: 'string',
+ defaultValue: 'pc',
+ desc: {
+ 'zh-CN': '通配置项pc,mobile表示不同设备
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'type'
+ },
+ {
+ name: 'type',
+ type: 'string',
+ defaultValue: 'primary',
+ desc: {
+ 'zh-CN': '通过type设置不同的加载样式
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'type'
+ }
+ ],
+ events: [],
+ methods: [
+ {
+ name: 'closeLoading',
+ type: 'Function',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '关闭Loading
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'type'
+ }
+ ],
+ slots: []
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/locales.js b/examples/sites/demos/apis/locales.js
new file mode 100644
index 000000000..bfde66615
--- /dev/null
+++ b/examples/sites/demos/apis/locales.js
@@ -0,0 +1,96 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'locales',
+ type: 'component',
+ props: [
+ {
+ name: 'change-lang',
+ type: 'Function',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '切换语言',
+ 'en-US': 'Switch Language'
+ },
+ mode: ['pc'],
+ pcDemo: 'change-lang'
+ },
+ {
+ name: 'getChangeLocaleUrl',
+ type: 'Function',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义更新语言服务接口,未使用框架服务并且未配置 change-lang 时必填',
+ 'en-US':
+ 'Customized language update service interface. This parameter is mandatory when the framework service is not used and change-lang is not configured.'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-service'
+ },
+ {
+ name: 'getCurrentLocale',
+ type: 'Function',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义获取当前语种接口,未使用框架服务时必填',
+ 'en-US':
+ 'Customized interface for obtaining the current language. This parameter is mandatory when the framework service is not used.'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-service'
+ },
+ {
+ name: 'getLocale',
+ type: 'Function',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义获取系统语言列表接口,未使用框架服务时必填',
+ 'en-US':
+ 'User-defined interface for obtaining the system language list. This parameter is mandatory when the framework service is not used.'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-service'
+ },
+ {
+ name: 'local',
+ type: 'boolean',
+ defaultValue: '该属性的默认值为 false',
+ desc: {
+ 'zh-CN': '是否本地',
+ 'en-US': 'Local or not'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'popper-append-to-body',
+ type: 'boolean',
+ defaultValue: '该属性的默认值为 true',
+ desc: {
+ 'zh-CN':
+ '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)',
+ 'en-US':
+ 'Indicates whether to insert the pop-up box to the body element. If a fault occurs in locating the fault in the dialog box that is displayed, you can set this attribute to false (for details, see the select component).'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'popper-class',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '为 popper 添加类名(可参考 popover 组件)',
+ 'en-US': 'Add a class name for the popper. For details, see the popover component.'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: []
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/logon-user.js b/examples/sites/demos/apis/logon-user.js
new file mode 100644
index 000000000..9a3ab1dbe
--- /dev/null
+++ b/examples/sites/demos/apis/logon-user.js
@@ -0,0 +1,25 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'logon-user',
+ type: 'component',
+ props: [
+ {
+ name: 'getUserInfo',
+ type: 'Function',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '配置查询系统当前用户接口',
+ 'en-US': 'Configure the interface for querying current system users.'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-service'
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: []
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/logout.js b/examples/sites/demos/apis/logout.js
new file mode 100644
index 000000000..60e7be235
--- /dev/null
+++ b/examples/sites/demos/apis/logout.js
@@ -0,0 +1,91 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'logout',
+ type: 'component',
+ props: [
+ {
+ name: 'before-logout',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '注销前的回调函数',
+ 'en-US': 'Callback function before deregistration'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'get-logout-url',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义获取注销服务接口',
+ 'en-US': 'User-defined interface for obtaining the deregistration service'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'is-guest-user',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义是否访客用户',
+ 'en-US': 'Customizing whether a user is a guest user'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'is-local',
+ type: 'boolean',
+ defaultValue: 'service.setting.local',
+ desc: {
+ 'zh-CN': '是否本地注销',
+ 'en-US': 'Indicates whether to deregister locally. The default value is service.setting.local'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'is-mock',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否开启 mock 模拟服务,默认值为 false',
+ 'en-US': 'Indicates whether to enable the mock service. The default value is false'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'redirect-url',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义配置注销后跳转地址',
+ 'en-US': 'User-defined redirection address after deregistration'
+ },
+ mode: ['pc'],
+ pcDemo: 'redirecturl'
+ },
+ {
+ name: 'show-login',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义登录方法',
+ 'en-US': 'Custom Login Method'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: []
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/mask.js b/examples/sites/demos/apis/mask.js
new file mode 100644
index 000000000..8c76c5815
--- /dev/null
+++ b/examples/sites/demos/apis/mask.js
@@ -0,0 +1,67 @@
+export default {
+ mode: ['mobile'],
+ apis: [
+ {
+ name: 'Mask',
+ type: 'component',
+ props: [
+ {
+ name: 'cancelTouch',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否禁用touch事件,设为 true
后点击遮罩层不会关闭',
+ 'en-US': "whether to disable touch events, and mask wouldn't close when it was set true
"
+ },
+ mode: ['mobile'],
+ mobileDemo: 'cancel-touch'
+ },
+ {
+ name: 'visible',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否展示遮罩层',
+ 'en-US': 'whether to show mask layer'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'base'
+ },
+ {
+ name: 'z-index',
+ type: 'number',
+ defaultValue: '99',
+ desc: {
+ 'zh-CN': '层叠数值',
+ 'en-US': 'z-index property'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'z-index'
+ }
+ ],
+ events: [
+ {
+ name: 'click',
+ desc: {
+ 'zh-CN': '点击遮罩层触发',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'basic-usage'
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ desc: {
+ 'zh-CN': '默认插槽',
+ 'en-US': 'Default slot'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'slot-default'
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/menu.js b/examples/sites/demos/apis/menu.js
new file mode 100644
index 000000000..e290a0eae
--- /dev/null
+++ b/examples/sites/demos/apis/menu.js
@@ -0,0 +1,137 @@
+export default {
+ mode: ['mobile-first'],
+ apis: [
+ {
+ name: 'menu',
+ type: 'component',
+ props: [
+ {
+ name: 'actived-keys',
+ type: 'Number / String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '默认选中项',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'data',
+ type: 'Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '数据源',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'empty-text',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义空文本',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'expand-all',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '默认全部展开',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'expanded-keys',
+ type: 'Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '默认展开项',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'only-check-children',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '只能选中子级,父子不关联',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'search-icon',
+ type: 'Object',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '搜索图标',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'show-filter',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '显示搜索框',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ events: [
+ {
+ name: 'current-change',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '选中菜单改变事件',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'node-click',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '菜单点击事件',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'empty',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '空数据插槽',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/message.js b/examples/sites/demos/apis/message.js
new file mode 100644
index 000000000..ac3eb4410
--- /dev/null
+++ b/examples/sites/demos/apis/message.js
@@ -0,0 +1,69 @@
+export default {
+ mode: ['mobile-first'],
+ apis: [
+ {
+ name: 'message',
+ type: 'component',
+ props: [
+ {
+ name: 'duration',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置提示信息停留时间',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'id',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置唯一的 id 防止重复提示,只对 type=message 有效',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'message',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置提示信息',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'show-close',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '控制弹窗是否显示关闭图标',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'status',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置消息状态,可选值有 info | success | warning | error',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: []
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/milestone.js b/examples/sites/demos/apis/milestone.js
new file mode 100644
index 000000000..19b1a5214
--- /dev/null
+++ b/examples/sites/demos/apis/milestone.js
@@ -0,0 +1,302 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'milestone',
+ type: 'component',
+ props: [
+ {
+ name: 'completed-field',
+ type: 'string',
+ defaultValue: "'completed'",
+ desc: {
+ 'zh-CN': '设置节点完成状态对应的键值',
+ 'en-US': 'Set the key values corresponding to the node completion status'
+ },
+ mode: ['pc'],
+ pcDemo: 'data-field-mapping'
+ },
+ {
+ name: 'data',
+ typeAnchorName: 'ICustomData',
+ type: 'ICustomData | ICustomData[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置步骤条的数据,可自定义键值映射',
+ 'en-US': 'Set the step bar data, Customizable key value mapping'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'flag-before',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '设置旗子的数据是取自前面还是后面的节点,默认取后面节点上的数据',
+ 'en-US':
+ 'Set whether the flag data is taken from the preceding or following nodes, and default to taking data from the following nodes'
+ },
+ mode: ['pc'],
+ pcDemo: 'flag-before'
+ },
+ {
+ name: 'flag-content-field',
+ type: 'string',
+ defaultValue: "'content'",
+ desc: {
+ 'zh-CN': '设置旗子内容描述部分对应的键名',
+ 'en-US': 'Set the key name corresponding to the flag content description section'
+ },
+ mode: ['pc'],
+ pcDemo: 'data-field-mapping'
+ },
+ {
+ name: 'flag-field',
+ type: 'string',
+ defaultValue: "'flags'",
+ desc: {
+ 'zh-CN': '设置旗子信息数组对应的键名',
+ 'en-US': 'Set the key name corresponding to the flag information array'
+ },
+ mode: ['pc'],
+ pcDemo: 'data-field-mapping'
+ },
+ {
+ name: 'flag-name-field',
+ type: 'string',
+ defaultValue: "'name'",
+ desc: {
+ 'zh-CN': '设置旗子标题对应的键名',
+ 'en-US': 'Set the key name corresponding to the flag title'
+ },
+ mode: ['pc'],
+ pcDemo: 'data-field-mapping'
+ },
+ {
+ name: 'flag-status-field',
+ type: 'string',
+ defaultValue: "'status'",
+ desc: {
+ 'zh-CN': '设置旗子状态对应的键名',
+ 'en-US': 'Set the key name corresponding to the flag state'
+ },
+ mode: ['pc'],
+ pcDemo: 'data-field-mapping'
+ },
+ {
+ name: 'line-style',
+ type: "'number' | 'string'",
+ defaultValue: '1',
+ desc: {
+ 'zh-CN':
+ '线条颜色取值模式为数字时,只有1和2可选;如果为字符串则需传入 16 进制颜色值
\n 设置为数字 1 时只有完成与未完成两种状态的线条颜色,完成状态的线条颜色与 milestones-status 定义的 completed 状态的颜色一致
\n 设置为数字 2 时线条颜色根随节点状态颜色
\n 当设置为字符串形式的 16 进制色值时,如:#1890FF 时,线条不区分状态,全部统一为所设置的颜色',
+ 'en-US':
+ 'When the line color value mode is numeric, only 1 and 2 can be selected; If it is a string, the hexadecimal color value needs to be passed in
\n When set to the number 1, there are only two types of line colors: complete and incomplete. The color of the completed state line is consistent with the color of the completed state defined by milestone status
\n When set to number 2, the root color of the line follows the node state color
\n When set to a hexadecimal color value in string form, such as # 1890FF, the lines do not differentiate between states and are all unified to the set color'
+ },
+ mode: ['pc'],
+ pcDemo: 'line-style'
+ },
+ {
+ name: 'milestones-status',
+ typeAnchorName: 'IStatus',
+ type: 'IStatus',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '定义状态与颜色对应关系,颜色取值须是 16 进制颜色值或组件库的主题变量',
+ 'en-US':
+ 'Define the correspondence between state and color, and the color value must be a hexadecimal color value or a theme variable from the component library'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'name-field',
+ type: 'string',
+ defaultValue: "'name'",
+ desc: {
+ 'zh-CN': '设置节点名称对应的键名',
+ 'en-US': 'Set the key name corresponding to the node name'
+ },
+ mode: ['pc'],
+ pcDemo: 'data-field-mapping'
+ },
+ {
+ name: 'show-number',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '设置未完成状态的节点是否显示序号',
+ 'en-US': 'Set whether nodes in incomplete status display serial numbers'
+ },
+ mode: ['pc'],
+ pcDemo: 'show-number'
+ },
+ {
+ name: 'solid',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '在里程碑模式下,设置已经完成节点显示为实心,且光晕不透明',
+ 'en-US': 'In milestone mode, set the completed node to be displayed as solid and the halo is opaque'
+ },
+ mode: ['pc'],
+ pcDemo: 'solid-style'
+ },
+ {
+ name: 'space',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置相邻节点的间距,即节点间线条的长度',
+ 'en-US': 'Set the spacing between adjacent nodes, i.e. the length of lines between nodes'
+ },
+ mode: ['pc'],
+ pcDemo: 'line-style'
+ },
+ {
+ name: 'start',
+ type: 'number',
+ defaultValue: '-1',
+ desc: {
+ 'zh-CN': '设置节点的序号起始值,从首个节点开始计算',
+ 'en-US': 'Set the starting value of the nodes sequence number, starting from the first node'
+ },
+ mode: ['pc'],
+ pcDemo: 'show-number'
+ },
+ {
+ name: 'status-field',
+ type: 'string',
+ defaultValue: "'status'",
+ desc: {
+ 'zh-CN': '设置节点状态对应的键名',
+ 'en-US': 'Set the key name corresponding to the node state'
+ },
+ mode: ['pc'],
+ pcDemo: 'data-field-mapping'
+ },
+ {
+ name: 'time-field',
+ type: 'string',
+ defaultValue: "'time'",
+ desc: {
+ 'zh-CN': '设置节点时间信息对应的键名',
+ 'en-US': 'Set the key name corresponding to node time information'
+ },
+ mode: ['pc'],
+ pcDemo: 'data-field-mapping'
+ }
+ ],
+ events: [
+ {
+ name: 'click',
+ typeAnchorName: 'ICustomData',
+ type: '(index: number, node: ICustomData) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '节点的点击事件,参数(index:节点索引, node:节点数据信息)',
+ 'en-US': 'Node click event (parameter) (index: node index, node: node data information)'
+ },
+ mode: ['pc'],
+ pcDemo: 'milestone-events'
+ },
+ {
+ name: 'flag-click',
+ typeAnchorName: 'ICustomData',
+ type: '(index: number, node: ICustomData) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '旗子的点击事件,参数(index:旗子索引, node:旗子数据信息)',
+ 'en-US': 'Flag click event, parameters (index: flag index, node: data information of flag)'
+ },
+ mode: ['pc'],
+ pcDemo: 'milestone-events'
+ },
+ {
+ name: 'flagclick',
+ typeAnchorName: 'ICustomData',
+ type: '(index: number, node: ICustomData) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '[使用flag-click代替, deprecated v3.5.0废弃,v3.17.0移除;移除原因:命名规范]',
+ 'en-US':
+ '[It is recommended that flag-click be used instead of flag-click, deprecated in v3.5.0 and removed in v3.17.0; Reason for removal: ]'
+ },
+ mode: ['pc'],
+ pcDemo: 'milestone-events'
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'bottom',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '节点下方内容',
+ 'en-US': 'Content under a node'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-bottom-top'
+ },
+ {
+ name: 'flag',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '旗帜内容',
+ 'en-US': 'Flag Content'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-flag'
+ },
+ {
+ name: 'icon',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '节点图标',
+ 'en-US': 'Node icon'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-icon-slot'
+ },
+ {
+ name: 'top',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '节点上方内容',
+ 'en-US': 'Content above the node'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-bottom-top'
+ }
+ ]
+ }
+ ],
+ types: [
+ {
+ name: 'IStatus',
+ type: 'interface',
+ code: `
+interface IStatus {
+ completed?: string // 可通过completed-field自定义completed键名
+ doing: string
+ back: string
+ end: string
+ cancel: string
+}`
+ },
+ {
+ name: 'ICustomData',
+ type: 'interface',
+ code: `
+interface ICustomData {
+ name?: string
+ time?: string
+ status?: string
+ flags?: string
+ content?: string
+ [propName: string]: string // 可自定义以上的默认属性
+}`
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/mind-map.js b/examples/sites/demos/apis/mind-map.js
new file mode 100644
index 000000000..48edd6603
--- /dev/null
+++ b/examples/sites/demos/apis/mind-map.js
@@ -0,0 +1,234 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'mind-map',
+ type: 'component',
+ props: [
+ {
+ name: 'modelValue',
+ type: 'NodeObj',
+ defaultValue: '{}',
+ desc: {
+ 'zh-CN': '默认节点数据',
+ 'en-US': 'Default node data'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'options',
+ type: 'Options',
+ defaultValue: '{contextMenu: false,toolBar: false,nodeMenu: false}',
+ desc: {
+ 'zh-CN': '配置项',
+ 'en-US': 'options'
+ },
+ mode: ['pc']
+ }
+ ],
+ events: [
+ {
+ name: 'afterImport',
+ type: '({render, data}: {render:MindElixirInstance, data: })=>void',
+ desc: {
+ 'zh-CN': 'v-model更新后会触发',
+ 'en-US': 'After updating the v-model, it will trigger'
+ },
+ mode: ['pc']
+ },
+ {
+ name: 'beforeImport',
+ type: '({render, data}: {render:MindElixirInstance, data: })=>void',
+ desc: {
+ 'zh-CN': 'v-model更新前会触发',
+ 'en-US': 'Triggered before updating the v-model'
+ },
+ mode: ['pc']
+ },
+ {
+ name: 'create',
+ type: '(render:MindElixirInstance)=>void',
+ desc: {
+ 'zh-CN': 'mindmap创建时会触发该事件',
+ 'en-US': 'This event will be triggered when creating mindmap'
+ },
+ mode: ['pc']
+ },
+ {
+ name: 'expandNode',
+ type: 'onExpandNode',
+ desc: {
+ 'zh-CN': '展开节点时会触发该事件',
+ 'en-US': 'This event will be triggered when expanding a node'
+ },
+ mode: ['pc']
+ },
+ {
+ name: 'operation',
+ type: 'onOperation',
+ desc: {
+ 'zh-CN': '节点重新计算时, 例如将节点A拖拽到节点B, 使得节点A是节点B的子节点',
+ 'en-US':
+ 'When recalculating nodes, for example, dragging node A to node B so that node A is a child node of node B'
+ },
+ mode: ['pc']
+ },
+ {
+ name: 'selectNewNode',
+ type: 'onSelectNewNode',
+ desc: {
+ 'zh-CN': '创建新节点时',
+ 'en-US': 'when create new node'
+ },
+ mode: ['pc']
+ },
+ {
+ name: 'selectNode',
+ type: 'onSelectNode',
+ desc: {
+ 'zh-CN': '选择任意一个节点时, 会触发该事件',
+ 'en-US': 'When selecting any node, this event will be triggered'
+ },
+ mode: ['pc']
+ },
+ {
+ name: 'selectNodes',
+ type: 'onSelectNodes',
+ desc: {
+ 'zh-CN': '选择多个节点的时候会触发该事件',
+ 'en-US': 'When selecting multiple nodes, this event will be triggered'
+ },
+ mode: ['pc']
+ },
+ {
+ name: 'unselectNode',
+ type: 'onUnselectNode',
+ desc: {
+ 'zh-CN': '取消选择的时候会触发该事件',
+ 'en-US': 'When deselecting, this event will be triggered'
+ },
+ mode: ['pc']
+ },
+ {
+ name: 'unselectNodes',
+ type: 'onUnselectNode',
+ desc: {
+ 'zh-CN': '取消选择多个节点时会触发该事件',
+ 'en-US': 'This event will be triggered when multiple nodes are unselected'
+ },
+ mode: ['pc']
+ }
+ ],
+ methods: [],
+ slots: []
+ }
+ ],
+ types: [
+ {
+ name: 'Options',
+ type: 'interface',
+ code: `
+interface Options {
+ direction?: number
+ locale?: string
+ draggable?: boolean
+ editable?: boolean
+ contextMenu?: boolean
+ contextMenuOption?: any
+ toolBar?: boolean
+ keypress?: boolean
+ mouseSelectionButton?: 0 | 2
+ before?: Before
+ newTopicName?: string
+ allowUndo?: boolean
+ overflowHidden?: boolean
+ mainLinkStyle?: number
+ subLinkStyle?: number
+ mobileMenu?: boolean
+ theme?: Theme
+ nodeMenu?: boolean
+}
+`
+ },
+ {
+ name: 'onOperation',
+ type: 'type',
+ code: `
+type onOperation = ({render, info}: {render:MindElixirInstance, info: Operation}) => void
+`
+ },
+ {
+ name: 'onSelectNode',
+ type: 'type',
+ code: `
+type onSelectNode = ({render,nodeObj}: {render:MindElixirInstance,nodeObj:NodeObj}, e?: MouseEvent) => void
+`
+ },
+ {
+ name: 'onSelectNewNode',
+ type: 'type',
+ code: `
+type selectNewNode: ({render,nodeObj}: {render:MindElixirInstance,nodeObj:NodeObj}) => void
+`
+ },
+ {
+ name: 'onSelectNodes',
+ type: 'type',
+ code: `
+type selectNodes: ({render,nodeObj}: {render:MindElixirInstance,nodeObj:NodeObj[]}) => void
+`
+ },
+ {
+ name: 'onUnselectNode',
+ type: 'type',
+ code: `
+type unselectNodes: ({render}: {render: MindElixirInstance}) => void
+`
+ },
+ {
+ name: 'onUnselectNodes',
+ type: 'type',
+ code: `
+type unselectNodes: ({render}: {render: MindElixirInstance}) => void
+`
+ },
+ {
+ name: 'onExpandNode',
+ type: 'type',
+ code: `
+type expandNode: ({render,nodeObj}: {render:MindElixirInstance,nodeObj:NodeObj}) => void
+`
+ },
+ {
+ name: 'NodeObj',
+ type: 'interface',
+ code: `
+export interface NodeObj {
+ topic: string
+ id: Uid
+ style?: {
+ fontSize?: string
+ color?: string
+ background?: string
+ fontWeight?: string
+ }
+ children?: NodeObj[]
+ tags?: string[]
+ icons?: string[]
+ hyperLink?: string
+ expanded?: boolean
+ direction?: number
+ root?: boolean
+ image?: {
+ url: string
+ width: number
+ height: number
+ }
+ branchColor?: string
+ parent?: NodeObj
+}
+`
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/minipicker.js b/examples/sites/demos/apis/minipicker.js
new file mode 100644
index 000000000..df1f441c3
--- /dev/null
+++ b/examples/sites/demos/apis/minipicker.js
@@ -0,0 +1,218 @@
+export default {
+ mode: ['mobile'],
+ apis: [
+ {
+ name: 'MiniPicker',
+ type: 'component',
+ props: [
+ {
+ name: 'cancel-button-text',
+ type: 'String',
+ defaultValue: '取消',
+ desc: {
+ 'zh-CN': '取消按钮内容设置,该属性默认为‘取消’
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'cancel-button-text'
+ },
+ {
+ name: 'columns',
+ type: 'Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '配置每一列显示的数据
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'multicolumn'
+ },
+ {
+ name: 'confirm-button-text',
+ type: 'String',
+ defaultValue: '确定',
+ desc: {
+ 'zh-CN': '确定按钮内容设置,该属性默认为‘确定’
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'confirm-button-text'
+ },
+ {
+ name: 'default-index',
+ type: 'Number',
+ defaultValue: '0',
+ desc: {
+ 'zh-CN': '单列选择时,选择的初始值索引,该属性默认为0
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'defaultindex'
+ },
+ {
+ name: 'item-height',
+ type: 'Number',
+ defaultValue: '34',
+ desc: {
+ 'zh-CN': '选项高度,该属性默认为34
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'itemheight'
+ },
+ {
+ name: 'swipe-duration',
+ type: 'Number',
+ defaultValue: '1000',
+ desc: {
+ 'zh-CN': '快速滑动时惯性滚动的时长,单位 ms,该属性默认为1000
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'cancel-button-text'
+ },
+ {
+ name: 'title',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '标题
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'cancel-button-text'
+ },
+ {
+ name: 'value-key',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '选项对象中,选项文字对应的键名,该属性默认为"text"
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: ''
+ },
+ {
+ name: 'visible',
+ type: 'Boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '选择器组件显示或隐藏,该属性默认为false
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'cancel-button-text'
+ },
+ {
+ name: 'visible-item-count',
+ type: 'Number',
+ defaultValue: '5',
+ desc: {
+ 'zh-CN': '可见的选项个数,该属性默认为5
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'visibleitemcount'
+ }
+ ],
+ events: [
+ {
+ name: 'cancel',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '点击取消按钮时触发
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: ''
+ },
+ {
+ name: 'change',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '选项改变时触发。
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'change'
+ },
+ {
+ name: 'confirm',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '点击确定按钮时触发
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'cancel'
+ }
+ ],
+ methods: [
+ {
+ name: 'getColumnIndex',
+ type: '获取对应列选中项的索引,参数columnIndex,返回值optionIndex',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '下拉时触发的事件
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'methods'
+ },
+ {
+ name: 'getColumnValue',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '获取对应列选中的值,参数columnIndex,返回值value
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'methods'
+ },
+ {
+ name: 'getColumnValues',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '获取对应列中所有选项,参数columnIndex,返回值values
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'methods'
+ },
+ {
+ name: 'getIndexes',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '获取所有列选中值对应的索引
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'column'
+ },
+ {
+ name: 'getValues',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '获取所有列选中的值
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'column'
+ }
+ ],
+ slots: [
+ {
+ name: 'toolbar',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义工具栏
',
+ 'en-US': 'toolbar'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'toolbar'
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/modal.js b/examples/sites/demos/apis/modal.js
new file mode 100644
index 000000000..5a8b8d286
--- /dev/null
+++ b/examples/sites/demos/apis/modal.js
@@ -0,0 +1,615 @@
+export default {
+ mode: ['pc', 'mobile', 'mobile-first'],
+ apis: [
+ {
+ name: 'modal',
+ type: 'component',
+ props: [
+ {
+ name: 'before-close',
+ type: 'Function',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '可以配置一个拦截弹窗关闭的方法。如果方法返回 false 值,则拦截弹窗关闭;否则不拦截',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'cancel-btn-props',
+ typeAnchorName: 'button#API',
+ type: 'Button.props',
+ defaultValue: '{}',
+ desc: {
+ 'zh-CN': '自定义取消按钮的 props ,可选值与 Button 组件一致',
+ 'en-US':
+ 'Customize the props of the cancel button. The optional values are consistent with the Button component'
+ },
+ mode: ['pc'],
+ pcDemo: 'footer-btn-props'
+ },
+ {
+ name: 'cancel-content',
+ type: 'string',
+ defaultValue: "'取消'",
+ desc: {
+ 'zh-CN': '自定义取消按钮内容',
+ 'en-US': 'Customize cancel button content'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'footer-btn-content',
+ mfDemo: ''
+ },
+ {
+ name: 'confirm-btn-props',
+ typeAnchorName: 'button#API',
+ type: 'Button.props',
+ defaultValue: '{}',
+ desc: {
+ 'zh-CN': '自定义确认按钮 props,可选值与 Button 组件一致',
+ 'en-US':
+ 'Customize the confirmation button props, the optional values are consistent with the Button component'
+ },
+ mode: ['pc'],
+ pcDemo: 'footer-btn-props'
+ },
+ {
+ name: 'confirm-content',
+ type: 'string',
+ defaultValue: "'确认'",
+ desc: {
+ 'zh-CN': '自定义确认按钮内容',
+ 'en-US': 'Customize confirmation button content'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'footer-btn-content',
+ mfDemo: ''
+ },
+ {
+ name: 'custom-class',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '组件自定义 class 样式',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'description',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '组件详情信息',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'duration',
+ type: 'number | string',
+ defaultValue: '3000',
+ desc: {
+ 'zh-CN': "自动关闭的延时,仅当 type 为 'message' 有效",
+ 'en-US': "Delay for automatic shutdown, only valid when type is 'message'"
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'duration',
+ mobileDemo: 'duration',
+ mfDemo: ''
+ },
+ {
+ name: 'esc-closable',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否允许按 Esc 键关闭窗口',
+ 'en-US': 'Whether to allow pressing the Esc key to close a window'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'esc-closable',
+ mobileDemo: 'mask-closable',
+ mfDemo: ''
+ },
+ {
+ name: 'footer-dragable',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '控制底部可拖拽',
+ 'en-US': 'Control bottom dragable'
+ },
+ mode: ['pc'],
+ pcDemo: 'footer-slot'
+ },
+ {
+ name: 'fullscreen',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否最大化显示',
+ 'en-US': 'Whether to maximize the display'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'fullscreen',
+ mobileDemo: 'fullscreen',
+ mfDemo: ''
+ },
+ {
+ name: 'height',
+ type: 'number | string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '窗口的高度',
+ 'en-US': 'window height'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'resize',
+ mobileDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'id',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': "如果不想窗口重复点击,可以设置唯一的 id 防止重复提示,仅当 type 为 'message' 有效",
+ 'en-US':
+ "If you don't want the window to be clicked repeatedly, you can set a unique id to prevent repeated prompts. This is only valid when type is 'message'"
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'id',
+ mobileDemo: 'id',
+ mfDemo: ''
+ },
+ {
+ name: 'is-form-reset',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '关闭弹窗时,是否重置表单数据',
+ 'en-US': 'Whether to reset the form data when closing the pop-up window'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'is-form-reset',
+ mobileDemo: 'is-form-reset',
+ mfDemo: ''
+ },
+ {
+ name: 'lock-scroll',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否锁住滚动条,不允许页面滚动',
+ 'en-US': 'Whether to lock the scroll bar and not allow the page to scroll'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'lock-scroll',
+ mobileDemo: 'lock-scroll',
+ mfDemo: ''
+ },
+ {
+ name: 'lock-view',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否锁住页面,不允许窗口之外的任何操作',
+ 'en-US': 'Whether to lock the page and not allow any operations outside the window'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'lock-view',
+ mobileDemo: 'lock-view',
+ mfDemo: ''
+ },
+ {
+ name: 'mask',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否显示遮罩层',
+ 'en-US': 'Whether to display the mask layer'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'lock-view1',
+ mobileDemo: 'mask-closable',
+ mfDemo: ''
+ },
+ {
+ name: 'mask-closable',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否允许点击遮罩层关闭窗口',
+ 'en-US': 'Whether to allow clicking on the mask layer to close the window'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'mask-closable',
+ mobileDemo: 'mask-closable',
+ mfDemo: ''
+ },
+ {
+ name: 'message',
+ type: 'string | VNode | () => string | VNode',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '窗口的内容',
+ 'en-US': 'Window contents'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'message',
+ mobileDemo: 'message',
+ mfDemo: ''
+ },
+ {
+ name: 'message-closable',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': "'message' 类型弹窗是否显示关闭按钮",
+ 'en-US': "Whether the 'message' type pop-up window displays a close button"
+ },
+ mode: ['pc'],
+ pcDemo: 'message-closable'
+ },
+ {
+ name: 'min-height',
+ type: 'number | string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '窗口的最小高度',
+ 'en-US': 'Minimum height of window'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'min-height',
+ mobileDemo: 'min-height',
+ mfDemo: ''
+ },
+ {
+ name: 'min-width',
+ type: 'number | string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '窗口的最小宽度',
+ 'en-US': 'The minimum width of the window'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'min-width',
+ mobileDemo: 'min-width',
+ mfDemo: ''
+ },
+ {
+ name: 'modelValue / v-model',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否显示',
+ 'en-US': 'Whether to display'
+ },
+ mode: ['pc', 'mobile'],
+ pcDemo: 'value',
+ mobileDemo: 'cancel-event'
+ },
+ {
+ name: 'options',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': "多选选项,格式为 [{ value: 'value1', name: '选项1' }, ...]",
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'position',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': "弹出框位置,默认居中显示,设置值为 'bottom-right' 时弹出框显示在右下角",
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'resize',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否允许拖动调整窗口大小',
+ 'en-US': 'Whether to allow dragging to resize the window'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'resize',
+ mobileDemo: 'resize',
+ mfDemo: ''
+ },
+ {
+ name: 'show-close',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否显示关闭按钮,默认值为 true',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'show-footer',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否显示底部',
+ 'en-US': 'Display bottom'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'showFooter',
+ mfDemo: ''
+ },
+ {
+ name: 'show-header',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否显示头部',
+ 'en-US': 'Display Header'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'showHeader',
+ mobileDemo: 'showHeader',
+ mfDemo: ''
+ },
+ {
+ name: 'showFooter',
+ type: 'Boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否显示底部
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'showFooter'
+ },
+ {
+ name: 'status',
+ typeAnchorName: 'IStatus',
+ type: 'IStatus',
+ defaultValue: "'info'",
+ desc: {
+ 'zh-CN': "消息状态,当 type 为 'alert'、'message'、'confirm' 时有效",
+ 'en-US': "Message status, valid when type is 'alert', 'message', 'confirm'"
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'status',
+ mobileDemo: 'status',
+ mfDemo: ''
+ },
+ {
+ name: 'title',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '窗口的标题',
+ 'en-US': 'Window title'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'title',
+ mobileDemo: 'title',
+ mfDemo: ''
+ },
+ {
+ name: 'top',
+ type: 'number | string',
+ defaultValue: '15',
+ desc: {
+ 'zh-CN': "消息距离顶部的位置,仅当 type 为 'message' 时有效",
+ 'en-US': "The position of the message from the top, only valid when type is 'message'"
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'top',
+ mobileDemo: 'top',
+ mfDemo: ''
+ },
+ {
+ name: 'type',
+ type: "'alert' | 'confirm' | 'message'",
+ defaultValue: "'alert'",
+ desc: {
+ 'zh-CN': '窗口类型',
+ 'en-US': 'Window type'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'type',
+ mobileDemo: 'type',
+ mfDemo: ''
+ },
+ {
+ name: 'v-model',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '绑定值',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'width',
+ type: 'number | string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '窗口的宽度',
+ 'en-US': 'window width'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'resize',
+ mobileDemo: 'grid',
+ mfDemo: ''
+ },
+ {
+ name: 'z-index',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义堆叠顺序(对于某些特殊场景,比如被遮挡时可能会用到)',
+ 'en-US': 'Customize the stacking order (may be used in some special scenarios, such as when it is blocked)'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'z-index',
+ mfDemo: ''
+ },
+ {
+ name: 'zIndex',
+ type: 'Number',
+ defaultValue: '3000',
+ desc: {
+ 'zh-CN': '自定义堆叠顺序(对于某些特殊场景,比如被遮挡时可能会用到)
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile', 'mobile-first'],
+ mobileDemo: 'zIndex',
+ mfDemo: ''
+ }
+ ],
+ events: [
+ {
+ name: 'cancel',
+ typeAnchorName: 'IModalEventParam',
+ type: '(params: IModalEventParam, event: Event) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '点击取消按钮时会触发该事件',
+ 'en-US': 'This event is triggered when the Cancel button is clicked'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'event',
+ mobileDemo: 'cancel-event',
+ mfDemo: ''
+ },
+ {
+ name: 'close',
+ typeAnchorName: 'IModalEventParam',
+ type: '(params: IModalEventParam, event: Event) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '点击关闭按钮时会触发该事件',
+ 'en-US': 'This event is triggered when the close button is clicked'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'event',
+ mobileDemo: 'close-event',
+ mfDemo: ''
+ },
+ {
+ name: 'confirm',
+ typeAnchorName: 'IModalEventParam',
+ type: '(params: IModalEventParam, event: Event) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '点击确定按钮时会触发该事件',
+ 'en-US': 'This event is triggered when the OK button is clicked'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'event',
+ mobileDemo: 'confirm-event',
+ mfDemo: ''
+ },
+ {
+ name: 'hide',
+ typeAnchorName: 'IModalEventParam',
+ type: '(params: IModalEventParam) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在窗口关闭时会触发该事件',
+ 'en-US': 'This event is triggered when the window is closed'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'hide-event',
+ mobileDemo: 'hide-event',
+ mfDemo: ''
+ },
+ {
+ name: 'show',
+ typeAnchorName: 'IModalEventParam',
+ type: '(params: IModalEventParam) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在窗口显示时会触发该事件',
+ 'en-US': 'This event is triggered when the window is displayed'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'event',
+ mobileDemo: 'show-event',
+ mfDemo: ''
+ },
+ {
+ name: 'zoom',
+ typeAnchorName: 'IModalEventParam',
+ type: '(params: IModalEventParam, event: Event) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '窗口缩放时会触发该事件',
+ 'en-US': 'This event is triggered when a window is zoomed in or out'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'event',
+ mobileDemo: 'zoom-event',
+ mfDemo: ''
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '默认插槽',
+ 'en-US': 'Default slot'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'default-grid',
+ mobileDemo: 'cancel-event',
+ mfDemo: ''
+ },
+ {
+ name: 'footer',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '窗口底部的模板',
+ 'en-US': 'Template at the bottom of the window'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'footer-slot',
+ mobileDemo: 'footer-slot',
+ mfDemo: ''
+ }
+ ]
+ }
+ ],
+ types: [
+ {
+ name: 'IModalEventParam',
+ type: 'interface',
+ code: `
+interface IModalEventParam {
+ type: 'alert' | 'message' | 'confirm' // 弹窗类型
+ $modal: ComponentPublicInstance // Modal组件实例
+}
+`
+ },
+ {
+ name: 'IStatus',
+ type: 'type',
+ code: `
+ type IStatus = 'info' | 'success' | 'warning' | 'error' | 'loading'
+ `
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/multi-select.js b/examples/sites/demos/apis/multi-select.js
new file mode 100644
index 000000000..d14d0c660
--- /dev/null
+++ b/examples/sites/demos/apis/multi-select.js
@@ -0,0 +1,68 @@
+export default {
+ mode: ['mobile'],
+ apis: [
+ {
+ name: 'multiSelect',
+ type: 'component',
+ props: [
+ {
+ name: 'dataSource',
+ type: '[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '数据
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'basic-usage'
+ },
+ {
+ name: 'defaultSelectedArray',
+ type: '[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '默认值
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'basic-usage'
+ },
+ {
+ name: 'v-model/modelValue',
+ type: '[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '选中值
',
+ 'en-US': ''
+ },
+ mode: ['mobile'],
+ mobileDemo: 'basic-usage'
+ }
+ ],
+ events: [
+ {
+ name: 'confim',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '确认事件
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'basic-usage'
+ },
+ {
+ name: 'reset',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '重置事件
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'basic-usage'
+ }
+ ],
+ methods: [],
+ slots: []
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/nav-menu.js b/examples/sites/demos/apis/nav-menu.js
new file mode 100644
index 000000000..18d756da7
--- /dev/null
+++ b/examples/sites/demos/apis/nav-menu.js
@@ -0,0 +1,152 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'nav-menu',
+ type: 'component',
+ props: [
+ {
+ name: 'before-skip',
+ typeAnchorName: 'IMenuItem',
+ type: '(item: IMenuItem) => boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '点击菜单跳转前的钩子函数,返回 false 将无法跳转',
+ 'en-US':
+ 'Click the hook function before menu redirection. If false is returned, menu redirection cannot be performed'
+ },
+ mode: ['pc'],
+ pcDemo: 'before-skip'
+ },
+ {
+ name: 'data',
+ typeAnchorName: 'IDataItem',
+ type: 'IDataItem[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置导航菜单的数据',
+ 'en-US': 'Set the navigation menu data'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'fetch-menu-data',
+ typeAnchorName: 'IMenuItem',
+ type: '() => IDataItem[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义菜单数据加载服务,返回一个Promise对象',
+ 'en-US': 'Customize the menu data loading service. A Promise object is returned'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-service'
+ },
+ {
+ name: 'fields',
+ typeAnchorName: 'IFields',
+ type: 'IFields',
+ defaultValue: '{ textField: "title", urlField: "url", key: "id" }',
+ desc: {
+ 'zh-CN': '自定义菜单数据的映射',
+ 'en-US': 'User-defined menu data mapping'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-service'
+ },
+ {
+ name: 'overflow',
+ typeAnchorName: 'IOverflow',
+ type: 'IOverflow',
+ defaultValue: 'auto',
+ desc: {
+ 'zh-CN': '设置一级菜单无法在当前菜单容器里显示完全时的展示方式',
+ 'en-US':
+ 'Set the display method when the first level menu cannot be fully displayed in the current menu container'
+ },
+ mode: ['pc'],
+ pcDemo: 'overflow'
+ },
+ {
+ name: 'prevent',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '若使用组件的默认服务获取菜单数据,并且要阻止默认的跳转行为,需要 before-skip 和此属性一起使用',
+ 'en-US':
+ 'If you use the default service of the component to obtain menu data and want to prevent default jump behavior, you need to use before-skip in conjunction with this attribute'
+ },
+ mode: ['pc'],
+ pcDemo: 'before-skip-prevent'
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: [
+ {
+ name: 'logo',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '菜单栏 Logo 插槽',
+ 'en-US': 'Menu Bar Logo Slot'
+ },
+ mode: ['pc'],
+ pcDemo: 'slot-logo'
+ },
+ {
+ name: 'toolbar',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义右上角部分 toolbar 插槽',
+ 'en-US': 'Customize the toolbar slot in the upper right corner'
+ },
+ mode: ['pc'],
+ pcDemo: 'slot-toolbar'
+ }
+ ]
+ }
+ ],
+ types: [
+ {
+ name: 'IMenuItem',
+ type: 'interface',
+ code: `
+interface IMenuItem {
+ id: string
+ isFullUrl: boolean
+ pid: string
+ route: string
+ target: string
+ title: string
+ url: string
+}`
+ },
+ {
+ name: 'IDataItem',
+ type: 'interface',
+ code: `
+interface IDataItem {
+ title: string
+ url: string
+ children?: IDataItem[]
+}`
+ },
+ {
+ name: 'IFields',
+ type: 'interface',
+ code: `
+interface IFields {
+ textField: string
+ urlField: string
+ key?: string
+}`
+ },
+ {
+ name: 'IOverflow',
+ type: 'type',
+ code: `
+type IOverflow = 'auto' | 'retract' | 'fixed' | 'hidden'
+`
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/navbar.js b/examples/sites/demos/apis/navbar.js
new file mode 100644
index 000000000..b22c53665
--- /dev/null
+++ b/examples/sites/demos/apis/navbar.js
@@ -0,0 +1,133 @@
+export default {
+ mode: ['mobile'],
+ apis: [
+ {
+ name: 'navBar',
+ type: 'component',
+ props: [
+ {
+ name: 'fixed',
+ type: 'Boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否固定在顶部,该属性默认为true
',
+ 'en-US': 'Is fixed top'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'left-right-arrow'
+ },
+ {
+ name: 'left-arrow',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否显示左侧箭头,该属性默认为false
',
+ 'en-US': 'Is show left arrow'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'left-right-arrow'
+ },
+ {
+ name: 'left-text',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置左侧文本
',
+ 'en-US': 'Is show left text'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'left-right-text'
+ },
+ {
+ name: 'right-arrow',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否显示右侧箭头
',
+ 'en-US': 'Is show right arrow'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'left-right-arrow'
+ },
+ {
+ name: 'right-text',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置右侧文本
',
+ 'en-US': 'Is show right text'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'left-right-text'
+ },
+ {
+ name: 'sub-title',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置副标题
',
+ 'en-US': 'set sub-title'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'left-right-text'
+ },
+ {
+ name: 'title',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置主标题
',
+ 'en-US': 'set main-title'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'z-index'
+ },
+ {
+ name: 'z-index',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置z-index
',
+ 'en-US': 'set z-index'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'z-index'
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义标题
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'left-right-arrow'
+ },
+ {
+ name: 'left',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义左侧内容
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'left-right-text'
+ },
+ {
+ name: 'right',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义右侧内容
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'left-right-text'
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/notify.js b/examples/sites/demos/apis/notify.js
new file mode 100644
index 000000000..a57f08830
--- /dev/null
+++ b/examples/sites/demos/apis/notify.js
@@ -0,0 +1,183 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'notify',
+ type: 'component',
+ props: [
+ {
+ name: 'closeIcon',
+ type: 'Component',
+ defaultValue: 'IconClose',
+ desc: {
+ 'zh-CN': '关闭图标组件对象',
+ 'en-US': 'Close icon component object'
+ },
+ mode: ['pc'],
+ pcDemo: 'closeIcon'
+ },
+ {
+ name: 'customClass',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义样式类',
+ 'en-US': 'Custom style class'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'debounceDelay',
+ type: 'number',
+ defaultValue: '0',
+ desc: {
+ 'zh-CN': '启用防抖',
+ 'en-US': 'Enable image stabilization'
+ },
+ mode: ['pc'],
+ pcDemo: 'debounceDelay'
+ },
+ {
+ name: 'duration',
+ type: 'number',
+ defaultValue: '4500',
+ desc: {
+ 'zh-CN': '自动关闭延时毫秒数',
+ 'en-US': 'Automatic shutdown delay in milliseconds'
+ },
+ mode: ['pc'],
+ pcDemo: 'duration'
+ },
+ {
+ name: 'message',
+ typeAnchorName: 'INotifyMessage',
+ type: 'INotifyMessage',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '通知消息文本,可用 jsx 定制',
+ 'en-US': 'Notification message text, which can be customized using JSX.'
+ },
+ mode: ['pc'],
+ pcDemo: 'message'
+ },
+ {
+ name: 'position',
+ type: "'top-right' | 'bottom-right'",
+ defaultValue: "'bottom-right'",
+ desc: {
+ 'zh-CN': '通知显示位置',
+ 'en-US': 'Notification display position.'
+ },
+ mode: ['pc'],
+ pcDemo: 'position'
+ },
+ {
+ name: 'showClose',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否显示关闭按钮',
+ 'en-US': 'Whether to display the close button'
+ },
+ mode: ['pc'],
+ pcDemo: 'showClose'
+ },
+ {
+ name: 'showIcon',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否显示类型图标',
+ 'en-US': 'Display Type Icon'
+ },
+ mode: ['pc'],
+ pcDemo: 'showIcon'
+ },
+ {
+ name: 'statusIcon',
+ type: 'Component',
+ defaultValue: 'IconInfoSolid',
+ desc: {
+ 'zh-CN': '类型图标组件对象',
+ 'en-US': 'Type icon component object'
+ },
+ mode: ['pc'],
+ pcDemo: 'statusIcon'
+ },
+ {
+ name: 'title',
+ typeAnchorName: 'INotifyTitle',
+ type: 'INotifyTitle',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '通知消息标题,可用 jsx 定制',
+ 'en-US': 'Notification message title, which can be customized by JSX.'
+ },
+ mode: ['pc'],
+ pcDemo: 'title'
+ },
+ {
+ name: 'type',
+ type: "'info' | 'success' | 'warning' | 'error'",
+ defaultValue: "'info'",
+ desc: {
+ 'zh-CN': '通知消息类型',
+ 'en-US': 'Notification message type'
+ },
+ mode: ['pc'],
+ pcDemo: 'type'
+ },
+ {
+ name: 'verticalOffset',
+ type: 'number | string',
+ defaultValue: '16',
+ desc: {
+ 'zh-CN': '设置垂直方向偏离距离,单位 px',
+ 'en-US': ''
+ },
+ mode: ['pc'],
+ pcDemo: 'verticalOffset'
+ }
+ ],
+ events: [
+ {
+ name: 'beforeClose',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '关闭前回调方法,返回 false 可阻止关闭',
+ 'en-US': 'Callback method before closing. If false is returned, closing is prevented.'
+ },
+ mode: ['pc'],
+ pcDemo: 'notify-events'
+ },
+ {
+ name: 'onClose',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '关闭 notify 时触发的事件',
+ 'en-US': 'Event triggered when the notify function is disabled'
+ },
+ mode: ['pc'],
+ pcDemo: 'notify-events'
+ }
+ ],
+ methods: [],
+ slots: []
+ }
+ ],
+ types: [
+ {
+ name: 'INotifyTitle',
+ type: 'type',
+ code: `type INotifyTitle = string | (h: Vue.h, params: { titleClass: string, vm }) => JSX.Element`
+ },
+ {
+ name: 'INotifyMessage',
+ type: 'type',
+ code: `type INotifyMessage = string | (h: Vue.h, params: { messageClass: string, vm }) => JSX.Element`
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/numeric.js b/examples/sites/demos/apis/numeric.js
new file mode 100644
index 000000000..ec8523f27
--- /dev/null
+++ b/examples/sites/demos/apis/numeric.js
@@ -0,0 +1,481 @@
+export default {
+ mode: ['pc', 'mobile', 'mobile-first'],
+ apis: [
+ {
+ name: 'numeric',
+ type: 'component',
+ props: [
+ {
+ name: 'allow-empty',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '内容可清空',
+ 'en-US': 'The counter can be cleared'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'allow-empty',
+ mfDemo: ''
+ },
+ {
+ name: 'blank',
+ type: 'string',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '过滤器背景设置为透明,默认值为true',
+ 'en-US': 'The filter background is set to transparent. The default value is true.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'filter-mode',
+ mfDemo: ''
+ },
+ {
+ name: 'circulate',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '向上到达最大值后,是否从最小值开始,或反过来',
+ 'en-US': 'When the maximum value is reached, start from the minimum value, or vice versa'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'max-min',
+ mobileDemo: 'circulate',
+ mfDemo: ''
+ },
+ {
+ name: 'controls',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否使用加减按钮',
+ 'en-US': 'Whether to use the control button'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'controls',
+ mobileDemo: 'controls',
+ mfDemo: ''
+ },
+ {
+ name: 'controls-position',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '加减按钮位置,可选值为 right
,表示加减按钮均位于最右侧',
+ 'en-US': 'Control button position; The optional value of this attribute is right'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'controls',
+ mobileDemo: 'controls-position',
+ mfDemo: ''
+ },
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '禁用',
+ 'en-US': 'Whether to disable the counter'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'dynamic-disabled',
+ mobileDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'display-only',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置只读态',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'format',
+ typeAnchorName: 'INumericFormat',
+ type: 'INumericFormat',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '数字格式化置项',
+ 'en-US':
+ "For the specific configuration of the digital formatting entry, refer to the property description"
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'precision',
+ mfDemo: ''
+ },
+ {
+ name: 'hide-unit',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '隐藏单位',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'hold-zero',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '精度细化,默认值为 true ',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'label',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '组件arial-label
属性取值',
+ 'en-US': 'The value of arial-label
attribute'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: '',
+ mobileDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'max',
+ type: 'number',
+ defaultValue: 'Infinity',
+ desc: {
+ 'zh-CN': '规定组件可输入的最大数值,指定合法值的范围,支持整数和小数',
+ 'en-US':
+ 'Maximum value that can be entered in a component to create a valid value range. Integers and decimals are supported'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'max-min',
+ mobileDemo: 'max',
+ mfDemo: ''
+ },
+ {
+ name: 'min',
+ type: 'number',
+ defaultValue: '-Infinity',
+ desc: {
+ 'zh-CN': '规定组件可输入的最小数值,指定合法值的范围,支持整数和小数',
+ 'en-US':
+ 'Specify the minimum value that can be entered for a component to create a valid value range. Integers and decimals are supported'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'max-min',
+ mobileDemo: 'max',
+ mfDemo: ''
+ },
+ {
+ name: 'model-truncation',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在配置了精度情况下,是否对v-model绑字值进行精度截取,配为false时,精度仅用来作展示',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'mouse-wheel',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '鼠标滚动滑轮是否改变数值',
+ 'en-US': 'Whether to change the value of the scroll wheel'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'mouse-wheel',
+ mfDemo: ''
+ },
+ {
+ name: 'name',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '原生属性',
+ 'en-US': 'Native attribute'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'placeholder',
+ type: 'string',
+ defaultValue: "''",
+ desc: {
+ 'zh-CN': '输入框内的提示占位文本',
+ 'en-US': 'Set the placeholder text in the text box'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mobileDemo: 'placeholder',
+ mfDemo: ''
+ },
+ {
+ name: 'plugin',
+ type: 'Function',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '高精度的数据在IE下需要Bignumberjs兼容',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'precision',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '数值精度',
+ 'en-US': 'Numeric precision'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'precision',
+ mobileDemo: 'precision',
+ mfDemo: ''
+ },
+ {
+ name: 'shape',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': "设置输入的shape='filter,切换至过滤器模式'",
+ 'en-US': "Set Input Shape = 'Filter'"
+ },
+ mode: ['pc'],
+ pcDemo: 'filter-mode'
+ },
+ {
+ name: 'show-left',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '设置左对齐',
+ 'en-US': 'Set Left Alignment'
+ },
+ mode: ['pc'],
+ pcDemo: 'controls'
+ },
+ {
+ name: 'size',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '计数器尺寸,该属性的可选值为 medium | small | mini',
+ 'en-US': 'Counter size.The optional values of this attribute are medium | small | mini'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'numeric-size',
+ mfDemo: ''
+ },
+ {
+ name: 'step',
+ type: 'number',
+ defaultValue: '1',
+ desc: {
+ 'zh-CN': '步长',
+ 'en-US': 'Increment or decrement value each time'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'about-step',
+ mobileDemo: 'step',
+ mfDemo: ''
+ },
+ {
+ name: 'step-strictly',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否只能输入 step
的倍数',
+ 'en-US': 'Whether to enter only multiples of step'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: '',
+ mobileDemo: 'step',
+ mfDemo: ''
+ },
+ {
+ name: 'strict-input',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '严格控制输入,包含合法性输入与小数点长度验证,不允许输入超过精度设置',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'string-mode',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '使用字符串模式,精度超过JS限制时使用',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'tabindex',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': 'Numeric组件的 tabindex ',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'unit',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '数值的单位。在设置单位时,加减按钮将不可用',
+ 'en-US': 'Unit of measurement. When setting the unit, the increase and decrease buttons will be disabled'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'unit',
+ mfDemo: ''
+ },
+ {
+ name: 'unit-center',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '配置unit属性后,设置输入框内的数字是否居中显示,默认值为 false',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'v-model',
+ type: 'number',
+ defaultValue: '0',
+ desc: {
+ 'zh-CN': '设置输入组件的默认值,默认为 0',
+ 'en-US': 'Set the default value of the input component. The default value is 0'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mfDemo: ''
+ },
+ {
+ name: 'validate-event',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '验证事件,默认值为true',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'value',
+ type: 'Number',
+ defaultValue: '0',
+ desc: {
+ 'zh-CN': '设置输入组件的默认值,该属性默认为 0。
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: ''
+ }
+ ],
+ events: [
+ {
+ name: 'blur',
+ type: '(event: FocusEvent) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '组件失去焦点时触发的回调函数',
+ 'en-US': 'The callback function triggered when a component loses focus'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'blur-event',
+ mobileDemo: 'event',
+ mfDemo: ''
+ },
+ {
+ name: 'change',
+ type: '(newVal: number | undefined, oldVal: number | undefined) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '组件的值变化时触发的回调函数',
+ 'en-US': 'The callback function triggered when the value of a component changes'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'change-event',
+ mobileDemo: 'event',
+ mfDemo: ''
+ },
+ {
+ name: 'filter-change',
+ type: '(label) => void',
+ desc: {
+ 'zh-CN': '选择过滤器面板值的回调函数',
+ 'en-US': 'Callback function for selecting filter panel values'
+ },
+ mode: ['pc'],
+ pcDemo: 'filter-mode-change'
+ },
+ {
+ name: 'focus',
+ type: '(event: FocusEvent) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '组件获得焦点时触发的回调函数',
+ 'en-US': 'The callback function triggered when a component obtains the focus'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'focus-event',
+ mobileDemo: 'event',
+ mfDemo: ''
+ },
+ {
+ name: 'input',
+ type: 'Function(value)',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入值时触发事件',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ methods: [],
+ slots: []
+ }
+ ],
+ types: [
+ {
+ name: 'INumericFormat',
+ type: 'interface',
+ code: `
+interface INumericFormat {
+ fraction: 4, // 保留小数位数
+ rounding: 0, // 舍入点,0-9之间的数字,如配置为7时则为6舍7入,默认为5(四舍五入);配置为0或>9将会进行截取
+ prefix: '$', // 前置标识
+ groupSize: 3, // 整数部分分组间隔,即第一个分组位数
+ secondaryGroupSize: 2, // 整数部分第二级分组间隔,不设置或为0时 自动取groupSize
+ groupSeparator: ',', // 整数部分分组分隔符
+ decimalSeparator: '.', // 小数点符号
+ fractionGroupSize: 0, // 小数部分分组间隔
+ fractionGroupSeparator: '', // 小数分组分隔符
+ suffix: '@' // 后置标识
+}
+ `
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/pager.js b/examples/sites/demos/apis/pager.js
new file mode 100644
index 000000000..517814a5d
--- /dev/null
+++ b/examples/sites/demos/apis/pager.js
@@ -0,0 +1,358 @@
+export default {
+ mode: ['pc', 'mobile-first'],
+ apis: [
+ {
+ name: 'pager',
+ type: 'component',
+ props: [
+ {
+ name: 'align',
+ type: "'left' | 'center' | 'right'",
+ defaultValue: "'left'",
+ desc: {
+ 'zh-CN': '分页对齐方式,Aurora、SMB主题默认值为 right',
+ 'en-US': 'Pagination alignment, the default value for Aurora and SMB themes is right'
+ },
+ mode: ['pc'],
+ pcDemo: 'align'
+ },
+ {
+ name: 'current-page',
+ type: 'number',
+ defaultValue: '1',
+ desc: {
+ 'zh-CN': '当前所在页',
+ 'en-US': 'The current page'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'current-page',
+ mfDemo: ''
+ },
+ {
+ name: 'custom-total',
+ type: 'boolean | string',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '自定义总条数,传值为 true 时,显示10万+、100万+,传值为字符串则显示传入的字符串',
+ 'en-US':
+ 'Maximum number of page buttons to be displayed in the middle in number/complete mode. Number of page buttons. When the total number of pages exceeds the value, the buttons will be collapsed. The value of this attribute can be an odd number ranging from 5 to 21'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-total'
+ },
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否禁用分页',
+ 'en-US': 'Disabled pager'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'disabled-and-size',
+ mfDemo: ''
+ },
+ {
+ name: 'hide-on-single-page',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '只有一页时是否隐藏',
+ 'en-US': 'Hide when there is only one page'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'hide-on-single-page',
+ mfDemo: ''
+ },
+ {
+ name: 'is-before-page-change',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否开启前置处理特性,开启后,翻页或者改变页大小不会立即生效,由用户处理业务逻辑',
+ 'en-US':
+ 'Whether to enable the preprocessing feature. After opening, flipping or changing the page size will not take effect immediately. The user handles the business logic'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'before-page-change',
+ mfDemo: ''
+ },
+ {
+ name: 'layout',
+ type: 'string',
+ defaultValue: "'total, prev, pager, next, jumper'",
+ desc: {
+ 'zh-CN':
+ '组件布局,子组件名用英文逗号分隔,子组件类型有 sizes、 prev、 pager、 next、 jumper、 current、 total、 slot',
+ 'en-US':
+ 'Component layout, with sub component names separated by commas; The optional values for this attribute are sizes, preview, pager, next, jumper, current, total, slot.'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-layout'
+ },
+ {
+ name: 'mode',
+ type: "'number' | 'simple' | 'complete' | 'fixed'",
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置分页组件显示模式,此属性优先级大于 layout',
+ 'en-US': 'Set the display mode of pagination components, which takes priority over layout'
+ },
+ mode: ['pc'],
+ pcDemo: 'pager-mode'
+ },
+ {
+ name: 'next-text',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '替代图标显示的下一页文字',
+ 'en-US': 'Replace icon display with next page text'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'custom-next-prev-text',
+ mfDemo: ''
+ },
+ {
+ name: 'page-count',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '总页数,total 和 page-count 设置任意一个就可以达到显示页码的功能,如果要支持 page-sizes 的更改,则需要使用 total 属性',
+ 'en-US':
+ 'Setting either the total number of pages, total, or page count can achieve the function of displaying page numbers; If you want to support changes to page sizes, you need to use the total attribute'
+ },
+ mode: ['pc'],
+ pcDemo: 'page-count'
+ },
+ {
+ name: 'page-size',
+ type: 'Number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '每页显示条目个数,支持 .sync 修饰符',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'page-size/v-model:page-size',
+ type: 'number',
+ defaultValue: '10',
+ desc: {
+ 'zh-CN': '每页显示条目数',
+ 'en-US': 'Number of items displayed on each page'
+ },
+ mode: ['pc'],
+ pcDemo: 'page-size'
+ },
+ {
+ name: 'page-sizes',
+ type: 'number[]',
+ defaultValue: '[10, 20, 30, 40, 50, 100]',
+ desc: {
+ 'zh-CN': '设置指定可选择的每页显示条数,每页显示个数选择器的选项设置',
+ 'en-US':
+ 'Set the specified number of selectable display items per page; Option settings for displaying number selectors per page'
+ },
+ mode: ['pc'],
+ pcDemo: 'page-size'
+ },
+ {
+ name: 'pager-count',
+ type: 'number',
+ defaultValue: '7',
+ desc: {
+ 'zh-CN':
+ '设置页码按钮需要显示的最多个数,当总页数超过该值时会折叠,该属性的合法值为大于等于 5 且小于等于 21 的奇数',
+ 'en-US':
+ 'Set the maximum number of page number buttons to display; When the total number of pages exceeds this value, it will collapse; The optional values for this attribute are odd numbers greater than or equal to 5 and less than or equal to 21'
+ },
+ mode: ['pc'],
+ pcDemo: 'pager-count'
+ },
+ {
+ name: 'popper-append-to-body',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否将弹出框插入至 body 元素,可将该属性设置为 false(可参考 select 组件)',
+ 'en-US':
+ 'Whether to insert the pop-up box into the body element. You can set this attribute to false (refer to the select component)'
+ },
+ mode: ['pc'],
+ pcDemo: 'popper-append-to-body'
+ },
+ {
+ name: 'popper-class',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '为 popper 添加类名(可参考 popover 组件)',
+ 'en-US':
+ 'Indicates whether to insert a pop-up box to the body element. If an error occurs in locating a fault in the dialog box that is displayed, set this attribute to false (for details, see the select component).'
+ },
+ mode: ['pc'],
+ pcDemo: 'popper-class'
+ },
+ {
+ name: 'prev-text',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '替代图标显示的上一页文字',
+ 'en-US': 'Replace the previous page text displayed by the icon'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'custom-next-prev-text',
+ mfDemo: ''
+ },
+ {
+ name: 'show-total-loading',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否显示总条数加载中',
+ 'en-US': 'Is the total number of items being loaded'
+ },
+ mode: ['pc'],
+ pcDemo: 'show-total-loading'
+ },
+ {
+ name: 'size',
+ type: "'mini'",
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '定义分页尺寸',
+ 'en-US': 'Define the page size'
+ },
+ mode: ['pc'],
+ pcDemo: 'disabled-and-size'
+ },
+ {
+ name: 'total',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '总条目数',
+ 'en-US': 'Total number of entries'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mfDemo: ''
+ },
+ {
+ name: 'total-fixed-left',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '总条目数是否固定在左侧,Aurora、SMB主题默认值为 true',
+ 'en-US':
+ 'Whether the total number of entries is fixed on the left, the default value for Aurora and SMB themes is true'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ }
+ ],
+ events: [
+ {
+ name: 'before-page-change',
+ typeAnchorName: 'IBeforeChangeEvent',
+ type: 'IBeforeChangeEvent',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '当 is-before-page-change 设置为 true 后,翻页或改变页大小前会触发此事件,用户可以在参数中获取相应事件和分页相关信息控制后续逻辑',
+ 'en-US':
+ 'When the is-before-page-change is set to true, this event will be triggered before flipping or changing the page size. Users can obtain the corresponding event and pagination related information in the parameters to control the subsequent logic'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'before-page-change',
+ mfDemo: ''
+ },
+ {
+ name: 'current-change',
+ type: '(currentPage: number) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '当前所在页改变时会触发',
+ 'en-US': 'Triggered when the currentPage changes'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'pager-event',
+ mfDemo: ''
+ },
+ {
+ name: 'next-click',
+ type: '(currentPage: number) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '点击下一页按钮改变当前页后触发',
+ 'en-US': 'Triggered after clicking the next page button to change the current page'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'pager-event',
+ mfDemo: ''
+ },
+ {
+ name: 'prev-click',
+ type: '(currentPage: number) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '点击上一页按钮改变当前页后触发',
+ 'en-US': 'Triggered after clicking the previous page button to change the current page'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'pager-event',
+ mfDemo: ''
+ },
+ {
+ name: 'size-change',
+ type: '(pageSize: number) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '每页显示条目数改变后会触发',
+ 'en-US':
+ 'Set the event after pagination. This event is triggered when pageSize changes. arg1: pageSize new current value'
+ },
+ mode: ['pc'],
+ pcDemo: 'pager-event'
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义内容,需要在 layout 中列出 slot',
+ 'en-US': 'User-defined content. Slots must be listed in the layout'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-layout'
+ }
+ ]
+ }
+ ],
+ types: [
+ {
+ name: 'IBeforeChangeEvent',
+ type: 'interface',
+ code: `
+// 函数接受一个参数
+interface IBeforeChangeEvent {
+ (param: IBeforeChangeParam): void
+}
+interface IBeforeChangeParam {
+ callback: () => void // 回调函数,调用则继续本次变更
+ rollback: () => void // 回滚函数,调用则阻止本次变更
+ newPage: number // 变更后所在页
+ newPageSize: number // 变更后分页大小
+ currentPage: number // 当前所在页
+ currentPageSize: number // 当前分页大小
+}`
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/pop-upload.js b/examples/sites/demos/apis/pop-upload.js
new file mode 100644
index 000000000..c4374ffcb
--- /dev/null
+++ b/examples/sites/demos/apis/pop-upload.js
@@ -0,0 +1,306 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'pop-upload',
+ type: 'component',
+ props: [
+ {
+ name: 'accept',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '接受上传的文件类型',
+ 'en-US': 'File type to be uploaded'
+ },
+ mode: ['pc'],
+ pcDemo: 'file-type'
+ },
+ {
+ name: 'action',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '必选参数,设置上传的地址',
+ 'en-US': 'This parameter is mandatory and specifies the upload address.'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'before-remove',
+ typeAnchorName: 'file-upload#IFile',
+ type: '(file: IFile) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '删除文件之间的钩子函数,若返回 false 或者返回 Promise 且被 reject,则取消删除,反之则执行删除;入参为点击删除的文件信息',
+ 'en-US':
+ 'Delete the hook function between files. If it returns false or Promise and is rejected, cancel the deletion. Otherwise, execute the deletion; Enter the file information that was deleted by clicking on the input parameter'
+ },
+ mode: ['pc'],
+ pcDemo: 'prevent-delete-file'
+ },
+ {
+ name: 'before-upload',
+ typeAnchorName: 'file-upload#IFile',
+ type: '(file: IFile) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '上传文件之前的钩子,若返回 false 或者返回 Promise 且被 reject,则停止上传,反之则继续上传;入参为上传的文件信息',
+ 'en-US':
+ 'If the hook before uploading the file returns false or Promise and is rejected, the upload will be stopped. Otherwise, the upload will continue; Enter the uploaded file information as input'
+ },
+ mode: ['pc'],
+ pcDemo: 'before-upload'
+ },
+ {
+ name: 'cancel-button-text',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置文件上传弹框中取消按钮的文本;默认为 取消',
+ 'en-US': 'Set the text of the Cancel button in the file upload dialog box. The default value is Cancel'
+ },
+ mode: ['pc'],
+ pcDemo: 'fill-button-text'
+ },
+ {
+ name: 'data',
+ typeAnchorName: 'ICustomObject',
+ type: 'ICustomObject',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '上传时附带的额外参数',
+ 'en-US': 'Extra parameters attached during upload'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'dialog-title',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置文件上传弹框的标题;默认为 文件上传',
+ 'en-US': 'Set the title of the file upload dialog box. The default value is file upload'
+ },
+ mode: ['pc'],
+ pcDemo: 'fill-button-text'
+ },
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否禁用;默认为 false',
+ 'en-US': 'Whether to disable; The default value is false'
+ },
+ mode: ['pc'],
+ pcDemo: 'size'
+ },
+ {
+ name: 'headers',
+ typeAnchorName: 'ICustomObject',
+ type: 'ICustomObject',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置上传的请求头部',
+ 'en-US': 'Set the upload request header'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-request-headers'
+ },
+ {
+ name: 'http-request',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '覆盖默认的上传行为,可以自定义上传的实现',
+ 'en-US': 'Overwrite the default upload behavior. You can customize the upload implementation.'
+ },
+ mode: ['pc'],
+ pcDemo: 'http-request'
+ },
+ {
+ name: 'limit',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '最大允许上传个数',
+ 'en-US': 'Maximum number of files that can be uploaded'
+ },
+ mode: ['pc'],
+ pcDemo: 'file-limit'
+ },
+ {
+ name: 'max-upload-file-size',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '最大上传文件大小',
+ 'en-US': 'Maximum size of files to be uploaded'
+ },
+ mode: ['pc'],
+ pcDemo: 'file-type'
+ },
+ {
+ name: 'multiple',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否支持多选文件',
+ 'en-US': 'Specifies whether multiple files can be selected.'
+ },
+ mode: ['pc'],
+ pcDemo: 'file-limit'
+ },
+ {
+ name: 'size',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置组件大小',
+ 'en-US': 'Set the component size'
+ },
+ mode: ['pc'],
+ pcDemo: 'size'
+ },
+ {
+ name: 'submit-button-text',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置文件上传弹框中提交按钮的文本;默认为 开始上传',
+ 'en-US':
+ 'Set the text of the Submit button in the file upload dialog box. The default value is Start uploading'
+ },
+ mode: ['pc'],
+ pcDemo: 'fill-button-text'
+ },
+ {
+ name: 'upload-button-text',
+ type: 'string',
+ defaultValue: "'选择文件'",
+ desc: {
+ 'zh-CN': '打开弹出框的按钮的文本配置属性',
+ 'en-US': 'Text configuration attribute of the button for opening a dialog box'
+ },
+ mode: ['pc'],
+ pcDemo: 'fill-button-text'
+ },
+ {
+ name: 'upload-file-type',
+ type: 'Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': "对上传文件进行校验的类型,比如 ['.png', '.jpg']",
+ 'en-US': "Type of the uploaded file to be verified, for example, ['.png', '.jpg']"
+ },
+ mode: ['pc'],
+ pcDemo: 'file-type'
+ },
+ {
+ name: 'upload-name',
+ type: 'string',
+ defaultValue: "'file'",
+ desc: {
+ 'zh-CN': '上传的文件字段名',
+ 'en-US': 'Field name of the uploaded file'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'with-credentials',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '支持发送 cookie 凭证信息',
+ 'en-US': 'Cookie credential information can be sent.'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-request-headers'
+ }
+ ],
+ events: [
+ {
+ name: 'error',
+ typeAnchorName: 'file-upload#IFile',
+ type: '(file: IFile) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '文件上传失败时触发的事件; file 为当前上传失败文件信息',
+ 'en-US': 'Event triggered when file upload fails; file is the current upload failure file information'
+ },
+ mode: ['pc'],
+ pcDemo: 'upload-events'
+ },
+ {
+ name: 'exceed',
+ typeAnchorName: 'file-upload#IFile',
+ type: '(files: File | File[], fileList: IFile[]) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '文件超出个数限制时触发的事件; files 为上传的文件',
+ 'en-US': 'Event triggered when the number of files exceeds the limit; Files are uploaded files'
+ },
+ mode: ['pc'],
+ pcDemo: 'upload-events'
+ },
+ {
+ name: 'progress',
+ typeAnchorName: 'file-upload#IFile',
+ type: '(file: IFile) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '文件上传时触发的事件',
+ 'en-US': 'Event triggered during file upload'
+ },
+ mode: ['pc'],
+ pcDemo: 'upload-events'
+ },
+ {
+ name: 'remove',
+ typeAnchorName: 'file-upload#IFile',
+ type: '(file: IFile, fileList: IFile[]) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '从文件列表移除文件时触发的事件; file 为当前移除的文件信息',
+ 'en-US':
+ 'Event triggered when removing a file from the file list; File is the information of the currently removed file'
+ },
+ mode: ['pc'],
+ pcDemo: 'upload-events'
+ },
+ {
+ name: 'success',
+ typeAnchorName: 'IFile',
+ type: '(res: ProgressEvent, file: IFile) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '文件上传成功时触发的事件; res 为上传成功后的响应信息事件对象,file 为当前上传的文件',
+ 'en-US':
+ 'Event triggered when the file is successfully uploaded; Res is the response information event object after successful upload'
+ },
+ mode: ['pc'],
+ pcDemo: 'upload-events'
+ }
+ ],
+ methods: [],
+ slots: []
+ }
+ ],
+ types: [
+ {
+ name: 'ICustomObject',
+ type: 'interface',
+ code: `
+interface ICustomObject {
+ [propName: string]: any // 自定义属性
+}
+ `
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/popconfirm.js b/examples/sites/demos/apis/popconfirm.js
new file mode 100644
index 000000000..000c070e1
--- /dev/null
+++ b/examples/sites/demos/apis/popconfirm.js
@@ -0,0 +1,205 @@
+export default {
+ mode: ['pc', 'mobile-first'],
+ apis: [
+ {
+ name: 'popconfirm',
+ type: 'component',
+ props: [
+ {
+ name: 'cancel-button',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否展示取消按钮',
+ 'en-US': 'Is show the cancel button'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'cancel-button',
+ mfDemo: ''
+ },
+ {
+ name: 'custom-class',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '为气泡提示框自定义类名',
+ 'en-US': 'Set the pop confirm popper class name'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'custom-class',
+ mfDemo: ''
+ },
+ {
+ name: 'message',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '气泡提示框的内容',
+ 'en-US': 'Set the pop confirm content'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mfDemo: ''
+ },
+ {
+ name: 'placement',
+ typeAnchorName: 'popover#IPopperPlacement',
+ type: 'IPopperPlacement',
+ defaultValue: "'top'",
+ desc: {
+ 'zh-CN': '气泡提示框显示位置',
+ 'en-US': 'Set the pop confirm placement'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'placement',
+ mfDemo: ''
+ },
+ {
+ name: 'reference',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '触发弹出层显示的 HTML 元素',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'title',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置气泡提示框的标题',
+ 'en-US': 'Set the pop confirm title'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mfDemo: ''
+ },
+ {
+ name: 'trigger',
+ type: "'click' | 'hover'",
+ defaultValue: "'hover'",
+ desc: {
+ 'zh-CN': '气泡提示框显示触发方式',
+ 'en-US': 'How to show the pop confirm'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'trigger',
+ mfDemo: ''
+ },
+ {
+ name: 'type',
+ typeAnchorName: 'IPopconfirmtype',
+ type: 'IPopconfirmtype',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '提示图标类型,可以传入自定义图标',
+ 'en-US': 'Prompt icon type, custom icons can be passed in'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'type',
+ mfDemo: ''
+ },
+ {
+ name: 'width',
+ type: 'string | number',
+ defaultValue: '350',
+ desc: {
+ 'zh-CN': '气泡提示框宽度',
+ 'en-US': 'Set the pop confirm box with'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'width',
+ mfDemo: ''
+ }
+ ],
+ events: [
+ {
+ name: 'confirm',
+ typeAnchorName: 'IPopconfirmState',
+ type: '(state: IPopconfirmState) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '点击确认按钮时触发',
+ 'en-US': 'Triggered when confirm button is clicked'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'event',
+ mfDemo: ''
+ },
+ {
+ name: 'hide',
+ typeAnchorName: 'IPopconfirmState',
+ type: '(state: IPopconfirmState) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '气泡确认框关闭时触发',
+ 'en-US': 'Triggered when pop confirm hide'
+ },
+ mode: ['pc'],
+ pcDemo: 'event'
+ },
+ {
+ name: 'show',
+ typeAnchorName: 'IPopconfirmState',
+ type: '(state: IPopconfirmState) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '气泡确认框显示时触发',
+ 'en-US': 'Triggered when pop confirm show'
+ },
+ mode: ['pc'],
+ pcDemo: 'event'
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'footer',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '底部插槽',
+ 'en-US': 'default slot'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'slot-footer',
+ mfDemo: ''
+ },
+ {
+ name: 'reference',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '触发气泡提示框显示的 HTML 元素',
+ 'en-US': 'reference slot'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mfDemo: ''
+ }
+ ]
+ }
+ ],
+ types: [
+ {
+ name: 'IPplacement',
+ type: 'type',
+ code: `type IPplacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'`
+ },
+ {
+ name: 'IPopconfirmtype',
+ type: 'type',
+ code: `type IPopconfirmtype = 'info' | 'success' | 'warning' | 'error' | Component`
+ },
+ {
+ name: 'IPopconfirmState',
+ type: 'interface',
+ code: `interface IPopconfirmState {
+ showPopover: boolean
+ }`
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/popeditor.js b/examples/sites/demos/apis/popeditor.js
new file mode 100644
index 000000000..b84e9831d
--- /dev/null
+++ b/examples/sites/demos/apis/popeditor.js
@@ -0,0 +1,481 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'pop-editor',
+ type: 'component',
+ props: [
+ {
+ name: 'auto-lookup',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '初始化时是否自动请求数据',
+ 'en-US': 'Set initialization not to request data'
+ },
+ mode: ['pc'],
+ pcDemo: 'auto-lookup'
+ },
+ {
+ name: 'auto-reset',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '筛选后点击关闭是否自动重置筛选条件',
+ 'en-US': 'After filtering, click Off to reset the filter automatically'
+ },
+ mode: ['pc'],
+ pcDemo: 'auto-reset'
+ },
+ {
+ name: 'before-close',
+ type: '() => boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '可以配置一个拦截弹窗关闭的方法。如果方法返回 false 值,则拦截弹窗关闭,否则不拦截',
+ 'en-US': ''
+ },
+ mode: ['pc'],
+ pcDemo: 'before-close'
+ },
+ {
+ name: 'before-reset',
+ type: '() => boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '重置前的钩子函数',
+ 'en-US': 'Hook function before reset'
+ },
+ mode: ['pc'],
+ pcDemo: 'before-reset'
+ },
+ {
+ name: 'conditions',
+ typeAnchorName: 'IConditions',
+ type: 'IConditions[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '当弹出面板配置的是表格时,设置弹出面板中的表单查询项',
+ 'en-US': 'When a table is configured on the pop-up panel, set the table query items in the pop-up panel.'
+ },
+ mode: ['pc'],
+ pcDemo: 'conditions'
+ },
+ {
+ name: 'dialog-class',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义配置弹窗类名',
+ 'en-US': 'Customized configuration pop-up window class name'
+ },
+ mode: ['pc'],
+ pcDemo: 'width'
+ },
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '禁用状态',
+ 'en-US': 'Sets whether a component is disabled.'
+ },
+ mode: ['pc'],
+ pcDemo: 'disabled'
+ },
+ {
+ name: 'draggable',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '设置弹出窗口是否可拖动',
+ 'en-US': 'Set whether the pop-up window can be dragged.'
+ },
+ mode: ['pc'],
+ pcDemo: 'draggable'
+ },
+ {
+ name: 'grid-op',
+ typeAnchorName: 'grid#IGridOp',
+ type: 'IGridOp',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置弹出面板中表格组件的配置信息',
+ 'en-US': 'Set the configuration information of the table component in the pop-up panel.'
+ },
+ mode: ['pc'],
+ pcDemo: 'grid'
+ },
+ {
+ name: 'icon',
+ type: 'Component',
+ defaultValue: 'IconPopup',
+ desc: {
+ 'zh-CN': '自定义选择框尾部图标',
+ 'en-US': 'Set the icon of the popEditor component. The default value is svg component'
+ },
+ mode: ['pc'],
+ pcDemo: 'icon'
+ },
+ {
+ name: 'modelValue / v-model',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '绑定值',
+ 'en-US': 'Bound Value'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'multi',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '设置弹出面板中的数据是否可多选',
+ 'en-US': 'Specifies whether multiple data can be selected in the pop-up panel.'
+ },
+ mode: ['pc'],
+ pcDemo: 'multi'
+ },
+ {
+ name: 'pager-op',
+ typeAnchorName: 'pager#IPagerOp',
+ type: 'IPagerOp',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置分页配置',
+ 'en-US': 'Setting Pagination Configuration'
+ },
+ mode: ['pc'],
+ pcDemo: 'pager'
+ },
+ {
+ name: 'placeholder',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '占位符',
+ 'en-US': 'Placeholder'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'popseletor',
+ type: 'string',
+ defaultValue: 'grid',
+ desc: {
+ 'zh-CN': '设置弹出面板中可显示的树或者表格组件',
+ 'en-US': 'Set the tree or table components that can be displayed in the pop-up panel.'
+ },
+ mode: ['pc'],
+ pcDemo: 'tree'
+ },
+ {
+ name: 'radio-change-close',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '单选选中后是否关闭弹窗',
+ 'en-US': 'Whether to close the pop-up window after selecting a radio option'
+ },
+ mode: ['pc'],
+ pcDemo: 'radio-change-close'
+ },
+ {
+ name: 'readonly',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '设置是否只读,【3.0】设置为 false 后点击 Input 框可以弹出选择框',
+ 'en-US':
+ 'Set [3.0] to read-only. If [3.0] is set to false, click the Ipunt box to display the selection box.'
+ },
+ mode: ['pc'],
+ pcDemo: 'readonly'
+ },
+ {
+ name: 'remote-search',
+ type: '({ page, conditions }) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '配置远程搜索',
+ 'en-US': 'Configure remote search'
+ },
+ mode: ['pc'],
+ pcDemo: 'remote-search'
+ },
+ {
+ name: 'resize',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否显示弹框全屏按钮',
+ 'en-US': 'Whether to display the full-screen button in the pop-up box'
+ },
+ mode: ['pc'],
+ pcDemo: 'resize'
+ },
+ {
+ name: 'selected-box-op',
+ typeAnchorName: 'ISelectedBoxOp',
+ type: 'ISelectedBoxOp',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '通过属性 selected-box-op 指定 SelectedBox 组件配置,可以把已选表格显示为已选栏',
+ 'en-US': ''
+ },
+ mode: ['pc'],
+ pcDemo: 'selected-box-op'
+ },
+ {
+ name: 'show-clear-btn',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '设置输入框中右侧是否显示清除按钮',
+ 'en-US': 'Specifies whether to display the Clear button on the right of the text box.'
+ },
+ mode: ['pc'],
+ pcDemo: 'show-clear-btn'
+ },
+ {
+ name: 'show-history',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '当弹出面板配置的是表格时,设置历史记录标签页是否显示表格',
+ 'en-US':
+ 'Specifies whether to display tables on the History tab page when tables are configured on the pop-up panel.'
+ },
+ mode: ['pc'],
+ pcDemo: 'show-history'
+ },
+ {
+ name: 'show-pager',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '展示分页',
+ 'en-US': 'Paging'
+ },
+ mode: ['pc'],
+ pcDemo: 'pager'
+ },
+ {
+ name: 'show-selected-box',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '多选场景,是否将已选表格显示为已选栏',
+ 'en-US': ''
+ },
+ mode: ['pc'],
+ pcDemo: 'show-selected-box'
+ },
+ {
+ name: 'size',
+ type: "'medium' | 'small' | '' | 'mini'",
+ defaultValue: "''",
+ desc: {
+ 'zh-CN': '尺寸',
+ 'en-US': 'Set the component size. The options are medium, small, and mini.'
+ },
+ mode: ['pc'],
+ pcDemo: 'size'
+ },
+ {
+ name: 'suggest',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '配置 suggest 开启联想功能,输入框输入后自动触发联想查询,该功能需要联合 remote-search 使用',
+ 'en-US':
+ 'Configure the suggest to enable the association function, and automatically trigger the association query after entering the input box; This function needs to be used in conjunction with remoteSearch'
+ },
+ mode: ['pc'],
+ pcDemo: 'suggest'
+ },
+ {
+ name: 'tabindex',
+ type: 'string',
+ defaultValue: '1',
+ desc: {
+ 'zh-CN': '设置通过 Tab 键获焦及获焦顺序(readonly 属性设置为 false 时有效)',
+ 'en-US':
+ 'Sets whether focus can be obtained by pressing Tab and the focus sequence. This parameter is valid only when readonly is set to false.'
+ },
+ mode: ['pc'],
+ pcDemo: 'tabindex'
+ },
+ {
+ name: 'text-field',
+ type: 'string',
+ defaultValue: 'label',
+ desc: {
+ 'zh-CN': '设置输入框中显示文本的字段,提交数据时,不提交该显示文本',
+ 'en-US': 'Set the text field in the text box. When data is submitted, the text is not submitted.'
+ },
+ mode: ['pc'],
+ pcDemo: 'text-field'
+ },
+ {
+ name: 'text-split',
+ type: 'string',
+ defaultValue: '/',
+ desc: {
+ 'zh-CN': '在多选的情况下,设置输入框中要显示多个数据时的分隔符',
+ 'en-US': 'Separator for displaying multiple records in the text box when multiple records are selected.'
+ },
+ mode: ['pc'],
+ pcDemo: 'multi'
+ },
+ {
+ name: 'title',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置弹出面板的标题,并且支持国际化',
+ 'en-US': 'Set the title of the pop-up panel and support internationalization.'
+ },
+ mode: ['pc'],
+ pcDemo: 'title'
+ },
+ {
+ name: 'trigger',
+ type: "'default' | 'cell' | 'row'",
+ defaultValue: "'default'",
+ desc: {
+ 'zh-CN':
+ '弹框表格中为单选时 radio 的选中配置,可配置:default(默认), cell(点击单元格触发), row(点击行触发)',
+ 'en-US':
+ 'In the table in the dialog box that is displayed, the radio is selected. The options are as follows: default (default), cell (clicking a cell), and row (clicking a row)'
+ },
+ mode: ['pc'],
+ pcDemo: 'trigger'
+ },
+ {
+ name: 'value-field',
+ type: 'string',
+ defaultValue: 'id',
+ desc: {
+ 'zh-CN': '设置输入框要提交数据的字段',
+ 'en-US': 'Set the field to which data is to be submitted in the text box.'
+ },
+ mode: ['pc'],
+ pcDemo: 'title'
+ },
+ {
+ name: 'value-split',
+ type: 'string',
+ defaultValue: ';',
+ desc: {
+ 'zh-CN': '在多选的情况下,设置输入框要提交多个数据时的分隔符',
+ 'en-US':
+ 'Separator for submitting multiple pieces of data in the text box when multiple pieces of data are selected.'
+ },
+ mode: ['pc'],
+ pcDemo: 'multi'
+ },
+ {
+ name: 'width',
+ type: 'number | string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置弹出面板的宽度(单位像素),当组件的 multi = true 时,宽度最小为 900px,否则宽度最小为 600px',
+ 'en-US':
+ 'Wide of the pop-up panel, in pixels.When multi of a component is set to true, the minimum width is 900px. Otherwise, the minimum width is 600px.'
+ },
+ mode: ['pc'],
+ pcDemo: 'width'
+ }
+ ],
+ events: [
+ {
+ name: 'change',
+ type: '(commitValue, selectedDatas) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '数据发生变化的事件,commitValue 为选中数据的索引(value-field 配置的字段),selectedDatas 为选中的数据项',
+ 'en-US':
+ 'Change event in the input box of the Popeditor component. ; onChange(arg1, arg2){\n// arg1 = state.commitValue arg1 is the index of the submitted information. \n// arg2 = state.selectedDatas arg2 is the data of the submitted information. \n// do something you want...}'
+ },
+ mode: ['pc'],
+ pcDemo: 'events'
+ },
+ {
+ name: 'close',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '弹框关闭时触发的事件',
+ 'en-US': 'Event triggered when the pop-up dialog box of the Popeditor component is closed.'
+ },
+ mode: ['pc'],
+ pcDemo: 'events'
+ },
+ {
+ name: 'page-change',
+ type: '(page: number) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '表格模式分页切换事件,page 为分页切换页码',
+ 'en-US':
+ 'Indicates that the table mode of the Popeditor component is switched by page. ; onPageChange (arg1) {// arg1 = val arg1 is the page number. // do something you want...}'
+ },
+ mode: ['pc'],
+ pcDemo: 'events'
+ },
+ {
+ name: 'popup',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '弹框打开时触发的事件',
+ 'en-US': 'The event that is triggered when the Popeditor component pop-up box is opened.'
+ },
+ mode: ['pc'],
+ pcDemo: 'events'
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'footer',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '底部区域插槽',
+ 'en-US': ''
+ },
+ mode: ['pc'],
+ pcDemo: 'slot-footer'
+ },
+ {
+ name: 'search',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '查询条件插槽',
+ 'en-US': 'Query Condition Slot'
+ },
+ mode: ['pc'],
+ pcDemo: 'slot'
+ }
+ ]
+ }
+ ],
+ types: [
+ {
+ name: 'IConditions',
+ type: 'interface',
+ code: `
+interface IConditions {
+ field: string
+ label: string
+}
+ `
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/popover.js b/examples/sites/demos/apis/popover.js
new file mode 100644
index 000000000..1e0a34c53
--- /dev/null
+++ b/examples/sites/demos/apis/popover.js
@@ -0,0 +1,388 @@
+export default {
+ mode: ['pc', 'mobile', 'mobile-first'],
+ apis: [
+ {
+ name: 'popover',
+ type: 'component',
+ props: [
+ {
+ name: 'append-to-body',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否添加到body上',
+ 'en-US': 'Whether to add it to the body'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: '',
+ mobileDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'arrow-offset',
+ type: 'number',
+ defaultValue: '0',
+ desc: {
+ 'zh-CN': '弹出层的箭头偏移位置',
+ 'en-US': "the layer's arrow offset "
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'offset',
+ mobileDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'close-delay',
+ type: 'number',
+ defaultValue: '200',
+ desc: {
+ 'zh-CN': '触发方式为 hover 时的隐藏延迟,单位为毫秒',
+ 'en-US': 'The close delay when the trigger mode is hover, in milliseconds'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'delay',
+ mobileDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'content',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '弹出层的内容',
+ 'en-US': 'Layer Content.'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mobileDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否禁用',
+ 'en-US': 'Whether the status is visible'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'disabled',
+ mobileDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'height',
+ type: "'auto' | number",
+ defaultValue: "'auto'",
+ desc: {
+ 'zh-CN': '弹出层高度',
+ 'en-US': 'Layer height'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'listData',
+ type: 'Array | Object',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '内容对象列表,对象字段包含:icon图片地址、label标题、subLabel子标题
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'base'
+ },
+ {
+ name: 'maxHeight',
+ type: 'Number | String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '最大高度
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'base'
+ },
+ {
+ name: 'modelValue / v-model',
+ type: 'Boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '状态是否可见
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: ''
+ },
+ {
+ name: 'offset',
+ type: 'number',
+ defaultValue: '0',
+ desc: {
+ 'zh-CN': '弹出层的偏移量',
+ 'en-US': 'Layer offset'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'offset',
+ mobileDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'open-delay',
+ type: 'number',
+ defaultValue: '0',
+ desc: {
+ 'zh-CN': '触发方式为 hover 时的显示延迟,单位为毫秒',
+ 'en-US': 'The display delay when the trigger mode is hover, in milliseconds'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'delay',
+ mobileDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'placement',
+ typeAnchorName: 'IPopperPlacement',
+ type: 'IPopperPlacement',
+ defaultValue: "'bottom'",
+ desc: {
+ 'zh-CN': '弹出层出现的位置',
+ 'en-US': 'Layer Placement'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'custom-popper',
+ mobileDemo: 'base',
+ mfDemo: ''
+ },
+ {
+ name: 'popper-class',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '为弹出层添加类名',
+ 'en-US': 'Add a class name for the pop-up layer.'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'custom-popper',
+ mobileDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'popper-options',
+ type: 'object',
+ defaultValue: '{}',
+ desc: {
+ 'zh-CN': '弹出层参数',
+ 'en-US': 'layer parameters; Refer to the description of IPopperOption'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'popper-options',
+ mobileDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'title',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '弹出层的标题',
+ 'en-US': 'Layer Title'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mobileDemo: 'base',
+ mfDemo: ''
+ },
+ {
+ name: 'transform-origin',
+ type: 'Boolean | String',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '组件的旋转中心点
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile', 'mobile-first'],
+ mobileDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'transition',
+ type: 'string',
+ defaultValue: "'fade-in-linear'",
+ desc: {
+ 'zh-CN': '定义渐变动画',
+ 'en-US': 'Define gradient animation'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'transition',
+ mobileDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'trigger',
+ type: "'click' | 'focus' | 'hover' | 'manual'",
+ defaultValue: "'click'",
+ desc: {
+ 'zh-CN': '触发方式',
+ 'en-US': 'Trigger mode'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'trigger',
+ mobileDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'v-model',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '状态是否可见',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'v-model / modelValue',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '状态是否可见,仅在 trigger="manual"
时有效',
+ 'en-US': 'Status is visible only when trigger="manual"
'
+ },
+ mode: ['pc'],
+ pcDemo: 'trigger'
+ },
+ {
+ name: 'visible-arrow',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否显示弹出层的箭头',
+ 'en-US': "whether to show layer's arrow"
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'custom-popper',
+ mobileDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'width',
+ type: "'auto' | number",
+ defaultValue: "'auto'",
+ desc: {
+ 'zh-CN': '弹出层宽度',
+ 'en-US': 'Layer width'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mobileDemo: 'base',
+ mfDemo: ''
+ }
+ ],
+ events: [
+ {
+ name: 'after-enter',
+ type: '()=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '进入的动画播放完毕后触发',
+ 'en-US': 'This event is triggered after the animation is played.'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'events',
+ mobileDemo: 'base',
+ mfDemo: ''
+ },
+ {
+ name: 'after-leave',
+ type: '()=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '离开的动画播放完毕后触发',
+ 'en-US': 'Triggered after the hidden animation is played.'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'events',
+ mobileDemo: 'base',
+ mfDemo: ''
+ },
+ {
+ name: 'hide',
+ type: '()=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '隐藏时触发',
+ 'en-US': 'Triggered when hidden'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'events',
+ mobileDemo: 'base',
+ mfDemo: ''
+ },
+ {
+ name: 'show',
+ type: '()=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '显示时触发',
+ 'en-US': 'Triggered when display'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'events',
+ mobileDemo: 'base',
+ mfDemo: ''
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '弹出层元素插槽',
+ 'en-US': 'The layer element slot'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'content',
+ mobileDemo: 'base',
+ mfDemo: ''
+ },
+ {
+ name: 'reference',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '触发源元素插槽,该插槽是必传插槽。',
+ 'en-US': "The layer's reference element slot"
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'content',
+ mobileDemo: 'base',
+ mfDemo: ''
+ }
+ ]
+ }
+ ],
+ types: [
+ {
+ name: 'IPopperOption',
+ type: 'interface',
+ code: `
+interface IPopperOption {
+ bubbling: boolean // 是否监听元素所有上级有滚动元素的scroll事件,监听到则更新popper的位置。用于解决某些弹出层位置在页面滚动时,位置不正确的场景,默认false
+ followReferenceHide: boolean // 当触发源隐藏时,自动隐藏弹出层,默认true
+ removeOnDestroy: boolean // 弹出层消失后,是否移除弹出层的DOM元素,布尔false
+}
+ `
+ },
+ {
+ name: 'IPopperPlacement',
+ type: 'type',
+ code: `
+type IPopperPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'
+ `
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/progress.js b/examples/sites/demos/apis/progress.js
new file mode 100644
index 000000000..9b1c0c18e
--- /dev/null
+++ b/examples/sites/demos/apis/progress.js
@@ -0,0 +1,166 @@
+export default {
+ mode: ['pc', 'mobile', 'mobile-first'],
+ apis: [
+ {
+ name: 'progress',
+ type: 'component',
+ props: [
+ {
+ name: 'color',
+ typeAnchorName: 'IColorItem',
+ type: 'string | IColorItem[] | (percentage: string) => string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '进度条背景色(会覆盖 status 状态颜色)',
+ 'en-US': 'Background color of the progress bar (overwrites the status color)'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'custom-color',
+ mobileDemo: 'custom-color',
+ mfDemo: ''
+ },
+ {
+ name: 'format',
+ type: '() => string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义进度条的文字',
+ 'en-US': 'Customize the text of the progress bar'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'format-text',
+ mfDemo: ''
+ },
+ {
+ name: 'info',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '环形进度条底部描述文字',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'percentage',
+ type: 'number',
+ defaultValue: '0',
+ desc: {
+ 'zh-CN': '百分比(必填);该属性的可选值为 0-100',
+ 'en-US': 'Percentage (mandatory) The optional values for this property are 0 - 100'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mobileDemo: 'dynamic-progress',
+ mfDemo: ''
+ },
+ {
+ name: 'show-text',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否显示进度条文字内容',
+ 'en-US': 'Display progress bar text'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'format-text',
+ mobileDemo: 'text-inside-or-no-text',
+ mfDemo: ''
+ },
+ {
+ name: 'size',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '进度条尺寸',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'status',
+ type: "'success' | 'exception' | 'warning'",
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '进度条当前状态',
+ 'en-US': 'Current status of the progress bar'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'progress-status',
+ mobileDemo: 'progress-status',
+ mfDemo: ''
+ },
+ {
+ name: 'stroke-width',
+ type: 'number',
+ defaultValue: '6',
+ desc: {
+ 'zh-CN': 'line 类型进度条的宽度,单位 px',
+ 'en-US': 'The width of the progress bar of type line, in px'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mobileDemo: 'progress-width',
+ mfDemo: ''
+ },
+ {
+ name: 'text-inside',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '进度条显示文字内置在进度条内(只在 type=line 时可用)',
+ 'en-US':
+ 'The text displayed on the progress bar is embedded in the progress bar. This parameter is available only when type is set to line'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'format-text',
+ mobileDemo: 'format-text',
+ mfDemo: ''
+ },
+ {
+ name: 'type',
+ type: "'line' | 'circle' | 'dashboard'",
+ defaultValue: "'line'",
+ desc: {
+ 'zh-CN': '进度条类型',
+ 'en-US': 'Progress bar type'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'progress-type-circle',
+ mobileDemo: 'progress-type',
+ mfDemo: ''
+ },
+ {
+ name: 'width',
+ type: 'number',
+ defaultValue: '126',
+ desc: {
+ 'zh-CN': '环形进度条画布宽度(只在 type 为 circle 或 dashboard 时可用)',
+ 'en-US': 'Circular progress bar canvas width (available only when type is circle or dashboard)'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'progress-type-circle',
+ mobileDemo: 'width',
+ mfDemo: ''
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: []
+ }
+ ],
+ types: [
+ {
+ name: 'IColorItem',
+ type: 'type',
+ code: `
+interface IColorItem {
+ color: string
+ percentage: number
+}
+`
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/pull-refresh.js b/examples/sites/demos/apis/pull-refresh.js
new file mode 100644
index 000000000..b8c3b8aa0
--- /dev/null
+++ b/examples/sites/demos/apis/pull-refresh.js
@@ -0,0 +1,383 @@
+export default {
+ mode: ['mobile', 'mobile-first'],
+ apis: [
+ {
+ name: 'pull-refresh ',
+ type: 'component',
+ props: [
+ {
+ name: 'disabled-pull-down',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否禁用下拉刷新
',
+ 'en-US': 'disablde pull down'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'disabled-pull-down'
+ },
+ {
+ name: 'disabled-pull-up',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否禁用上拉
',
+ 'en-US': 'disablded pull up'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'disabled-pull-up'
+ },
+ {
+ name: 'has-more',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否有更多数据
',
+ 'en-US': 'has more'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'has-more'
+ },
+ {
+ name: 'loosing-text',
+ type: 'string',
+ defaultValue: '释放即可刷新',
+ desc: {
+ 'zh-CN': '下拉高度大于等于head-height时的提示文字,默认为:释放即可刷新
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'loosing-text'
+ },
+ {
+ name: 'pull-down-loading-text',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '下拉加载文字
',
+ 'en-US': 'pull down loading text'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'pulling-text'
+ },
+ {
+ name: 'pull-up-distance',
+ type: 'number',
+ defaultValue: '18',
+ desc: {
+ 'zh-CN': '触发上拉刷新的距离
',
+ 'en-US': 'pull up distance'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'pull-up-distance'
+ },
+ {
+ name: 'pull-up-loading-text',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '上拉加载文字
',
+ 'en-US': 'pull up loading text'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'pulling-text'
+ },
+ {
+ name: 'v-model',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否刷新状态,可以手动设置false来关闭刷新
',
+ 'en-US': 'is refreshing'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'base'
+ }
+ ],
+ events: [
+ {
+ name: 'pull-down',
+ type: '(event: PullEvent) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '下拉时触发的事件
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'event'
+ },
+ {
+ name: 'pull-up',
+ type: '(event: PullEvent) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '上拉时触发的事件
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'event'
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'footer',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '上拉加载更多插槽
',
+ 'en-US': 'pull up slot'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'pull-refresh-slot'
+ },
+ {
+ name: 'header',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '下拉刷新插槽
',
+ 'en-US': 'pull down slot'
+ },
+ mode: ['mobile'],
+ mobileDemo: ''
+ }
+ ]
+ },
+ {
+ name: 'pull-refresh',
+ type: 'component',
+ props: [
+ {
+ mode: []
+ },
+ {
+ name: 'disabled',
+ type: 'Boolean',
+ defaultValue: '默认值是false',
+ desc: {
+ 'zh-CN': '是否禁用下拉刷新',
+ 'en-US': 'Whether to disable pull-down refresh'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'disabled'
+ },
+ {
+ name: 'headHeight',
+ type: '[Number, String]',
+ defaultValue: '默认值是50',
+ desc: {
+ 'zh-CN': '组件头部提示区域的高度',
+ 'en-US': 'Height of the component head prompt area'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'head-height'
+ },
+ {
+ name: 'loadingOptions',
+ type: 'Object',
+ defaultValue: '默认值是空对象{}',
+ desc: {
+ 'zh-CN': '不使用loading插槽时,内置加载组件Loading的参数:Loading.service(options)',
+ 'en-US':
+ 'When the loading slot is not used, the loading parameter of the built-in loading component is Loading.service(options).'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'loadingText',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '数据刷新过程的提示文本',
+ 'en-US': 'Prompt text for the data refresh process'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'loosingText',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '向下拖动超过阈值后可松开进行刷新的提示文本',
+ 'en-US': 'Drag down to release the prompt text for refresh after the threshold is exceeded.'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'loosing-text'
+ },
+ {
+ name: 'modelValue',
+ type: 'Boolean',
+ defaultValue: '默认值是false',
+ desc: {
+ 'zh-CN': '是否正在进行下拉刷新',
+ 'en-US': 'Is the pull-down refresh in progress'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'pullDistance',
+ type: '[Number, String]',
+ defaultValue: '默认值是属性 `headHeight` 的值',
+ desc: {
+ 'zh-CN': '拖拽产生刷新的距离',
+ 'en-US': 'Refreshing distance generated by dragging'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'pullingText',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '向下拖动过程的提示文本',
+ 'en-US': 'Drag down the prompt text for the procedure'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'pulling-text'
+ },
+ {
+ name: 'selfSimulate',
+ type: 'Boolean',
+ defaultValue: '默认值是false',
+ desc: {
+ 'zh-CN':
+ '是否开启自模拟Touch事件。如果开启,那么组件只处理自身产生的模拟Touch事件,忽略冒泡上来的非自身模拟事件。正常非模拟Touch事件始终不会跳过处理',
+ 'en-US':
+ 'Indicates whether to enable the self-simulation Touch event. If this function is enabled, the component only processes simulated Touch events generated by itself and ignores non-simulated events generated by itself. Normal non-simulated Touch events never skip processing'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'successDuration',
+ type: '[Number, String]',
+ defaultValue: '默认值是500',
+ desc: {
+ 'zh-CN': '刷新成功提示文本延时消失时间',
+ 'en-US': 'Time for the text to disappear after the refresh is successful.'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'success-duration'
+ },
+ {
+ name: 'successText',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '刷新成功的提示文本',
+ 'en-US': 'Text of the message indicating that the refresh is successful'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'success-text'
+ }
+ ],
+ events: [
+ {
+ name: 'change',
+ type: 'Function({ status, distance })',
+ defaultValue: 'status:{String 组件当前状态},distance:{Number 当前的拖动距离}',
+ desc: {
+ 'zh-CN': '在组件状态改变时抛出',
+ 'en-US': 'Thrown when the component state changes'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'refresh',
+ type: 'Function()',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在组件状态进入 loading 刷新数据时抛出',
+ 'en-US': 'Thrown when the component enters the loading state to refresh data'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'update:modelValue',
+ type: 'Function(isLoading)',
+ defaultValue: 'isLoading:{Boolean 组件是否处于 loading}',
+ desc: {
+ 'zh-CN': '在组件状态进入 loading 刷新数据时抛出',
+ 'en-US': 'Thrown when the component enters the loading state to refresh data'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '组件默认插槽',
+ 'en-US': 'Component Default Slot'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'pull-refresh-slot'
+ },
+ {
+ name: 'loading',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '组件 loading 插槽,自定义 loading 状态的提示',
+ 'en-US': 'Component loading slot, which is used to customize the loading status prompt.'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'pull-refresh-slot'
+ },
+ {
+ name: 'loosing',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '组件 loosing 插槽,自定义 loosing 状态的提示',
+ 'en-US': 'Component loosing slot, which is used to customize the loosing status prompt.'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'pull-refresh-slot'
+ },
+ {
+ name: 'normal',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '组件 normal 插槽,自定义 normal 状态的提示',
+ 'en-US': 'Indicates the normal slot of the component. The prompt for the normal status is customized.'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'pull-refresh-slot'
+ },
+ {
+ name: 'pulling',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '组件 pulling 插槽,自定义 pulling 状态的提示',
+ 'en-US': 'Pull slot of the component, which is used to customize the prompt of the pull status.'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'pull-refresh-slot'
+ },
+ {
+ name: 'success',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '组件 success 插槽,自定义 success 状态的提示',
+ 'en-US': 'Indicates the success slot of the component. The success status is customized.'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'pull-refresh-slot'
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/qr-code.js b/examples/sites/demos/apis/qr-code.js
new file mode 100644
index 000000000..ea01d0ec6
--- /dev/null
+++ b/examples/sites/demos/apis/qr-code.js
@@ -0,0 +1,102 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'qr-code',
+ type: 'component',
+ props: [
+ {
+ name: 'bordered',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否有边框',
+ 'en-US': 'Whether has border style'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'color',
+ type: 'string',
+ defaultValue: "'#000'",
+ desc: {
+ 'zh-CN': '二维码颜色, 仅支持十六进制',
+ 'en-US': 'QRCode Color'
+ },
+ mode: ['pc'],
+ pcDemo: 'style'
+ },
+ {
+ name: 'icon',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '二维码中图片的地址(目前只支持图片地址)',
+ 'en-US': 'include image url (only image link are supported)'
+ },
+ mode: ['pc'],
+ pcDemo: 'icon'
+ },
+ {
+ name: 'icon-size',
+ type: 'number',
+ defaultValue: '50',
+ desc: {
+ 'zh-CN': '二维码中图片的大小,icon 覆盖面积不能超过二维码面积的 30%, 否则影响扫码',
+ 'en-US': 'include image size,no more than 30%'
+ },
+ mode: ['pc'],
+ pcDemo: 'icon'
+ },
+ {
+ name: 'level',
+ type: 'string',
+ defaultValue: "'Medium'",
+ desc: {
+ 'zh-CN': "二维码纠错等级, 可选 'Low' | 'Medium' | 'Quality' | 'High'",
+ 'en-US': 'Error Code Level'
+ },
+ mode: ['pc'],
+ pcDemo: 'level'
+ },
+ {
+ name: 'size',
+ type: 'number',
+ defaultValue: '200',
+ desc: {
+ 'zh-CN': '二维码大小',
+ 'en-US': 'QRCode size'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'value',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '扫描后的文本',
+ 'en-US': 'scanned text'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ }
+ ],
+ events: [
+ {
+ name: 'change',
+ type: '()=> void',
+ desc: {
+ 'zh-CN': '二维码发生变化后的回调',
+ 'en-US': 'chang callback'
+ },
+ mode: ['pc'],
+ pcDemo: 'level'
+ }
+ ],
+ methods: [],
+ slots: []
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/query-builder.js b/examples/sites/demos/apis/query-builder.js
new file mode 100644
index 000000000..b4b58ca0e
--- /dev/null
+++ b/examples/sites/demos/apis/query-builder.js
@@ -0,0 +1,4 @@
+export default {
+ mode: ['pc'],
+ apis: []
+}
diff --git a/examples/sites/demos/apis/radio-block.js b/examples/sites/demos/apis/radio-block.js
new file mode 100644
index 000000000..7edcbd58a
--- /dev/null
+++ b/examples/sites/demos/apis/radio-block.js
@@ -0,0 +1,13 @@
+export default {
+ mode: ['mobile-first'],
+ apis: [
+ {
+ name: 'radio-block',
+ type: 'component',
+ props: [],
+ events: [],
+ methods: [],
+ slots: []
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/radio.js b/examples/sites/demos/apis/radio.js
new file mode 100644
index 000000000..b29c8afcf
--- /dev/null
+++ b/examples/sites/demos/apis/radio.js
@@ -0,0 +1,385 @@
+export default {
+ mode: ['pc', 'mobile', 'mobile-first'],
+ apis: [
+ {
+ name: 'radio',
+ type: 'component',
+ props: [
+ {
+ name: 'border',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否显示边框',
+ 'en-US': 'Display Border'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'with-border',
+ mfDemo: ''
+ },
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否禁用',
+ 'en-US': 'Disable'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'dynamic-disable',
+ mobileDemo: 'disabled',
+ mfDemo: ''
+ },
+ {
+ name: 'display-only',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否只读状态',
+ 'en-US': 'Is display only'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'display-only',
+ mfDemo: ''
+ },
+ {
+ name: 'label',
+ type: 'boolean | number | string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': 'radio 选中时的值',
+ 'en-US': 'Value when radio is selected'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mobileDemo: 'label',
+ mfDemo: ''
+ },
+ {
+ name: 'modelValue / v-model',
+ type: 'boolean | number | string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '绑定值',
+ 'en-US': 'Bound Value'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'name',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '原生 name 属性',
+ 'en-US': 'Native name attribute'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: '',
+ mobileDemo: 'base',
+ mfDemo: ''
+ },
+ {
+ name: 'size',
+ type: "'medium' | small' | 'mini'",
+ defaultValue: '',
+ desc: {
+ 'zh-CN': 'radio 的尺寸,仅在 border 为真时有效',
+ 'en-US': 'radio size. This parameter is valid only when border is set to true'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'radio-size',
+ mfDemo: ''
+ },
+ {
+ name: 'tabindex',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': 'Radio 组件的 tabindex。默认值为 1 ',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'text',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '单选框文本内容',
+ 'en-US': 'Radio Box Text Content'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'radio-text',
+ mobileDemo: 'base',
+ mfDemo: ''
+ },
+ {
+ name: 'v-model',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '绑定值',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'value',
+ type: 'object | string',
+ defaultValue: '{}',
+ desc: {
+ 'zh-CN': '绑定值,该属性默认为{}
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'base'
+ }
+ ],
+ events: [
+ {
+ name: 'change',
+ type: '(value: boolean | number | string) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '绑定值变化时触发的事件',
+ 'en-US': 'Event triggered when the binding value changes'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'radio-events',
+ mobileDemo: 'event',
+ mfDemo: ''
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': 'radio 的默认插槽',
+ 'en-US': 'Radio default slot'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'default-slot',
+ mobileDemo: '',
+ mfDemo: ''
+ }
+ ]
+ },
+ {
+ name: 'radio-group',
+ type: 'component',
+ props: [
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否禁用单选组',
+ 'en-US': 'Disable radio group'
+ },
+ mode: ['pc'],
+ pcDemo: 'dynamic-disable'
+ },
+ {
+ name: 'display-only',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否只读状态',
+ 'en-US': 'Is display only'
+ },
+ mode: ['pc'],
+ pcDemo: 'display-only'
+ },
+ {
+ name: 'fill',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '按钮形式单选选中时的背景颜色',
+ 'en-US': 'Set the background color for button form when radio selected'
+ },
+ mode: ['pc'],
+ pcDemo: 'active-color'
+ },
+ {
+ name: 'modelValue / v-model',
+ type: 'string[] | number[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '单选组绑定值',
+ 'en-US': 'Radio group binding value'
+ },
+ mode: ['pc'],
+ pcDemo: 'radio-group'
+ },
+ {
+ name: 'options',
+ typeAnchorName: 'IRadioGroupOptions',
+ type: 'IRadioGroupOptions[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '配置式单选组设置列表',
+ 'en-US': 'Configuration based radio group settings list'
+ },
+ mode: ['pc'],
+ pcDemo: 'group-options'
+ },
+ {
+ name: 'size',
+ type: "'medium' | small' | 'mini'",
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '单选组尺寸',
+ 'en-US': 'Radio Group Size'
+ },
+ mode: ['pc'],
+ pcDemo: 'radio-size'
+ },
+ {
+ name: 'text-color',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '按钮形式单选激活时的文本颜色',
+ 'en-US': 'Set the text color for button format radio active'
+ },
+ mode: ['pc'],
+ pcDemo: 'active-color'
+ },
+ {
+ name: 'type',
+ type: "'radio' | 'button'",
+ defaultValue: "'radio'",
+ desc: {
+ 'zh-CN': '配置式单选组的展示形式',
+ 'en-US': 'Set the display format of configurable radio groups'
+ },
+ mode: ['pc'],
+ pcDemo: 'group-options'
+ },
+ {
+ name: 'vertical',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '垂直显示单选组',
+ 'en-US': 'Vertical display of radio groups'
+ },
+ mode: ['pc'],
+ pcDemo: 'vertical'
+ }
+ ],
+ events: [
+ {
+ name: 'change',
+ type: '(value: number[] | string[]) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '绑定值变化时触发的事件',
+ 'en-US': 'Event triggered when the binding value changes'
+ },
+ mode: ['pc'],
+ pcDemo: 'radio-events'
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': 'radio-group 的默认插槽',
+ 'en-US': 'Radio group default slot'
+ },
+ mode: ['pc'],
+ pcDemo: 'radio-group'
+ }
+ ]
+ },
+ {
+ name: 'radio-button',
+ type: 'component',
+ props: [
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否禁用',
+ 'en-US': 'Is disabled'
+ },
+ mode: ['pc'],
+ pcDemo: 'dynamic-disable'
+ },
+ {
+ name: 'label',
+ type: 'boolean | number | string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': 'Radio 的 value',
+ 'en-US': 'Radio value'
+ },
+ mode: ['pc'],
+ pcDemo: 'radio-group'
+ },
+ {
+ name: 'name',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '原生name属性',
+ 'en-US': 'Native name attribute'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'text',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '单选框文本内容',
+ 'en-US': 'Radio Box Text Content'
+ },
+ mode: ['pc'],
+ pcDemo: 'radio-text'
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '默认插槽',
+ 'en-US': 'Default slot'
+ },
+ mode: ['pc'],
+ pcDemo: 'default-slot'
+ }
+ ]
+ }
+ ],
+ types: [
+ {
+ name: 'IRadioGroupOptions',
+ type: 'interface',
+ code: `
+interface IRadioGroupOptions {
+ label: string // 选中时对应的值
+ text?: number // 描述文本
+ events?: {
+ click?: (e: Event) => void // 点击事件
+ change?: (e: Event) => void // change事件
+ }
+}`
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/rate.js b/examples/sites/demos/apis/rate.js
new file mode 100644
index 000000000..9f84f663d
--- /dev/null
+++ b/examples/sites/demos/apis/rate.js
@@ -0,0 +1,312 @@
+export default {
+ mode: ['pc', 'mobile-first'],
+ apis: [
+ {
+ name: 'rate',
+ type: 'component',
+ props: [
+ {
+ name: 'allow-half',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否允许半选',
+ 'en-US': 'Whether to allow half selection'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'allow-half',
+ mfDemo: ''
+ },
+ {
+ name: 'colors',
+ type: '[string, string, string]',
+ defaultValue: "['#FADB14', '#FADB14', '#FADB14']",
+ desc: {
+ 'zh-CN': 'icon 的颜色数组,为 Threshold 三个分段所对应的颜色',
+ 'en-US': 'icon color array, which is the color corresponding to the Threshold three segments.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'custom-3-threshold-colors',
+ mfDemo: ''
+ },
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否为只读',
+ 'en-US': 'Read-only'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'dynamic-disable',
+ mfDemo: ''
+ },
+ {
+ name: 'disabled-void-color',
+ type: 'string',
+ defaultValue: "'#D9D9D9'",
+ desc: {
+ 'zh-CN': '禁用状态下未选中 icon 的颜色',
+ 'en-US': 'Color of unselected icons in disabled state'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'disabled-not-selected-color',
+ mfDemo: ''
+ },
+ {
+ name: 'disabled-void-icon-class',
+ typeAnchorName: 'IRateIconName',
+ type: 'IRateIconName',
+ defaultValue: "'icon-starActive'",
+ desc: {
+ 'zh-CN': '只读状态下未选中的图标样式名',
+ 'en-US': 'Icon style name that is not selected in read-only state.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'disabled-not-selected-class',
+ mfDemo: ''
+ },
+ {
+ name: 'high-threshold',
+ type: 'number',
+ defaultValue: '4',
+ desc: {
+ 'zh-CN': '高分和中等分数的界限值,值本身被划分在高分中',
+ 'en-US':
+ 'The threshold between the high score and the medium score. The value is divided into the high score.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'threshold-value',
+ mfDemo: ''
+ },
+ {
+ name: 'icon-classes',
+ typeAnchorName: 'IRateIconName',
+ type: '[IRateIconName, IRateIconName, IRateIconName]',
+ defaultValue: "['icon-starActive', 'icon-starActive', 'icon-starActive']",
+ desc: {
+ 'zh-CN': '三个分段对应的图标样式名',
+ 'en-US': 'Icon style name corresponding to the three segments'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'custom-3-threshold-icon',
+ mfDemo: ''
+ },
+ {
+ name: 'low-threshold',
+ type: 'number',
+ defaultValue: '2',
+ desc: {
+ 'zh-CN': '低分和中等分数的界限值,值本身被划分在低分中',
+ 'en-US':
+ 'The threshold value of the low score and the medium score. The value is divided into the low score.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'threshold-value',
+ mfDemo: ''
+ },
+ {
+ name: 'max',
+ type: 'number',
+ defaultValue: '5',
+ desc: {
+ 'zh-CN': '最大分值',
+ 'en-US': 'Maximum score'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'max-score',
+ mfDemo: ''
+ },
+ {
+ name: 'modelValue / v-model',
+ type: 'number',
+ defaultValue: '0',
+ desc: {
+ 'zh-CN': '绑定值',
+ 'en-US': 'Bound Value'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'radio',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '评分其他形态单选',
+ 'en-US': 'Single choice for scoring other forms'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'radio-rate',
+ mfDemo: ''
+ },
+ {
+ name: 'score-template',
+ type: 'string',
+ defaultValue: "'{value}'",
+ desc: {
+ 'zh-CN': '分数显示模板,用“{value}”代表分数',
+ 'en-US': 'Score display template'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'show-score',
+ mfDemo: ''
+ },
+ {
+ name: 'show-score',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否显示当前分数,show-score 和 show-text 不能同时为真',
+ 'en-US':
+ 'Whether to display the current score. The values of show-score and show-text cannot be true at the same time.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'show-score',
+ mfDemo: ''
+ },
+ {
+ name: 'show-text',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否显示辅助文字,若为真,则会从 texts 数组中选取当前分数对应的文字内容',
+ 'en-US':
+ 'Indicates whether to display auxiliary text. If yes, the text corresponding to the current score is selected from the texts array.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'texts-and-text-color',
+ mfDemo: ''
+ },
+ {
+ name: 'size',
+ type: 'string',
+ defaultValue: "'18px'",
+ desc: {
+ 'zh-CN': '图标字体大小',
+ 'en-US': 'Icon font size'
+ },
+ mode: ['pc'],
+ pcDemo: 'size-and-space'
+ },
+ {
+ name: 'space',
+ type: 'string',
+ defaultValue: "'24px'",
+ desc: {
+ 'zh-CN': '每个图标所占宽度',
+ 'en-US': 'Width of each icon'
+ },
+ mode: ['pc'],
+ pcDemo: 'size-and-space'
+ },
+ {
+ name: 'text-color',
+ type: 'string',
+ defaultValue: "'#666666'",
+ desc: {
+ 'zh-CN': '辅助文字的颜色',
+ 'en-US': 'Color of auxiliary text'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'texts-and-text-color',
+ mfDemo: ''
+ },
+ {
+ name: 'text-on-bottom',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否在图标下显示对应的文字',
+ 'en-US': 'Whether to display the corresponding text under the icon'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'text-on-bottom',
+ mfDemo: ''
+ },
+ {
+ name: 'texts',
+ type: 'string[]',
+ defaultValue: "['很差', '差', '一般', '好', '很好']",
+ desc: {
+ 'zh-CN': '辅助文字数组,文字的数量应该与max属性一致',
+ 'en-US': 'Auxiliary text array'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'texts-and-text-color',
+ mfDemo: ''
+ },
+ {
+ name: 'type',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置尺寸 large small(默认)',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'v-model',
+ type: 'Number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '绑定值',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'void-color',
+ type: 'string',
+ defaultValue: "'#BFBFBF'",
+ desc: {
+ 'zh-CN': '未选中 icon 的颜色',
+ 'en-US': 'Color of unselected icons'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'not-selected-color',
+ mfDemo: ''
+ },
+ {
+ name: 'void-icon-class',
+ typeAnchorName: 'IRateIconName',
+ type: 'IRateIconName',
+ defaultValue: "'icon-starDisable'",
+ desc: {
+ 'zh-CN': '未选中 icon 的图标样式名',
+ 'en-US': 'Class name of unselected icons.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'not-selected-class',
+ mfDemo: ''
+ }
+ ],
+ events: [
+ {
+ name: 'change',
+ type: '(value: number) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '分值改变时触发',
+ 'en-US': 'This event is triggered when the score changes.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'rate-events',
+ mfDemo: ''
+ }
+ ],
+ methods: [],
+ slots: []
+ }
+ ],
+ types: [
+ {
+ name: 'IRateIconName',
+ type: 'type',
+ code: `type IRateIconName = 'icon-starDisable' | 'icon-starActive' | 'icon-frown' | 'icon-meh' | 'icon-smile'`
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/record.js b/examples/sites/demos/apis/record.js
new file mode 100644
index 000000000..3a1a448d1
--- /dev/null
+++ b/examples/sites/demos/apis/record.js
@@ -0,0 +1,59 @@
+export default {
+ mode: ['mobile-first'],
+ apis: [
+ {
+ name: 'record',
+ type: 'component',
+ props: [
+ {
+ name: 'is-hwh5',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否为H5页面',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'lock-scroll',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置页面锁住滚动,默认值为 true ',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'v-model',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '数据绑定',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ events: [
+ {
+ name: 'confirm',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置结束录音事件',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ methods: [],
+ slots: []
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/rich-text-editor.js b/examples/sites/demos/apis/rich-text-editor.js
new file mode 100644
index 000000000..912e4aa41
--- /dev/null
+++ b/examples/sites/demos/apis/rich-text-editor.js
@@ -0,0 +1,151 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'rich-text-editor',
+ type: 'component',
+ props: [
+ {
+ name: 'customToolBar',
+ type: 'Array',
+ defaultValue: '[]',
+ desc: {
+ 'zh-CN':
+ "传入需要展示的工具栏按钮配置,设置时,显示全量的工具栏。可配置的项目有:'bold','italic', 'underline', 'strike', 'quote', 'code', 'codeBlock', 'unorderedlist', 'orderedlist', 'taskList', 'subscript', 'superscript', 'undo', 'redo', 'left', 'center', 'right', 'h-box', 'font-size', 'line-height', 'highlight', 'color', 'backgroundColor', 'formatClear', 'link', 'unlink', 'img', 'table'",
+ 'en-US': 'Pass in the toolbar button configuration that needs to be displayed, and customize the use'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'modelValue',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '默认富文本内容',
+ 'en-US': 'default rich text content'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'options',
+ type: 'Object',
+ defaultValue: '{}',
+ desc: {
+ 'zh-CN': '参见tiptap扩展说明,会覆盖useEditor配置项',
+ 'en-US': 'See tiptap extension notes to overwrite the useEditor configuration item'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'placeholder',
+ type: 'Stirng',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '占位符,在v-model为空时展示',
+ 'en-US': 'Placeholder, displayed when v-model is empty'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ }
+ ],
+ events: [
+ {
+ name: 'beforeCreate',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '当编辑器视图创造之前,将会触发该事件',
+ 'en-US': 'Before view creation.'
+ },
+ mode: ['pc'],
+ pcDemo: 'base'
+ },
+ {
+ name: 'blur',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '当编辑器失去焦点,将会触发该事件',
+ 'en-US': 'The editor loses focus.'
+ },
+ mode: ['pc'],
+ pcDemo: 'base'
+ },
+ {
+ name: 'create',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '当编辑器已经挂载好,将会触发该事件',
+ 'en-US': 'The editor is mounted.'
+ },
+ mode: ['pc'],
+ pcDemo: 'base'
+ },
+ {
+ name: 'destroy',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '当编辑器编辑器销毁了,将会触发该事件',
+ 'en-US': 'The editor is being destroyed.'
+ },
+ mode: ['pc'],
+ pcDemo: 'base'
+ },
+ {
+ name: 'focus',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '当编辑器获得焦点,将会触发该事件',
+ 'en-US': 'The editor gets focus.'
+ },
+ mode: ['pc'],
+ pcDemo: 'base'
+ },
+ {
+ name: 'selectionUpdate',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '当编辑器选区改变,将会触发该事件',
+ 'en-US': 'The selection has changed.'
+ },
+ mode: ['pc'],
+ pcDemo: 'base'
+ },
+ {
+ name: 'transaction',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '当编辑器状态改变,将会触发该事件。',
+ 'en-US': 'The editor state has changed.'
+ },
+ mode: ['pc'],
+ pcDemo: 'base'
+ },
+ {
+ name: 'update',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '当编辑器状态改变完成后,将会触发该事件',
+ 'en-US': 'When the content is updated.'
+ },
+ mode: ['pc'],
+ pcDemo: 'base'
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'toolBar',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': 'toolBar添加按钮,会传出editor实例,详情见tiptap',
+ 'en-US': 'toolBar Add Button'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-search-types'
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/roles.js b/examples/sites/demos/apis/roles.js
new file mode 100644
index 000000000..a80859471
--- /dev/null
+++ b/examples/sites/demos/apis/roles.js
@@ -0,0 +1,37 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'roles',
+ type: 'component',
+ props: [
+ {
+ name: 'fetch-role',
+ type: 'Function',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义接口,返回一个Promise对象,未使用框架服务时必填。',
+ 'en-US':
+ 'Customized interface. A Promise object is returned. This parameter is mandatory when the framework service is not used.'
+ },
+ mode: ['pc'],
+ pcDemo: 'fetch-role'
+ }
+ ],
+ events: [
+ {
+ name: 'change',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '选中值发生变化时触发',
+ 'en-US': 'This event is triggered when the selected value changes.'
+ },
+ mode: ['pc'],
+ pcDemo: 'base'
+ }
+ ],
+ methods: [],
+ slots: []
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/scroll-text.js b/examples/sites/demos/apis/scroll-text.js
new file mode 100644
index 000000000..45fc6605d
--- /dev/null
+++ b/examples/sites/demos/apis/scroll-text.js
@@ -0,0 +1,69 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'scroll-text',
+ type: 'component',
+ props: [
+ {
+ name: 'direction',
+ type: "'up' | 'left' | 'down' | 'right'",
+ defaultValue: "'left'",
+ desc: {
+ 'zh-CN': '滚动的方向',
+ 'en-US': 'Scrolling direction'
+ },
+ mode: ['pc'],
+ pcDemo: 'scroll-direction'
+ },
+ {
+ name: 'hover-stop',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': 'hover 滚动是否停止',
+ 'en-US': 'Whether to stop scrolling.'
+ },
+ mode: ['pc'],
+ pcDemo: 'hover-stop'
+ },
+ {
+ name: 'text',
+ type: 'string',
+ defaultValue: "'ScrollText'",
+ desc: {
+ 'zh-CN': '滚动的文本内容',
+ 'en-US': 'Scrolled text content'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'time',
+ type: 'number',
+ defaultValue: '5',
+ desc: {
+ 'zh-CN': '整个滚动过程所用的时间',
+ 'en-US': 'Time taken for scrolling'
+ },
+ mode: ['pc'],
+ pcDemo: 'scroll-time'
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '默认插槽,滚动的内容的插槽',
+ 'en-US': 'Default slot, the slot for scrolling content'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-scroll-text'
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/scrollbar.js b/examples/sites/demos/apis/scrollbar.js
new file mode 100644
index 000000000..82f133185
--- /dev/null
+++ b/examples/sites/demos/apis/scrollbar.js
@@ -0,0 +1,13 @@
+export default {
+ mode: ['mobile-first'],
+ apis: [
+ {
+ name: 'scrollbar',
+ type: 'component',
+ props: [],
+ events: [],
+ methods: [],
+ slots: []
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/search.js b/examples/sites/demos/apis/search.js
new file mode 100644
index 000000000..ba9b0b869
--- /dev/null
+++ b/examples/sites/demos/apis/search.js
@@ -0,0 +1,339 @@
+export default {
+ mode: ['pc', 'mobile', 'mobile-first'],
+ apis: [
+ {
+ name: 'search',
+ type: 'component',
+ props: [
+ {
+ name: 'big',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '大尺寸,配置为true时,搜索框高度将变高。',
+ 'en-US': 'Large size. If this parameter is set to true, the height of the search box increases.'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'big-mode'
+ },
+ {
+ name: 'button-text',
+ type: 'String',
+ defaultValue: '搜索',
+ desc: {
+ 'zh-CN': '自定义搜索框按钮的文本内容,默认是‘搜索’
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'button-text'
+ },
+ {
+ name: 'change-bg-color',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '可通过 change-bg-color 属性切换背景色(只针对移动端有效)。',
+ 'en-US':
+ 'You can use the change-bg-color attribute to switch the background color (only for mobile devices)'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'change-bg'
+ },
+ {
+ name: 'clearable',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否显示清空图标按钮',
+ 'en-US': 'Is the clear icon button displayed'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'clearable',
+ mfDemo: ''
+ },
+ {
+ name: 'default-value',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置搜索输入框内的默认搜索值',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'is-enter-search',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否在按下键盘 Enter 键时触发 search 事件',
+ 'en-US': 'Whether to trigger the search event when pressing the Enter key on the keyboard'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'events',
+ mfDemo: ''
+ },
+ {
+ name: 'mini',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否为迷你模式,配置为 true 时,默认显示为一个带图标的圆形按钮,点击后展开',
+ 'en-US':
+ 'Is it mini mode? When configured to true, it will default to a circular button with an icon, which will expand after clicking'
+ },
+ mode: ['pc'],
+ pcDemo: 'mini-mode'
+ },
+ {
+ name: 'placeholder',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '搜索输入框内的提示占位文本',
+ 'en-US': 'Search for prompt placeholder text in the input box'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mobileDemo: 'button-text',
+ mfDemo: ''
+ },
+ {
+ name: 'search-size',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '通过 size 属性定义输入框尺寸,可选项有 medium、small、mini,默认为 small',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'search-types',
+ typeAnchorName: 'ITypeValue',
+ type: 'ITypeValue[]',
+ defaultValue: '[]',
+ desc: {
+ 'zh-CN': '搜索类型的选项列表',
+ 'en-US': 'List of options for search types'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'search-types',
+ mobileDemo: 'default-value',
+ mfDemo: ''
+ },
+ {
+ name: 'show-button',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '可通过 show-button 属性对移动端设置按钮搜索。',
+ 'en-US': 'You can use the show-button attribute to set button search for mobile devices.'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'search-types'
+ },
+ {
+ name: 'size',
+ type: "'medium' | 'mini'",
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入框尺寸',
+ 'en-US': 'input size'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'size-medium'
+ },
+ {
+ name: 'themeType',
+ type: 'String',
+ defaultValue: 'primary',
+ desc: {
+ 'zh-CN': '配置主题色,primary:蓝 gray:灰
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'base'
+ },
+ {
+ name: 'transparent',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否为透明模式,此模式一般用在带有背景的场景',
+ 'en-US': 'Is it transparent mode? This mode is generally used in scenes with a background'
+ },
+ mode: ['pc'],
+ pcDemo: 'transparent-mode'
+ },
+ {
+ name: 'type-value',
+ typeAnchorName: 'ITypeValue',
+ type: 'ITypeValue',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '搜索类型的默认值。默认为搜索类型的第一项【3.11.0新增】',
+ 'en-US':
+ 'The default value for the search type. Default to the first item of the search type [added on 3.11.0]'
+ },
+ mode: ['pc'],
+ pcDemo: 'search-types'
+ },
+ {
+ name: 'v-model',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '绑定搜索值',
+ 'en-US': 'Bind search values'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mfDemo: ''
+ },
+ {
+ name: 'v-model/value',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置搜索输入框内的默认搜索值
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'default-value'
+ }
+ ],
+ events: [
+ {
+ name: 'change',
+ typeAnchorName: 'ITypeValue',
+ type: '(value: ITypeValue, input: string) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入完成时触发的回调函数; value 为搜索类型,input 为当前输入值',
+ 'en-US':
+ 'The callback function triggered upon input completion; value is the search type, input is the current input value'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'events',
+ mobileDemo: 'events',
+ mfDemo: ''
+ },
+ {
+ name: 'clear',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '清空值触发的回调函数',
+ 'en-US': 'Callback function triggered by clearing values'
+ },
+ mode: ['pc', 'mobile'],
+ pcDemo: 'events',
+ mobileDemo: 'clear'
+ },
+ {
+ name: 'input',
+ typeAnchorName: 'ITypeValue',
+ type: '(input: string, value: ITypeValue) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入实时触发的回调函数; input 为当前输入值,value 为搜索类型【3.9.1新增】',
+ 'en-US':
+ 'Input a real-time triggered callback function; input is the current input value, value is the search type [3.9.1 added]'
+ },
+ mode: ['pc'],
+ pcDemo: 'events'
+ },
+ {
+ name: 'search',
+ typeAnchorName: 'ITypeValue',
+ type: '(value: ITypeValue, input: string) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '展开模式下,点击搜索按钮时触发的回调函数; value 为搜索类型,input 为当前输入值',
+ 'en-US':
+ 'The callback function triggered when clicking the search button in expansion mode; value is the search type, input is the current input value'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'events',
+ mobileDemo: 'events',
+ mfDemo: ''
+ },
+ {
+ name: 'select',
+ typeAnchorName: 'ITypeValue',
+ type: '(value: ITypeValue) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '切换类型时触发的回调函数; value 为搜索类型',
+ 'en-US': 'The callback function triggered when switching types; value is a search type'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'events',
+ mobileDemo: 'clear',
+ mfDemo: ''
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义搜索框右侧内容
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: ''
+ },
+ {
+ name: 'poplist',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '搜索的弹出列表插槽',
+ 'en-US': 'Slot in the search pop-up list'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'custom-search-types',
+ mfDemo: ''
+ },
+ {
+ name: 'prefix',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '左侧插槽',
+ 'en-US': 'Left slot'
+ },
+ mode: ['pc'],
+ pcDemo: 'slot-prefix'
+ },
+ {
+ name: 'text',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '默认搜索类型插槽',
+ 'en-US': 'Default search type slot'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'show-selected-types',
+ mfDemo: ''
+ }
+ ]
+ }
+ ],
+ types: [
+ {
+ name: 'ITypeValue',
+ type: 'interface',
+ code: `
+interface ITypeValue {
+ text: string
+ value: number
+}`
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/select-mobile.js b/examples/sites/demos/apis/select-mobile.js
new file mode 100644
index 000000000..f599c3e4d
--- /dev/null
+++ b/examples/sites/demos/apis/select-mobile.js
@@ -0,0 +1,314 @@
+export default {
+ mode: ['mobile-first'],
+ apis: [
+ {
+ name: 'select-mobile',
+ type: 'component',
+ props: [
+ {
+ name: 'ellipsis',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否超出一行隐藏并显示省略号,默认值为 false ',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'lock-scroll',
+ type: 'Object',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '弹出面板是否锁定浏览器滚动条,默认值为 true',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'menus',
+ type: 'Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '列表数据',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'mode',
+ type: 'Object',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '组件模式,值为 form 时开启表单模式显示选中文本',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'multiple',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否开启多选,默认值为 false',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'search-config',
+ type: 'Object',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '搜索配置,默认值为 { options: [], searchMethod: null, openSearchSlot: false }',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'show-footer',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否显示底部,默认值为 false',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'show-header',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否显示头部,默认值为 true',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'text-field',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': 'text 文本字段,默认值为 label',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'text-field2',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '第二个 text 文本字段,一般用于附属文本',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'text-field3',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '第三个 text 文本字段,一般用于描述文本',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'text-split',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '文本信息分隔符,默认值为 ”; “ ',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'title',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '面板标题',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'v-model',
+ type: 'Number / String / Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '绑定值',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'value-field',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': 'value 唯一键字段,默认值为 id ',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'visible',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否弹出面板',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ events: [
+ {
+ name: 'click',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '选中项时触发',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'close',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '关闭面板时触发',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'confirm',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '确认时触发',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'search-click',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '搜索列表选中项时触发',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'update:text',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '绑定值改变时触发',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'update:visible',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '面板显隐时触发',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ methods: [
+ {
+ name: 'confirm',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '确认修改并关闭面板',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'hide',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '关闭面板',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'selectOption(option)',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '选中列表项,option 为选择项',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ slots: [
+ {
+ name: 'default',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '选项插槽',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'search-item',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '搜索选项插槽,设置 :search-config="{ openSearchSlot: true, ... }" 时有效',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/select-view.js b/examples/sites/demos/apis/select-view.js
new file mode 100644
index 000000000..53d1ac2e6
--- /dev/null
+++ b/examples/sites/demos/apis/select-view.js
@@ -0,0 +1,314 @@
+export default {
+ mode: ['mobile-first'],
+ apis: [
+ {
+ name: 'select-view',
+ type: 'component',
+ props: [
+ {
+ name: 'custom-class',
+ type: 'String / Object / Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义 class 样式',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'infinite-scroll',
+ type: 'Object',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '无限滚动配置,默认值为 { load: null, delay: 200, disabled: true, distance: 0, immediate: true }',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'lock-scroll',
+ type: 'Object',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '弹出面板是否锁定浏览器滚动条,默认值为 true',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'mask',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否显示遮罩层,默认值为 true',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'menus',
+ type: 'Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '列表数据',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'multiple',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否开启多选,默认值为 false',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'placeholder',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置输入框提示语',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'required-selected-list',
+ type: 'Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '必选项列表',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'search-config',
+ type: 'Object',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '搜索配置,默认值为 { options: [], searchMethod: null, openSearchSlot: false }',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'show-header',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否显示头部,默认值为 true',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'text-field',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': 'text 文本字段,默认值为 label',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'text-field2',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '第二个 text 文本字段,一般用于附属文本',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'text-field3',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '第三个 text 文本字段,一般用于描述文本',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'text-split',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '文本信息分隔符,默认值为 ”; “ ',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'title',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '面板标题',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'top-config',
+ type: 'Object',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': "选项置顶配置,默认值为 { label: '', options: [] }",
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'v-model',
+ type: 'Number / String / Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '绑定值',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'value-field',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': 'value 唯一键字段,默认值为 id ',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'visible',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否弹出面板',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ events: [
+ {
+ name: 'close',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '关闭面板时触发',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'confirm',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '确认时触发',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'search-click',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '搜索列表选中项时触发',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'update:text',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '绑定值改变时触发',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'update:visible',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '面板显隐时触发',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ methods: [
+ {
+ name: 'clean',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '清空除所有选中项,requiredSelectedList 必选项不会被清空',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'close',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '关闭面板',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ slots: [
+ {
+ name: 'default',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '选项插槽',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/select.js b/examples/sites/demos/apis/select.js
new file mode 100644
index 000000000..bfbac13e3
--- /dev/null
+++ b/examples/sites/demos/apis/select.js
@@ -0,0 +1,891 @@
+export default {
+ mode: ['pc', 'mobile-first'],
+ apis: [
+ {
+ name: 'select',
+ type: 'component',
+ props: [
+ {
+ name: 'allow-copy',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否允许复制输入框的内容,适用单选可搜索场景',
+ 'en-US':
+ 'Is it allowed to copy the content of the input box, applicable to single choice searchable scenarios'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'copy-single',
+ mfDemo: 'copy-single'
+ },
+ {
+ name: 'allow-create',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否允许创建新条目,需配合 filterable 使用。若搜索字段不在选项列表中,可创建为新的选项',
+ 'en-US':
+ 'Is it allowed to create new entries? It needs to be used in conjunction with filterable. If the search field is not in the option list, it can be created as a new option'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'allow-create',
+ mfDemo: 'allow-create'
+ },
+ {
+ name: 'autocomplete',
+ type: 'string',
+ defaultValue: "'off'",
+ desc: {
+ 'zh-CN': '输入框的原生 autocomplete 属性',
+ 'en-US': 'The native autocomplete attribute of the input box'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'native-properties',
+ mfDemo: 'native-properties'
+ },
+ {
+ name: 'cache-op',
+ typeAnchorName: 'ICacheOp',
+ type: 'ICacheOp',
+ defaultValue:
+ "\n{\n key: '',\n sortBy: 'frequency',\n sort: 'desc',\n dataKey: 'value',\n highlightClass: \n 'memorize-highlight',\n highlightNum: Infinity,\n cacheNum: Infinity,\n serialize: JSON.stringify\n deserialize: JSON.parse\n}\n
",
+ desc: {
+ 'zh-CN': '启用本地缓存已选项的功能配置(根据用户点击选择的次数、最后时间继续存储排序)',
+ 'en-US': 'Set the component type when Grid or Tree is embedded in the drop-down list box.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'cache-usage',
+ mfDemo: 'cache-usage'
+ },
+ {
+ name: 'clear-no-match-value',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否自动清空无法在 options 中找到匹配项的值',
+ 'en-US': 'Automatically clear values that cannot find matching items in options'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'clear-no-match-value',
+ mfDemo: 'clear-no-match-value'
+ },
+ {
+ name: 'clearable',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否启用一键清除的功能',
+ 'en-US': 'Whether to display the one click clear button, only applicable to radio selection'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'clearable',
+ mfDemo: 'clearable'
+ },
+ {
+ name: 'collapse-tags',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否将多个标签折叠显示。仅适用多选',
+ 'en-US': 'Whether to collapse multiple labels for display. Only applicable to multiple selections'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'collapse-tags',
+ mfDemo: 'collapse-tags'
+ },
+ {
+ name: 'copyable',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否启用一键复制的功能。点击复制按钮一键复制所有标签的文本内容并以逗号分隔,仅适用于多选',
+ 'en-US':
+ 'Is the one click copy function enabled. Click the copy button to copy the text content of all labels with one click, separated by commas, only applicable to multiple selections'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'copy-multi',
+ mfDemo: 'copy-multi'
+ },
+ {
+ name: 'default-first-option',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否启用按 Enter 键选择第一个匹配项的功能。需配合 filterable 或 remote 使用',
+ 'en-US':
+ 'Whether to enable the function of pressing the Enter key to select the first match. Must be used in conjunction with filterable or remote'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'allow-create',
+ mfDemo: 'allow-create'
+ },
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否禁用',
+ 'en-US': 'Is it disabled'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'disabled',
+ mfDemo: 'disabled'
+ },
+ {
+ name: 'dropdown-icon',
+ type: 'Component',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义下拉图标',
+ 'en-US': 'Custom drop-down icon'
+ },
+ mode: ['pc'],
+ pcDemo: 'multiple'
+ },
+ {
+ name: 'dropdown-style',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义下拉选项样式',
+ 'en-US': 'Custom drop-down options style'
+ },
+ mode: ['pc'],
+ pcDemo: 'multiple'
+ },
+ {
+ name: 'filter-method',
+ type: '(query: string) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义过滤方法',
+ 'en-US': 'Custom filtering method'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'filter-method',
+ mfDemo: 'filter-method'
+ },
+ {
+ name: 'filterable',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否可搜索',
+ 'en-US': 'Is it searchable'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'filter-method',
+ mfDemo: 'filter-method'
+ },
+ {
+ name: 'grid-op',
+ typeAnchorName: 'IGridOption',
+ type: 'IGridOption',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '下拉表格时,内置表格的配置,用法同 Grid 组件。需结合 render-type 属性使用',
+ 'en-US':
+ 'When pulling down a table, the configuration of the built-in table is the same as that of the Grid component. To be used in conjunction with the render type attribute'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'nest-grid',
+ mfDemo: 'nest-grid'
+ },
+ {
+ name: 'input-box-type',
+ type: "'input' | 'underline'",
+ defaultValue: "'input'",
+ desc: {
+ 'zh-CN': '输入框的显示类型',
+ 'en-US': 'Display type of input box'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'input-box-type',
+ mfDemo: 'input-box-type'
+ },
+ {
+ name: 'is-drop-inherit-width',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '下拉弹框的宽度是否跟输入框保持一致。默认超出输入框宽度时由内容撑开',
+ 'en-US':
+ 'Is the width of the dropdown box consistent with the input box. By default, when the width of the input box is exceeded, it is supported by the content'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'is-drop-inherit-width',
+ mfDemo: 'is-drop-inherit-width'
+ },
+ {
+ name: 'loading',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否加载中,适用于远程搜索场景',
+ 'en-US': 'Loading or not, suitable for remote search scenarios'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'remote-method',
+ mfDemo: 'remote-method'
+ },
+ {
+ name: 'loading-text',
+ type: 'string',
+ defaultValue: "'加载中'",
+ desc: {
+ 'zh-CN': '远程加载时显示的文本',
+ 'en-US': 'Text displayed during remote loading'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'remote-method',
+ mfDemo: 'remote-method'
+ },
+ {
+ name: 'modelValue / v-model',
+ type: 'string | number | Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '绑定值',
+ 'en-US': 'Bind value'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'multiple',
+ mfDemo: 'multiple'
+ },
+ {
+ name: 'multiple',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否允许选择多个选项',
+ 'en-US': 'Allow multiple options to be selected'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'multiple',
+ mfDemo: 'multiple'
+ },
+ {
+ name: 'multiple-limit',
+ type: 'number',
+ defaultValue: '0',
+ desc: {
+ 'zh-CN': '多选时最多可选择的个数,默认为 0 不限制',
+ 'en-US':
+ 'When selecting multiple options, the maximum number of options available is 0, with no limit by default'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'multiple-limit',
+ mfDemo: 'multiple-limit'
+ },
+ {
+ name: 'name',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入框的原生 name 属性',
+ 'en-US': 'The native name attribute of the input box'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'native-properties',
+ mfDemo: 'native-properties'
+ },
+ {
+ name: 'no-data-text',
+ type: 'string',
+ defaultValue: "'暂无相关数据'",
+ desc: {
+ 'zh-CN': '选项列表为空时显示的文本,也可以使用 empty 插槽设置',
+ 'en-US': 'The text displayed when the option list is empty can also be set using empty slots'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'no-data-text',
+ mfDemo: 'no-data-text'
+ },
+ {
+ name: 'no-match-text',
+ type: 'string',
+ defaultValue: "'无匹配数据'",
+ desc: {
+ 'zh-CN': '搜索条件无匹配时显示的文本,也可以使用 empty 插槽设置',
+ 'en-US':
+ 'The text displayed when there is no match for the search criteria can also be set using empty slots'
+ },
+ mode: ['pc'],
+ pcDemo: 'filter-method'
+ },
+ {
+ name: 'options',
+ typeAnchorName: 'IOption',
+ type: 'IOption[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '选项列表配置,使用后不需要再配置 tiny-option',
+ 'en-US': 'Option list configuration, no need to configure tiny options after use'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'map-field',
+ mfDemo: 'map-field'
+ },
+ {
+ name: 'placeholder',
+ type: 'string',
+ defaultValue: "'请选择'",
+ desc: {
+ 'zh-CN': '占位符',
+ 'en-US': 'Placeholder'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'native-properties',
+ mfDemo: 'native-properties'
+ },
+ {
+ name: 'placement',
+ typeAnchorName: 'IPlacement',
+ type: 'IPlacement',
+ defaultValue: "'bottom-start'",
+ desc: {
+ 'zh-CN': '下拉弹框相对于触发源的弹出位置',
+ 'en-US': 'The pop-up position of the pull-down pop-up box relative to the trigger source'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'popup-style-position',
+ mfDemo: 'popup-style-position'
+ },
+ {
+ name: 'popper-append-to-body',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否将弹出框的 dom 元素插入至 body 元素',
+ 'en-US': 'Whether to insert the dom element of the pop-up box into the body element'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'popup-style-position',
+ mfDemo: 'popup-style-position'
+ },
+ {
+ name: 'popper-class',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义下拉框的类名,用于自定义样式',
+ 'en-US': 'The class name of the custom dropdown box, used for customizing styles'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'popup-style-position',
+ mfDemo: 'popup-style-position'
+ },
+ {
+ name: 'remote',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否为远程搜索',
+ 'en-US': 'Is it a remote search'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'remote-method',
+ mfDemo: 'remote-method'
+ },
+ {
+ name: 'remote-method',
+ type: '(query:string) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '远程搜索的方法',
+ 'en-US': 'Remote search methods'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'remote-method',
+ mfDemo: 'remote-method'
+ },
+ {
+ name: 'render-type',
+ type: "'tree' | 'grid'",
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '渲染为下拉表格或下拉树,需结合 grid-op / tree-op 使用',
+ 'en-US': 'Rendered as a dropdown table or tree, to be used in conjunction with grid op/tree op'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'nest-grid',
+ mfDemo: 'nest-grid'
+ },
+ {
+ name: 'reserve-keyword',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '多选可搜索时,是否在选中一个选项后仍然保留当前的搜索关键词',
+ 'en-US':
+ 'When selecting multiple searchable options, do you still keep the current search keywords after selecting one option'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'remote-method',
+ mfDemo: 'remote-method'
+ },
+ {
+ name: 'searchable',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否启用下拉面板搜索',
+ 'en-US': 'Whether to allow users to create new items. This parameter must be used together with filterable.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'searchable',
+ mfDemo: 'searchable'
+ },
+ {
+ name: 'show-alloption',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否展示 “全选” 选项',
+ 'en-US': 'Whether to display the "Select All" option'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'show-alloption',
+ mfDemo: 'show-alloption'
+ },
+ {
+ name: 'show-empty-image',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否显示空数据图片',
+ 'en-US': 'Display empty data image'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'no-data-text',
+ mfDemo: 'no-data-text'
+ },
+ {
+ name: 'size',
+ type: "'medium' | 'small' | 'mini'",
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入框尺寸。',
+ 'en-US': 'Text box size'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'size',
+ mfDemo: 'size'
+ },
+ {
+ name: 'tag-selectable',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '输入框中的标签是否可通过鼠标选中复制',
+ 'en-US': 'Can the label in the input box be copied by selecting it with the mouse'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'copy-multi',
+ mfDemo: 'copy-multi'
+ },
+ {
+ name: 'tag-type',
+ type: "'success' | 'info' | 'warning' | 'danger'",
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '标签类型,仅多选适用。使用 aurora 主题时设置该属性为 info',
+ 'en-US':
+ 'Label type, only applicable for multiple choices. Set this property to info when using the aurora theme'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'tag-type',
+ mfDemo: 'tag-type'
+ },
+ {
+ name: 'text-field',
+ type: 'string',
+ defaultValue: "'label'",
+ desc: {
+ 'zh-CN': '显示值字段',
+ 'en-US': 'Show Value Fields'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'map-field',
+ mfDemo: 'map-field'
+ },
+ {
+ name: 'text-split',
+ type: 'string',
+ defaultValue: "','",
+ desc: {
+ 'zh-CN': '自定义复制文本的分隔符,需结合 copyable 属性使用',
+ 'en-US': 'The separator for custom copied text needs to be used in conjunction with the copyable attribute'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'copy-multi',
+ mfDemo: 'copy-multi'
+ },
+ {
+ name: 'top-create',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否显示下拉框顶部新增按钮,点击按钮会抛出一个 top-create-click 事件,可以在事件中自定义一些行为',
+ 'en-US':
+ 'Indicates whether to display a new button on the top of the drop-down list box. When a button is clicked, a top-create-click event is thrown. You can customize some behaviors in the event'
+ },
+ mode: ['pc'],
+ pcDemo: 'allow-create'
+ },
+ {
+ name: 'tree-op',
+ typeAnchorName: 'ITreeOption',
+ type: 'ITreeOption',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '下拉树时,内置树组件的配置,用法同 Tree 组件。需结合 render-type 属性使用',
+ 'en-US':
+ 'When pulling down a tree, the configuration of the built-in tree component is the same as that of the Tree component. To be used in conjunction with the render type attribute'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'nest-tree',
+ mfDemo: 'nest-tree'
+ },
+ {
+ name: 'value-field',
+ type: 'string',
+ defaultValue: "'value'",
+ desc: {
+ 'zh-CN': '绑定值字段',
+ 'en-US': 'Bind Value Field'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'map-field',
+ mfDemo: 'map-field'
+ },
+ {
+ name: 'value-key',
+ type: 'string',
+ defaultValue: "'value'",
+ desc: {
+ 'zh-CN': '作为 value 唯一标识的键名,绑定值为对象类型时必填',
+ 'en-US':
+ 'The key name that uniquely identifies the value must be filled in when the binding value is of object type'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'binding-obj',
+ mfDemo: 'binding-obj'
+ }
+ ],
+ events: [
+ {
+ name: 'blur',
+ type: '(event:MouseEvent) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '监听输入框失去焦点事件',
+ 'en-US': 'Listening for input box lose focus event'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'events',
+ mfDemo: 'events'
+ },
+ {
+ name: 'change',
+ type: '(value:string|number|Array, list:Array) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '监听绑定值变更事件',
+ 'en-US': 'Listening for binding value change events'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'events',
+ mfDemo: 'events'
+ },
+ {
+ name: 'clear',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '监听一键清除事件',
+ 'en-US': 'Listening for one click clear events'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'events',
+ mfDemo: 'events'
+ },
+ {
+ name: 'focus',
+ type: '(event:MouseEvent) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '监听输入框获取焦点事件',
+ 'en-US': 'Listening to input boxes to obtain focus events'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'events',
+ mfDemo: 'events'
+ },
+ {
+ name: 'remove-tag',
+ type: '(tag:string|number) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '监听多选时移除标签事件',
+ 'en-US': 'Remove label events when listening for multiple selections'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'events',
+ mfDemo: 'events'
+ },
+ {
+ name: 'top-create-click',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '监听顶部新增按钮点击事件,同 top-create 属性一起使用',
+ 'en-US':
+ 'Listens to the click event of a new button on the top. This parameter is used together with the top-create attribute'
+ },
+ mode: ['pc'],
+ pcDemo: 'events'
+ },
+ {
+ name: 'visible-change',
+ type: '(status:boolean) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '监听下拉弹框的显示隐藏状态',
+ 'en-US': 'Monitor the display and hidden status of dropdown pop ups'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'events',
+ mfDemo: 'events'
+ }
+ ],
+ methods: [
+ {
+ name: 'blur',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '使输入框失去焦点',
+ 'en-US': 'Causes the input box to lose focus'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'manual-focus-blur',
+ mfDemo: 'manual-focus-blur'
+ },
+ {
+ name: 'focus',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '使输入框获取焦点',
+ 'en-US': 'Bring the input box to focus'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'manual-focus-blur',
+ mfDemo: 'manual-focus-blur'
+ }
+ ],
+ slots: [
+ {
+ name: 'default',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '选项默认插槽',
+ 'en-US': 'Option default slot'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'slot-default',
+ mfDemo: 'slot-default'
+ },
+ {
+ name: 'empty',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '空数据插槽',
+ 'en-US': 'Empty data slot'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'slot-empty',
+ mfDemo: 'slot-empty'
+ },
+ {
+ name: 'footer',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '下拉弹框底部插槽',
+ 'en-US': 'Pull down the bottom slot of the pop-up box'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'slot-footer',
+ mfDemo: 'slot-footer'
+ },
+ {
+ name: 'prefix',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入框前缀插槽',
+ 'en-US': 'Input box prefix slot'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'slot-prefix',
+ mfDemo: 'slot-prefix'
+ },
+ {
+ name: 'reference',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '触发源插槽',
+ 'en-US': 'Trigger Source Slot'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'slot-reference',
+ mfDemo: 'slot-reference'
+ }
+ ]
+ },
+ {
+ name: 'option',
+ type: 'component',
+ props: [
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '选项是否禁用',
+ 'en-US': 'Is the option disabled'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'disabled',
+ mfDemo: 'disabled'
+ },
+ {
+ name: 'icon',
+ type: 'Component',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义选项的图标',
+ 'en-US': 'Customize icons for options'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mfDemo: 'basic-usage'
+ },
+ {
+ name: 'label',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '选项的显示文本',
+ 'en-US': 'Display text for option'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mfDemo: 'basic-usage'
+ },
+ {
+ name: 'required',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '选项是否必选',
+ 'en-US': 'Is it mandatory to select an option'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'value',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '选项的值',
+ 'en-US': 'Value for option'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mfDemo: 'basic-usage'
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: []
+ }
+ ],
+ types: [
+ {
+ name: 'IOption',
+ type: 'interface',
+ code: `
+interface IOption {
+ value?: string | number
+ label?: string
+ disabled?: boolean
+ icon?: Component
+ required?:boolean
+}
+`
+ },
+ {
+ name: 'ICacheOp',
+ type: 'interface',
+ code: `
+interface ICacheItem {
+ frequency: number
+ key: string
+ time: number
+}
+
+interface ICacheOp {
+ key: string // 本地缓存的唯一 key 值
+ sortBy?: 'frequency' | 'time' // 排序的字段,默认 frequency (频次)
+ sort?: 'desc' | 'asc' // 排序方式,默认 desc (降序)
+ dataKey?: string // 数据中的唯一标识的 key 名称,默认 value
+ highlightClass?: string // 个性化高亮 class 名称,默认:memorize-highlight
+ highlightNum?: number // 高亮个性化的条数,默认:Infinity
+ cacheNum?: number // 存储个性化的条数,默认:Infinity
+ serialize?: ()=> string // 本地存储序列化方法,默认:JSON.stringify
+ deserialize?: ()=> ICacheItem[] // 本地存储序反列化方法,默认:JSON.parse
+}
+`
+ },
+ {
+ name: 'IGridOption',
+ type: 'interface',
+ code: `
+interface IGridOption {
+ data: any[] // 表格数据,用法同 Grid
+ columns: any[] // 列配置,用法同 Grid
+}
+`
+ },
+ {
+ name: 'ITreeOption',
+ type: 'interface',
+ code: `
+interface ITreeNode {
+ label: string // 默认树节点的文本字段
+ id: number|string // 树节点唯一标识
+ children: ITreeNode[] // 子节点
+}
+
+interface ITreeOption {
+ data: ITreeNode[] // 树数据,用法同 Tree
+}
+`
+ },
+ {
+ name: 'IPlacement',
+ type: 'type',
+ code: `
+type IPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'
+`
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/selected-box.js b/examples/sites/demos/apis/selected-box.js
new file mode 100644
index 000000000..fdaf9ff67
--- /dev/null
+++ b/examples/sites/demos/apis/selected-box.js
@@ -0,0 +1,159 @@
+export default {
+ mode: ['mobile-first'],
+ apis: [
+ {
+ name: 'selected-box',
+ type: 'component',
+ props: [
+ {
+ name: 'config',
+ type: 'Object',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '已选栏配置项,详细属性请参考基本示例',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'inverse',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '启用反选,属性 inverse 设置为 true,属性 total 设置为总记录数,启用反选模式',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'select',
+ type: 'Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '已选栏数据列表',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'total',
+ type: 'Number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '已选择数据总条数',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ events: [
+ {
+ name: 'change',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '增加、删除、清空和拖拽顺序,都会触发组件 change 事件,事件参数就是组件当前暂存的数据',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'clear',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '清空按钮点击事件',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'delete',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '删除按钮点击事件',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'drag',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '拖动排序事件',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'button',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '已选栏右侧自定义按钮插槽',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'clear',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '清空按钮插槽',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'close',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '删除按钮插槽',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'option',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '已选择数据列表显示插槽',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'select',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '已选中数据条数显示插槽',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/signature.js b/examples/sites/demos/apis/signature.js
new file mode 100644
index 000000000..a73a2997f
--- /dev/null
+++ b/examples/sites/demos/apis/signature.js
@@ -0,0 +1,13 @@
+export default {
+ mode: ['mobile-first'],
+ apis: [
+ {
+ name: 'signature',
+ type: 'component',
+ props: [],
+ events: [],
+ methods: [],
+ slots: []
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/skeleton.js b/examples/sites/demos/apis/skeleton.js
new file mode 100644
index 000000000..0d0ee9410
--- /dev/null
+++ b/examples/sites/demos/apis/skeleton.js
@@ -0,0 +1,142 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'skeleton',
+ type: 'component',
+ props: [
+ {
+ name: 'active',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否开启动画',
+ 'en-US':
+ 'Customized interface. A Promise object is returned. This parameter is mandatory when the framework service is not used.'
+ },
+ mode: ['pc'],
+ pcDemo: 'fine-grained-mode'
+ },
+ {
+ name: 'avatar',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否显示头像',
+ 'en-US':
+ 'Customized interface. A Promise object is returned. This parameter is mandatory when the framework service is not used.'
+ },
+ mode: ['pc'],
+ pcDemo: 'complex-demo'
+ },
+ {
+ name: 'loading',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否显示骨架屏,传 false 时会展示加载完成后的内容',
+ 'en-US':
+ 'Customized interface. A Promise object is returned. This parameter is mandatory when the framework service is not used.'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-layout'
+ },
+ {
+ name: 'rows',
+ type: 'number',
+ defaultValue: '3',
+ desc: {
+ 'zh-CN': '默认排版,可配置段落显示行数',
+ 'en-US':
+ 'Customized interface. A Promise object is returned. This parameter is mandatory when the framework service is not used.'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-rows'
+ },
+ {
+ name: 'rows-width',
+ type: 'number[] | string[]',
+ defaultValue: '[]',
+ desc: {
+ 'zh-CN': '自定义段落每一行的宽度',
+ 'en-US':
+ 'Customized interface. A Promise object is returned. This parameter is mandatory when the framework service is not used.'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-paragraph-width'
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '加载完成后显示的内容',
+ 'en-US': 'Option default slot'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-layout'
+ },
+ {
+ name: 'placeholder',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义骨架屏结构',
+ 'en-US': 'Option default slot'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-layout'
+ }
+ ]
+ },
+ {
+ name: 'skeleton-item',
+ type: 'component',
+ props: [
+ {
+ name: 'size',
+ typeAnchorName: 'ISize',
+ type: 'ISize',
+ defaultValue: 'medium',
+ desc: {
+ 'zh-CN': '针对 image 和 circle 形态,内置三种大小',
+ 'en-US':
+ 'Customized interface. A Promise object is returned. This parameter is mandatory when the framework service is not used.'
+ },
+ mode: ['pc'],
+ pcDemo: 'fine-grained-mode'
+ },
+ {
+ name: 'variant',
+ typeAnchorName: 'IVariant',
+ type: 'IVariant',
+ defaultValue: 'square',
+ desc: {
+ 'zh-CN': '骨架屏形态',
+ 'en-US':
+ 'Customized interface. A Promise object is returned. This parameter is mandatory when the framework service is not used.'
+ },
+ mode: ['pc'],
+ pcDemo: 'fine-grained-mode'
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: []
+ }
+ ],
+ types: [
+ {
+ name: 'IVariant',
+ type: 'type',
+ code: `type IVariant = 'image' | 'circle' | 'square'`
+ },
+ {
+ name: 'ISize',
+ type: 'type',
+ code: `type ISize = 'large' | 'medium' | 'small'`
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/slide-bar.js b/examples/sites/demos/apis/slide-bar.js
new file mode 100644
index 000000000..4a32f78eb
--- /dev/null
+++ b/examples/sites/demos/apis/slide-bar.js
@@ -0,0 +1,104 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'slide-bar',
+ type: 'component',
+ props: [
+ {
+ name: 'init-blocks',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '初始时需要显示的块数',
+ 'en-US': 'Number of blocks to be displayed initially'
+ },
+ mode: ['pc'],
+ pcDemo: 'wheel-blocks'
+ },
+ {
+ name: 'sub-tag',
+ type: 'string',
+ defaultValue: "该属性的默认值为 'li'",
+ desc: {
+ 'zh-CN': '设置组件的子级 Dom 标签',
+ 'en-US': 'Setting the Dom Label of a Component'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-tag'
+ },
+ {
+ name: 'tag',
+ type: 'string',
+ defaultValue: "该属性的默认值为 'ul'",
+ desc: {
+ 'zh-CN': '设置组件的 Dom 标签',
+ 'en-US': 'Setting the Dom Label of a Component'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-tag'
+ },
+ {
+ name: 'value',
+ type: 'Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '调用服务时候获取数据的来源',
+ 'en-US': 'Data source obtained during service invoking'
+ },
+ mode: ['pc'],
+ pcDemo: 'wheel-blocks'
+ },
+ {
+ name: 'wheel-blocks',
+ type: 'number',
+ defaultValue: '该属性的默认值为 1',
+ desc: {
+ 'zh-CN': '鼠标滚轮上下滚动的时候,滚动的块数长度',
+ 'en-US': 'Number of scrolling blocks when the mouse wheel is scrolled up or down'
+ },
+ mode: ['pc'],
+ pcDemo: 'wheel-blocks'
+ }
+ ],
+ events: [
+ {
+ name: 'before-click',
+ type: 'Function(value)',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '滑动点击前触发的事件;event: 原生事件',
+ 'en-US': 'Event triggered before a user swipes the screen. event: Native event'
+ },
+ mode: ['pc'],
+ pcDemo: 'slide-bar-events'
+ },
+ {
+ name: 'click',
+ type: 'Function(data, index)',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '滑动块点击事件;data: 点击的滑块数据,index: 点击的滑块索引值',
+ 'en-US':
+ 'Sliding block click event; data: data of the clicked slider, index: index value of the clicked slider'
+ },
+ mode: ['pc'],
+ pcDemo: 'slide-bar-events'
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '默认的作用域插槽',
+ 'en-US': 'Default scope slot'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-content'
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/slider-button.js b/examples/sites/demos/apis/slider-button.js
new file mode 100644
index 000000000..9a82f6bd6
--- /dev/null
+++ b/examples/sites/demos/apis/slider-button.js
@@ -0,0 +1,59 @@
+export default {
+ mode: ['mobile-first'],
+ apis: [
+ {
+ name: 'slider-button',
+ type: 'component',
+ props: [
+ {
+ name: 'disabled',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置滑块项禁用态',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'label',
+ type: 'Number / String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置 Button 的内容',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'text',
+ type: 'Number / String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置 Button 的内容',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '组件默认插槽',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/slider.js b/examples/sites/demos/apis/slider.js
new file mode 100644
index 000000000..3c0227006
--- /dev/null
+++ b/examples/sites/demos/apis/slider.js
@@ -0,0 +1,301 @@
+export default {
+ mode: ['pc', 'mobile', 'mobile-first'],
+ apis: [
+ {
+ name: 'slider',
+ type: 'component',
+ props: [
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否禁用',
+ 'en-US': 'Disable'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'dynamic-disable',
+ mobileDemo: 'dynamic-disable',
+ mfDemo: ''
+ },
+ {
+ name: 'format-label',
+ type: 'Function(value)',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '格式化刻度值',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'format-tooltip',
+ type: '(currentValue: number) => string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '格式化 tooltip 提示',
+ 'en-US': 'Format tooltip message'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'show-tip',
+ mobileDemo: 'format-tooltip',
+ mfDemo: ''
+ },
+ {
+ name: 'height',
+ type: 'string',
+ defaultValue: "'300px'",
+ desc: {
+ 'zh-CN': 'Slider 组件的高度,当 vertical 为 true 时有效',
+ 'en-US': 'Height of Slider component, effective when vertical is true'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'vertical-mode',
+ mfDemo: ''
+ },
+ {
+ name: 'max',
+ type: 'number',
+ defaultValue: '100',
+ desc: {
+ 'zh-CN': '设置最大值,必需是整数,可以负数,必需大于所设置的最小值',
+ 'en-US':
+ 'Set the maximum value. The value must be an integer and can be a negative number. The value must be greater than the minimum value set'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'max-min',
+ mobileDemo: 'max-min',
+ mfDemo: ''
+ },
+ {
+ name: 'min',
+ type: 'number',
+ defaultValue: '0',
+ desc: {
+ 'zh-CN': '设置最小值',
+ 'en-US': 'Set the minimum value'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'max-min',
+ mobileDemo: 'max-min',
+ mfDemo: ''
+ },
+ {
+ name: 'num-pages',
+ type: 'number',
+ defaultValue: '1',
+ desc: {
+ 'zh-CN': '设置总步数,即按快捷键 PageDown/PageUp 时,每次移动的距离是 "⌈(max-min)/num-pages⌉"',
+ 'en-US':
+ 'Set the total number of steps. That is, when you press PageDown or PageUp, the moving distance is "⌈(max-min)/num-pages⌉".'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'shortcut-operation',
+ mobileDemo: 'shortcut-operation',
+ mfDemo: ''
+ },
+ {
+ name: 'range',
+ type: 'Boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否为范围选择
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: ''
+ },
+ {
+ name: 'show-input',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否显示输入框,仅在非范围选择时有效',
+ 'en-US': 'Indicates whether to display the text box. This parameter is valid only for non-range selection'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'show-input',
+ mobileDemo: 'show-input',
+ mfDemo: ''
+ },
+ {
+ name: 'show-label',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '显示 Label,需结合show-steps一起使用',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'show-steps',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '显示刻度,需结合 step 一起使用,最前与最后的刻度默认不显示',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'show-tip',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否显示 tooltip',
+ 'en-US': 'Whether to display tooltip'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'show-tip',
+ mobileDemo: 'show-tip',
+ mfDemo: ''
+ },
+ {
+ name: 'step',
+ type: 'number',
+ defaultValue: '1',
+ desc: {
+ 'zh-CN': '设置滑块移动时,每步位移距离,必需是大于0的正整数',
+ 'en-US':
+ 'Displacement distance of each step when the slider moves. The value must be a positive integer greater than 0'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'about-step',
+ mobileDemo: 'about-step',
+ mfDemo: ''
+ },
+ {
+ name: 'unit',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '输入框后面显示的单位,仅在输入框模式下有效',
+ 'en-US': 'The units displayed after the input box, only valid in input box mode'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'show-input',
+ mfDemo: ''
+ },
+ {
+ name: 'v-model',
+ type: 'number | [number, number]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置单滑块的当前值,必需是整数或数组',
+ 'en-US': 'Sets the current value of a single slider. The value must be an integer or an array.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mfDemo: ''
+ },
+ {
+ name: 'value',
+ type: 'Number | Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置单滑块的当前值,必需是整数或数组。
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: ''
+ },
+ {
+ name: 'vertical',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否竖向模式',
+ 'en-US': 'Whether the vertical mode is used'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'vertical-mode',
+ mobileDemo: 'vertical-mode',
+ mfDemo: ''
+ }
+ ],
+ events: [
+ {
+ name: 'change',
+ type: '(value: number | [number, number]) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '值改变时触发(使用鼠标拖曳时,只在松开鼠标后触发)',
+ 'en-US':
+ 'Triggered when the value changes (When you drag the mouse, it is triggered only after you release the mouse).'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'slider-event',
+ mobileDemo: 'slider-event-change',
+ mfDemo: ''
+ },
+ {
+ name: 'start',
+ type: '(event: Event, value: number | [number, number]) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置滑块滑动开始时,触发该事件',
+ 'en-US': 'This event is triggered when the slider starts to slide.'
+ },
+ mode: ['pc', 'mobile'],
+ pcDemo: 'slider-event',
+ mobileDemo: 'slider-event-start'
+ },
+ {
+ name: 'Start',
+ type: 'Function(arg)',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置滑块滑动开始时,触发该事件',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'stop',
+ type: '(value: number | [number, number]) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置滑块滑动结束时,触发该事件',
+ 'en-US': 'This event is triggered when the slider sliding ends. '
+ },
+ mode: ['pc', 'mobile'],
+ pcDemo: 'slider-event',
+ mobileDemo: 'slider-event-stop'
+ },
+ {
+ name: 'Stop',
+ type: 'Function(arg)',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置滑块滑动结束时,触发该事件',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '显示滑块值的插槽,仅仅 v-model 是单数值时才有效,插槽参数为:slotArg: { slotScope: number }',
+ 'en-US':
+ 'Slot for displaying slider values, valid only if v-model is a single value. Slot parameters are: slotArg: {slotScope: number}'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'slider-slot',
+ mobileDemo: '',
+ mfDemo: ''
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/split.js b/examples/sites/demos/apis/split.js
new file mode 100644
index 000000000..e794208b8
--- /dev/null
+++ b/examples/sites/demos/apis/split.js
@@ -0,0 +1,205 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'split',
+ type: 'component',
+ props: [
+ {
+ name: 'collapse-left-top',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '简易模式启用左/上展开收起按钮',
+ 'en-US': 'Easy Mode Enables Left/Top Expand Collapse Button'
+ },
+ mode: ['pc'],
+ pcDemo: 'split-threshold'
+ },
+ {
+ name: 'collapse-right-bottom',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '简易模式启用右/下展开收起按钮',
+ 'en-US': 'Easy Mode Enables Right/Down Expand Collapse Button'
+ },
+ mode: ['pc'],
+ pcDemo: 'split-threshold'
+ },
+ {
+ mode: []
+ },
+ {
+ name: 'left-top-min',
+ type: 'number | string',
+ defaultValue: '40px',
+ desc: {
+ 'zh-CN': '左面板 / 上面板最小阈值',
+ 'en-US': 'Minimum threshold on the left or upper panel.'
+ },
+ mode: ['pc'],
+ pcDemo: 'split-threshold'
+ },
+ {
+ name: 'mode',
+ type: "'horizontal' | 'vertical'",
+ defaultValue: 'horizontal',
+ desc: {
+ 'zh-CN': '分割类型,可选值为 horizontal 或 vertical;默认值horizontal',
+ 'en-US':
+ 'Separation type. The value can be horizontal or vertical. The default value is horizontal. ;The optional values of this attribute are horizontal / vertical'
+ },
+ mode: ['pc'],
+ pcDemo: 'split-mode'
+ },
+ {
+ name: 'modelValue',
+ type: 'number | string',
+ defaultValue: '0.5',
+ desc: {
+ 'zh-CN': '分割面板的位置',
+ 'en-US': 'Position of the split panel.'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'right-bottom-min',
+ type: 'number | string',
+ defaultValue: '40px',
+ desc: {
+ 'zh-CN': '右面板 / 下面板最小阈值',
+ 'en-US': 'Minimum threshold on the right or lower panel.'
+ },
+ mode: ['pc'],
+ pcDemo: 'split-threshold'
+ },
+ {
+ name: 'three-areas',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '配置3个区块',
+ 'en-US': 'Three blocks are configured.'
+ },
+ mode: ['pc'],
+ pcDemo: 'split-threshold'
+ },
+ {
+ mode: []
+ }
+ ],
+ events: [
+ {
+ name: 'left-top-click',
+ type: '()=> void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '左箭头收起时触发',
+ 'en-US': 'Triggered when the left arrow is folded'
+ },
+ mode: ['pc'],
+ pcDemo: 'moving-event'
+ },
+ {
+ name: 'moveend',
+ type: '()=> void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '拖拽结束的事件',
+ 'en-US': 'Drag end event. ;Drag end event. ;No arguments'
+ },
+ mode: ['pc'],
+ pcDemo: 'moveend-event'
+ },
+ {
+ name: 'movestart',
+ type: '()=> void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '拖拽开始的事件',
+ 'en-US': 'Drag start event. ;Drag start event. ;No arguments'
+ },
+ mode: ['pc'],
+ pcDemo: 'movestart-event'
+ },
+ {
+ name: 'moving',
+ type: '(event: Event)=> void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '拖拽中的事件',
+ 'en-US': 'Draging events. ;Drag the event in. ; arg1:event (type object)'
+ },
+ mode: ['pc'],
+ pcDemo: 'moving-event'
+ },
+ {
+ name: 'right-bottom-click',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '右箭头收起时触发',
+ 'en-US': 'Triggered when the right arrow is folded'
+ },
+ mode: ['pc'],
+ pcDemo: 'moving-event'
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'bottom',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '下面板插槽',
+ 'en-US': 'Slot on the lower panel'
+ },
+ mode: ['pc'],
+ pcDemo: 'top-bottom-slot'
+ },
+ {
+ name: 'left',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '左面板插槽',
+ 'en-US': 'Slot on the left panel'
+ },
+ mode: ['pc'],
+ pcDemo: 'left-right-slot'
+ },
+ {
+ name: 'right',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '右面板插槽',
+ 'en-US': 'Right panel slot'
+ },
+ mode: ['pc'],
+ pcDemo: 'left-right-slot'
+ },
+ {
+ name: 'top',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '上面板插槽',
+ 'en-US': 'Slot on the upper panel'
+ },
+ mode: ['pc'],
+ pcDemo: 'top-bottom-slot'
+ },
+ {
+ name: 'trigger',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '拖拽插槽',
+ 'en-US': 'Drag Slot'
+ },
+ mode: ['pc'],
+ pcDemo: 'trigger-slot'
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/standard-list-item.js b/examples/sites/demos/apis/standard-list-item.js
new file mode 100644
index 000000000..f71de2aae
--- /dev/null
+++ b/examples/sites/demos/apis/standard-list-item.js
@@ -0,0 +1,203 @@
+export default {
+ mode: ['mobile-first'],
+ apis: [
+ {
+ name: 'StandardListItem',
+ type: 'component',
+ props: [
+ {
+ name: 'custom-class',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '用户自定义class,可覆盖组件默认class',
+ 'en-US': 'User-defined class, which can overwrite the default class of the component'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'custom-class'
+ },
+ {
+ name: 'data',
+ type: 'Object',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '列表数据源',
+ 'en-US': 'List Data Sources'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'icon',
+ type: 'Object',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': 'icon配置项',
+ 'en-US': 'icon configuration item'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'icon-more',
+ type: 'Object',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '更多按钮图标,可传入一个svg图标对象进行替换',
+ 'en-US': 'More button icons can be replaced by a svg icon object.'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'options',
+ type: 'Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '操作按钮配置项',
+ 'en-US': 'Operation button configuration item'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'selected',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否选中列表项,为true表示选中列表项。',
+ 'en-US': 'Indicates whether to select a list item. The value true indicates that a list item is selected.'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'show-image',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '显示图片',
+ 'en-US': 'Show Pictures'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'tag',
+ type: 'Object',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '标签配置项',
+ 'en-US': 'Label configuration items'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'title-option',
+ type: 'Object',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '标题配置项',
+ 'en-US': 'Title configuration item'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'type',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '类型,支持 card 和 list 两种模式',
+ 'en-US': 'Indicates the type. The options are card and list.'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'type'
+ },
+ {
+ name: 'user-head',
+ type: 'Object',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '用户头像配置项',
+ 'en-US': 'User avatar configuration items'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ events: [
+ {
+ name: 'icon-click',
+ type: 'Function()',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '操作栏按钮点击事件',
+ 'en-US': 'Operation bar button click event'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'icon-click-event'
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '组件默认插槽',
+ 'en-US': 'Component Default Slot'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'content-slot'
+ },
+ {
+ name: 'image',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '图片插槽',
+ 'en-US': 'Picture Slot'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'image-operate-slot'
+ },
+ {
+ name: 'operate',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '操作栏插槽',
+ 'en-US': 'Action Bar Slots'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'image-operate-slot'
+ },
+ {
+ name: 'tag',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '标签插槽',
+ 'en-US': 'Label Slot'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'content-slot'
+ },
+ {
+ name: 'title',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '标题插槽',
+ 'en-US': 'Header Slot'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/steps.js b/examples/sites/demos/apis/steps.js
new file mode 100644
index 000000000..7d2478e5b
--- /dev/null
+++ b/examples/sites/demos/apis/steps.js
@@ -0,0 +1,244 @@
+export default {
+ mode: ['pc', 'mobile-first'],
+ apis: [
+ {
+ name: 'steps',
+ type: 'component',
+ props: [
+ {
+ name: 'active',
+ type: 'number',
+ defaultValue: '-1',
+ desc: {
+ 'zh-CN': '当前步骤索引,从0开始计数',
+ 'en-US': 'Current step index and count from 0'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'advanced-steps',
+ mfDemo: ''
+ },
+ {
+ name: 'advanced',
+ type: 'Boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否开启高级向导模式',
+ 'en-US': 'Enable Advanced Wizard Mode'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'advanced-steps'
+ },
+ {
+ name: 'count-field',
+ type: 'string',
+ defaultValue: "'count'",
+ desc: {
+ 'zh-CN': '条形步骤条里徽标计数对应的字段名',
+ 'en-US': 'Custom field name corresponding to logo count in bar steps'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-steps-item'
+ },
+ {
+ name: 'data',
+ typeAnchorName: 'IStepsItem[]',
+ type: 'IStepsItem',
+ defaultValue: '[]',
+ desc: {
+ 'zh-CN': '步骤条的数据',
+ 'en-US': 'data of steps'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'line-horizontal',
+ mfDemo: ''
+ },
+ {
+ name: 'description-field',
+ type: 'String',
+ defaultValue: 'description',
+ desc: {
+ 'zh-CN': '描述字段',
+ 'en-US': 'Description field'
+ },
+ mode: ['mobile-first']
+ },
+ {
+ name: 'duration',
+ type: 'number',
+ defaultValue: '300',
+ desc: {
+ 'zh-CN': '节点滚动的持续时间(单位 ms),仅高级向导模式有效',
+ 'en-US': 'time of node scrolling(unit: ms), only apply for advanced mode'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'duration',
+ mfDemo: 'duration'
+ },
+ {
+ name: 'flex',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '节点是否自适应宽度',
+ 'en-US': 'responsible node width'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-width'
+ },
+ {
+ name: 'name-field',
+ type: 'string',
+ defaultValue: "'name'",
+ desc: {
+ 'zh-CN': '节点名称对应的字段名',
+ 'en-US': 'Field name corresponds to name of node'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'custom-steps-item',
+ mfDemo: ''
+ },
+ {
+ name: 'no-arrow',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '添加属性 no-arrow 隐藏左右箭头,在 PC 端按住 shift+鼠标滚轮 进行节点左右滚动,移动端触屏左右滑动即可,仅开启 advanced 高级向导模式有效',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'size',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ 'line 单链型模式支持 mini、small、medium、large 4 种尺寸,默认值为 medium。advanced 高级向导模式支持 medium、large 2 种尺寸,默认值为 medium',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'space',
+ type: 'string | number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '节点宽度, 可取值数字、带长度单位数值与百分比,传数字则默认以 px 为长度单位',
+ 'en-US':
+ 'Node width can be set to numeric values, values with length units, or percentages. Numeric values will default to using pixels as the length unit'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-width'
+ },
+ {
+ name: 'status-field',
+ type: 'string',
+ defaultValue: "'status'",
+ desc: {
+ 'zh-CN': '数据状态对应的字段名,用于条形步骤条',
+ 'en-US': 'Field name corresponding to data status, used for bar steps '
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'custom-steps-item',
+ mfDemo: ''
+ },
+ {
+ name: 'vertical',
+ type: 'Boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否开启垂直单链型',
+ 'en-US': 'Indicates whether to enable the vertical single chain mode.'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'vertical'
+ },
+ {
+ name: 'visible-num',
+ type: 'Number',
+ defaultValue: '5',
+ desc: {
+ 'zh-CN': '显示模块数量,超出隐藏',
+ 'en-US': 'Display the number of modules. The number of modules exceeds the hidden value'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'vertical'
+ }
+ ],
+ events: [
+ {
+ name: 'click',
+ type: '(index: number, node: IStepsItem) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '节点点击事件,参数:index: 点击节点的索引 node:点击节点的数据 ',
+ 'en-US': 'Node click event. Parameter: (index: node index, node: node data information)'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'click',
+ mfDemo: ''
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'block-bottom',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '滚动块底部插槽,仅开启 advanced 高级向导模式有效',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'item',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '步骤条数据项插槽,用于条形步骤条',
+ 'en-US': 'Step bar data item slot, used for bar steps'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'slot-item',
+ mfDemo: ''
+ },
+ {
+ name: 'prefix',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '前置插槽,仅开启 advanced 高级向导模式有效',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ]
+ }
+ ],
+ types: [
+ {
+ name: 'IStepsItem',
+ type: 'interface',
+ code: `
+interface IStepsItem {
+ // 条形步骤条数据项
+ name: string, // 节点名称
+ description: string, // 描述,仅用于单链型步骤条
+ status: IStepsStatus, // 节点状态,取值见下面IStepsStatus类型说明
+ count: number // 节点右上角徽标计数,仅用于默认条形步骤条
+}
+ `
+ },
+ {
+ name: 'IStepsStatus',
+ type: 'type',
+ code: `type IStepsStatus = 'doing' | 'done' | 'disabled' | 'error' | ''`
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/switch.js b/examples/sites/demos/apis/switch.js
new file mode 100644
index 000000000..5c1b26ea0
--- /dev/null
+++ b/examples/sites/demos/apis/switch.js
@@ -0,0 +1,182 @@
+export default {
+ mode: ['pc', 'mobile', 'mobile-first'],
+ apis: [
+ {
+ name: 'switch',
+ type: 'component',
+ props: [
+ {
+ name: 'before-change',
+ type: '(done: () => void) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '开关值变化前置处理',
+ 'en-US': 'Pre processing of switch value changes'
+ },
+ mode: ['pc'],
+ pcDemo: 'before-change'
+ },
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否禁用',
+ 'en-US': 'Disable'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'dynamic-disable',
+ mobileDemo: 'disabled',
+ mfDemo: ''
+ },
+ {
+ name: 'false-value',
+ type: 'boolean | string | number',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': 'switch 关闭时的值',
+ 'en-US': 'Value when switch is disabled'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'custom-true-false-value',
+ mobileDemo: 'base',
+ mfDemo: ''
+ },
+ {
+ name: 'mini',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '设置是否显示为 mini 模式,mini 模式下不会显示 slot 的内容',
+ 'en-US': 'Sets whether to display in mini mode. In mini mode, the content of the slot is not displayed'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'mini-mode',
+ mobileDemo: 'mini',
+ mfDemo: ''
+ },
+ {
+ name: 'modelValue / v-model',
+ type: 'boolean | string | number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '开关绑定值',
+ 'en-US': 'Switch bind value'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'show-text',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': 'switch 是否显示内容里面的文字',
+ 'en-US': 'Switch whether to display the text in the content'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-open-close'
+ },
+ {
+ name: 'size',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '定义开关尺寸',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'true-value',
+ type: 'boolean | string | number',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': 'switch 打开时的值',
+ 'en-US': 'Value when switch is enabled'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'custom-true-false-value',
+ mobileDemo: 'base',
+ mfDemo: ''
+ },
+ {
+ name: 'types',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '展示开关不同的状态',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'v-model',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '绑定值
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile', 'mobile-first'],
+ mobileDemo: 'base',
+ mfDemo: ''
+ }
+ ],
+ events: [
+ {
+ name: 'change',
+ type: '(value: boolean | string | number) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': 'switch 状态发生变化时的回调函数',
+ 'en-US': 'Callback function for switch changes'
+ },
+ mode: ['pc', 'mobile'],
+ pcDemo: 'event-change',
+ mobileDemo: 'event'
+ },
+ {
+ name: 'enent',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': 'switch发生变化的回调函数',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'close',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '关闭内容,当 show-text 为 true 时有效',
+ 'en-US': 'Close Content'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'custom-open-close',
+ mfDemo: ''
+ },
+ {
+ name: 'open',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '开启内容,当 show-text 为 true 时有效',
+ 'en-US': 'Enable Content'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'custom-open-close',
+ mfDemo: ''
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/tabbar.js b/examples/sites/demos/apis/tabbar.js
new file mode 100644
index 000000000..af013b0a5
--- /dev/null
+++ b/examples/sites/demos/apis/tabbar.js
@@ -0,0 +1,249 @@
+export default {
+ mode: ['mobile', 'mobile-first'],
+ apis: [
+ {
+ name: 'Tabbar',
+ type: 'component',
+ props: [
+ {
+ name: 'active-color',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '选中标签的颜色
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile', 'mobile-first'],
+ mobileDemo: 'active-inactive-color',
+ mfDemo: 'active-inactive-color'
+ },
+ {
+ name: 'border',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否显示外边框,该属性默认为true
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile', 'mobile-first'],
+ mobileDemo: 'border',
+ mfDemo: 'custom-close'
+ },
+ {
+ name: 'fixed',
+ type: 'Boolen',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否固定在底部,该属性默认为true
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'border'
+ },
+ {
+ name: 'inactive-color',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '未选中标签的颜色
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile', 'mobile-first'],
+ mobileDemo: 'active-inactive-color',
+ mfDemo: 'active-inactive-color'
+ },
+ {
+ name: 'item-list',
+ type: 'Object[]',
+ defaultValue: '[]',
+ desc: {
+ 'zh-CN': '设置底部导航虚幻遍历需要放的数组;',
+ 'en-US': 'Sets the array to be placed in the bottom navigation illusory traversal.'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'options'
+ },
+ {
+ name: 'route',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否开启路由模式,该属性默认为false
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'route'
+ },
+ {
+ name: 'show-number',
+ type: 'Number',
+ defaultValue: '5',
+ desc: {
+ 'zh-CN': '设置底部导航需要展示的项数',
+ 'en-US': 'Set the number of items to be displayed in the bottom navigation.'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'options'
+ },
+ {
+ name: 'v-model',
+ type: 'Number | String',
+ defaultValue: '0',
+ desc: {
+ 'zh-CN': '设置底部导航双向数据绑定',
+ 'en-US': 'Set bottom navigation bidirectional data binding'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'base'
+ },
+ {
+ name: 'z-index',
+ type: 'Number | String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '元素 z-index
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'border'
+ }
+ ],
+ events: [
+ {
+ name: 'change',
+ type: 'Function()',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '切换标签时触发,value: 当前选中标签的名称或索引值
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile', 'mobile-first'],
+ mobileDemo: 'event-change',
+ mfDemo: 'event-change'
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '底部导航每一项',
+ 'en-US': 'Bottom navigation for each item'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'base'
+ },
+ {
+ name: 'icon',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义图标
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'slot-icon'
+ }
+ ]
+ },
+ {
+ name: 'TabbarItem',
+ type: 'component',
+ props: [
+ {
+ name: 'badge',
+ type: 'Number | String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置底部导航选项徽标',
+ 'en-US': 'Set bottom navigation option logo'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'badge'
+ },
+ {
+ name: 'custom-icon',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置底部导航个性化图标',
+ 'en-US': 'Set bottom navigation personalization icon'
+ },
+ mode: ['mobile-first']
+ },
+ {
+ name: 'dot',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置底部导航选项点',
+ 'en-US': 'Set bottom navigation option points'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'badge'
+ },
+ {
+ name: 'icon',
+ type: 'Object',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置底部导航上自定义图标',
+ 'en-US': 'Set custom icons on bottom navigation'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'slot-icon'
+ },
+ {
+ name: 'name',
+ type: 'Number | String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置底部导航选项标题',
+ 'en-US': 'Set bottom navigation option title'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'base'
+ },
+ {
+ name: 'text',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置底部导航循环时设定的标题',
+ 'en-US': 'Sets the title set when the bottom navigation loop'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'base'
+ }
+ ],
+ events: [
+ {
+ name: 'click',
+ type: 'Function()',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '选项点击时触发的事件',
+ 'en-US': 'Event triggered when an option is clicked'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'event-change'
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '底部导航每一项',
+ 'en-US': 'Bottom navigation for each item'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'base'
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/table.js b/examples/sites/demos/apis/table.js
new file mode 100644
index 000000000..1cd0356a2
--- /dev/null
+++ b/examples/sites/demos/apis/table.js
@@ -0,0 +1,69 @@
+export default {
+ mode: ['mobile'],
+ apis: [
+ {
+ name: 'Table',
+ type: 'component',
+ props: [
+ {
+ name: 'columns',
+ type: '[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '列数据
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'base'
+ },
+ {
+ name: 'data',
+ type: '[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '表格数据
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'base'
+ },
+ {
+ name: 'defaultChecked',
+ type: '[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '默认选中项
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'base'
+ },
+ {
+ name: 'keys',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '数据标识
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'base'
+ },
+ {
+ name: 'width',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '表格宽度
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'base'
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: []
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/tabs.js b/examples/sites/demos/apis/tabs.js
new file mode 100644
index 000000000..f868dcec4
--- /dev/null
+++ b/examples/sites/demos/apis/tabs.js
@@ -0,0 +1,530 @@
+export default {
+ mode: ['pc', 'mobile', 'mobile-first'],
+ apis: [
+ {
+ name: 'tabs',
+ type: 'component',
+ props: [
+ {
+ name: 'active-color',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '当前页签的字体颜色',
+ 'en-US': 'active tab color'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'active-color'
+ },
+ {
+ name: 'active-name',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置初始选中的页签项',
+ 'en-US': 'Set initially selected label items'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'tab-style-card',
+ mobileDemo: 'active-name',
+ mfDemo: ''
+ },
+ {
+ name: 'before-leave',
+ type: '(activeName: string, oldActiveName: string) => boolean | Promise',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '切换页签项之前的钩子,若返回 false 或返回 Promise 且被 reject,则阻止切换; activeName: 即将切换的页签项名称, oldActiveName: 当前页签项名称',
+ 'en-US':
+ 'The hook before the tag is switched. If false is returned or Promise is returned and rejected, the switch is blocked; ActiveName: The name of the label item that is about to be switched, oldActiveName: The name of the current label item'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'before-leave',
+ mobileDemo: 'before-leave',
+ mfDemo: ''
+ },
+ {
+ name: 'drop-config',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '启用页签拖拽功能,配置第三方排序插件,对页签项进行重新排序;需注意:不是通过 v-for 渲染的 tab-item,在拖拽排序后,无法在 tab-drag-end 事件中对其顺序进行保存',
+ 'en-US':
+ 'Enable tab drag and drop functionality, configure third-party sorting plugins, and reorder tabs; Please note that tab items that are not rendered through v-for cannot be saved in the tab drag end event after dragging and sorting'
+ },
+ mode: ['pc'],
+ pcDemo: 'tabs-draggable'
+ },
+ {
+ name: 'editable',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否同时显示添加和删除按钮,与 edit 事件搭配使用',
+ 'en-US': 'Do you want to display both add and delete buttons for use with the edit event'
+ },
+ mode: ['pc'],
+ pcDemo: 'tabs-events-edit'
+ },
+ {
+ name: 'expand-tabs-mode',
+ type: 'string',
+ defaultValue: 'columns',
+ desc: {
+ 'zh-CN': '展开内容的排列方式,可选值 column:为单列,columns:为多列',
+ 'en-US':
+ "The arrangement of content can be displayed in either a single column format, which is referred to as 'column', or in multiple columns, which is referred to as 'columns'."
+ },
+ mode: ['mobile'],
+ mobileDemo: 'expend'
+ },
+ {
+ name: 'expand-tabs-title',
+ type: 'string',
+ defaultValue: '请选择',
+ desc: {
+ 'zh-CN': '展开内容的标题',
+ 'en-US': 'Expand Content Title'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'expend'
+ },
+ {
+ name: 'modelValue / v-model',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '绑定选中值,选中项的 name',
+ 'en-US': 'Bound selected value, The name of the selected item'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'optimized',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否开启优化渲染,默认值为true,表示开启优化渲染,此时只会渲染当前标签项',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'popper-class',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '为"更多"下拉页签框添加类名,可用于自定义下拉选项的样式',
+ 'en-US':
+ 'Add a class name to the “More” dropdown label box, which can be used to customize the style of dropdown options'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-more-icon'
+ },
+ {
+ name: 'position',
+ typeAnchorName: 'IPosition',
+ type: 'IPosition',
+ defaultValue: "'top'",
+ desc: {
+ 'zh-CN': '设置页签栏所在位置; 默认为 top',
+ 'en-US': 'Set the location of the label bar; Default to top'
+ },
+ mode: ['pc'],
+ pcDemo: 'position'
+ },
+ {
+ name: 'separator',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '设置分隔符样式',
+ 'en-US': 'Set Separator Style'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'tabs-separator',
+ mfDemo: ''
+ },
+ {
+ name: 'show-expand-tabs',
+ type: 'Boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '页签可展开',
+ 'en-US': 'tabs expandable'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'expend'
+ },
+ {
+ name: 'show-more-tabs',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN':
+ '设置当页签栏超过一定宽度时是否显示"更多"按钮,若为 true,则当鼠标悬停到按钮上时,将出现下拉框展示超出宽度的页签项',
+ 'en-US':
+ 'Set whether to display the "More" button when the label bar exceeds a certain width. If true, a drop-down box will appear when the mouse hovers over the button to display label items that exceed the width'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-more-icon'
+ },
+ {
+ name: 'size',
+ type: "'small' | 'large'",
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '设置 tabs 页签尺寸,该属性可选值为 large 或 small,其中 small 在 tabStyle 为 card 或者 border-card 时生效',
+ 'en-US':
+ 'Sets the tab size. The value can be large or small. This parameter is valid only when tabStyle is set to card or border-card'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'tab-style-card',
+ mfDemo: ''
+ },
+ {
+ name: 'stretch',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '页签项的宽度是否自动撑开',
+ 'en-US': 'Does the width of the label item automatically expand'
+ },
+ mode: ['pc'],
+ pcDemo: 'stretch-wh'
+ },
+ {
+ name: 'swipeable',
+ type: 'Boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '滑动页签内容切换页签',
+ 'en-US': 'slide tab content to switch tab'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'swipe'
+ },
+ {
+ name: 'tab-style',
+ typeAnchorName: 'ITabStyle',
+ type: 'ITabStyle',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '页签的类型;默认为空字符串',
+ 'en-US': 'Tabs style; Default to empty string'
+ },
+ mode: ['pc'],
+ pcDemo: 'tab-style-card'
+ },
+ {
+ name: 'tooltip-config',
+ typeAnchorName: 'ITooltipProps',
+ type: 'ITooltipProps | "title"',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '设置文字超出提示, object 类型的值参考 tooltip 组件的 Props 配置,如果想使用默认的 title 属性,可设置为 string 类型,值为 title,【3.8.0版本新增】',
+ 'en-US':
+ 'Set the message indicating that the text exceeds the limit. The value of the object type refers to the Props configuration of the tooltip component. If you want to use the default title attribute, set it to the string type and set it to title. [Added in 3.8.0]'
+ },
+ mode: ['pc'],
+ pcDemo: 'tooltip'
+ },
+ {
+ name: 'v-model',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '绑定值,选中选项卡的 name',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'v-model / modelValue',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '选中选项卡的 name',
+ 'en-US': 'the name of the selected item'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'basic-usage'
+ },
+ {
+ name: 'with-add',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否显示添加按钮,用来添加页签项',
+ 'en-US': 'Do you want to display the add button to add tab item'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'with-add',
+ mobileDemo: 'add-delete-tab',
+ mfDemo: ''
+ },
+ {
+ name: 'with-close',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否显示页签项的关闭按钮,用来删除页签项',
+ 'en-US': 'Do you want to display the close button for label items to delete them'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'tabs-events-close',
+ mobileDemo: 'add-delete-tab',
+ mfDemo: ''
+ }
+ ],
+ events: [
+ {
+ name: 'add',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '点击"添加"按钮后触发,用于编写增加页签项的逻辑',
+ 'en-US': 'Triggered after clicking the "Add" button, used to write logic for adding tab items'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'with-add',
+ mobileDemo: 'tabs-events',
+ mfDemo: ''
+ },
+ {
+ name: 'click',
+ type: '(TabItem: Component, event: Event) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '点击页签项时触发,tab 被选中时触发; TabItem: 点中页签项的vueComponent对象信息',
+ 'en-US':
+ 'Trigger an event when clicking on a tab item, Triggered when tab is selected; TabItem: Click on the Component object information of the tab item in the middle'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'tabs-events-click',
+ mobileDemo: 'tabs-events',
+ mfDemo: ''
+ },
+ {
+ name: 'close',
+ type: '(name: string) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '点击页签项关闭按钮后触发,用于编写删除页签项的逻辑; name: 要删除的页签项name值',
+ 'en-US':
+ 'Triggered after clicking the tab item close button, used to write logic for deleting tab items; name: The name value of the tab item to be deleted'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'tabs-events-close',
+ mobileDemo: 'tabs-events',
+ mfDemo: ''
+ },
+ {
+ name: 'edit',
+ type: '(name: string, type: "add" | "remove") => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '点击"添加"或"关闭"按钮触发; name:null或删除的tab名称, type:添加或删除字段',
+ 'en-US':
+ 'Click the "Add" or "Close" button to trigger; name: null or deleted tab name, type: added or deleted field'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'tabs-events-edit',
+ mfDemo: ''
+ },
+ {
+ name: 'tab-drag-end',
+ type: '(event: DragEvent) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '拖动结束后的事件',
+ 'en-US': 'Event after the drag is complete'
+ },
+ mode: ['pc'],
+ pcDemo: 'tabs-draggable'
+ },
+ {
+ name: 'tab-drag-over',
+ type: '(event: DragEvent) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '拖动中的事件',
+ 'en-US': 'Dragging event'
+ },
+ mode: ['pc'],
+ pcDemo: 'tabs-draggable'
+ },
+ {
+ name: 'tab-drag-start',
+ type: '(event: DragEvent) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '拖动开始时的事件',
+ 'en-US': 'Drag start event'
+ },
+ mode: ['pc'],
+ pcDemo: 'tabs-draggable'
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '默认插槽',
+ 'en-US': 'default slot'
+ },
+ mode: ['mobile', 'mobile-first'],
+ mobileDemo: 'basic-usage',
+ mfDemo: ''
+ },
+ {
+ name: 'moreIcon',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '更多按钮插槽',
+ 'en-US': 'More Button Slot'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-more-icon'
+ },
+ {
+ name: 'title',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '页签项标题插槽',
+ 'en-US': 'Label Item Title Slot'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-tab-title'
+ }
+ ]
+ },
+ {
+ name: 'tab-item',
+ type: 'component',
+ props: [
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '设置页签项禁用,设置为 true 则无法点击',
+ 'en-US': 'Set tab items to disable, set to true to prevent clicking'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'lazy',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '设置本页签项内容是否为懒加载,默认为否',
+ 'en-US': 'Set whether the content of this tab is lazy loading, default to no'
+ },
+ mode: ['pc'],
+ pcDemo: 'lazy'
+ },
+ {
+ name: 'name',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '页签项的值',
+ 'en-US': 'Value of tab items'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'title',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '页签项标题',
+ 'en-US': 'Tab Item Title'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'with-close',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '页签项是否展示删除按钮,与 Tabs 的 with-close 取或,只要有一个为true,则此项展示删除按钮',
+ 'en-US':
+ "Does the tab item display a delete button, which is equal to or greater than the 'with close' option in Tabs? As long as one of these options is true, this option displays the delete button"
+ },
+ mode: ['pc'],
+ pcDemo: 'tabs-events-close'
+ }
+ ],
+ events: [
+ {
+ name: 'tab-nav-update',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '当页签项的 title 值发生变化时触发',
+ 'en-US': 'Triggered when the title value of the tab item changes'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '页签项对应内容部分的默认插槽,用来自定义页签项对应的页面内容',
+ 'en-US':
+ 'The default slot for the content section corresponding to the tab item, used to customize the page content corresponding to the tab item'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ }
+ ]
+ }
+ ],
+ types: [
+ {
+ name: 'IPosition',
+ type: 'type',
+ code: `
+type IPosition = 'top' | 'right' | 'bottom' | 'left'
+`
+ },
+ {
+ name: 'ITabStyle',
+ type: 'type',
+ code: `
+type ITabStyle = 'card' | 'border-card' | 'button-card' | ''
+`
+ },
+ {
+ name: 'ITooltipProps',
+ type: 'interface',
+ code: `
+interface ITooltipProps { // 参照tooltip的props进行配置
+ effect?: string
+ placement?: string
+ visible?: string
+ [propName: string]: any
+}
+`
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/tag-group.js b/examples/sites/demos/apis/tag-group.js
new file mode 100644
index 000000000..ba385d982
--- /dev/null
+++ b/examples/sites/demos/apis/tag-group.js
@@ -0,0 +1,77 @@
+export default {
+ mode: ['pc', 'mobile-first'],
+ apis: [
+ {
+ name: 'tag-group',
+ type: 'component',
+ props: [
+ {
+ name: 'data',
+ typeAnchorName: 'ITagGroupDataItem',
+ type: 'ITagGroupDataItem[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': ' 数据源',
+ 'en-US': 'Data source'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mfDemo: ''
+ },
+ {
+ name: 'effect',
+ type: "'dark' | 'light' | 'plain'",
+ defaultValue: "'light'",
+ desc: {
+ 'zh-CN': '主题',
+ 'en-US': 'Effect'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'tag-group-effect',
+ mfDemo: 'tag-group-effect'
+ },
+ {
+ name: 'size',
+ type: "'medium' | 'small' | 'mini'",
+ defaultValue: "'medium'",
+ desc: {
+ 'zh-CN': '尺寸',
+ 'en-US': 'Size '
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'tag-group-size',
+ mfDemo: 'tag-group-size'
+ }
+ ],
+ events: [
+ {
+ name: 'item-click',
+ typeAnchorName: 'ITagGroupItemClick',
+ type: 'ITagGroupItemClick',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '单个标签的点击事件',
+ 'en-US': 'Click event of a single tag. '
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'tag-group-event',
+ mfDemo: 'tag-group-event'
+ }
+ ],
+ methods: [],
+ slots: []
+ }
+ ],
+ types: [
+ {
+ name: 'ITagGroupDataItem',
+ type: 'type',
+ code: `type ITagGroupDataItem = { name: string, type?: 'success' | 'info' | 'warning' | 'danger' }`
+ },
+ {
+ name: 'ITagGroupItemClick',
+ type: 'type',
+ code: `type ITagGroupItemClick = (item: ITagGroupDataItem, index: number, event: Event) => void`
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/tag.js b/examples/sites/demos/apis/tag.js
new file mode 100644
index 000000000..539236425
--- /dev/null
+++ b/examples/sites/demos/apis/tag.js
@@ -0,0 +1,263 @@
+export default {
+ mode: ['pc', 'mobile', 'mobile-first'],
+ apis: [
+ {
+ name: 'tag',
+ type: 'component',
+ props: [
+ {
+ name: 'before-delete',
+ type: '(close: () => void) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '删除前回调函数',
+ 'en-US': 'Delete callback function before deletion'
+ },
+ mode: ['pc'],
+ pcDemo: 'delete'
+ },
+ {
+ name: 'closable',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否可关闭',
+ 'en-US': 'Can be disabled'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'delete',
+ mfDemo: ''
+ },
+ {
+ name: 'color',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '背景色:rgb,rgba,hex 三种格式',
+ 'en-US': 'Background color: The value can be in rgb, rgba, or hex format'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'color3',
+ mobileDemo: 'different-color',
+ mfDemo: ''
+ },
+ {
+ name: 'custom-class',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '标签class',
+ 'en-US': 'Tag class'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否禁用',
+ 'en-US': 'Whether to disable'
+ },
+ mode: ['pc'],
+ pcDemo: 'disabled'
+ },
+ {
+ name: 'effect',
+ typeAnchorName: 'IEffect',
+ type: 'IEffect',
+ defaultValue: "'light'",
+ desc: {
+ 'zh-CN': '主题',
+ 'en-US': 'Subject'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'effect',
+ mfDemo: ''
+ },
+ {
+ name: 'hit',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否有边框',
+ 'en-US': 'Whether there is a border stroke'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'color3',
+ mfDemo: ''
+ },
+ {
+ name: 'max-width',
+ type: 'string | number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '最大宽度',
+ 'en-US': 'max width'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'max-width'
+ },
+ {
+ name: 'mini',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '小尺寸',
+ 'en-US': 'mini'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'mini'
+ },
+ {
+ name: 'operable',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否可操作',
+ 'en-US': 'Operable or Not'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'selectable',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否可选择',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'size',
+ typeAnchorName: 'ISize',
+ type: 'ISize',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '尺寸',
+ 'en-US': 'Size'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mfDemo: ''
+ },
+ {
+ name: 'text',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '文字',
+ 'en-US': 'Text'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'basic-usage'
+ },
+ {
+ name: 'theme',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '彩色标签,该属性的可选值为 pink、purple、cyan',
+ 'en-US': 'Color label. The value can be pink, purple, or cyan.'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'colorful-tag'
+ },
+ {
+ name: 'type',
+ typeAnchorName: 'IType',
+ type: 'IType',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '显示类型',
+ 'en-US': 'Display type'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'effect',
+ mfDemo: 'effect'
+ },
+ {
+ name: 'value',
+ type: 'number | string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '配置式标签,自定义标签内容【3.9.1新增】',
+ 'en-US': 'Configurable labels, custom label content [Added in 3.9.1]'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'content',
+ mfDemo: ''
+ }
+ ],
+ events: [
+ {
+ name: 'click',
+ type: '(event: Event) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '点击标签时触发的事件',
+ 'en-US': 'Event triggered when clicking on Tag'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'tag-event-click',
+ mfDemo: ''
+ },
+ {
+ name: 'close',
+ type: '(event: Event)) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '点击关闭按钮时触发的事件',
+ 'en-US': 'Event triggered when the close button is clicked'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'delete',
+ mfDemo: ''
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '标签内容',
+ 'en-US': 'Label Content'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'slot-default',
+ mobileDemo: 'slot-default',
+ mfDemo: ''
+ }
+ ]
+ }
+ ],
+ types: [
+ {
+ name: 'IEffect',
+ type: 'type',
+ code: `
+type IEffect = 'dark' | 'light' | 'plain'
+`
+ },
+ {
+ name: 'ISize',
+ type: 'type',
+ code: `
+type ISize = 'medium' | 'small' | 'mini' | ''
+`
+ },
+ {
+ name: 'IType',
+ type: 'type',
+ code: `
+type IType = 'success' | 'info' | 'mini' | 'warning' | 'danger'
+`
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/text-popup.js b/examples/sites/demos/apis/text-popup.js
new file mode 100644
index 000000000..19ae606bf
--- /dev/null
+++ b/examples/sites/demos/apis/text-popup.js
@@ -0,0 +1,69 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'text-popup',
+ type: 'component',
+ props: [
+ {
+ name: 'placeholder',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入框内的提示占位文本',
+ 'en-US': 'Set the prompt placeholder text in the text box.'
+ },
+ mode: ['pc'],
+ pcDemo: 'placeholder'
+ },
+ {
+ name: 'readonly',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否只读',
+ 'en-US': 'Set whether to read only'
+ },
+ mode: ['pc'],
+ pcDemo: 'readonly'
+ },
+ {
+ name: 'separtor',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '分隔符',
+ 'en-US': 'Separator'
+ },
+ mode: ['pc'],
+ pcDemo: 'separtor'
+ },
+ {
+ name: 'value',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '绑定值',
+ 'en-US': 'Bound Value'
+ },
+ mode: ['pc'],
+ pcDemo: 'value'
+ },
+ {
+ name: 'width',
+ type: 'number , string',
+ defaultValue: '150',
+ desc: {
+ 'zh-CN': '宽度',
+ 'en-US': 'Set width'
+ },
+ mode: ['pc'],
+ pcDemo: 'width'
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: []
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/time-line.js b/examples/sites/demos/apis/time-line.js
new file mode 100644
index 000000000..cec075eb2
--- /dev/null
+++ b/examples/sites/demos/apis/time-line.js
@@ -0,0 +1,334 @@
+export default {
+ mode: ['pc', 'mobile-first'],
+ apis: [
+ {
+ name: 'time-line',
+ type: 'component',
+ props: [
+ {
+ name: 'active',
+ type: 'number',
+ defaultValue: '-1',
+ desc: {
+ 'zh-CN': '当前节点索引,从0开始计数',
+ 'en-US': 'Current node index and count from 0'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'auto-color-field',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '显示组件二级标题内容,默认值为 autoColor',
+ 'en-US': 'Displays the level-2 title of the component. The default value is autoColor.'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'data',
+ typeAnchorName: 'ITimelineItem',
+ type: 'ITimelineItem',
+ defaultValue: '[]',
+ desc: {
+ 'zh-CN': '节点数据',
+ 'en-US': 'Nodes data'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mfDemo: ''
+ },
+ {
+ name: 'horizontal',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否水平方向',
+ 'en-US': 'Whether horizontal constructure'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'line-width',
+ type: 'string | number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': "连接线长度,仅当 text-position 取值为 'right' 时生效,设置后 space 属性失效。",
+ 'en-US':
+ "The length of the connection line and it is valid only when text-position is set to 'right'. After setting, the space property is invalid"
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'name-field',
+ type: 'string',
+ defaultValue: "'name'",
+ desc: {
+ 'zh-CN': '节点名称对应的字段名',
+ 'en-US': 'Set the field name in the node information.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'custom-field',
+ mfDemo: ''
+ },
+ {
+ name: 'only-number',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '节点序号是否只显示数字,适用于横向时间线',
+ 'en-US': 'Whether the node sequence number only displays numbers, used for horizontal timeline'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'reverse',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否逆序排列节点,仅用于竖式时间线',
+ 'en-US': 'Whether the node in reverse order and only for vertical timeline'
+ },
+ mode: ['pc'],
+ pcDemo: 'vertical-timeline'
+ },
+ {
+ name: 'shape',
+ type: 'string',
+ defaultValue: "'circle'",
+ desc: {
+ 'zh-CN': "圆点外形: 空心圆形或实心圆点,取值分别对应 'circle' | 'dot'",
+ 'en-US': "Set the appearance of point, optional values include 'circle' and 'dot'"
+ },
+ mode: ['pc'],
+ pcDemo: 'shape'
+ },
+ {
+ name: 'show-divider',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否显示底部分割线,适用于横向时间线',
+ 'en-US': 'Whether to display the bottom separator line of horizontal timeline'
+ },
+ mode: ['pc'],
+ pcDemo: 'show-divider'
+ },
+ {
+ name: 'show-number',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '未完成状态的节点是否显示序号',
+ 'en-US': 'Whether to display sequence numbers for unfinished states'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'space',
+ type: 'string | number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '节点宽度, 取值为数字、带长度单位的数值字符串和百分比字符串,数字会默认以px为长度单位',
+ 'en-US':
+ 'Set the width of the timeline.The value can be a number, a numeric string with length units, or a percentage string. For numbers, the default length unit is px'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'set-node-width',
+ mfDemo: ''
+ },
+ {
+ name: 'start',
+ type: 'number',
+ defaultValue: '1',
+ desc: {
+ 'zh-CN': '节点序号起始值',
+ 'en-US': 'The start step sequence number.'
+ },
+ mode: ['pc'],
+ pcDemo: 'set-start-value'
+ },
+ {
+ name: 'sub-field',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置时间线两侧展示',
+ 'en-US': 'Set the display on both sides of the timeline.'
+ },
+ mode: ['mobile-first'],
+ mfDemo: 'sub-field'
+ },
+ {
+ name: 'time-field',
+ type: 'string',
+ defaultValue: "'time'",
+ desc: {
+ 'zh-CN': '节点时间信息对应的字段名',
+ 'en-US': 'The name of the field corresponding to the node time information'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'custom-field',
+ mfDemo: ''
+ },
+ {
+ name: 'tips-field',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '显示组件二级标题内容,默认值为 tips',
+ 'en-US': 'Displays the level-2 title of the component. The default value is tips.'
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'vertical',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否竖直方向',
+ 'en-US': 'Vertical direction'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'vertical-timeline',
+ mfDemo: ''
+ }
+ ],
+ events: [
+ {
+ name: 'click',
+ type: '(index: number, node: ITimelineItem) => void',
+ desc: {
+ 'zh-CN': '节点的点击事件,参数:
index:点击节点的下标
node: 点击节点数据}',
+ 'en-US': 'Click event of a node. arguments:
index: click the subscript of a node
node: node data'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'bottom',
+ desc: {
+ 'zh-CN': '自定义节点底部内容',
+ 'en-US': 'Customize bottom content for timeline item'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-horizontal-timeline'
+ },
+ {
+ name: 'description',
+ desc: {
+ 'zh-CN': '节点描述信息插槽,适用于横向时间线',
+ 'en-US': 'Node description information slot, used for horizontal timeline'
+ },
+ mode: ['pc'],
+ pcDemo: 'slot-description'
+ },
+ {
+ name: 'left',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义节点左侧内容',
+ 'en-US': 'Customize left content for timeline item'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'custom-vertical-timeline',
+ mfDemo: ''
+ },
+ {
+ name: 'right',
+ desc: {
+ 'zh-CN': '自定义节点右侧内容',
+ 'en-US': 'Customize right content for timeline item'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-vertical-timeline'
+ },
+ {
+ name: 'top',
+ desc: {
+ 'zh-CN': '自定义节点顶部内容',
+ 'en-US': 'Customize bottom content for timeline item'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-horizontal-timeline'
+ }
+ ]
+ },
+ {
+ name: 'timeline-item',
+ type: 'component',
+ props: [
+ {
+ name: 'line-width',
+ type: 'string | number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '连接线长度,仅当 timeline 组件 text-position 属性取值为 true 时生效,设置后 space 属性失效',
+ 'en-US':
+ 'The length of the connection line and it is valid only when text-position is set to true. After setting, the space property is invalid'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'node',
+ typeAnchorName: 'ITimelineItem',
+ type: 'ITimelineItem',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '节点数据',
+ 'en-US': 'Node data'
+ },
+ mode: ['pc'],
+ pcDemo: 'timeline-item'
+ },
+ {
+ name: 'space',
+ type: 'string | number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '节点宽度, 取值为数字、带长度单位的数值字符串和百分比字符串,数字会默认以px为长度单位',
+ 'en-US':
+ 'Set the width of the timeline.The value can be a number, a numeric string with length units, or a percentage string. For numbers, the default length unit is px'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: []
+ }
+ ],
+ types: [
+ {
+ name: 'ITimelineItem',
+ type: 'interface',
+ code: `
+interface ITimelineItem {
+ name: string // 节点名称
+ time?: string // 节点时间
+ error?: boolean // 是否异常状态
+ disabled?: boolean // 是否禁用
+ type?: ITimelineItemType // 节点类型
+}
+ `
+ },
+ {
+ name: 'ITimelineItemType',
+ type: 'type',
+ code: `type ITimelineItemType = 'primary' | 'success' | 'warning' | 'error' | 'info'`
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/time-picker-mobile.js b/examples/sites/demos/apis/time-picker-mobile.js
new file mode 100644
index 000000000..7525245bd
--- /dev/null
+++ b/examples/sites/demos/apis/time-picker-mobile.js
@@ -0,0 +1,60 @@
+export default {
+ mode: ['mobile-first'],
+ apis: [
+ {
+ name: 'time-picker-mobile',
+ type: 'component',
+ props: [
+ {
+ name: 'v-model',
+ type: 'Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '绑定值',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'visible',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '是否弹出面板',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ events: [
+ {
+ name: 'update:visible',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '显示或隐藏面板时触发',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '组件默认插槽,设置 type 为 action 启用操作列表模式会提供参数 data 列表项和 index 列表索引',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/time-picker.js b/examples/sites/demos/apis/time-picker.js
new file mode 100644
index 000000000..bcea5dfc3
--- /dev/null
+++ b/examples/sites/demos/apis/time-picker.js
@@ -0,0 +1,388 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'time-picker',
+ type: 'component',
+ props: [
+ {
+ name: 'arrow-control',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否使用箭头进行时间选择',
+ 'en-US': 'Whether to use arrows for time selection'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'clear-icon',
+ type: 'Component',
+ defaultValue: 'IconOperationfaild',
+ desc: {
+ 'zh-CN': '自定义清空图标',
+ 'en-US':
+ 'Indicates whether to insert a pop-up box to the body element. If a fault occurs in locating the fault in the dialog box that is displayed, you can set this attribute to false'
+ },
+ mode: ['pc'],
+ pcDemo: 'clearable'
+ },
+ {
+ name: 'clearable',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否显示清除按钮',
+ 'en-US': 'Display Clear Button'
+ },
+ mode: ['pc'],
+ pcDemo: 'clearable'
+ },
+ {
+ name: 'default-value',
+ type: 'Date | string | number | Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '当选中的日期值为空时,选择器面板打开时默认显示的时间,需设置为可被 new Date() 解析的值',
+ 'en-US': 'Native attribute'
+ },
+ mode: ['pc'],
+ pcDemo: 'default-value'
+ },
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '禁用',
+ 'en-US': 'Disabled'
+ },
+ mode: ['pc'],
+ pcDemo: 'disabled'
+ },
+ {
+ name: 'editable',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '文本框可输入',
+ 'en-US': 'The text box can be entered.'
+ },
+ mode: ['pc'],
+ pcDemo: 'editable'
+ },
+ {
+ name: 'end-placeholder',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '范围选择时结束日期的占位内容',
+ 'en-US': 'Placeholder of the end date when the range is selected'
+ },
+ mode: ['pc'],
+ pcDemo: 'placeholder'
+ },
+ {
+ name: 'is-range',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否为时间范围选择',
+ 'en-US':
+ 'Indicates whether to use arrows to select time. This parameter is valid only for .'
+ },
+ mode: ['pc'],
+ pcDemo: 'is-range'
+ },
+ {
+ name: 'modelValue / v-model',
+ type: 'Date | string | number | Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '日期选择器选中的日期值,可设置选择器的初始值',
+ 'en-US': 'Date value selected by the date selector. You can set the initial value of the selector.'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'name',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '原生 input name
属性',
+ 'en-US': 'Native input name
attribute'
+ },
+ mode: ['pc'],
+ pcDemo: 'name'
+ },
+ {
+ name: 'picker-options',
+ typeAnchorName: 'IPickerOptions',
+ type: 'IPickerOptions',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '配置可选的时间范围、下拉框中显示的格式',
+ 'en-US': ''
+ },
+ mode: ['pc'],
+ pcDemo: 'disabled'
+ },
+ {
+ name: 'placeholder',
+ type: 'string',
+ defaultValue: "''",
+ desc: {
+ 'zh-CN': '非范围选择时的占位内容',
+ 'en-US': 'Placeholder content for non-range selection'
+ },
+ mode: ['pc'],
+ pcDemo: 'placeholder'
+ },
+ {
+ name: 'popper-append-to-body',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否将弹出框插入至 body 元素,在弹出框的定位出现问题时,可将该属性设置为 false',
+ 'en-US': ''
+ },
+ mode: ['pc'],
+ pcDemo: 'popper-class'
+ },
+ {
+ name: 'popper-class',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': 'TimePicker 下拉框的 class 类名',
+ 'en-US': 'The following table lists the options of the current time and date selector.'
+ },
+ mode: ['pc'],
+ pcDemo: 'popper-class'
+ },
+ {
+ name: 'range-separator',
+ type: 'string',
+ defaultValue: "'-'",
+ desc: {
+ 'zh-CN': '选择范围时的分隔符',
+ 'en-US':
+ 'Optional. When the selected date is empty, the time displayed by default when the selector panel is opened. Set it to a value that can be parsed by new Date().'
+ },
+ mode: ['pc'],
+ pcDemo: 'is-range'
+ },
+ {
+ name: 'size',
+ type: "'medium' | 'small' | '' | 'mini'",
+ defaultValue: "''",
+ desc: {
+ 'zh-CN': '输入框尺寸',
+ 'en-US': 'Text box size; The values of this attribute are medium, small, and mini'
+ },
+ mode: ['pc'],
+ pcDemo: 'size'
+ },
+ {
+ name: 'start-placeholder',
+ type: 'string',
+ defaultValue: "''",
+ desc: {
+ 'zh-CN': '范围选择时开始日期的占位内容',
+ 'en-US': 'Placeholder of the start date when the range is selected'
+ },
+ mode: ['pc'],
+ pcDemo: 'placeholder'
+ },
+ {
+ name: 'step',
+ typeAnchorName: 'IStep',
+ type: 'IStep',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义时分秒步长',
+ 'en-US': 'Indicates whether to select a time range. This parameter is valid only for .'
+ },
+ mode: ['pc'],
+ pcDemo: 'step'
+ },
+ {
+ name: 'suffix-icon',
+ type: 'object',
+ defaultValue: 'IconCalendar',
+ desc: {
+ 'zh-CN': '自定义头部图标的类名',
+ 'en-US': 'Custom Clear Icon'
+ },
+ mode: ['pc'],
+ pcDemo: 'suffix-icon'
+ }
+ ],
+ events: [
+ {
+ name: 'blur',
+ type: '() => void',
+ desc: {
+ 'zh-CN': '当 input 失去焦点时触发',
+ 'en-US': 'This event is triggered when the input loses focus. arg:{object Time Component Vue Object}'
+ },
+ mode: ['pc'],
+ pcDemo: 'event'
+ },
+ {
+ name: 'change',
+ type: '(date: Date | Date[]) => void',
+ desc: {
+ 'zh-CN': '用户确认选定的值时触发',
+ 'en-US':
+ 'This event is triggered when the user confirms the selected value. arg:{Date|Array is the time object of the currently selected value when it is not selected in a range. When the range is selected, it is the time object array of the currently selected value}'
+ },
+ mode: ['pc'],
+ pcDemo: 'event'
+ },
+ {
+ name: 'focus',
+ type: '() => void',
+ desc: {
+ 'zh-CN': '当 input 获得焦点时触发',
+ 'en-US': 'This event is triggered when the input is focused. arg:{object Time Component Vue object}'
+ },
+ mode: ['pc'],
+ pcDemo: 'event'
+ }
+ ],
+ methods: [
+ {
+ name: 'focus',
+ type: '() => void',
+ desc: {
+ 'zh-CN': '使 input 获取焦点',
+ 'en-US': 'Enable input to focus.'
+ },
+ mode: ['pc'],
+ pcDemo: 'event'
+ }
+ ],
+ slots: [],
+ format: [
+ {
+ name: 'a',
+ desc: {
+ 'zh-CN': 'am/pm',
+ 'en-US': ''
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'A',
+ desc: {
+ 'zh-CN': 'AM/PM',
+ 'en-US': ''
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'h',
+ desc: {
+ 'zh-CN': '小时,12小时制,需要和 A 或 a 一起使用,不补0',
+ 'en-US': ''
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'H',
+ desc: {
+ 'zh-CN': '小时,24小时制,不补0',
+ 'en-US': ''
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'hh',
+ desc: {
+ 'zh-CN': '小时,12小时制,需要和 A 或 a 一起使用',
+ 'en-US': ''
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'HH',
+ desc: {
+ 'zh-CN': '小时,24小时制',
+ 'en-US': ''
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'm',
+ desc: {
+ 'zh-CN': '分钟,不补0',
+ 'en-US': ''
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'mm',
+ desc: {
+ 'zh-CN': '分钟',
+ 'en-US': ''
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 's',
+ desc: {
+ 'zh-CN': '秒,不补0',
+ 'en-US': ''
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'ss',
+ desc: {
+ 'zh-CN': '秒',
+ 'en-US': ''
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ }
+ ]
+ }
+ ],
+ types: [
+ {
+ name: 'IStep',
+ type: 'interface',
+ code: `
+interface IStep {
+ hour: number
+ minute: number
+ second: number
+}
+ `
+ },
+ {
+ name: 'IPickerOptions',
+ type: 'interface',
+ code: `
+interface IPickerOptions {
+ // 可选的时间范围
+ selectableRange: string
+ // 下拉框中显示的格式
+ format: string
+}
+ `
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/time-select.js b/examples/sites/demos/apis/time-select.js
new file mode 100644
index 000000000..b6eb9a390
--- /dev/null
+++ b/examples/sites/demos/apis/time-select.js
@@ -0,0 +1,205 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'time-select',
+ type: 'component',
+ props: [
+ {
+ name: 'clear-icon',
+ type: 'string',
+ defaultValue: 'IconOperationfaild',
+ desc: {
+ 'zh-CN': '自定义清空图标',
+ 'en-US': 'Customized clear icon'
+ },
+ mode: ['pc'],
+ pcDemo: 'clear-icon'
+ },
+ {
+ name: 'clearable',
+ type: 'boolean',
+ defaultValue: ' true',
+ desc: {
+ 'zh-CN': '清除按钮是否显示',
+ 'en-US': 'Display Clear Button'
+ },
+ mode: ['pc'],
+ pcDemo: 'clear-icon'
+ },
+ {
+ name: 'default-value',
+ type: 'Date',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '可选,当选中的日期值为空时,选择器面板打开时默认显示的时间,需设置为可被new Date()解析的值',
+ 'en-US':
+ 'Optional. When the selected date is empty, the time displayed by default when the selector panel is opened. Set it to a value that can be parsed by new Date().'
+ },
+ mode: ['pc'],
+ pcDemo: 'default-value'
+ },
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: ' false',
+ desc: {
+ 'zh-CN': '时间选择器是否禁用',
+ 'en-US': 'Disabled'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'editable',
+ type: 'boolean',
+ defaultValue: ' true',
+ desc: {
+ 'zh-CN': '文本框是否可手动输入',
+ 'en-US': 'The text box can be entered.'
+ },
+ mode: ['pc'],
+ pcDemo: 'editable'
+ },
+ {
+ name: 'modelValue / v-model',
+ type: 'date(DatePicker) / array(DateRangePicker)',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '日期选择器选中的日期值,可设置选择器的初始值',
+ 'en-US': 'Date value selected by the date selector. You can set the initial value of the selector.'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'name',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '原生属性',
+ 'en-US': 'Native attribute'
+ },
+ mode: ['pc'],
+ pcDemo: 'clear-icon'
+ },
+ {
+ name: 'picker-options',
+ type: 'object',
+ defaultValue: '{}',
+ desc: {
+ 'zh-CN': '当前时间日期选择器特有的选项参考下表',
+ 'en-US': 'The following table lists the options of the current time and date selector.'
+ },
+ mode: ['pc'],
+ pcDemo: 'picker-options'
+ },
+ {
+ name: 'placeholder',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入框的提示占位内容',
+ 'en-US': 'Placeholder content for non-range selection'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'popper-append-to-body',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false',
+ 'en-US':
+ 'Indicates whether to insert a pop-up box to the body element. If a fault occurs in locating the fault in the dialog box that is displayed, you can set this attribute to false'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'popper-class',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': 'TimePicker 下拉框的 class 类名',
+ 'en-US': 'Class name of the TimePicker drop-down list box'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'size',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入框尺寸;该属性的可选值为 medium、small、mini',
+ 'en-US': 'Text box size; The values of this attribute are medium, small, and mini'
+ },
+ mode: ['pc'],
+ pcDemo: 'size-medium'
+ },
+ {
+ name: 'suffix-icon',
+ type: 'string',
+ defaultValue: 'IconCalendar',
+ desc: {
+ 'zh-CN': '自定义头部图标',
+ 'en-US': 'Custom header icon'
+ },
+ mode: ['pc'],
+ pcDemo: 'suffix-icon'
+ }
+ ],
+ events: [
+ {
+ name: 'blur',
+ type: '( ) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '当 input 失去焦点时触发',
+ 'en-US': 'This event is triggered when the input loses focus.'
+ },
+ mode: ['pc'],
+ pcDemo: 'event-blur'
+ },
+ {
+ name: 'change',
+ type: '(value: string) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '当 input 绑定的值发生改变时触发',
+ 'en-US': 'This event is triggered when the user confirms the selected value.'
+ },
+ mode: ['pc'],
+ pcDemo: 'event-blur'
+ },
+ {
+ name: 'focus',
+ type: '( ) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '当 input 获得焦点时触发',
+ 'en-US': 'This event is triggered when the input is focused.'
+ },
+ mode: ['pc'],
+ pcDemo: 'event-blur'
+ }
+ ],
+ methods: [
+ {
+ name: 'handleFocus',
+ type: '( ) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '使 input 获取焦点',
+ 'en-US': 'Enable input to focus.'
+ },
+ mode: ['pc'],
+ pcDemo: 'focus'
+ }
+ ],
+ slots: []
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/timeline.js b/examples/sites/demos/apis/timeline.js
new file mode 100644
index 000000000..a46541e80
--- /dev/null
+++ b/examples/sites/demos/apis/timeline.js
@@ -0,0 +1,208 @@
+export default {
+ mode: ['mobile'],
+ apis: [
+ {
+ name: 'TimeLine',
+ type: 'component',
+ props: [
+ {
+ name: 'active',
+ type: 'Number',
+ defaultValue: '1',
+ desc: {
+ 'zh-CN': '设置步骤条的选中步骤
',
+ 'en-US': 'Is show right text'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'different-data'
+ },
+ {
+ name: 'data',
+ type: 'Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置时间线步骤条数据',
+ 'en-US': 'data'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'different-data'
+ },
+ {
+ name: 'horizontal',
+ type: 'Boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '
是否为横向步骤条
',
+ 'en-US': 'Is show right text'
+ },
+ mode: ['mobile'],
+ mobileDemo: ''
+ },
+ {
+ name: 'name-field',
+ type: 'String',
+ defaultValue: 'name',
+ desc: {
+ 'zh-CN': '设置节点信息中名称对应的字段名
',
+ 'en-US': 'Is show left arrow'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'different-data'
+ },
+ {
+ name: 'reverse',
+ type: 'Boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '设置竖向步骤条的方向
',
+ 'en-US': 'Is show right text'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'mobileTimeLine'
+ },
+ {
+ name: 'show-number',
+ type: 'Boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '设置未完成的状态是否显示序号',
+ 'en-US': 'data'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'different-data'
+ },
+ {
+ name: 'showStatus',
+ type: 'Boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '
是否展示状态文字
',
+ 'en-US': 'Is show right text'
+ },
+ mode: ['mobile'],
+ mobileDemo: ''
+ },
+ {
+ name: 'space',
+ type: 'Number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置步骤条的宽度
',
+ 'en-US': 'Is show right arrow'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'space'
+ },
+ {
+ name: 'start',
+ type: 'start',
+ defaultValue: '1',
+ desc: {
+ 'zh-CN': '设置步骤条序号起始值
',
+ 'en-US': 'Is show left arrow'
+ },
+ mode: ['mobile'],
+ mobileDemo: ''
+ },
+ {
+ name: 'time-field',
+ type: 'String',
+ defaultValue: 'time',
+ desc: {
+ 'zh-CN': '设置节点时间信息对应的字段名
',
+ 'en-US': 'Is show right text'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'different-data'
+ },
+ {
+ name: 'vertical',
+ type: 'Boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '竖式步骤条
',
+ 'en-US': 'Is show right text'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'steps'
+ }
+ ],
+ events: [
+ {
+ name: 'click',
+ type: 'Function(arg1,arg2)',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '节点的点击事件;arguments: arg1:点击节点的下标, arg2:{ name: 节点名称, time: 时间 }
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'mobileTimeLine'
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'bottom',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '定义横向步骤条底部
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: ''
+ },
+ {
+ name: 'conternt',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '定义竖向步骤条内容
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: ''
+ },
+ {
+ name: 'header',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '定义竖向步骤条头部内容
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: ''
+ },
+ {
+ name: 'left',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '定义步骤条左侧内容
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'slot'
+ },
+ {
+ name: 'right',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '定义步骤条右侧内容
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'slot'
+ },
+ {
+ name: 'top',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '定义横向步骤条顶部
',
+ 'en-US': 'Click'
+ },
+ mode: ['mobile'],
+ mobileDemo: ''
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/toast.js b/examples/sites/demos/apis/toast.js
new file mode 100644
index 000000000..75458faf8
--- /dev/null
+++ b/examples/sites/demos/apis/toast.js
@@ -0,0 +1,70 @@
+export default {
+ mode: ['mobile'],
+ apis: [
+ {
+ name: 'Toast',
+ type: 'component',
+ props: [
+ {
+ name: 'text',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '展示的文本
',
+ 'en-US': 'display text'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'base'
+ },
+ {
+ name: 'time',
+ type: 'Number',
+ defaultValue: '2000',
+ desc: {
+ 'zh-CN': '展示持续时间,单位:ms
',
+ 'en-US': 'display times'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'base'
+ },
+ {
+ name: 'type',
+ type: 'string',
+ defaultValue: 'text',
+ desc: {
+ 'zh-CN': '类型, text:纯文本 correct:成功 error:失败
',
+ 'en-US': 'type'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'base'
+ },
+ {
+ name: 'zIndex',
+ type: 'Number',
+ defaultValue: '100',
+ desc: {
+ 'zh-CN': '弹框层级
',
+ 'en-US': ''
+ },
+ mode: ['mobile'],
+ mobileDemo: 'base'
+ }
+ ],
+ events: [],
+ methods: [
+ {
+ name: 'timeout',
+ type: 'Function',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '消失前的回调
',
+ 'en-US': ''
+ },
+ mode: ['mobile'],
+ mobileDemo: 'base'
+ }
+ ],
+ slots: []
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/toggle-menu.js b/examples/sites/demos/apis/toggle-menu.js
new file mode 100644
index 000000000..1e1d8d94b
--- /dev/null
+++ b/examples/sites/demos/apis/toggle-menu.js
@@ -0,0 +1,289 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'toggle-menu',
+ type: 'component',
+ props: [
+ {
+ name: 'automatic-filtering',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入框输入内容时是否自动过滤内容,默认是 true',
+ 'en-US':
+ 'Whether to automatically filter content when you enter content in the text box. The default value is true'
+ },
+ mode: ['pc'],
+ pcDemo: 'automatic-filtering'
+ },
+ {
+ name: 'data',
+ type: 'Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置收缩菜单的数据',
+ 'en-US': 'Set the data of the collapsed menu'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'default-expand-all',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置菜单默认是否展开所有节点,默认为 false',
+ 'en-US': 'Whether to expand all nodes in the menu by default. The default value is false'
+ },
+ mode: ['pc'],
+ pcDemo: 'default-expand-all'
+ },
+ {
+ name: 'draggable',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置是否开启拖拽节点的功能,默认值为false',
+ 'en-US': 'Whether to enable the node drag function. The default value is false'
+ },
+ mode: ['pc'],
+ pcDemo: 'draggable'
+ },
+ {
+ name: 'ellipsis',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '菜单内容超长时省略显示,默认为 false',
+ 'en-US': 'Omitted if the menu content is too long. The default value is false'
+ },
+ mode: ['pc'],
+ pcDemo: 'draggable'
+ },
+ {
+ name: 'expand-on-click-node',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置是否可以通过点击节点展开/收起菜单,默认为 false',
+ 'en-US': 'Whether to expand or collapse menus by clicking a node. The default value is false'
+ },
+ mode: ['pc'],
+ pcDemo: 'default-expand-all'
+ },
+ {
+ name: 'get-menu-data-async',
+ type: 'Function',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义菜单数据服务,返回异步数据,需返回Promise对象',
+ 'en-US': 'Custom menu data service, returns asynchronous data, requires a Promise object to be returned'
+ },
+ mode: ['pc'],
+ pcDemo: 'get-menu-data-aync'
+ },
+ {
+ name: 'get-menu-data-sync',
+ type: 'Function',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '自定义菜单数据服务,直接返回数据(deprecated v3.4.0废弃, v3.16.0移除;移除原因:如果是同步数据则和:data功能重复)',
+ 'en-US':
+ 'Customized menu data service, directly returning data (deprecated v3.4.0 discarded, v3.16.0 removed; reason for removal: if it is synchronized data, it is duplicated with the: data function)'
+ },
+ mode: ['pc'],
+ pcDemo: 'get-menu-data-sync'
+ },
+ {
+ name: 'icon',
+ type: 'object',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义菜单左侧图标',
+ 'en-US': 'Customize the icon on the left of the menu'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-icon'
+ },
+ {
+ name: 'placeholder',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入框占位符',
+ 'en-US': 'Placeholder in the text box'
+ },
+ mode: ['pc'],
+ pcDemo: 'show-filter'
+ },
+ {
+ name: 'props',
+ type: 'object',
+ defaultValue: "该属性的默认值为 {children: 'children',label: 'label',disabled: 'disabled'}",
+ desc: {
+ 'zh-CN': '配置数据选项的映射字段名称',
+ 'en-US': 'Configuration data option mapping field name'
+ },
+ mode: ['pc'],
+ pcDemo: 'toggle-props'
+ },
+ {
+ name: 'show-filter',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置是否展示过滤搜索框,默认为 `true`',
+ 'en-US': 'Specifies whether to display the search box. The default value is true'
+ },
+ mode: ['pc'],
+ pcDemo: 'show-filter'
+ },
+ {
+ name: 'wrap',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '菜单内容超长时换行显示,默认为 false',
+ 'en-US': 'The menu content is displayed in a new line when it is too long. The default value is false'
+ },
+ mode: ['pc'],
+ pcDemo: 'show-filter'
+ }
+ ],
+ events: [
+ {
+ name: 'node-click',
+ type: 'Function(arg1,arg2)',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '点击节点后的事件。;点击节点后触发的回调函数;//参数arg1:\n{children: 点击节点的子节点, id: 点击节点的id ,label: 点击节点的title} \n//参数arg2:\n object 当前点击节点的数据信息对象',
+ 'en-US':
+ 'Indicates that a node is clicked. ;Callback function triggered after a node is clicked. //Parameter arg1:\n{children: child node of the clicked node, id: ID of the clicked node, label: title of the clicked node} \n//Parameter arg2:\n object Data information object of the currently clicked node'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-click'
+ },
+ {
+ name: 'node-collapse',
+ type: 'Function(arg1,arg2)',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '收缩节点后的事件。;节点被关闭时触发的事件;//参数arg1:object \n{children: 点击节点的子节点,id: 点击节点的id,label: 点击节点的title}\n//参数arg2:object 当前点击节点的数据信息对象',
+ 'en-US':
+ 'Event after the node is scaled in. ; Event triggered when a node is shut down; //Parameter arg1:object \n{children: child node of the clicked node, id: ID of the clicked node, label: title of the clicked node}\n//Parameter arg2:object Data information object of the currently clicked node'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-collapse'
+ },
+ {
+ name: 'node-drag-end',
+ type: 'Function(arg1,arg2,arg3,arg4)',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ "拖拽结束时(r可能未成功)触发的事件;拖拽成功完成时触发的事件;//参数\narg1: object当前拖拽节点的数据信息对象\narg2: object当前点击节点拖拽后位置的节点数据信息对象\narg3: 拖拽的类型,如:'inner'\narg4:event",
+ 'en-US':
+ "Event triggered when dragging ends (r may not succeed). Event triggered when the drag is successfully completed; / / Parameter \narg1: object Data information object of the current node\narg2: object Data information object of the current node after the node is dragged\narg3: Drag type, for example,'inner'\narg4:event"
+ },
+ mode: ['pc'],
+ pcDemo: 'drag-events'
+ },
+ {
+ name: 'node-drag-enter',
+ type: 'Function(arg1,arg2)',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '拖拽进入其他节点时触发的事件;拖拽进入其他节点时触发的事件;//参数\narg1:object 当前拖拽节点的数据信息对象\narg2: object 当前点击节点拖拽后位置的节点数据信息对象',
+ 'en-US':
+ 'This event is triggered when a user drags a node to another node. Event triggered when a user drags a node to another node. / / Parameter \narg1: object Data information object of the current node \narg2: object Data information object of the current node after the node is dragged'
+ },
+ mode: ['pc'],
+ pcDemo: 'drag-events'
+ },
+ {
+ name: 'node-drag-leave',
+ type: 'Function(arg1,arg2)',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '拖拽离开某个节点时触发的事件;拖拽离开某个节点时触发的事件;//参数\narg1:object 当前拖拽节点的数据信息对象\narg2: object 当前拖出后节点的数据信息对象',
+ 'en-US':
+ 'This event is triggered when a user drags a node. Event triggered when a user drags a node. / / Parameter \narg1:object Data information object of the currently dragged node \narg2: object Data information object of the currently dragged node'
+ },
+ mode: ['pc'],
+ pcDemo: 'drag-events'
+ },
+ {
+ name: 'node-drag-over',
+ type: 'Function(arg1,arg2,arg3)',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '在拖拽节点时触发的事件(类似浏览器的 mouseover 事件);在拖拽节点时触发的事件(类似浏览器的 mouseover 事件);//参数\narg1:object 当前拖拽节点的数据信息对象\narg2:object 当前拖拽节点拖拽时节点的数据信息对象\n arg3:event',
+ 'en-US':
+ 'Event triggered when a node is dragged (similar to the mouseover event of the browser); Event triggered when a node is dragged (similar to the mouseover event of the browser) / / Parameter \narg1:object Data information object of the current dragged node \narg2:object Data information object of the current dragged node \n arg3:event'
+ },
+ mode: ['pc'],
+ pcDemo: 'drag-events'
+ },
+ {
+ name: 'node-drag-start',
+ type: 'Function(arg1,arg2)',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '节点开始拖拽时触发的事件。;节点开始拖拽时触发的事件。;//参数: \narg1:object 当前拖拽节点的数据信息对象\narg2:event',
+ 'en-US':
+ 'Event triggered when a node starts to be dragged. ;Event triggered when a node starts to be dragged. ; / / Parameters:\narg1:object Data information object of the current node \narg2:event'
+ },
+ mode: ['pc'],
+ pcDemo: 'drag-events'
+ },
+ {
+ name: 'node-drop',
+ type: 'Function(arg1,arg2)',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '拖放节点后的事件。开启 draggable 属性为 true 有效。;拖放节点后的事件。开启 draggable 属性为 true 有效。;//参数\narg1:object 当前拖拽节点的数据信息对象\n arg2:object 当前点击节点拖拽后的位置节点的数据信息对象\narg3: 拖拽的类型\narg4:event',
+ 'en-US':
+ 'Indicates the event after a node is dragged and dropped. This parameter is valid when the draggable attribute is set to true. ; Events after a node is dragged and dropped. This parameter is valid when the draggable attribute is set to true. ; / / Parameter \narg1:object Data information object of the current dragged node \n arg2:object Data information object of the current clicked node after the dragged node \narg3:Drag type \narg4:event'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-drop'
+ },
+ {
+ name: 'node-expand',
+ type: 'Function(arg1,arg2,arg3)',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '展开节点后的事件。;节点被展开时触发的事件;//参数arg1:\n{children: 点击节点的子节点, id: 点击节点的id, label: 点击节点的title}\n//参数arg2:\nComponent 点击节点的componet对象信息\n//参数arg3:\n{ children: 点击节点的子节点id: 点击节点的id, label: 点击节点的title}',
+ 'en-US':
+ 'Event after a node is expanded. ; Event triggered when a node is expanded; / / Parameter arg1:\n{children: child node of the clicked node, id: ID of the clicked node, label: title of the clicked node}\n//Parameter arg2:\nComponent Componet object information of the clicked node\n//Parameter arg3:\n{children: subnode ID of the clicked node: ID of the clicked node, label: Click title} of the node'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-expand'
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'node',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义插槽',
+ 'en-US': 'Custom Slot'
+ },
+ mode: ['pc'],
+ pcDemo: 'toggle-props'
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/tooltip.js b/examples/sites/demos/apis/tooltip.js
new file mode 100644
index 000000000..0cc8a3413
--- /dev/null
+++ b/examples/sites/demos/apis/tooltip.js
@@ -0,0 +1,333 @@
+export default {
+ mode: ['pc', 'mobile-first'],
+ apis: [
+ {
+ name: 'tooltip',
+ type: 'component',
+ props: [
+ {
+ name: 'append-to-body',
+ type: 'boolean',
+ defaultValue: ' true',
+ desc: {
+ 'zh-CN': '是否将弹出层的元素添加到body上',
+ 'en-US': 'Whether to append to body'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'close-delay',
+ type: 'number',
+ defaultValue: '300',
+ desc: {
+ 'zh-CN': '延迟关闭的时长,单位毫秒',
+ 'en-US': 'Close Delay time, in milliseconds.'
+ },
+ mode: ['pc'],
+ pcDemo: 'delay'
+ },
+ {
+ name: 'content',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '显示的内容',
+ 'en-US': 'Displayed content.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'content',
+ mfDemo: ''
+ },
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': 'Tooltip 是否禁用',
+ 'en-US': 'Whether Tooltip is disable'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'control',
+ mfDemo: ''
+ },
+ {
+ name: 'effect',
+ type: "'dark' | 'light'",
+ defaultValue: "'dark'",
+ desc: {
+ 'zh-CN': '提示的主题',
+ 'en-US': 'Default theme'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'theme',
+ mfDemo: ''
+ },
+ {
+ name: 'enterable',
+ type: 'boolean',
+ defaultValue: ' true',
+ desc: {
+ 'zh-CN': '鼠标是否可进入到 tooltip 的弹出层中',
+ 'en-US': 'Whether the mouse can enter the pop-up layer of the tooltip'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'custom-popper',
+ mfDemo: ''
+ },
+ {
+ name: 'hide-after',
+ type: 'number',
+ defaultValue: ' 0',
+ desc: {
+ 'zh-CN': '出现后自动隐藏的时长,单位毫秒,为 0 则不会自动隐藏',
+ 'en-US':
+ 'Duration of automatic hiding after appearing, in milliseconds. If 0, it will not be automatically hidden'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'delay',
+ mfDemo: ''
+ },
+ {
+ name: 'manual',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '手动控制模式,设置为 true 后,mouseenter 和 mouseleave 事件将不会生效',
+ 'en-US':
+ 'Manual control mode. If this parameter is set to true, the mouseenter and mouseleave events do not take effect.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'control',
+ mfDemo: ''
+ },
+ {
+ name: 'modelValue / v-model',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '配置 manual = true时,控制弹出状态',
+ 'en-US': 'If manual is set to true, the pop-up status is controlled'
+ },
+ mode: ['pc'],
+ pcDemo: 'control'
+ },
+ {
+ name: 'offset',
+ type: 'number',
+ defaultValue: '0',
+ desc: {
+ 'zh-CN': '弹出层出现位置的偏移量',
+ 'en-US': 'Offset of the occurrence position'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'offset',
+ mfDemo: ''
+ },
+ {
+ name: 'open-delay',
+ type: 'number',
+ defaultValue: '0',
+ desc: {
+ 'zh-CN': '延迟出现的时长,单位毫秒',
+ 'en-US': 'Open delay time, in milliseconds.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'delay',
+ mfDemo: ''
+ },
+ {
+ name: 'placement',
+ typeAnchorName: 'IPopperPlacement',
+ type: 'IPopperPlacement',
+ defaultValue: ' "bottom"',
+ desc: {
+ 'zh-CN': 'Tooltip 的出现位置',
+ 'en-US': 'Location where the tooltip appears'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mfDemo: ''
+ },
+ {
+ name: 'popper-class',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '为 Tooltip 的弹出层添加类名',
+ 'en-US': 'Add a class name to the pop-up layer of Tooltip'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'custom-popper',
+ mfDemo: ''
+ },
+ {
+ name: 'popper-options',
+ typeAnchorName: 'IPopperOption',
+ type: 'IPopperOption',
+ defaultValue: ' { }',
+ desc: {
+ 'zh-CN': '弹出层参数',
+ 'en-US': 'Advanced parameters; Refer to the description of IPopperOption'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'popper-options',
+ mfDemo: ''
+ },
+ {
+ name: 'pre',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': 'content 文本是否预格式化',
+ 'en-US': 'Indicates whether the content text is preformatted.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'content',
+ mfDemo: ''
+ },
+ {
+ name: 'renderContent',
+ type: '(h: Vue.h, content:string)=> VNode',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义渲染函数,返回需要渲染的节点内容',
+ 'en-US': 'A custom rendering function that returns the contents of the node to be rendered'
+ },
+ mode: ['pc'],
+ pcDemo: 'content'
+ },
+ {
+ name: 'tabindex',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置组件的触发源的 tabindex',
+ 'en-US': 'Sets the tabindex of the trigger source of the component.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: '',
+ mfDemo: ''
+ },
+ {
+ name: 'transition',
+ type: 'string',
+ defaultValue: "'tiny-fade-in-linear'",
+ desc: {
+ 'zh-CN': '定义渐变动画的类名',
+ 'en-US': 'Define the class name of the gradient animation'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'transition',
+ mfDemo: ''
+ },
+ {
+ name: 'type',
+ type: "'normal' | 'warning' | 'error' | 'info' | 'success'",
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '提示的类型, type 的优先级大于 effect ',
+ 'en-US': 'The default type is provided. The priority of type is higher than that of effect.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'theme',
+ mfDemo: ''
+ },
+ {
+ name: 'v-model',
+ type: 'Boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '状态是否可见',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ },
+ {
+ name: 'visible',
+ type: " 'always' | 'auto'",
+ defaultValue: "'always'",
+ desc: {
+ 'zh-CN': '提示的智能出现的模式',
+ 'en-US': 'The pattern of intelligent emergence of hints'
+ },
+ mode: ['pc'],
+ pcDemo: 'control'
+ },
+ {
+ name: 'visible-arrow',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否显示箭头',
+ 'en-US': 'Indicates whether to display the tooltip arrow.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'custom-popper',
+ mfDemo: ''
+ },
+ {
+ name: 'z-index',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置 z-index 属性为 relative 时,弹出层样式属性 zIndex 值参考 Reference 及其父级 Dom',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: [
+ {
+ name: 'content',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '内容插槽',
+ 'en-US': 'Content Slot'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'content',
+ mfDemo: ''
+ },
+ {
+ name: 'default',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '默认插槽',
+ 'en-US': 'Default slot'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'basic-usage',
+ mfDemo: ''
+ }
+ ]
+ }
+ ],
+ types: [
+ {
+ name: 'IPopperOption',
+ type: 'interface',
+ code: `
+interface IPopperOption {
+ bubbling: boolean // 是否监听元素所有上级有滚动元素的scroll事件,监听到则更新popper的位置。用于解决某些弹出层位置在页面滚动时,位置不正确的场景,默认false
+ followReferenceHide: boolean // 当触发源隐藏时,自动隐藏弹出层,默认true
+ removeOnDestroy: boolean // 弹出层消失后,是否移除弹出层的DOM元素,布尔false
+}
+ `
+ },
+ {
+ name: 'IPopperPlacement',
+ type: 'type',
+ code: `
+type IPopperPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'
+ `
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/transfer.js b/examples/sites/demos/apis/transfer.js
new file mode 100644
index 000000000..c5357e78f
--- /dev/null
+++ b/examples/sites/demos/apis/transfer.js
@@ -0,0 +1,449 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'transfer',
+ type: 'component',
+ props: [
+ {
+ name: 'button-texts',
+ type: 'string[]',
+ defaultValue: '[]',
+ desc: {
+ 'zh-CN': '通过传入一个2值的字符串数组,自定义左右穿梭按钮的文案',
+ 'en-US':
+ 'Customize the copy of the left and right shuttle button by passing in an array of 2-valued strings'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-btns'
+ },
+ {
+ name: 'columns',
+ typeAnchorName: 'grid#IColumnConfig',
+ type: 'IColumnConfig',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在渲染类型为 table 时,设置穿梭框表格的列配置',
+ 'en-US': "When the render type is table, set the transfer's table column configuration"
+ },
+ mode: ['pc'],
+ pcDemo: 'nested-table'
+ },
+ {
+ name: 'data',
+ type: 'ITransferData[]',
+ defaultValue: '[]',
+ desc: {
+ 'zh-CN': '左右列表的全量数据源',
+ 'en-US': 'Full data source for the left and right lists'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'drop-config',
+ typeAnchorName: 'IDropConfig',
+ type: 'IDropConfig',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置穿梭框列表项可拖拽的参数,参见sortablejs插件',
+ 'en-US': 'To set drag-and-drop parameters for shuttle list items, see sortablejs plugin'
+ },
+ mode: ['pc'],
+ pcDemo: 'drop-config'
+ },
+ {
+ name: 'filter-method',
+ type: '(query:string, item:object) => boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '\n 设置穿梭框的搜索过滤函数,仅在默认列表和嵌套表时有效
\n 嵌套树时,请使用treeConfig进行搜索配置
\n ',
+ 'en-US':
+ '\n Set the search filter function for the transfer to work only for default lists and nested tables.
\n When nesting trees, use treeConfig for search configuration.
\n '
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-filter'
+ },
+ {
+ name: 'filter-placeholder',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '启用搜索时,搜索框占位文本',
+ 'en-US': "When Search, filter box's placeholder"
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-filter'
+ },
+ {
+ name: 'filterable',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否启用搜索的功能',
+ 'en-US': 'Whether to enable the search function'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-filter'
+ },
+ {
+ name: 'format',
+ type: 'object',
+ defaultValue:
+ // eslint-disable-next-line no-template-curly-in-string
+ "{
noChecked:'${checked}/${total}',
hasChecked: '${checked}/${total}'
}",
+ desc: {
+ 'zh-CN': '列表顶部勾选状态文案',
+ 'en-US': 'Check the status copy at the top of the list'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-titles'
+ },
+ {
+ name: 'left-columns',
+ typeAnchorName: 'grid#IColumnConfig',
+ type: 'IColumnConfig',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在渲染类型为 table 时,左边表格的列配置,优先级高于 columns',
+ 'en-US':
+ "When the render type is table, set the transfer's left table column configuration,the priority is higher than that of columns"
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'left-default-checked',
+ type: 'string[]',
+ defaultValue: '[]',
+ desc: {
+ 'zh-CN': '默认左侧列表的已勾选项的 key 数组',
+ 'en-US': 'The key array of the checked items in the left list'
+ },
+ mode: ['pc'],
+ pcDemo: 'default-checked'
+ },
+ {
+ name: 'pager-op',
+ typeAnchorName: 'IPagerOp',
+ type: 'IPagerOp',
+ defaultValue: "{ mode: 'fixed',pageVO: {currentPage: 1,pageSize: 10}",
+ desc: {
+ 'zh-CN': '在渲染类型为 table 时,设置表格的分页配置',
+ 'en-US': 'When the render type is table, set the paging configuration'
+ },
+ mode: ['pc'],
+ pcDemo: 'nested-table'
+ },
+ {
+ name: 'props',
+ type: '{key:string, label:string, disabled:string}',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '数据源的字段别名映射配置',
+ 'en-US': 'Field alias mapping configuration for the data source'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-render'
+ },
+ {
+ name: 'render',
+ type: 'Table | Tree',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '设置左右区域的渲染类型,Table 和 Tree 对象需要从组件包中引入相应的组件变量。
该属性值的plugin设置为Table时设置渲染为表格;该属性值的 plugin 设置为Tree渲染为树',
+ 'en-US':
+ 'Sets the rendering type for the left and right regions.
This property renders to a Table when plugin is set to table; The value of the pluginplugin set to Tree renders as a tree'
+ },
+ mode: ['pc'],
+ pcDemo: 'nested-table'
+ },
+ {
+ name: 'render-content',
+ type: '(h: Vue.h, item: any) => vnode',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '数据项的自定义渲染函数',
+ 'en-US': 'Custom data item rendering function'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-render'
+ },
+ {
+ name: 'right-columns',
+ typeAnchorName: 'grid#IColumnConfig',
+ type: 'IColumnConfig',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在渲染类型为 table 时,右边表格的列配置,优先级高于 columns',
+ 'en-US':
+ "When the render type is table, set the transfer's right table column configuration,the priority is higher than that of columns"
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'right-default-checked',
+ type: 'string[]',
+ defaultValue: '[]',
+ desc: {
+ 'zh-CN': '默认右侧列表的已勾选项的 key 数组',
+ 'en-US': 'The key array of the checked items in the right list'
+ },
+ mode: ['pc'],
+ pcDemo: 'default-checked'
+ },
+ {
+ name: 'show-all-btn',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否显示全部移动按钮',
+ 'en-US': 'Whether to show all move buttons'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-btns'
+ },
+ {
+ name: 'show-pager',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '在渲染类型为 table 时,设置表格是否显示分页',
+ 'en-US': 'Sets whether pagination should be displayed when the render type is table.'
+ },
+ mode: ['pc'],
+ pcDemo: 'nested-table'
+ },
+ {
+ name: 'target-order',
+ type: '"original" / "push" / "unshift"',
+ defaultValue: '"original"',
+ desc: {
+ 'zh-CN':
+ ' 右侧列表元素的插入排序策略
\n 若为 original,则保持与数据源相同的顺序
\n 若为 push,则新加入的元素排在最后
\n 若为 unshift,则新加入的元素排在最前。',
+ 'en-US':
+ 'The insertion sort strategy for the elements in the list on the right
\n If original, it maintains the same order as the data source
\n If it is a push, the new element is listed last
\n If unshift is used, the new element is listed first\n '
+ },
+ mode: ['pc'],
+ pcDemo: 'target-order'
+ },
+ {
+ name: 'titles',
+ type: 'string[]',
+ defaultValue: '[]',
+ desc: {
+ 'zh-CN':
+ '自定义列表的标题;不设置titles时,左右列表的标题默认显示为: 列表 1
, 列表 2
',
+ 'en-US':
+ 'Custom list titles When titles are not set, the titles of the left and right lists are displayed by default: list 1
, list 2
'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-titles'
+ },
+ {
+ name: 'to-left-disable',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '组件初始化状态下未选中时,默认按钮显示禁用状态',
+ 'en-US': 'When a component is initialized unselected, the default button is disabled'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-btns'
+ },
+ {
+ name: 'to-right-disable',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '组件初始化状态下未选中时,默认按钮显示禁用状态',
+ 'en-US': 'When a component is initialized unselected, the default button is disabled'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-btns'
+ },
+ {
+ name: 'tree-op',
+ typeAnchorName: 'tree#API',
+ type: 'Tree props',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在渲染类型为 tree 时,设置树的相关配置属性',
+ 'en-US': 'Set the tree-related configuration attributes when the plug-in is set to tree.'
+ },
+ mode: ['pc'],
+ pcDemo: 'nested-tree'
+ },
+ {
+ name: 'v-model / modelValue',
+ type: 'string[]',
+ defaultValue: '[]',
+ desc: {
+ 'zh-CN': '移动到右列表的数据项的key的数组值',
+ 'en-US': 'The array value of the key of the data item that moves to the right list'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ }
+ ],
+ events: [
+ {
+ name: 'change',
+ type: '(value:string[], move:string, keyArray:string[])=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '右侧列表元素变化时触发的事件;
\n value: 穿梭框右侧数据值列表
\n move: 数据移动方向,是left或者right
\n keyArray: 被移动的数据值列表',
+ 'en-US':
+ 'Fires when the right side of the list changes
\n value: List of data values to the right of the Array
\n move: direction to move the data, either left or right
\n keyArray:A list of data values whose Array has been moved\n '
+ },
+ mode: ['pc'],
+ pcDemo: 'transfer-events'
+ },
+ {
+ name: 'left-check-change',
+ type: '(checked:string[], statusChanged:string[]) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '左侧列表元素选择时触发的事件;
\n checked: 穿梭框左侧被选中的数据值列表
\n statusChanged: 穿梭框左侧选中状态发生变化的数据值列表',
+ 'en-US':
+ 'Triggered when an element in the left list is selected/unselected by the user.
\n checked: List of selected values to the left of the Array
\n statusChanged: The list of data values whose status has changed is selected on the left side of the Array transfer'
+ },
+ mode: ['pc'],
+ pcDemo: 'transfer-events'
+ },
+ {
+ name: 'right-check-change',
+ type: '(checked:string[], statusChanged:string[]) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '右侧列表元素选择时触发的事件;
\n checked: 穿梭框右侧被选中的数据值列表
\n statusChanged: 穿梭框右侧选中状态发生变化的数据值列表',
+ 'en-US':
+ 'Triggered when an element in the list on the right is selected/unselected by the user
\n checked: List of selected data values to the right of the Array shuttle box
\n statusChanged: The list of data values whose status has changed is selected to the right of the Array shuttle box'
+ },
+ mode: ['pc'],
+ pcDemo: 'transfer-events'
+ }
+ ],
+ methods: [
+ {
+ name: 'clearQuery',
+ type: '(name: string) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '开启过滤功能时,清空左右面板的搜索关键词',
+ 'en-US': 'When the filtering function is enabled, clear the search keywords on the left and right panels'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-filter'
+ }
+ ],
+ slots: [
+ {
+ name: 'button-panel',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '穿梭按钮插槽',
+ 'en-US': 'Customized transfer button'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'default',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '数据项的内容插槽,插槽数据上下文为: { option }',
+ 'en-US': 'The content of the custom data item, slot data context is {option}.'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-render'
+ },
+ {
+ name: 'left-footer',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '左侧列表底部的内容插槽',
+ 'en-US': 'Content at the bottom of the left list'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-footer'
+ },
+ {
+ name: 'left-panel',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '左侧自定义内容插槽',
+ 'en-US': 'Customized content on the left'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'right-footer',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '右侧列表底部的内容插槽',
+ 'en-US': 'Content at the bottom of the right list'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-footer'
+ },
+ {
+ name: 'right-panel',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '右侧自定义内容插槽',
+ 'en-US': 'Customized content on the right'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ }
+ ]
+ }
+ ],
+ types: [
+ {
+ name: 'ITransferData',
+ type: 'interface',
+ code: `
+interface ITransferData {
+ key: string,
+ label: string,
+ disabled: string,
+ [other:string]: any
+}
+ `
+ },
+ {
+ name: 'IDropConfig',
+ type: 'interface',
+ code: `
+interface IDropConfig {
+ plugin: object // 指定拖放排序的插件Sortable, 该变量通过 import Sortable from 'sortablejs' 导入
+}
+ `
+ },
+ {
+ name: 'IPagerOp',
+ type: 'interface',
+ code: `
+interface IPagerOp {
+ mode: string // 通过 mode 设置分页组件组件渲染模式,不同模式是组件内置的 layout 设置, mode 优先级高于 layout
+ pagerCount:number // 总页数
+ pageVo:{
+ currentPage: number
+ pageSize: number
+ pageSizes: number[]
+ layout: string // 分页组件布局默认值:'total, prev, pager, next, jumper, sizes'
+ }
+}
+ `
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/tree-menu.js b/examples/sites/demos/apis/tree-menu.js
new file mode 100644
index 000000000..4ac48aed7
--- /dev/null
+++ b/examples/sites/demos/apis/tree-menu.js
@@ -0,0 +1,640 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'tree-menu',
+ type: 'component',
+ props: [
+ {
+ name: 'accordion',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否设置为手风琴效果(只能展开一个同级别的节点)',
+ 'en-US': 'Set to accordion effect (can only expand one node at the same level)'
+ },
+ mode: ['pc'],
+ pcDemo: 'accordion'
+ },
+ {
+ name: 'allow-drag',
+ typeAnchorName: 'ITreeNodeVm',
+ type: '(vm:ITreeNodeVm) => boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '拖拽开始前的回调事件,定义节点是否允许拖拽的规则,返回 true 则允许拖拽,配合 draggable 属性使用',
+ 'en-US':
+ 'The callback event before the start of dragging, defining the rules for whether nodes are allowed to drag, and returning true to allow dragging, used in conjunction with the draggable attribute'
+ },
+ mode: ['pc'],
+ pcDemo: 'event-allow-draggable'
+ },
+ {
+ name: 'allow-drop',
+ typeAnchorName: 'ITreeNodeVm',
+ type: '(draggingNode: ITreeNodeVm, targetNode: ITreeNodeVm,type: "prev"|"next"|"inner") => boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '拖拽结束前的回调事件,定义节点是否允许放置到模板节点的规则,返回 true 则允许放置,配合 draggable 属性使用',
+ 'en-US':
+ 'Callback event before the end of drag and drop, defining rules for whether nodes are allowed to be placed on template nodes. If true is returned, placement is allowed, and the draggable attribute needs to be configured for use'
+ },
+ mode: ['pc'],
+ pcDemo: 'event-allow-draggable'
+ },
+ {
+ name: 'check-strictly',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否遵循父级和子级严格不相关联的做法,配合 show-checkbox 属性使用',
+ 'en-US':
+ 'Do you follow the practice of strictly unrelated parents and children, and use it in conjunction with the show checkbox attribute'
+ },
+ mode: ['pc'],
+ pcDemo: 'show-checkbox'
+ },
+ {
+ name: 'collapsible',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否允许展开后的菜单收起,未和 show-number 配套使用时,仍可以点击图标收起',
+ 'en-US':
+ 'Set whether to allow expanded menus to be collapsed. When not used in conjunction with show number, the icon can still be clicked to collapse'
+ },
+ mode: ['pc'],
+ pcDemo: 'show-number'
+ },
+ {
+ name: 'customIcon',
+ type: 'VueComponent',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置带图标树形菜单',
+ 'en-US': 'Set the Tree Menu with Icons'
+ },
+ mode: ['pc'],
+ pcDemo: 'show-expand'
+ },
+ {
+ name: 'data',
+ typeAnchorName: 'ITreeNodeData',
+ type: 'ITreeNodeData[]',
+ defaultValue: '[]',
+ desc: {
+ 'zh-CN': '静态数据源',
+ 'en-US': 'Static Data Source'
+ },
+ mode: ['pc'],
+ pcDemo: 'data-resource'
+ },
+ {
+ name: 'default-checked-keys',
+ type: 'Array',
+ defaultValue: '[]',
+ desc: {
+ 'zh-CN': '默认勾选节点的 key 的数组',
+ 'en-US': 'Array of keys for default selected nodes'
+ },
+ mode: ['pc'],
+ pcDemo: 'default-expand-all'
+ },
+ {
+ name: 'default-expand-all',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否默认展开所有子节点',
+ 'en-US': 'Expand all child nodes by default'
+ },
+ mode: ['pc'],
+ pcDemo: 'default-expand-all'
+ },
+ {
+ name: 'default-expanded-keys',
+ type: 'Array',
+ defaultValue: '[]',
+ desc: {
+ 'zh-CN': '默认展开节点的 key 的数组',
+ 'en-US': 'Array of keys for default expanded nodes'
+ },
+ mode: ['pc'],
+ pcDemo: 'default-expanded-keys'
+ },
+ {
+ name: 'default-expanded-keys-highlight',
+ type: 'number|string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置默认展开节点中的某个节点高亮,配合 default-expanded-keys 属性使用',
+ 'en-US':
+ 'Set a node highlight in the default expanded node to be used in conjunction with the default expanded keys attribute'
+ },
+ mode: ['pc'],
+ pcDemo: 'default-expanded-keys-highlight'
+ },
+ {
+ name: 'draggable',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否可拖动菜单节点',
+ 'en-US': 'Can menu nodes be dragged'
+ },
+ mode: ['pc'],
+ pcDemo: 'draggable'
+ },
+ {
+ name: 'ellipsis',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否文字超长省略显示。优先级高于 wrap',
+ 'en-US': 'Whether the text is too long and omitted for display. Priority higher than wrap'
+ },
+ mode: ['pc'],
+ pcDemo: 'text-ellipsis'
+ },
+ {
+ name: 'empty-text',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '内容为空时展示的文本',
+ 'en-US': 'Text displayed when the content is empty'
+ },
+ mode: ['pc'],
+ pcDemo: 'empty-text'
+ },
+ {
+ name: 'expand-on-click-node',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否能点击节点即展开/收起。配置为 fasle 则只能点击下拉图标展开/收起',
+ 'en-US':
+ 'Whether to click on the node to expand/collapse. If configured as fasle, you can only click on the dropdown icon to expand/collapse'
+ },
+ mode: ['pc'],
+ pcDemo: 'expand-on-click-node'
+ },
+ {
+ name: 'filter-node-method',
+ typeAnchorName: 'ITreeNodeVm',
+ type: '(query:string, data:ITreeNodeData, node:ITreeNodeVm) => boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义树节点过滤的方法,返回 true 表示这个节点可以显示,返回 false 则表示这个节点会被隐藏',
+ 'en-US':
+ 'Custom tree node filtering method, returning true indicates that this node can be displayed, while returning false indicates that this node will be hidden'
+ },
+ mode: ['pc'],
+ pcDemo: 'filter-node-method'
+ },
+ {
+ name: 'get-menu-data-sync',
+ typeAnchorName: 'ITreeNodeData',
+ type: '() => ITreeNodeData[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义获取服务端数据源的方法,返回一个 Promise 对象',
+ 'en-US': 'Customize the method for obtaining server-side data sources and return a Promise object'
+ },
+ mode: ['pc'],
+ pcDemo: 'data-resource'
+ },
+ {
+ name: 'indent',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '子级相对于父级节点的水平缩进距离,单位 px',
+ 'en-US': 'The horizontal indentation distance of a child relative to its parent node, in px'
+ },
+ mode: ['pc'],
+ pcDemo: 'indent'
+ },
+ {
+ name: 'lazy',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否懒加载子节点,配合 load 属性使用',
+ 'en-US': 'Whether to lazily load child nodes and use them in conjunction with the load attribute'
+ },
+ mode: ['pc'],
+ pcDemo: 'lazy-load'
+ },
+ {
+ name: 'load',
+ typeAnchorName: 'IResolveType',
+ type: '(node:ITreeNodeVm, resolve:IResolveType) => IResolveType',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '加载子树数据的方法,仅当 lazy 属性为 true 时生效',
+ 'en-US': 'Method for loading subtree data. This parameter is valid only when lazy is set to true'
+ },
+ mode: ['pc'],
+ pcDemo: 'lazy-load'
+ },
+ {
+ name: 'menu-collapsible',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否显示侧边折叠与展开按钮',
+ 'en-US': 'Is the side fold and unfold buttons displayed'
+ },
+ mode: ['pc'],
+ pcDemo: 'menu-collapsible'
+ },
+ {
+ name: 'node-height',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '节点高度',
+ 'en-US': 'Node height'
+ },
+ mode: ['pc'],
+ pcDemo: 'show-number'
+ },
+ {
+ name: 'node-key',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置每个树节点唯一标识(key)的属性,在整棵树中都是唯一的',
+ 'en-US':
+ "Set the attribute of each tree node's unique identifier (key) to be unique throughout the entire tree"
+ },
+ mode: ['pc'],
+ pcDemo: 'default-expand-all'
+ },
+ {
+ name: 'only-check-children',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '父级是否不可选,只能展开不能跳转',
+ 'en-US': 'Parent level is not optional, can only be expanded and cannot jump'
+ },
+ mode: ['pc'],
+ pcDemo: 'only-check-children'
+ },
+ {
+ name: 'prefix-icon',
+ type: 'Component',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义前置图标',
+ 'en-US': 'Customize the front icon'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-icon'
+ },
+ {
+ name: 'props',
+ typeAnchorName: 'IProps',
+ type: 'IProps',
+ defaultValue:
+ "\n{\n children: 'children'\n label: 'label'\n disabled: 'disabled'\n isLeaf: 'isLeaf'\n} \n
",
+ desc: {
+ 'zh-CN': '映射字段',
+ 'en-US': 'Map Fields'
+ },
+ mode: ['pc'],
+ pcDemo: 'props'
+ },
+ {
+ name: 'search-icon',
+ type: 'Component',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义搜索图标',
+ 'en-US': 'Customize the search icon'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-icon'
+ },
+ {
+ name: 'show-checkbox',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '节点是否可被选择',
+ 'en-US': 'Whether the node can be selected'
+ },
+ mode: ['pc'],
+ pcDemo: 'show-checkbox'
+ },
+ {
+ name: 'show-expand',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN':
+ '是否启用一键展开/收起功能。点击左下角图标可展开/收起菜单注意:配合 customIcon 属性使用,纯文本菜单不支持此功能',
+ 'en-US':
+ 'Whether to enable the one click expand/collapse function. Click on the icon in the bottom left corner to expand/collapse the menu. Note: When used in conjunction with the customIcon attribute, plain text menus do not support this feature'
+ },
+ mode: ['pc'],
+ pcDemo: 'show-expand'
+ },
+ {
+ name: 'show-filter',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否显示搜索框,可搜索过滤节点',
+ 'en-US': 'Display a search box to search for filter nodes'
+ },
+ mode: ['pc'],
+ pcDemo: 'show-filter'
+ },
+ {
+ name: 'show-number',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '右侧下拉图标区域是否显示为 number 属性定义的数字内容,建议不超过 4 个字符',
+ 'en-US':
+ 'The drop-down icon area on the right displays the numerical content defined by the number attribute, which should not exceed 4 characters'
+ },
+ mode: ['pc'],
+ pcDemo: 'show-number'
+ },
+ {
+ name: 'show-title',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否显示节点的 title 提示,鼠标悬浮节点之上触发',
+ 'en-US': 'Whether to display the title prompt of the node, triggered by hovering the mouse over the node'
+ },
+ mode: ['pc'],
+ pcDemo: 'show-filter'
+ },
+ {
+ name: 'suffix-icon',
+ type: 'Component',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义后置图标',
+ 'en-US': 'Customize the post icon'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-icon'
+ },
+ {
+ name: 'wrap',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否换行显示',
+ 'en-US': 'Indicates whether to display information in a new line.'
+ },
+ mode: ['pc'],
+ pcDemo: 'text-wrap'
+ }
+ ],
+ events: [
+ {
+ name: 'check-change',
+ typeAnchorName: 'ITreeNodeVm',
+ type: '(node:ITreeNodeVm,checked:boolean,indeterminate:boolean) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '监听可勾选节点的勾选状态发生变化时的事件',
+ 'en-US': 'Listen for events when the check status of checkable nodes changes'
+ },
+ mode: ['pc'],
+ pcDemo: 'events'
+ },
+ {
+ name: 'current-change',
+ typeAnchorName: 'ITreeNodeVm',
+ type: '(nodeData:ITreeNodeData,node:ITreeNodeVm) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '监听当前选中节点发生变化时的事件',
+ 'en-US': 'Listen for events when the currently selected node changes'
+ },
+ mode: ['pc'],
+ pcDemo: 'events'
+ },
+ {
+ name: 'node-click',
+ typeAnchorName: 'ITreeNodeVm',
+ type: '(nodeData:ITreeNodeData,node:ITreeNodeVm) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '监听节点被点击时的事件',
+ 'en-US': 'Listen for events when a node is clicked'
+ },
+ mode: ['pc'],
+ pcDemo: 'events'
+ },
+ {
+ name: 'node-collapse',
+ typeAnchorName: 'ITreeNodeVm',
+ type: '(nodeData:ITreeNodeData,node:ITreeNodeVm) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '监听节点被点击收起时的事件;',
+ 'en-US': 'Event when a listening node is clicked to collapse'
+ },
+ mode: ['pc'],
+ pcDemo: 'events'
+ },
+ {
+ name: 'node-drag-end',
+ typeAnchorName: 'IDropType',
+ type: '(draggingNode:ITreeNodeVm, targetNode:ITreeNodeVm, dropType:IDropType, event:DragEvent) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '监听节点拖拽结束(可能未成功)的事件',
+ 'en-US': 'Listening for events where node drag and drop ends (possibly unsuccessful)'
+ },
+ mode: ['pc'],
+ pcDemo: 'event-allow-draggable'
+ },
+ {
+ name: 'node-drag-start',
+ typeAnchorName: 'ITreeNodeVm',
+ type: '(node:ITreeNodeVm, event:DragEvent) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '监听节点开始拖拽的事件',
+ 'en-US': 'Listening for events where nodes start dragging and dropping'
+ },
+ mode: ['pc'],
+ pcDemo: 'event-allow-draggable'
+ },
+ {
+ name: 'node-expand',
+ typeAnchorName: 'ITreeNodeVm',
+ type: '(nodeData:ITreeNodeData,node:ITreeNodeVm) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '监听节点被点击展开时的事件;',
+ 'en-US': 'Event when a listening node is clicked to expand'
+ },
+ mode: ['pc'],
+ pcDemo: 'events'
+ }
+ ],
+ methods: [
+ {
+ name: 'getCurrentKey',
+ type: '() => string | number | null',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '获取当前选中节点的 key ,注意:配合 node-key 属性设置每个节点 key 值的字段,仅适用单选',
+ 'en-US':
+ 'Obtain the key of the currently selected node. Note: Set the field for the key value of each node in conjunction with the node key attribute, only applicable for single selection'
+ },
+ mode: ['pc'],
+ pcDemo: 'current-node'
+ },
+ {
+ name: 'getCurrentNode',
+ typeAnchorName: 'ITreeNodeData',
+ type: '() => ITreeNodeData|null',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '获得当前选中节点的数据,注意:配合 node-key 属性设置每个节点 key 值的字段,仅适用单选',
+ 'en-US':
+ 'Obtain the data of the currently selected node. Note: Set the field for the key value of each node in conjunction with the node key attribute, only applicable for single selection'
+ },
+ mode: ['pc'],
+ pcDemo: 'current-node'
+ },
+ {
+ name: 'setCurrentKey',
+ type: '(key:string|number) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '通过 key 设置某个节点为当前选中的节点,注意:配合 node-key 属性设置每个节点 key 值的字段',
+ 'en-US':
+ 'Set a node as the currently selected node through key. Note: Set the key value field for each node in conjunction with the node key attribute'
+ },
+ mode: ['pc'],
+ pcDemo: 'current-node'
+ },
+ {
+ name: 'setCurrentNode',
+ typeAnchorName: 'ITreeNodeData',
+ type: '(nodeData:ITreeNodeData) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '通过 nodeData 设置某个节点为当前选中的节点,注意:配合 node-key 属性设置每个节点 key 值的字段',
+ 'en-US':
+ 'Set a node as the currently selected node through nodeData. Note: Set the key value field for each node in conjunction with the node key attribute'
+ },
+ mode: ['pc'],
+ pcDemo: 'current-node'
+ }
+ ],
+ slots: [
+ {
+ name: 'default',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义树节点的内容,参数为 { node, data }',
+ 'en-US': 'Content of a customized tree node. The parameter is {node, data}'
+ },
+ mode: ['pc'],
+ pcDemo: 'tree-menu-slot'
+ }
+ ]
+ }
+ ],
+ types: [
+ {
+ name: 'ITreeNodeVm',
+ type: 'interface',
+ code: `
+interface ITreeNodeVm {
+ // 是否已勾选
+ "checked": boolean
+ // 子节点
+ "childNodes": ITreeNodeVm[]
+ // 节点数据
+ "data": ITreeNodeData
+ // 是否展开
+ "expanded": boolean
+ // 唯一标识
+ "id": string | number
+ // 是否半选
+ "indeterminate": boolean
+ // 是否当前节点
+ "isCurrent": boolean
+ // 是否叶子节点
+ "isLeaf": boolean
+ // 层级
+ "level": number
+ // 是否已加载
+ "loaded": boolean
+ // 是否加载中
+ "loading": boolean
+ // 是否可见
+ "visible": boolean
+ // 是否禁用
+ "disabled": boolean
+ // 节点显示文本
+ "label": string
+}
+`
+ },
+ {
+ name: 'ITreeNodeData',
+ type: 'interface',
+ code: `
+interface ITreeNodeData {
+ // node-key='id' 设置节点的唯一标识
+ "id": number | string
+ // 节点显示文本
+ "label": string
+ // 子节点
+ "children"?: ITreeNodeData[]
+ // 链接
+ "url"?: string,
+ // show-number 时展示的字段
+ "number"?: number | string
+ // 自定义每个节点的图标
+ "customIcon": Component
+}
+`
+ },
+ {
+ name: 'IProps',
+ type: 'interface',
+ code: `
+interface IProps {
+ "label"?: string
+ "children"?: string
+ "disabled": string
+ "isLeaf": string
+}
+`
+ },
+ {
+ name: 'IResolveType',
+ type: 'type',
+ code: `
+// Promise 的 resolve 回调函数
+type IResolveType = (data:ITreeNodeData) => void
+`
+ },
+ {
+ name: 'IDropType',
+ type: 'type',
+ code: `
+// 拖拽节点相对目标节点的位置
+type IDropType = before | after | inner | none
+`
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/tree.js b/examples/sites/demos/apis/tree.js
new file mode 100644
index 000000000..d31e9d1cd
--- /dev/null
+++ b/examples/sites/demos/apis/tree.js
@@ -0,0 +1,1197 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'tree',
+ type: 'component',
+ props: [
+ {
+ name: 'accordion',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否为手风琴模式,每次只打开一个同级树节点展开',
+ 'en-US': 'Whether in accordion mode, only open one sibling tree node expansion at a time'
+ },
+ mode: ['pc'],
+ pcDemo: 'other'
+ },
+ {
+ name: 'add-disabled-keys',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '禁止添加的节点 key 值列表,也可通过 setAddDisabledKeys 方法设置',
+ 'en-US':
+ 'List of key values of nodes that cannot be added. You can also use the setAddDisabledKeys method to set the key values.'
+ },
+ mode: ['pc'],
+ pcDemo: 'edit-control'
+ },
+ {
+ name: 'after-load',
+ type: '(nodes: object[])=> void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '下级树节点数据加载完毕后的回调函数',
+ 'en-US': 'The callback function after the data of the subordinate tree node is loaded'
+ },
+ mode: ['pc'],
+ pcDemo: 'lazy'
+ },
+ {
+ name: 'allow-drag',
+ type: '(node)=>boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '判断节点能否被拖拽',
+ 'en-US': 'Whether a node can be dragged.'
+ },
+ mode: ['pc'],
+ pcDemo: 'drag'
+ },
+ {
+ name: 'allow-drop',
+ type: '(srcNode, targetNode, type)=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ "拖拽时判定目标节点能否被放置。type 参数有三种情况:'prev'、'inner' 和 'next',分别表示放置在目标节点前、插入至目标节点和放置在目标节点后",
+ 'en-US':
+ "Whether the target node can be placed during dragging. The type parameter has three situations: 'prev',' inner', and'next', which indicate that it is placed before the target node, inserted into the target node, and placed after the target node respectively"
+ },
+ mode: ['pc'],
+ pcDemo: 'drag'
+ },
+ {
+ name: 'check-on-click-node',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否点击节点时,自动勾选节点',
+ 'en-US': 'When you click a node, the node is automatically selected'
+ },
+ mode: ['pc'],
+ pcDemo: 'checkbox'
+ },
+ {
+ name: 'check-strictly',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否为父子严格模式',
+ 'en-US': 'Whether it is in strict parent-child mode'
+ },
+ mode: ['pc'],
+ pcDemo: 'checkbox'
+ },
+ {
+ name: 'current-node-key',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '当前选中节点',
+ 'en-US': 'Currently selected node'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-hl'
+ },
+ {
+ name: 'data',
+ type: 'Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置数据源, 默认通过数据项的 label , children 属性展示数据',
+ 'en-US':
+ 'Set the data source. By default, the data is displayed through the label and children attributes of the data item'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'default-checked-keys',
+ type: 'string[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '默认勾选的节点的keys',
+ 'en-US': 'keys of the node selected by default'
+ },
+ mode: ['pc'],
+ pcDemo: 'checkbox'
+ },
+ {
+ name: 'default-expand-all',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否默认展开所有节点',
+ 'en-US': 'Whether to expand all nodes by default'
+ },
+ mode: ['pc'],
+ pcDemo: 'expand-control'
+ },
+ {
+ name: 'default-expanded-keys',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '默认展开节点的keys',
+ 'en-US': 'The keys of the node are expanded by default'
+ },
+ mode: ['pc'],
+ pcDemo: 'expand-control'
+ },
+ {
+ name: 'delete-disabled-keys',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '禁止删除的节点 key 值列表,也可通过 setDeleteDisabledKeys 方法设置',
+ 'en-US':
+ 'Indicates the list of key values of nodes that cannot be deleted. You can also use the setDeleteDisabledKeys method to set the key values.'
+ },
+ mode: ['pc'],
+ pcDemo: 'edit-control'
+ },
+ {
+ name: 'delete-node-method',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '删除节点的装置钩子函数,若返回 false 或者返回 Promise 且被 reject,则停止删除。 ',
+ 'en-US':
+ 'Device hook function for deleting a node. If false is returned or Promise is returned and rejected, the deletion is stopped.'
+ },
+ mode: ['pc'],
+ pcDemo: 'edit-control'
+ },
+ {
+ name: 'draggable',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否开启节点拖拽',
+ 'en-US': 'Whether to enable the node dragging function'
+ },
+ mode: ['pc'],
+ pcDemo: 'drag'
+ },
+ {
+ name: 'edit-disabled-keys',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '禁止编辑的节点 key 值列表,也可通过 setEditDisabledKeys 方法设置',
+ 'en-US':
+ 'List of key values of nodes that cannot be edited. You can also use the setEditDisabledKeys method to set the key values.'
+ },
+ mode: ['pc'],
+ pcDemo: 'edit-control'
+ },
+ {
+ name: 'empty-text',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '内容为空的时候展示的文本',
+ 'en-US': 'Text displayed when the content is empty'
+ },
+ mode: ['pc'],
+ pcDemo: 'slot'
+ },
+ {
+ name: 'expand-icon',
+ type: 'Component',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '指示展开的图标',
+ 'en-US': 'Indicates the expanded icon'
+ },
+ mode: ['pc'],
+ pcDemo: 'icons'
+ },
+ {
+ name: 'expand-icon-color',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '指示展开的图标色',
+ 'en-US': 'Indicates the expanded icon color'
+ },
+ mode: ['pc'],
+ pcDemo: 'icons'
+ },
+ {
+ name: 'expand-on-click-node',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '节点在点击内容时,是否展开 / 收起',
+ 'en-US': 'Whether the node expands/collapses when it clicks on content'
+ },
+ mode: ['pc'],
+ pcDemo: 'expand-control'
+ },
+ {
+ name: 'filter-node-method',
+ type: '(value, data, node)=>boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '对树节点进行筛选时执行的方法,返回 true 表示这个节点可以显示,返回 false 则表示这个节点会被隐藏',
+ 'en-US':
+ 'Method to be executed when filtering a tree node, returning true means the node can be displayed, and returning false means the node is hidden'
+ },
+ mode: ['pc'],
+ pcDemo: 'filter-view'
+ },
+ {
+ name: 'highlight-current',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否高亮当前选中节点',
+ 'en-US': 'Whether to highlight the selected node'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-hl'
+ },
+ {
+ name: 'icon',
+ type: 'Component',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义节点图标',
+ 'en-US': 'Customize the node icon'
+ },
+ mode: ['pc'],
+ pcDemo: 'icons'
+ },
+ {
+ name: 'icon-trigger-click-node',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '点击图标展开节点时是否触发 node-click 事件',
+ 'en-US': 'Whether a node-click event is triggered when a node is expanded by clicking the icon'
+ },
+ mode: ['pc'],
+ pcDemo: 'other'
+ },
+ {
+ name: 'indent',
+ type: 'number',
+ defaultValue: '18',
+ desc: {
+ 'zh-CN': '相邻级节点间的水平缩进,单位为像素',
+ 'en-US': 'horizontal indentation between adjacent nodes, in pixels.'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'lazy',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否为异步加载模式,展开节点时再请求数据',
+ 'en-US': 'Whether to load asynchronously and request data when the node is expanded'
+ },
+ mode: ['pc'],
+ pcDemo: 'lazy'
+ },
+ {
+ name: 'load',
+ type: '(node, resolve)=> void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '加载子树数据的方法。点击节点后,组件开始调用load方法,只有在load函数内调用resolve(data),才表示返回下级的数据成功。',
+ 'en-US':
+ 'Method of loading subtree data. After the node is clicked, the component starts to call the load method. Only when resolve(data) is called in the load function, the data at the lower level is successfully returned.'
+ },
+ mode: ['pc'],
+ pcDemo: 'lazy'
+ },
+ {
+ name: 'node-key',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '节点唯一标识属性名称',
+ 'en-US': 'The node uniquely identifies the attribute name'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-hl'
+ },
+ {
+ name: 'only-check-children',
+ type: 'Boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否只能选中叶子节点',
+ 'en-US': 'whether only leaf nodes be selected'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'props',
+ type: 'object',
+ defaultValue: "{children: 'children',label: 'label',disabled: 'disabled',isLeaf: 'isLeaf'}",
+ desc: {
+ 'zh-CN': '用户传入非标准格式的数据时,指定映射属性的关系',
+ 'en-US':
+ 'Specifies the relationship of the mapping properties when the user passes in data in a non-standard format'
+ },
+ mode: ['pc'],
+ pcDemo: 'props'
+ },
+ {
+ name: 'render-after-expand',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '是否在第一次展开某个树节点后才渲染其子节点',
+ 'en-US': 'Whether to render child nodes after the first expansion of a tree node'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'render-content',
+ type: '(h: Vue.h, { node, data, store }=> VNode',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '树节点的内容区的渲染函数',
+ 'en-US': 'Rendering function for the content area of the tree node'
+ },
+ mode: ['pc'],
+ pcDemo: 'slot'
+ },
+ {
+ name: 'show-auxi',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '平铺视图模式时,是否显示节点的上级路径的辅助信息',
+ 'en-US': 'Whether to display auxiliary information about the upper path of a node in the tile view mode'
+ },
+ mode: ['pc'],
+ pcDemo: 'filter-view'
+ },
+ {
+ name: 'show-check-easily',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '在严格模式时,是否显示勾选父节点时,自动勾选子节点的功能区域',
+ 'en-US':
+ 'In strict mode, when the parent node is displayed, the function area of the child node is automatically selected.'
+ },
+ mode: ['pc'],
+ pcDemo: 'other'
+ },
+ {
+ name: 'show-checkbox',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否为多选模式',
+ 'en-US': 'Whether to select multiple mode'
+ },
+ mode: ['pc'],
+ pcDemo: 'checkbox'
+ },
+ {
+ name: 'show-contextmenu',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否启用右键菜单功能',
+ 'en-US': 'Whether to enable the right-click menu function'
+ },
+ mode: ['pc'],
+ pcDemo: 'contextmenu'
+ },
+ {
+ name: 'show-line',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否显示连接线',
+ 'en-US': 'Whether the connection cable is displayed'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'show-radio',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '是否为单选模式',
+ 'en-US': 'Whether to select an radio mode'
+ },
+ mode: ['pc'],
+ pcDemo: 'radio'
+ },
+ {
+ name: 'shrink-icon',
+ type: 'Component',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '指示收缩的图标',
+ 'en-US': 'Icon indicating shrink'
+ },
+ mode: ['pc'],
+ pcDemo: 'icons'
+ },
+ {
+ name: 'shrink-icon-color',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '指示收缩的图标色',
+ 'en-US': 'Icon indicating shrink color'
+ },
+ mode: ['pc'],
+ pcDemo: 'icons'
+ },
+ {
+ name: 'size',
+ type: "'medium'|'small'",
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '组件的大小',
+ 'en-US': 'Component size'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'view-type',
+ type: "'tree' | 'plain'",
+ defaultValue: 'tree',
+ desc: {
+ 'zh-CN': '视图模式,其中tree是普通视图,plain是平铺视图',
+ 'en-US': 'View mode, where tree is a normal view and plain is a tiled view'
+ },
+ mode: ['pc'],
+ pcDemo: 'filter-view'
+ }
+ ],
+ events: [
+ {
+ name: 'add-node',
+ type: '(node)=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '添加节点的事件',
+ 'en-US': 'Add Node Events'
+ },
+ mode: ['pc'],
+ pcDemo: 'edit-control'
+ },
+ {
+ name: 'check',
+ type: '(data, currentChecked)=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '勾选节点后的事件
参数说明:{data: 当前选中节点信息, currentChecked: 树组件目前的选中状态信息}',
+ 'en-US':
+ 'Parameter description: {data: information about the selected node; currentChecked: information about the selected tree component}'
+ },
+ mode: ['pc'],
+ pcDemo: 'check-op'
+ },
+ {
+ name: 'check-change',
+ type: '(data, checked, indeterminate)=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '节点选中状态发生变化时的回调;
参数说明:{data: 节点状态信息,checked:当前点击节点的勾选状态,indeterminate:当前节点的半选状态}',
+ 'en-US':
+ 'Callback when node status changes;
Parameter description: {data: node status information,checked: the selected state of the current node,indeterminate: the semi-selected state of the current node}'
+ },
+ mode: ['pc'],
+ pcDemo: 'check-op'
+ },
+ {
+ name: 'check-plain',
+ type: '(plainNode, value)=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '平铺模式下,勾选或取消勾选节点的事件,需要设置show-checkbox为true才生效。
参数说明:{ plainNode: 被点击的节点数据, value: 复选框是否选中,取值true或false }',
+ 'en-US':
+ 'In tile mode, select or deselect node events to take effect only when show-checkbox is set to true.
Parameter description: {plainNode: indicates the node data to be clicked. value: indicates whether the check box is selected. The value can be true or false.'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'close-edit',
+ type: '()=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '关闭编辑的事件',
+ 'en-US': 'Close Edited Events'
+ },
+ mode: ['pc'],
+ pcDemo: 'edit-control'
+ },
+ {
+ name: 'current-change',
+ type: '(data, currentNode)=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '当前选中节点变化时触发的事件;
参数说明:{data: 节点数据,currentNode: 节点状态信息(包括数据)}',
+ 'en-US':
+ 'The event triggered when the currently selected node changes;
Parameter description: {data: node data,currentNode: node status information (including data)}'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-hl'
+ },
+ {
+ name: 'delete-node',
+ type: '(node)=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '删除节点的事件',
+ 'en-US': 'Delete Node Events'
+ },
+ mode: ['pc'],
+ pcDemo: 'edit-control'
+ },
+ {
+ name: 'edit-node',
+ type: '(node)=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '修改节点的事件',
+ 'en-US': 'Edit Node Events'
+ },
+ mode: ['pc'],
+ pcDemo: 'edit-control'
+ },
+ {
+ name: 'leave-plain-view',
+ type: '(plainNode, event)=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '平铺模式下,点击节点定位图标触发的事件。
参数说明:{ plainNode: 被点击的节点数据, event: 原生点击事件 }',
+ 'en-US':
+ 'In tile mode, click the node positioning icon to trigger the event.
Parameter description: {plainNode: node data to be clicked, event: native click event}'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'load-data',
+ type: '(data)=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '懒加载时,加载数据成功的事件;
参数说明:{data: 加载的数据}',
+ 'en-US': 'During lazy loading, data is loaded successfully.
Parameter description: {data: loaded data}'
+ },
+ mode: ['pc'],
+ pcDemo: 'lazy'
+ },
+ {
+ name: 'node-click',
+ type: '(data, node, vm)=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '点击节点后的事件。
参数说明:{data: 节点数据,node: 节点状态信息(包括数据),vm: 组件实例}',
+ 'en-US':
+ 'The event after clicking a node.
Parameter description: {data: node data,node: node status information (including data),vm: component instance}'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'node-collapse',
+ type: '(data, node, vm)=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '收缩节点后的事件
参数说明:{data: 节点数据,node: 节点状态信息(包括数据),vm: 当前组件实例}',
+ 'en-US':
+ 'Events after a node is shrunk
Parameter Description: {data: node data,node: node status information (including data),vm: current component instance}'
+ },
+ mode: ['pc'],
+ pcDemo: 'expand-control'
+ },
+ {
+ name: 'node-contextmenu',
+ type: '(event, data, node, vm)=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '当某一节点被鼠标右键点击时会触发该事件;
参数说明:{event:原生事件,data: 节点数据,node: 节点状态信息(包括数据),vm: 组件实例}',
+ 'en-US':
+ 'This event is triggered when a node is clicked by the right mouse button.
Parameter description: {event: native event,data: node data,node state information (including data),vm: component instance}'
+ },
+ mode: ['pc'],
+ pcDemo: 'contextmenu'
+ },
+ {
+ name: 'node-drag-end',
+ type: '(srcNode, targetNode, dropType, event)=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '拖拽结束时(可能未成功)触发的事件;
参数说明:{srcNode: 拖拽节点,targetNode: 目标节点,dropType: 拖拽类型, (before/after/inner/none),event: 原生事件}',
+ 'en-US':
+ 'An event triggered at the end of a (possibly unsuccessful) drag;
Parameter description: {srcNode: drag node,targetNode: target node,dropType: drag type, (before/after/inner/none),event: native event}'
+ },
+ mode: ['pc'],
+ pcDemo: 'drag'
+ },
+ {
+ name: 'node-drag-enter',
+ type: '(srcNode, targetNode, event)=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '拖拽进入其他节点时触发的事件;
参数说明:{srcNode: 拖拽节点,targetNode: 目标节点,event: 原生事件}',
+ 'en-US':
+ 'An event triggered when dragging to another node;
Parameter description: {srcNode: drag node,targetNode: target node,event: native event}'
+ },
+ mode: ['pc'],
+ pcDemo: 'drag'
+ },
+ {
+ name: 'node-drag-leave',
+ type: '(srcNode, targetNode, event)=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '拖拽离开某个节点时触发的事件;
参数说明:{srcNode: 拖拽节点,targetNode: 目标节点,event: 原生事件}',
+ 'en-US':
+ 'An event that is triggered when you drag and drop away from a node;
Parameter description: {srcNode: drag node,targetNode: target node,event: native event}'
+ },
+ mode: ['pc'],
+ pcDemo: 'drag'
+ },
+ {
+ name: 'node-drag-over',
+ type: '(srcNode, targetNode, event)=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在拖拽节点时触发的事件;
参数说明:{srcNode: 拖拽节点,targetNode: 目标节点,event: 原生事件}',
+ 'en-US':
+ 'An event that is triggered when a node is dragged;
Parameter description: {srcNode: drag node,targetNode: target node,event: native event}'
+ },
+ mode: ['pc'],
+ pcDemo: 'drag'
+ },
+ {
+ name: 'node-drag-start',
+ type: '(node, event)=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '节点开始拖拽时触发的事件;
参数说明:{node: 拖拽节点,event: 原生事件}',
+ 'en-US':
+ 'The event triggered when the node starts dragging;
Parameter description: {node: drags a node, event: native event}'
+ },
+ mode: ['pc'],
+ pcDemo: 'drag'
+ },
+ {
+ name: 'node-drop',
+ type: '(srcNode, targetNode, dropType, event)=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '拖拽成功完成时触发的事件;
参数说明:{srcNode: 拖拽节点,targetNode: 目标节点,dropType: 拖拽类型, (before/after/inner/none),event: 原生事件}',
+ 'en-US':
+ 'Drag-and-drop events triggered upon successful completion;
Parameter description: {srcNode: drag node,targetNode: target node,dropType: drag type, (before/after/inner/none),event: native event}'
+ },
+ mode: ['pc'],
+ pcDemo: 'drag'
+ },
+ {
+ name: 'node-expand',
+ type: '(data, node, vm)=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '展开节点后的事件。
参数说明:{data: 节点数据,node: 节点状态信息(包括数据,vm: 当前组件实例}',
+ 'en-US':
+ 'Events after expanding a node.
Parameter description: {data: node data,node: node status information (including data,vm: current component instance)}'
+ },
+ mode: ['pc'],
+ pcDemo: 'expand-control'
+ },
+ {
+ name: 'open-edit',
+ type: '()=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '进入编辑的事件',
+ 'en-US': 'Open Edited Events'
+ },
+ mode: ['pc'],
+ pcDemo: 'edit-control'
+ },
+ {
+ name: 'save-edit',
+ type: '(changedData, finalData)=>void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '保存编辑的事件',
+ 'en-US': 'Save Edited Events'
+ },
+ mode: ['pc'],
+ pcDemo: 'edit-control'
+ }
+ ],
+ methods: [
+ {
+ name: 'addNode',
+ type: '(node:object) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在指定的节点对象中,添加一个子节点',
+ 'en-US': 'In the specified node object, adds a child node'
+ },
+ mode: ['pc'],
+ pcDemo: 'edit'
+ },
+ {
+ name: 'append',
+ type: '(newData:object, targetNodeOrTargetKey: object | string) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN':
+ '为一个节点追加一个子节点,且位于其它子节点的最上方。
参数中的目标节点可以是节点数据或节点的key',
+ 'en-US':
+ 'Appends a child node to a node, on top of the other children. The target node in the
parameter can be the node data or the key of the node'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-op'
+ },
+ {
+ name: 'closeEdit',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '组件退出编辑状态',
+ 'en-US': 'The component exits the editing state'
+ },
+ mode: ['pc'],
+ pcDemo: 'edit'
+ },
+ {
+ name: 'closeMenu',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '关闭节点的自定义菜单',
+ 'en-US': 'Close the custom menu of the node'
+ },
+ mode: ['pc'],
+ pcDemo: 'contextmenu'
+ },
+ {
+ name: 'editNode',
+ type: '(node:object) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '让指定的节点对象进入编辑状态',
+ 'en-US': 'Puts the specified node object in the edit state'
+ },
+ mode: ['pc'],
+ pcDemo: 'edit'
+ },
+ {
+ name: 'expandAllNodes',
+ type: '(isExpand:boolean) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '展开或收起全部节点',
+ 'en-US': 'Expand or collapse all nodes'
+ },
+ mode: ['pc'],
+ pcDemo: 'expand-control'
+ },
+ {
+ name: 'filter',
+ type: '(value:string) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '触发树节点进行筛选操作',
+ 'en-US': 'The tree node is triggered for filtering operations'
+ },
+ mode: ['pc'],
+ pcDemo: 'filter-view'
+ },
+ {
+ name: 'getCheckedKeys',
+ type: '(leafOnly:boolean) => string[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '返回目前被选中的节点的 key 所组成的数组。当参数:leafOnly 为true时,只返回被选中的叶子节点。',
+ 'en-US':
+ 'Returns an array of keys for the currently selected node. If the parameter: leafOnly is true, only the selected leaf nodes are returned.'
+ },
+ mode: ['pc'],
+ pcDemo: 'check-op'
+ },
+ {
+ name: 'getCheckedNodes',
+ type: '(leafOnly:boolean, includeHalfChecked:boolean) => object[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '返回目前被选中的节点所组成的数组。',
+ 'en-US': 'Returns an array of currently selected nodes'
+ },
+ mode: ['pc'],
+ pcDemo: 'check-op'
+ },
+ {
+ name: 'getCurrentKey',
+ type: '() => string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '获取当前被选中节点的 key',
+ 'en-US': 'Gets the key of the currently selected node'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-hl'
+ },
+ {
+ name: 'getCurrentNode',
+ type: '() => data',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '获得当前的选中的节点数据,若没有节点被选中则返回 null',
+ 'en-US': 'Gets the current selected node data, or null if no node is selected'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-hl'
+ },
+ {
+ name: 'getHalfCheckedKeys',
+ type: '() => result',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '返回目前半选中的节点的 key 所组成的数组',
+ 'en-US': 'Returns an array of keys for the currently semi-selected node'
+ },
+ mode: ['pc'],
+ pcDemo: 'check-op'
+ },
+ {
+ name: 'getHalfCheckedNodes',
+ type: '() => object[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '返回目前半选中的节点所组成的数组',
+ 'en-US': 'Returns an array of currently half-selected nodes.'
+ },
+ mode: ['pc'],
+ pcDemo: 'check-op'
+ },
+ {
+ name: 'getNode',
+ type: '(data: string | object) => node',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '通过 "节点数据" 或者 "节点的key", 获得 Tree 组件中的 node 节点对象',
+ 'en-US': 'Obtain the node node object in the Tree component using Node Data or Node key'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-hl'
+ },
+ {
+ name: 'getNodeKey',
+ type: '(node:object) => number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '查询节点对象的内部唯一id',
+ 'en-US': 'Query the unique internal id of a node object'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-hl'
+ },
+ {
+ name: 'getNodePath',
+ type: '(key:string) => object[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '通过节点的id, 返回整个路径上节点数据的数组',
+ 'en-US': 'Returns an array of node data along the entire path, via the node id'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-hl'
+ },
+ {
+ name: 'insertAfter',
+ type: '(newData:object, targetNodeOrTargetKey: object | string) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在一个节点的后面增加一个节点',
+ 'en-US': 'Add a node after a node'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-op'
+ },
+ {
+ name: 'insertBefore',
+ type: '(newData:object, targetNodeOrTargetKey: object | string) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在一个节点的前面增加一个节点',
+ 'en-US': 'Add a node before a tree node.'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-op'
+ },
+ {
+ name: 'openEdit',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '组件进入编辑状态',
+ 'en-US': 'The component enters the edit state'
+ },
+ mode: ['pc'],
+ pcDemo: 'edit'
+ },
+ {
+ name: 'remove',
+ type: '(targetNodeOrTargetKey: object | string, isSaveChildNode :boolean ) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '删除节点。当参数:isSaveChildNode为true时,当前节点的子元素上移至删除节点的父节点中去。',
+ 'en-US':
+ 'Delete a node. When isSaveChildNode is true, the child elements of the current node are moved up to the parent node of the deleted node.'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-op'
+ },
+ {
+ name: 'saveEdit',
+ type: '() => object[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '返回组件编辑状态的值',
+ 'en-US': "Returns the value of the component's edit status"
+ },
+ mode: ['pc'],
+ pcDemo: 'edit'
+ },
+ {
+ name: 'saveNode',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '正在进行编辑的节点保存并退出编辑状态',
+ 'en-US': 'The node being edited is saved and exits the editing state'
+ },
+ mode: ['pc'],
+ pcDemo: 'edit'
+ },
+ {
+ name: 'setAddDisabledKeys',
+ type: '(keys: string[]) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置禁止添加的节点 key 值列表',
+ 'en-US': 'Sets the list of key values of nodes that cannot be added.'
+ },
+ mode: ['pc'],
+ pcDemo: 'edit-control'
+ },
+ {
+ name: 'setChecked',
+ type: '( nodeOrKey: object|string,checked:boolean,deep:boolean) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '通过节点或节点的key,设置它的勾选状态',
+ 'en-US': 'Set the checked status of the node or node by its key'
+ },
+ mode: ['pc'],
+ pcDemo: 'check-op'
+ },
+ {
+ name: 'setCheckedByNodeKey',
+ type: '(key:string, checked:boolean) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '通过节点的key, 设置它为勾选或不勾选',
+ 'en-US': "Through the node's key, set it to checked or unchecked"
+ },
+ mode: ['pc'],
+ pcDemo: 'check-op'
+ },
+ {
+ name: 'setCheckedKeys',
+ type: '(keys:string[], leafOnly:boolean) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '通过节点的key,设置一组节点为勾选状态',
+ 'en-US': 'You can set a group of nodes to the selected state by using the node key'
+ },
+ mode: ['pc'],
+ pcDemo: 'check-op'
+ },
+ {
+ name: 'setCheckedNodes',
+ type: '( nodeArr: object[], leafOnly:boolean) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '通过节点数据,设置一组节点为勾选状态',
+ 'en-US': 'Set a group of nodes to the selected state based on node data'
+ },
+ mode: ['pc'],
+ pcDemo: 'check-op'
+ },
+ {
+ name: 'setCurrentKey',
+ type: '(key:string) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '通过 key 设置某个节点的当前选中状态',
+ 'en-US': 'Use key to set the selected status of a node'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-op'
+ },
+ {
+ name: 'setCurrentNode',
+ type: '(data:object) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '通过节点数据, 设置某个节点的当前选中状态',
+ 'en-US': 'This section describes how to set the selected status of a node based on node data'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-op'
+ },
+ {
+ name: 'setCurrentRadio',
+ type: '() => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在单选模式下,设置组件实例的default-checked-keys 的第一项为勾选值',
+ 'en-US':
+ "In radio mode, set the first item of the component instance's default-checked keys to the checked value"
+ },
+ mode: ['pc'],
+ pcDemo: 'radio'
+ },
+ {
+ name: 'setDeleteDisabledKeys',
+ type: '(keys: string[]) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置禁止删除的节点 key 值列表',
+ 'en-US': 'Sets the list of key values of nodes that cannot be delete.'
+ },
+ mode: ['pc'],
+ pcDemo: 'edit-control'
+ },
+ {
+ name: 'setEditDisabledKeys',
+ type: '(keys: string[]) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置禁止编辑的节点 key 值列表',
+ 'en-US': 'Sets the list of key values of nodes that cannot be edit.'
+ },
+ mode: ['pc'],
+ pcDemo: 'edit-control'
+ },
+ {
+ name: 'updateKeyChildren',
+ type: '(key, children: object[]) => void',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '更新指定节点的所有子元素',
+ 'en-US': 'Updates all child elements of the specified node'
+ },
+ mode: ['pc'],
+ pcDemo: 'node-op'
+ }
+ ],
+ slots: [
+ {
+ name: 'contextmenu',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义树节点的右键菜单内容,插槽上下文数据为 { node }',
+ 'en-US': 'Custom tree node right-click menu content, slot context data is {node}'
+ },
+ mode: ['pc'],
+ pcDemo: 'contextmenu'
+ },
+ {
+ name: 'default',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义树节点的内容,插槽上下文数据为 { node, data }',
+ 'en-US': 'Custom tree node content, slot context data is {node, data}'
+ },
+ mode: ['pc'],
+ pcDemo: 'slot'
+ },
+ {
+ name: 'empty',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义空数据的元素',
+ 'en-US': 'Custom elements for empty data'
+ },
+ mode: ['pc'],
+ pcDemo: 'slot'
+ },
+ {
+ name: 'operation',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '节点内容靠右对齐的元素,插槽上下文数据为 { node }',
+ 'en-US': 'node content right-justified element, slot context data is {node}'
+ },
+ mode: ['pc'],
+ pcDemo: 'slot'
+ },
+ {
+ name: 'prefix',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '节点内容前置元素,插槽上下文数据为 { node }',
+ 'en-US': 'node content prefix element, slot context data is {node}'
+ },
+ mode: ['pc'],
+ pcDemo: 'slot'
+ },
+ {
+ name: 'suffix',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '节点内容后置元素,插槽上下文数据为 { node }',
+ 'en-US': 'node content post element, slot context data is {node}'
+ },
+ mode: ['pc'],
+ pcDemo: 'slot'
+ },
+ {
+ name: 'switch-text',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '在严格模式显示自动勾选子节点的功能时,自定义开关右侧的内容',
+ 'en-US':
+ 'When the function of automatically selecting subnodes is displayed in strict mode, the content on the right of the customized switch is displayed.'
+ },
+ mode: ['pc'],
+ pcDemo: 'other'
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/user-account.js b/examples/sites/demos/apis/user-account.js
new file mode 100644
index 000000000..1a29f9f54
--- /dev/null
+++ b/examples/sites/demos/apis/user-account.js
@@ -0,0 +1,93 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'user-account',
+ type: 'component',
+ props: [
+ {
+ name: 'beforeLogout',
+ type: 'Function(params)',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '注销前的回调函数',
+ 'en-US': 'Callback function before deregistration'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'getUserImageUrl',
+ type: 'Function',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义配置获取用户头像服务',
+ 'en-US': 'Customized configuration for obtaining user avatars'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-service'
+ },
+ {
+ name: 'getUserInfo',
+ type: 'Function',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义配置用户查询服务',
+ 'en-US': 'User-defined configuration query service'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-service'
+ },
+ {
+ name: 'popper-append-to-body',
+ type: 'boolean',
+ defaultValue: '该属性的默认值为 true',
+ desc: {
+ 'zh-CN':
+ '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)',
+ 'en-US':
+ 'Indicates whether to insert the pop-up box to the body element. If a fault occurs in locating the fault in the dialog box that is displayed, you can set this attribute to false (for details, see the select component).'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'popper-class',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '为 popper 添加类名(可参考 popover 组件)',
+ 'en-US': 'Add a class name for the popper. For details, see the popover component.'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'showArrow',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置为true时,箭头会与Roles组件的箭头方向保持一致',
+ 'en-US': 'If this parameter is set to true, the arrow direction is the same as that of the Roles component.'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-service'
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '默认插槽',
+ 'en-US': 'Default slot'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-operation'
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/user-contact.js b/examples/sites/demos/apis/user-contact.js
new file mode 100644
index 000000000..bb5ac1237
--- /dev/null
+++ b/examples/sites/demos/apis/user-contact.js
@@ -0,0 +1,104 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'user-contact',
+ type: 'component',
+ props: [
+ {
+ name: 'data',
+ type: 'object',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置的数据',
+ 'en-US': 'Setted data; Data Settings'
+ },
+ mode: ['pc'],
+ pcDemo: 'data-source'
+ },
+ {
+ name: 'espace',
+ type: 'Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': 'espace 信息配置',
+ 'en-US': 'Espace Configuration'
+ },
+ mode: ['pc'],
+ pcDemo: 'contact-espace'
+ },
+ {
+ name: 'popper-append-to-body',
+ type: 'boolean',
+ defaultValue: '该属性的默认值为 true',
+ desc: {
+ 'zh-CN':
+ '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)',
+ 'en-US':
+ 'Indicates whether to insert a pop-up box to the body element. If a fault occurs in locating the fault in the dialog box that is displayed, you can set this attribute to false (for details, see the select component)'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'popper-class',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '为 popper 添加类名(可参考 popover 组件)',
+ 'en-US': 'Add a class name for the popper. For details, see the popover component'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'show-img',
+ type: 'boolean',
+ defaultValue: '该属性的默认值为 true',
+ desc: {
+ 'zh-CN': '是否显示头像,默认 true',
+ 'en-US': 'Indicates whether to display the avatar. The default value is true'
+ },
+ mode: ['pc'],
+ pcDemo: 'not-displayed-content'
+ },
+ {
+ name: 'show-name',
+ type: 'boolean',
+ defaultValue: '该属性的默认值为 true',
+ desc: {
+ 'zh-CN': '是否显示姓名 userName,默认 true',
+ 'en-US': 'Indicates whether to display userName. The default value is true'
+ },
+ mode: ['pc'],
+ pcDemo: 'not-displayed-content'
+ },
+ {
+ name: 'show-number',
+ type: 'boolean',
+ defaultValue: '该属性的默认值为 true',
+ desc: {
+ 'zh-CN': '是否显示工号 roleNumber,默认 true',
+ 'en-US': 'Indicates whether to display the employee ID roleNumber. The default value is true'
+ },
+ mode: ['pc'],
+ pcDemo: 'not-displayed-content'
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '默认插槽',
+ 'en-US': 'Default slot'
+ },
+ mode: ['pc'],
+ pcDemo: 'slots-usercontact'
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/user-head.js b/examples/sites/demos/apis/user-head.js
new file mode 100644
index 000000000..eb87f61cf
--- /dev/null
+++ b/examples/sites/demos/apis/user-head.js
@@ -0,0 +1,231 @@
+export default {
+ mode: ['pc', 'mobile', 'mobile-first'],
+ apis: [
+ {
+ name: 'user-head',
+ type: 'component',
+ props: [
+ {
+ name: 'background-color',
+ type: 'string',
+ defaultValue: "'#d9d9d9'",
+ desc: {
+ 'zh-CN': '背景色',
+ 'en-US': 'Background color'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'custom-background-color',
+ mfDemo: ''
+ },
+ {
+ name: 'backgroundColor',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置背景色
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'custom-background-color'
+ },
+ {
+ name: 'color',
+ type: 'string',
+ defaultValue: "'#ffffff'",
+ desc: {
+ 'zh-CN': '文字颜色',
+ 'en-US': 'Text color'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'color',
+ mobileDemo: 'color',
+ mfDemo: ''
+ },
+ {
+ name: 'message-total',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '消息计数',
+ 'en-US': 'Number of messages'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'message-count-total',
+ mfDemo: ''
+ },
+ {
+ name: 'message-type',
+ type: 'string',
+ defaultValue: "'details'",
+ desc: {
+ 'zh-CN': '消息类型 details|basic 可选',
+ 'en-US': 'Message type details|basic is optional. The value of this attribute can be details or basic.'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'message-count-type',
+ mfDemo: ''
+ },
+ {
+ name: 'message-upper-limit',
+ type: 'number',
+ defaultValue: '0',
+ desc: {
+ 'zh-CN': '消息显示上限',
+ 'en-US': 'Maximum number of displayed messages'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'message-count-limit',
+ mfDemo: ''
+ },
+ {
+ name: 'messageTotal',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '右上角消息计数
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'message-count-limit'
+ },
+ {
+ name: 'messageType',
+ type: 'string',
+ defaultValue: 'details',
+ desc: {
+ 'zh-CN': '右上角消息提醒类型,basic显示小圆点不显示消息数量
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'message-count-type'
+ },
+ {
+ name: 'messageUpperLimit',
+ type: 'number',
+ defaultValue: '0',
+ desc: {
+ 'zh-CN': '右上角消息显示上限
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'message-count-limit'
+ },
+ {
+ name: 'min',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '小尺寸模式',
+ 'en-US': 'Small size mode'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'min-user-head',
+ mobileDemo: 'min-user-head',
+ mfDemo: ''
+ },
+ {
+ name: 'modelValue',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置头像值。',
+ 'en-US': 'Set the profile picture.'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'round',
+ type: 'boolean',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '圆形模式',
+ 'en-US': 'Circular mode'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'round-user-head',
+ mobileDemo: 'round-user-head',
+ mfDemo: ''
+ },
+ {
+ name: 'size',
+ type: 'number',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置头像尺寸
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile', 'mobile-first'],
+ mobileDemo: 'basic-usage',
+ mfDemo: ''
+ },
+ {
+ name: 'type',
+ type: 'string',
+ defaultValue: "'label'",
+ desc: {
+ 'zh-CN': '头像类型,icon|image|label 可选',
+ 'en-US':
+ 'Avatar type. The options are icon, image, and label. ;The value of this attribute can be icon / image / label'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'image-user-head',
+ mobileDemo: 'basic-usage',
+ mfDemo: ''
+ },
+ {
+ name: 'v-model',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': 'type=icon 时为图标类名,type=label 时为字体串,type=image 时为资源路径',
+ 'en-US':
+ 'If type is set to icon, it indicates the icon class name. If type is set to label, it indicates the font string. If type is set to image, it indicates the resource path'
+ },
+ mode: ['pc', 'mobile-first'],
+ pcDemo: 'icon-user-head',
+ mfDemo: ''
+ },
+ {
+ name: 'v-model/modelValue',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设type=icon 时为图标类名,type=label时为字体串,type=image时为资源路径
',
+ 'en-US': 'display different button'
+ },
+ mode: ['mobile'],
+ mobileDemo: 'basic-usage'
+ },
+ {
+ name: 'value',
+ type: 'String',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': 'type=icon 时为图标类名,type=label时为字体串,type=image时为资源路径',
+ 'en-US': ''
+ },
+ mode: ['mobile-first'],
+ mfDemo: ''
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: [
+ {
+ name: 'default',
+ type: '',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义图像内容',
+ 'en-US': 'Customized image content'
+ },
+ mode: ['pc', 'mobile', 'mobile-first'],
+ pcDemo: 'custom-user-head-content',
+ mobileDemo: 'round-user-head',
+ mfDemo: ''
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/user-link.js b/examples/sites/demos/apis/user-link.js
new file mode 100644
index 000000000..61a36013d
--- /dev/null
+++ b/examples/sites/demos/apis/user-link.js
@@ -0,0 +1,137 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'user-link',
+ type: 'component',
+ props: [
+ {
+ name: 'cache',
+ type: 'boolean',
+ defaultValue: '该属性的默认值为 true',
+ desc: {
+ 'zh-CN': '是否开启用户数据缓存,默认为 ture 缓存用户数据',
+ 'en-US': 'Indicates whether to enable the user data cache function. The default value is true.'
+ },
+ mode: ['pc'],
+ pcDemo: 'cache-users'
+ },
+ {
+ name: 'cache-fields',
+ type: 'Array',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义缓存的字段',
+ 'en-US': 'Custom cached fields'
+ },
+ mode: ['pc'],
+ pcDemo: 'cache-users'
+ },
+ {
+ name: 'cache-key',
+ type: 'string',
+ defaultValue: '该属性的默认值为 tiny-user',
+ desc: {
+ 'zh-CN': '自定义缓存 key 默认值为 tiny-user',
+ 'en-US': 'The default value of the customized cache key is tiny-user'
+ },
+ mode: ['pc'],
+ pcDemo: 'cache-users'
+ },
+ {
+ name: 'fetchUser',
+ type: 'Function',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '配置通过员区号查询用户信息(展示在卡片上)',
+ 'en-US': 'Configure the function of querying user information by area code (displayed on the card).'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-service'
+ },
+ {
+ name: 'fetchW3Accounts',
+ type: 'Function',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义配置批量查询用户信息服务',
+ 'en-US': 'Customize the user information batch query service'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-service'
+ },
+ {
+ name: 'getUserImageUrl',
+ type: 'Function',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义配置获取用户头像服务',
+ 'en-US': 'Customized configuration for obtaining user avatars'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-service'
+ },
+ {
+ name: 'text-field',
+ type: 'string',
+ defaultValue: '该属性的默认值为 userCN',
+ desc: {
+ 'zh-CN': '设置下拉框的文本对应的数据源的字段名称',
+ 'en-US': 'Set the field name of the data source corresponding to the text in the drop-down list box.'
+ },
+ mode: ['pc'],
+ pcDemo: 'text-field'
+ },
+ {
+ name: 'text-split',
+ type: 'string',
+ defaultValue: '该属性的默认值为 ,',
+ desc: {
+ 'zh-CN': '在多选的情况下,设置输入框显示多个文本时的分隔符',
+ 'en-US': 'Separator for displaying multiple texts in the text box when multiple texts are selected.'
+ },
+ mode: ['pc'],
+ pcDemo: 'text-split'
+ },
+ {
+ name: 'value',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '配置默认值,默认为空',
+ 'en-US': 'The default value is empty.'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-service'
+ },
+ {
+ name: 'value-field',
+ type: 'string',
+ defaultValue: '该属性的默认值为 userId',
+ desc: {
+ 'zh-CN': '设置下拉框的值所对应数据源的字段名称',
+ 'en-US': 'Field name of the data source corresponding to the value in the drop-down list box.'
+ },
+ mode: ['pc'],
+ pcDemo: 'value-field'
+ },
+ {
+ name: 'value-split',
+ type: 'string',
+ defaultValue: '该属性的默认值为 ,',
+ desc: {
+ 'zh-CN':
+ '在多选的情况下,设置输入框显示多个文本时的分隔符,默认为 ; 分号;在多选的情况下,设置输入框显示多个文本时的分隔符,默认为 , 逗号',
+ 'en-US':
+ 'Separator for displaying multiple texts in the text box. The default value is semicolon (;). Set the separator when multiple texts are displayed in the text box. The default value is, comma (,)'
+ },
+ mode: ['pc'],
+ pcDemo: 'value-split'
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: []
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/user.js b/examples/sites/demos/apis/user.js
new file mode 100644
index 000000000..2efe3222a
--- /dev/null
+++ b/examples/sites/demos/apis/user.js
@@ -0,0 +1,314 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'user',
+ type: 'component',
+ props: [
+ {
+ name: 'allow-copy',
+ type: 'boolean',
+ defaultValue: '该属性的默认值为 false,表示不能复制',
+ desc: {
+ 'zh-CN': '搜索单选场景,是否允许复制输入框的内容;属性会透传给内部的 Select 组件,参考 Select 示例',
+ 'en-US':
+ 'Indicates whether content in the text box can be copied in the single-choice search scenario. The attribute is transparently transferred to the internal Select component. For details, see the Select example.'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'cache',
+ type: 'boolean',
+ defaultValue: '该属性的默认值为 true',
+ desc: {
+ 'zh-CN': '是否缓存用户数据',
+ 'en-US': 'Whether to cache user data'
+ },
+ mode: ['pc'],
+ pcDemo: 'cache-users'
+ },
+ {
+ name: 'cache-fields',
+ type: 'Array',
+ defaultValue: '该属性的默认值为 []',
+ desc: {
+ 'zh-CN': '设置需要缓存的用户数据',
+ 'en-US': 'Set the user data to be cached.'
+ },
+ mode: ['pc'],
+ pcDemo: 'cache-users'
+ },
+ {
+ name: 'cache-key',
+ type: 'string',
+ defaultValue: '该属性的默认值为 tiny-user',
+ desc: {
+ 'zh-CN': '设置缓存数据的 key 值',
+ 'en-US': 'Set the key value of cached data.'
+ },
+ mode: ['pc'],
+ pcDemo: 'cache-users'
+ },
+ {
+ name: 'collapse-show-overflow-tooltip',
+ type: 'boolean',
+ defaultValue: '该属性的默认值为 true',
+ desc: {
+ 'zh-CN': '是否省略显示超出一行的数据并有tooltip提示',
+ 'en-US': 'Whether to omit the data that exceeds one line and display a tooltip.'
+ },
+ mode: ['pc'],
+ pcDemo: 'collapse-show-overflow-tooltip'
+ },
+ {
+ name: 'collapse-tags',
+ type: 'boolean',
+ defaultValue: '该属性的默认值为 false',
+ desc: {
+ 'zh-CN': '多用户时是否折叠标签',
+ 'en-US': 'Whether to collapse tags when there are multiple users'
+ },
+ mode: ['pc'],
+ pcDemo: 'multiple-users-tag'
+ },
+ {
+ name: 'delay',
+ type: 'number',
+ defaultValue: '该属性的默认值为 600 毫秒',
+ desc: {
+ 'zh-CN': '设置延时加载的时间',
+ 'en-US': 'Set the loading delay time.'
+ },
+ mode: ['pc'],
+ pcDemo: 'delay-load'
+ },
+ {
+ name: 'disabled',
+ type: 'boolean',
+ defaultValue: '该属性的默认值为 false',
+ desc: {
+ 'zh-CN': '是否禁用户组件',
+ 'en-US': 'Whether to disable the user component'
+ },
+ mode: ['pc'],
+ pcDemo: 'dynamic-disable'
+ },
+ {
+ name: 'fetchSuggestUser',
+ type: 'Function',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义输入查询服务',
+ 'en-US': 'Customized input query service'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-service'
+ },
+ {
+ name: 'fetchW3Accounts',
+ type: 'Function',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义批量查询用户服务',
+ 'en-US': 'User-defined batch query service'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-service'
+ },
+ {
+ name: 'multiple',
+ type: 'boolean',
+ defaultValue: '该属性的默认值为 false',
+ desc: {
+ 'zh-CN': '是否开启多用户形式,默认为 false ',
+ 'en-US': 'Whether to enable the multi-user mode. The default value is false.'
+ },
+ mode: ['pc'],
+ pcDemo: 'multiple-users'
+ },
+ {
+ name: 'placeholder',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置输入框占位文本',
+ 'en-US': 'Set the placeholder text in the text box'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'popper-append-to-body',
+ type: 'boolean',
+ defaultValue: '该属性的默认值为 true',
+ desc: {
+ 'zh-CN':
+ '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)',
+ 'en-US':
+ 'Indicates whether to insert a pop-up box to the body element. When a fault occurs in the dialog box that is displayed, you can set this attribute to false (for details, see the select component).'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'popper-class',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '为 popper 添加类名(可参考 popover 组件)',
+ 'en-US': 'Add a class name for the popper. For details, see the popover component.'
+ },
+ mode: ['pc'],
+ pcDemo: ''
+ },
+ {
+ name: 'size',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置用户组件尺寸',
+ 'en-US': 'Set the user component size'
+ },
+ mode: ['pc'],
+ pcDemo: 'user-select-size'
+ },
+ {
+ name: 'sort-by-fetch-data',
+ type: 'boolean',
+ defaultValue: '该属性的默认值为 false',
+ desc: {
+ 'zh-CN': '联想时下拉框的数据顺序和接口返回的数据顺序一致',
+ 'en-US':
+ 'The data sequence in the drop-down list box during association is the same as that returned by the interface.'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-service'
+ },
+ {
+ name: 'sortable',
+ type: 'Function',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '自定义用户拖拽排序,该属性引用 sortablejs 插件进行排序',
+ 'en-US': 'User-defined drag-and-drop sorting. This attribute references the sortablejs plug-in for sorting.'
+ },
+ mode: ['pc'],
+ pcDemo: 'custom-sort'
+ },
+ {
+ name: 'suggest-length',
+ type: 'number',
+ defaultValue: '该属性的默认值为 3',
+ desc: {
+ 'zh-CN': '设置输入指定长度完成后进行加载',
+ 'en-US': 'Load after the input length is set.'
+ },
+ mode: ['pc'],
+ pcDemo: 'load-after-input-the-length'
+ },
+ {
+ name: 'tag-selectable',
+ type: 'boolean',
+ defaultValue: '该属性的默认值为 false',
+ desc: {
+ 'zh-CN': '是否开启输入框中已选择的选项可复制',
+ 'en-US': 'Whether to enable copying of selected options in the text box'
+ },
+ mode: ['pc'],
+ pcDemo: 'tag-copy'
+ },
+ {
+ name: 'text-field',
+ type: 'string',
+ defaultValue: '该属性的默认值为 userCN',
+ desc: {
+ 'zh-CN': '显示字段映射',
+ 'en-US': 'Display field mapping'
+ },
+ mode: ['pc'],
+ pcDemo: 'text-field'
+ },
+ {
+ name: 'textSplit',
+ type: 'string',
+ defaultValue: '文本粘贴复制查询时的分割符,该属性的默认值为 ,',
+ desc: {
+ 'zh-CN': '文本分隔符',
+ 'en-US': 'Text separator'
+ },
+ mode: ['pc'],
+ pcDemo: 'value-split'
+ },
+ {
+ name: 'value',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '配置默认值',
+ 'en-US': 'Default value'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'value-field',
+ type: 'string',
+ defaultValue: '该属性的默认值为 userId',
+ desc: {
+ 'zh-CN': '取值字段映射',
+ 'en-US': 'Value Field Mapping'
+ },
+ mode: ['pc'],
+ pcDemo: 'value-field'
+ },
+ {
+ name: 'value-split',
+ type: 'string',
+ defaultValue: '该属性的默认值为 ,',
+ desc: {
+ 'zh-CN': '值分隔符',
+ 'en-US': 'Value Separator'
+ },
+ mode: ['pc'],
+ pcDemo: 'value-split'
+ }
+ ],
+ events: [
+ {
+ name: 'change',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '值发生变化时触发',
+ 'en-US': 'This event is triggered when the value changes.'
+ },
+ mode: ['pc'],
+ pcDemo: 'event-change'
+ },
+ {
+ name: 'error',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '输入未匹配到用户信息时触发',
+ 'en-US': 'This event is triggered when no user information is matched.'
+ },
+ mode: ['pc'],
+ pcDemo: 'event-error'
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'options',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '选项文本',
+ 'en-US': 'Option Text'
+ },
+ mode: ['pc'],
+ pcDemo: 'user-options'
+ }
+ ]
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/watermark.js b/examples/sites/demos/apis/watermark.js
new file mode 100644
index 000000000..7fcbafe0e
--- /dev/null
+++ b/examples/sites/demos/apis/watermark.js
@@ -0,0 +1,138 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'watermark',
+ type: 'component',
+ props: [
+ {
+ name: 'content',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '水印文字内容,此属性低于 image',
+ 'en-US': 'Watermark text content, lower image'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic'
+ },
+ {
+ name: 'font',
+ typeAnchorName: 'Font',
+ type: 'Font',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '水印文字样式',
+ 'en-US': 'Text style'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic'
+ },
+ {
+ name: 'gap',
+ type: 'array',
+ defaultValue: '[100, 100]',
+ desc: {
+ 'zh-CN': '水印之间的间距',
+ 'en-US': 'The spacing between watermarks'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic'
+ },
+ {
+ name: 'height',
+ type: 'number',
+ defaultValue: '64',
+ desc: {
+ 'zh-CN': '水印的高度, 最小高度64px',
+ 'en-US': 'The height of the watermark, minimum height 120'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic'
+ },
+ {
+ name: 'image',
+ type: 'string',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '图片源,建议导出 2 倍或 3 倍图,优先级高(支持 base64 格式),此属性高于 content ',
+ 'en-US': 'Image source, it is recommended to export 2x or 3x image, high priority, higher content'
+ },
+ mode: ['pc'],
+ pcDemo: 'image'
+ },
+ {
+ name: 'interlaced',
+ type: 'boolean',
+ defaultValue: 'true',
+ desc: {
+ 'zh-CN': '水印是否交错',
+ 'en-US': 'Whether the watermark is interlaced'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic'
+ },
+ {
+ name: 'offset',
+ type: 'array',
+ defaultValue: '[20, 20] ',
+ desc: {
+ 'zh-CN': '水印距离容器左上角的偏移量',
+ 'en-US': 'The offset of the watermark from the upper left corner of the container. '
+ },
+ mode: ['pc'],
+ pcDemo: 'basic'
+ },
+ {
+ name: 'rotate',
+ type: 'number',
+ defaultValue: '-22',
+ desc: {
+ 'zh-CN': '水印绘制时,旋转的角度,单位 °',
+ 'en-US': 'When the watermark is drawn, the rotation Angle, unit ° '
+ },
+ mode: ['pc'],
+ pcDemo: 'basic'
+ },
+ {
+ name: 'width',
+ type: 'number',
+ defaultValue: '120',
+ desc: {
+ 'zh-CN': '水印的宽度, 最小宽度120px',
+ 'en-US': 'The width of the watermark, minimum width 120'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic'
+ },
+ {
+ name: 'zIndex',
+ type: 'number',
+ defaultValue: '9',
+ desc: {
+ 'zh-CN': "追加的水印元素的 'z-index' ",
+ 'en-US': 'The z-index of the appended watermark element'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic'
+ }
+ ],
+ events: [],
+ methods: [],
+ slots: []
+ }
+ ],
+ types: [
+ {
+ name: 'Font',
+ type: 'type',
+ code: `type Font = {
+ color:string,
+ fontSize:number,
+ fontWeight:string,
+ fontFamily:string,
+ fontStyle:string
+ }`
+ }
+ ]
+}
diff --git a/examples/sites/demos/apis/wizard.js b/examples/sites/demos/apis/wizard.js
new file mode 100644
index 000000000..f6769cc02
--- /dev/null
+++ b/examples/sites/demos/apis/wizard.js
@@ -0,0 +1,161 @@
+export default {
+ mode: ['pc'],
+ apis: [
+ {
+ name: 'wizard',
+ type: 'component',
+ props: [
+ {
+ name: 'data',
+ typeAnchorName: 'IDataItem',
+ type: 'IDataItem[]',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '设置节点数据',
+ 'en-US': 'Setting Node Data'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ },
+ {
+ name: 'page-guide',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '设置页向导模式',
+ 'en-US': 'Set Page Wizard Mode'
+ },
+ mode: ['pc'],
+ pcDemo: 'page-guide'
+ },
+ {
+ name: 'time-line-flow',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '设置时间线',
+ 'en-US': 'Set timeline'
+ },
+ mode: ['pc'],
+ pcDemo: 'time-line-flow'
+ },
+ {
+ name: 'vertical',
+ type: 'boolean',
+ defaultValue: 'false',
+ desc: {
+ 'zh-CN': '设置为垂直模式',
+ 'en-US': 'Set to vertical mode'
+ },
+ mode: ['pc'],
+ pcDemo: 'vertical'
+ }
+ ],
+ events: [
+ {
+ name: 'btn-next',
+ typeAnchorName: 'IDataItem',
+ type: '(datas: IDataItem[]) => void',
+ desc: {
+ 'zh-CN': '页向导模式下,点击“下一步”按钮触发的回调事件',
+ 'en-US': 'Callback event triggered by clicking the "Next" button in page wizard mode'
+ },
+ mode: ['pc'],
+ pcDemo: 'btn-events'
+ },
+ {
+ name: 'btn-prev',
+ typeAnchorName: 'IDataItem',
+ type: '(datas: IDataItem[]) => void',
+ desc: {
+ 'zh-CN': '页向导模式下,点击“上一步”按钮触发的回调事件',
+ 'en-US': 'Callback event triggered by clicking the "Previous" button in page wizard mode'
+ },
+ mode: ['pc'],
+ pcDemo: 'btn-events'
+ },
+ {
+ name: 'btn-save',
+ typeAnchorName: 'IDataItem',
+ type: '(datas: IDataItem[]) => void',
+ desc: {
+ 'zh-CN': '页向导模式下,点击“保存”按钮触发的回调事件',
+ 'en-US': 'Callback event triggered by clicking the "Save" button in page wizard mode'
+ },
+ mode: ['pc'],
+ pcDemo: 'btn-events'
+ },
+ {
+ name: 'btn-submit',
+ typeAnchorName: 'IDataItem',
+ type: '(datas: IDataItem[]) => void',
+ desc: {
+ 'zh-CN': '页向导模式下,点击“下一步”导致最后一个节点的状态为 "doing" 时,点击“提交”按钮触发的回调事件',
+ 'en-US':
+ 'In page wizard mode, when clicking "Next" causes the status of the last node to be "doing", the callback event triggered by clicking the "Submit" button'
+ },
+ mode: ['pc'],
+ pcDemo: 'btn-events'
+ },
+ {
+ name: 'node-click',
+ typeAnchorName: 'IDataItem',
+ type: '(node: IDataItem, index: number, event: Event) => void',
+ desc: {
+ 'zh-CN': '节点点击事件',
+ 'en-US': 'Node click event'
+ },
+ mode: ['pc'],
+ pcDemo: 'basic-usage'
+ }
+ ],
+ methods: [],
+ slots: [
+ {
+ name: 'base',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '基本插槽',
+ 'en-US': 'Basic Slot'
+ },
+ mode: ['pc'],
+ pcDemo: 'slot-base'
+ },
+ {
+ name: 'stepbutton',
+ defaultValue: '',
+ desc: {
+ 'zh-CN': '页向导模式按钮插槽',
+ 'en-US': 'Page Wizard Mode Button Slot'
+ },
+ mode: ['pc'],
+ pcDemo: 'slot-step-button'
+ }
+ ]
+ }
+ ],
+ types: [
+ {
+ name: 'IDataItem',
+ type: 'interface',
+ code: `
+interface IDataItem {
+ name: string
+ status: string
+ showNode?: boolean
+ content?: string
+ imgUrl?: string
+ users?: string
+ userName?: string
+ roleNumber?: string
+ date?: string
+ values?: IDataItemValuesItem[]
+}
+
+interface IDataItemValuesItem {
+ text: string
+ value: string
+}`
+ }
+ ]
+}
diff --git a/examples/sites/demos/mobile-first/app/action-sheet/before-close.vue b/examples/sites/demos/mobile-first/app/action-sheet/before-close.vue
new file mode 100644
index 000000000..d1ce45d40
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/action-sheet/before-close.vue
@@ -0,0 +1,35 @@
+
+
+ 动作面板
+
+
+ 内容选项 {{ i }}
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/action-sheet/fullscreen.vue b/examples/sites/demos/mobile-first/app/action-sheet/fullscreen.vue
new file mode 100644
index 000000000..44e409115
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/action-sheet/fullscreen.vue
@@ -0,0 +1,35 @@
+
+
+ 动作面板
+
+
+ 内容选项 {{ i }}
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/action-sheet/webdoc/action-sheet.js b/examples/sites/demos/mobile-first/app/action-sheet/webdoc/action-sheet.js
index 88923711e..5e83c4cc4 100644
--- a/examples/sites/demos/mobile-first/app/action-sheet/webdoc/action-sheet.js
+++ b/examples/sites/demos/mobile-first/app/action-sheet/webdoc/action-sheet.js
@@ -34,12 +34,50 @@ export default {
},
desc: {
'zh-CN':
- 'show-header: 显示头部,默认值为 true;- show-search: 显示头部搜索功能,默认值为 true;- show-footer: 显示底部,默认值为 false;
',
+ '\n show-header
: 显示头部,默认值为 true; \n show-search
: 显示头部搜索功能,默认值为 true; \n show-footer
: 显示底部,默认值为 false; \n
',
'en-US':
- 'show-header: displays the header. The default value is true. - show-search: displays the header search function. The default value is true. - show-footer: displays the bottom. The default value is false
'
+ '\n show-header
: displays the header. The default value is true. \n show-search
: displays the header search function. The default value is true. \n show-footer
: displays the bottom. The default value is false '
},
codeFiles: ['show.vue']
},
+ {
+ demoId: 'before-close',
+ name: {
+ 'zh-CN': '关闭拦截',
+ 'en-US': 'Block Close'
+ },
+ desc: {
+ 'zh-CN':
+ '\n 通过 before-close
属性可以配置一个拦截弹窗关闭的方法。如果方法返回 false
值,则拦截弹窗关闭;否则不拦截。
\n 可以通过参数 type
获取触发关闭的方法名称, 一共有以下类型:confirm
| hide
| close
。
\n ',
+ 'en-US':
+ 'The before-close
attribute can be used to configure a method that intercepts closing of the pop-up window. If the method returns a value of false
, then the pop-up window is prevented from closing; otherwise it is not intercepted.
\n The method name that triggers the close action can be obtained through the type
parameter. There are three types available: confirm
, hide
, and close
.
\n '
+ },
+ codeFiles: ['before-close.vue']
+ },
+ {
+ demoId: 'fullscreen',
+ name: {
+ 'zh-CN': '全屏显示',
+ 'en-US': 'Display fullscreen'
+ },
+ desc: {
+ 'zh-CN': '通过 fullscreen
设置动作面板全屏显示。
',
+ 'en-US': 'Set action sheet display fullscreen.
'
+ },
+ codeFiles: ['fullscreen.vue']
+ },
+ {
+ demoId: 'mask',
+ name: {
+ 'zh-CN': '遮罩层1',
+ 'en-US': 'Mask layer one'
+ },
+ desc: {
+ 'zh-CN': '添加 `mask` 属性可以关闭遮罩层,默认值为 `true` 。
',
+ 'en-US': 'bAdd the `mask` attribute to turn off the mask layer. The default value is `true`.
'
+ },
+ codeFiles: ['mask.vue']
+ },
{
demoId: 'mask',
name: {
@@ -92,228 +130,5 @@ export default {
},
codeFiles: ['ellipsis.vue']
}
- ],
- apis: [
- {
- 'name': 'ActionSheet',
- 'type': 'component',
- 'props': [
- {
- 'name': 'custom-class',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义 class 样式',
- 'en-US': 'Customize the class style.'
- }
- },
- {
- 'name': 'flex',
- 'type': 'Boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '设置弹性布局,默认为 true',
- 'en-US': 'Sets the elastic layout. The default value is true.'
- }
- },
- {
- 'name': 'mask',
- 'type': 'Boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否显示遮罩层,默认值为 true',
- 'en-US': 'Indicates whether to display the mask layer. The default value is true.'
- },
- 'demoId': 'mask'
- },
- {
- 'name': 'mask-closable',
- 'type': 'Boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '单击遮罩层是否关闭弹窗,默认值为 true',
- 'en-US':
- 'Indicates whether to close the pop-up window when you click the mask layer. The default value is true.'
- },
- 'demoId': 'mask-event'
- },
- {
- 'name': 'menus',
- 'type': 'Array',
- 'defaultValue': '[]',
- 'desc': {
- 'zh-CN': '操作列表,设置 type 为 action 启用操作列表模式时有效。',
- 'en-US': 'Operation list. This parameter is valid only when type is set to action.'
- },
- 'demoId': 'action'
- },
- {
- 'name': 'show-footer',
- 'type': 'Boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否显示底部,默认值为 false',
- 'en-US': 'Indicates whether to display the bottom. The default value is false.'
- },
- 'demoId': 'show'
- },
- {
- 'name': 'show-header',
- 'type': 'Boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否显示头部,默认值为 true',
- 'en-US': 'Indicates whether to display the header. The default value is true.'
- },
- 'demoId': 'show'
- },
- {
- 'name': 'title',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '面板标题',
- 'en-US': 'Panel Title'
- },
- 'demoId': 'actoin'
- },
- {
- 'name': 'type',
- 'type': 'Array[string]',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置 type 为 action 启用操作列表模式',
- 'en-US': 'Set type to action to enable the operation list mode.'
- },
- 'demoId': 'action'
- },
- {
- 'name': 'v-model',
- 'type': 'Number | String | Array',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '双向数据绑定',
- 'en-US': 'bidirectional data binding'
- }
- },
- {
- 'name': 'visible',
- 'type': 'Boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '是否弹出面板',
- 'en-US': 'Indicates whether to display the panel.'
- }
- }
- ],
- 'methods': [
- {
- 'name': 'actionSelectOption',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '选择列表项,设置 type 为 action 启用操作列表模式时有效',
- 'en-US':
- 'Select a list item and set type to action. This parameter is valid only when the operation list mode is enabled.'
- }
- },
- {
- 'name': 'close',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '关闭面板',
- 'en-US': 'Close the panel.'
- },
- 'demoId': 'action'
- }
- ],
- 'events': [
- {
- 'name': 'click',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点击列表选项时触发,设置 type 为 action 启用操作列表模式时有效。',
- 'en-US':
- 'This event is triggered when a list option is clicked. This event is valid only when type is set to action and the operation list mode is enabled.'
- },
- 'demoId': 'action'
- },
- {
- 'name': 'close',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '关闭面板时触发的事件。',
- 'en-US': 'Event triggered when a panel is closed.'
- },
- 'demoId': 'action'
- },
- {
- 'name': 'confirm',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点击底部按钮时触发,设置 show-footer 为 true 时有效。',
- 'en-US':
- 'This event is triggered when the bottom button is clicked. It is valid only when show-footer is set to true.'
- }
- },
- {
- 'name': 'update:visible',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '面板显示或隐藏时触发',
- 'en-US': 'riggered when the panel is displayed or hidden'
- },
- 'demoId': 'slot'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '组件默认插槽,设置 type 为 action 启用操作列表模式会提供参数 data 列表项和 index 列表索引。',
- 'en-US':
- 'Component default slot. Set type to action to enable the operation list mode. The parameter data list item and index list index are provided.'
- },
- 'demoId': 'slot'
- },
- {
- 'name': 'footer',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '底部插槽,设置 show-footer 为 true 时有效',
- 'en-US': 'Bottom slot. This parameter is valid only when show-footer is set to true.'
- },
- 'demoId': 'slot'
- },
- {
- 'name': 'header-left',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '头部左侧插槽,设置 show-header 为 true 时有效',
- 'en-US': 'Slot on the left of the header. This parameter is valid only when show-header is set to true.'
- },
- 'demoId': 'slot'
- },
- {
- 'name': 'header-right ',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '头部右侧插槽,设置 show-header 为 true 时有效',
- 'en-US': 'Slot on the right of the header. This parameter is valid only when show-header is set to true.'
- },
- 'demoId': 'slot'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile-first/app/alert/webdoc/alert.js b/examples/sites/demos/mobile-first/app/alert/webdoc/alert.js
index c92e644a7..f4748515e 100644
--- a/examples/sites/demos/mobile-first/app/alert/webdoc/alert.js
+++ b/examples/sites/demos/mobile-first/app/alert/webdoc/alert.js
@@ -1,7 +1,8 @@
export default {
column: '2',
owner: '',
- demos: [{
+ demos: [
+ {
demoId: 'type',
name: {
'zh-CN': '类型',
@@ -9,7 +10,8 @@ export default {
},
desc: {
'zh-CN': '通过type
设置不同的类型。可选值:success、warning、info、error,默认值:info 。
',
- 'en-US': 'Use type
to set different types. The options are success, warning, info, and error. The default value is info.
'
+ 'en-US':
+ 'Use type
to set different types. The options are success, warning, info, and error. The default value is info.
'
},
codeFiles: ['type.vue']
},
@@ -21,7 +23,8 @@ export default {
},
desc: {
'zh-CN': '通过 size
属性设置不同的尺寸,可选值:nomal、large,默认值:nomal 。
',
- 'en-US': 'Use the size
attribute to set different sizes. The options are nomal and large. The default value is nomal.
'
+ 'en-US':
+ 'Use the size
attribute to set different sizes. The options are nomal and large. The default value is nomal.
'
},
codeFiles: ['size.vue']
},
@@ -32,8 +35,10 @@ export default {
'en-US': 'Custom Title'
},
desc: {
- 'zh-CN': '当 size
为 large 时显示标题,可设置 title
或 slot
自定义标题。默认标题根据设置的 type
显示。
',
- 'en-US': 'When size
is set to large, the title is displayed. You can set title
or slot
to customize the title. The default title is displayed according to the set type
.
'
+ 'zh-CN':
+ '当 size
为 large 时显示标题,可设置 title
或 slot
自定义标题。默认标题根据设置的 type
显示。
',
+ 'en-US':
+ 'When size
is set to large, the title is displayed. You can set title
or slot
to customize the title. The default title is displayed according to the set type
.
'
},
codeFiles: ['title.vue']
},
@@ -57,7 +62,8 @@ export default {
},
desc: {
'zh-CN': '通过 closable
属性可设置是否显示关闭按钮,没有关闭按钮,警告框将不可关闭。
',
- 'en-US': 'The closable
attribute can be used to set whether to display the Close button. If there is no Close button, the Warning dialog box cannot be closed.
'
+ 'en-US':
+ 'The closable
attribute can be used to set whether to display the Close button. If there is no Close button, the Warning dialog box cannot be closed.
'
},
codeFiles: ['closable.vue']
},
@@ -104,8 +110,10 @@ export default {
'en-US': 'Form submission result feedback'
},
desc: {
- 'zh-CN': '当 size
为 large 时,属性 description
和默认插槽结合使用,可渲染提交反馈界面。
',
- 'en-US': 'When size
is set to large, the description
attribute is used together with the default slot to render the submission feedback interface.
'
+ 'zh-CN':
+ '当 size
为 large 时,属性 description
和默认插槽结合使用,可渲染提交反馈界面。
',
+ 'en-US':
+ 'When size
is set to large, the description
attribute is used together with the default slot to render the submission feedback interface.
'
},
codeFiles: ['feedback-of-result.vue']
},
@@ -128,8 +136,10 @@ export default {
'en-US': 'Collapsible Style with Title'
},
desc: {
- 'zh-CN': '通过 `flex-basis` 属性可以设置内容插槽的宽度,flex-basis 类型为数组,最多能传入 4 个值,支持百分比,固定宽度及固有的尺寸关键词,默认为 auto,详情见 flex 的 flex-basis 属性。
通过设置`flex-grow`属性可以设置每一项在 flex 容器中分配剩余空间的相对比例,默认为 1。如果不想自动撑满主容器,可以设为 0,详情见 flex 的 flex-grow 属性。
flex-grow 举例:`:flex-grow="[0, 0]" :flex-grow="[2, 1]" :flex-grow="[2, 1,1,1]"`
flex-basis 举例:`:flex-basis="["200px", "100px","300px"]" :flex-basis="["75%", "25%"]" :flex-basis="["40%", "20%", "20%", "20%"]"`
',
- 'en-US': 'The `flex-basis` attribute can be used to set the width of the content slot. The flex-basis type is an array. A maximum of four values can be transferred. The percentage, fixed width, and inherent size keywords are supported. The default value is auto. For details, see the flex-basis attribute of Flex.
You can set the relative proportion of the remaining space allocated to each item in the flex container by setting the `flex-grow` attribute. The default value is 1. If you do not want to automatically fill the main container, set this parameter to 0. For details, see the flex-grow attribute of flex.
Flex-grow Example: `:flex-grow="[0, 0]" :flex-grow="[2, 1]" :flex-grow="[2, 1,1,1]"`
flex-basis Example: `:flex-basis="["200px", "100px","300px"]" :flex-basis="["75%", "25%"]" :flex-basis="["40%", "20%", "20%", "20%"]"`
'
+ 'zh-CN':
+ '通过 `flex-basis` 属性可以设置内容插槽的宽度,flex-basis 类型为数组,最多能传入 4 个值,支持百分比,固定宽度及固有的尺寸关键词,默认为 auto,详情见 flex 的 flex-basis 属性。
通过设置`flex-grow`属性可以设置每一项在 flex 容器中分配剩余空间的相对比例,默认为 1。如果不想自动撑满主容器,可以设为 0,详情见 flex 的 flex-grow 属性。
flex-grow 举例:`:flex-grow="[0, 0]" :flex-grow="[2, 1]" :flex-grow="[2, 1,1,1]"`
flex-basis 举例:`:flex-basis="["200px", "100px","300px"]" :flex-basis="["75%", "25%"]" :flex-basis="["40%", "20%", "20%", "20%"]"`
',
+ 'en-US':
+ 'The `flex-basis` attribute can be used to set the width of the content slot. The flex-basis type is an array. A maximum of four values can be transferred. The percentage, fixed width, and inherent size keywords are supported. The default value is auto. For details, see the flex-basis attribute of Flex.
You can set the relative proportion of the remaining space allocated to each item in the flex container by setting the `flex-grow` attribute. The default value is 1. If you do not want to automatically fill the main container, set this parameter to 0. For details, see the flex-grow attribute of flex.
Flex-grow Example: `:flex-grow="[0, 0]" :flex-grow="[2, 1]" :flex-grow="[2, 1,1,1]"`
flex-basis Example: `:flex-basis="["200px", "100px","300px"]" :flex-basis="["75%", "25%"]" :flex-basis="["40%", "20%", "20%", "20%"]"`
'
},
codeFiles: ['show-foldable.vue']
},
@@ -145,51 +155,5 @@ export default {
},
codeFiles: ['custom-class.vue']
}
- ],
- apis: [{
- 'name': 'Alert',
- 'type': 'component',
- 'props': [{
- 'name': 'scrolling',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '是否开启描述文字在鼠标 hover 时滚动显示的动画。',
- 'en-US': 'Indicates whether to enable the animation of the description text scrolling when the mouse hovers.'
- },
- 'demoId': ''
- },
- {
- 'name': 'show-foldable',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '展示带标题可折叠样式。',
- 'en-US': 'Shows collapsible styles with titles.'
- },
- 'demoId': ''
- },
- {
- 'name': 'single-line',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '描述内容是否一行显示,超出显示...,默认值为 false。',
- 'en-US': 'Indicates whether the description is displayed in one line. The default value is false.'
- },
- 'demoId': ''
- }
- ],
- 'events': [{
- 'name': 'handleHeaderClick',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '标题点击事件,设置 show-foldable 为 true 时有效。',
- 'en-US': 'Title click event. This parameter is valid only when show-foldable is set to true.'
- },
- 'demoId': ''
- }],
- 'slots': []
- }]
-}
\ No newline at end of file
+ ]
+}
diff --git a/examples/sites/demos/mobile-first/app/amount/amount-disable.vue b/examples/sites/demos/mobile-first/app/amount/amount-disable.vue
new file mode 100644
index 000000000..ba442d3e1
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/amount-disable.vue
@@ -0,0 +1,28 @@
+
+
+ 启用/禁用
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/amount/basic-usage.vue b/examples/sites/demos/mobile-first/app/amount/basic-usage.vue
new file mode 100644
index 000000000..607aeb358
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/basic-usage.vue
@@ -0,0 +1,18 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/amount/custom-currency.vue b/examples/sites/demos/mobile-first/app/amount/custom-currency.vue
new file mode 100644
index 000000000..48277dbcd
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/custom-currency.vue
@@ -0,0 +1,18 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/amount/custom-service.vue b/examples/sites/demos/mobile-first/app/amount/custom-service.vue
new file mode 100644
index 000000000..eb7636493
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/custom-service.vue
@@ -0,0 +1,31 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/amount/date-allow-empty.vue b/examples/sites/demos/mobile-first/app/amount/date-allow-empty.vue
new file mode 100644
index 000000000..6563b4620
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/date-allow-empty.vue
@@ -0,0 +1,27 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/amount/digits-maxlen.vue b/examples/sites/demos/mobile-first/app/amount/digits-maxlen.vue
new file mode 100644
index 000000000..c608f28a5
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/digits-maxlen.vue
@@ -0,0 +1,23 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/amount/display-only.vue b/examples/sites/demos/mobile-first/app/amount/display-only.vue
new file mode 100644
index 000000000..7f3b91867
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/display-only.vue
@@ -0,0 +1,18 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/amount/filter-box.vue b/examples/sites/demos/mobile-first/app/amount/filter-box.vue
new file mode 100644
index 000000000..60826a431
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/filter-box.vue
@@ -0,0 +1,18 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/amount/filter-event.vue b/examples/sites/demos/mobile-first/app/amount/filter-event.vue
new file mode 100644
index 000000000..8833ae8fe
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/filter-event.vue
@@ -0,0 +1,34 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/amount/filter.vue b/examples/sites/demos/mobile-first/app/amount/filter.vue
new file mode 100644
index 000000000..c4c5aced6
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/filter.vue
@@ -0,0 +1,18 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/amount/format.vue b/examples/sites/demos/mobile-first/app/amount/format.vue
new file mode 100644
index 000000000..5efb06de0
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/format.vue
@@ -0,0 +1,29 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/amount/hide-currency.vue b/examples/sites/demos/mobile-first/app/amount/hide-currency.vue
new file mode 100644
index 000000000..45b6cbbda
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/hide-currency.vue
@@ -0,0 +1,18 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/amount/hide-icon.vue b/examples/sites/demos/mobile-first/app/amount/hide-icon.vue
new file mode 100644
index 000000000..d42902cc8
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/hide-icon.vue
@@ -0,0 +1,18 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/amount/hold-zero.vue b/examples/sites/demos/mobile-first/app/amount/hold-zero.vue
new file mode 100644
index 000000000..bca748fbe
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/hold-zero.vue
@@ -0,0 +1,30 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/amount/negative.vue b/examples/sites/demos/mobile-first/app/amount/negative.vue
new file mode 100644
index 000000000..21e5d6db3
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/negative.vue
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/amount/num-allow-empty.vue b/examples/sites/demos/mobile-first/app/amount/num-allow-empty.vue
new file mode 100644
index 000000000..883acb2a0
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/num-allow-empty.vue
@@ -0,0 +1,29 @@
+
+
+
+ 可清空时,清空输入框后,返回值为:{{ value1 }}
+
+
+
+
+ 默认情况,清空输入框后,返回值为:{{ value2 }}
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/amount/pop-up.vue b/examples/sites/demos/mobile-first/app/amount/pop-up.vue
new file mode 100644
index 000000000..e8eb88deb
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/pop-up.vue
@@ -0,0 +1,18 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/amount/set-date.vue b/examples/sites/demos/mobile-first/app/amount/set-date.vue
new file mode 100644
index 000000000..5d7b13369
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/set-date.vue
@@ -0,0 +1,27 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/amount/size.vue b/examples/sites/demos/mobile-first/app/amount/size.vue
new file mode 100644
index 000000000..93d4b057a
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/size.vue
@@ -0,0 +1,19 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/amount/string-mode.vue b/examples/sites/demos/mobile-first/app/amount/string-mode.vue
new file mode 100644
index 000000000..5030b5005
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/string-mode.vue
@@ -0,0 +1,36 @@
+
+
+
+ {{ value }}
+
+
+
+
+
+ 负值高精度: {{ value1 }}
+
+
+
+
+ 通过negative设置不支持负值: {{ value2 }}
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/amount/webdoc/amount.cn.md b/examples/sites/demos/mobile-first/app/amount/webdoc/amount.cn.md
new file mode 100644
index 000000000..2d3814e2a
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/webdoc/amount.cn.md
@@ -0,0 +1,9 @@
+---
+title: Amount 金额
+---
+
+# Amount 金额
+
+
+用于处理货币、金额和相关时间,选择货币类型并填写数目和时间,也可以通过设定服务,自定义货币类型。
+
diff --git a/examples/sites/demos/mobile-first/app/amount/webdoc/amount.en.md b/examples/sites/demos/mobile-first/app/amount/webdoc/amount.en.md
new file mode 100644
index 000000000..2d3814e2a
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/webdoc/amount.en.md
@@ -0,0 +1,9 @@
+---
+title: Amount 金额
+---
+
+# Amount 金额
+
+
+用于处理货币、金额和相关时间,选择货币类型并填写数目和时间,也可以通过设定服务,自定义货币类型。
+
diff --git a/examples/sites/demos/mobile-first/app/amount/webdoc/amount.js b/examples/sites/demos/mobile-first/app/amount/webdoc/amount.js
new file mode 100644
index 000000000..797527ea8
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/amount/webdoc/amount.js
@@ -0,0 +1,261 @@
+export default {
+ column: '2',
+ owner: '',
+ demos: [
+ {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example '
+ },
+ codeFiles: ['basic-usage.vue']
+ },
+ {
+ demoId: 'set-date',
+ name: {
+ 'zh-CN': '设置日期',
+ 'en-US': 'Set Date'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 date
属性设置日期后,将会在金额组件中显示日期框。值可设置为 string 或者 Date() 类型。\n通过 change
获取改变后的值。
\n',
+ 'en-US':
+ 'After the date is set through the date
attribute, the date box is displayed in the amount component. The value can be of the string or Date() type. \n Obtain the changed value through change
.
\n'
+ },
+ codeFiles: ['set-date.vue']
+ },
+ {
+ demoId: 'date-allow-empty',
+ name: {
+ 'zh-CN': '允许日期为空',
+ 'en-US': 'Set Date'
+ },
+ desc: {
+ 'zh-CN':
+ '为了避免 date
属性初始值为空值时,日期框不显示的问题,可通过 date-allow-empty
属性允许date
为空值时,日期框也能显示。',
+ 'en-US':
+ 'After the date is set through the date
attribute, the date box is displayed in the amount component. The value can be of the string or Date() type. \n Obtain the changed value through change
.
\n'
+ },
+ codeFiles: ['date-allow-empty.vue']
+ },
+ {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '编辑框大小',
+ 'en-US': 'editing box size'
+ },
+ desc: {
+ 'zh-CN': '可选择的类型:medium
,small
,mini
\n',
+ 'en-US': 'The options are as follows:medium
,small
, mini
\n'
+ },
+ codeFiles: ['size.vue']
+ },
+ {
+ demoId: 'custom-currency',
+ name: {
+ 'zh-CN': '指定币种',
+ 'en-US': 'Specified Currency'
+ },
+ desc: {
+ 'zh-CN':
+ '默认显示币种为 CNY,可通过 currency
指定需要的币种,若指定的币种在返回的服务数据中不存在,则币种下拉框将不显示该币种。
\n',
+ 'en-US':
+ 'The default currency is CNY. You can use currency
to specify the currency. If the specified currency does not exist in the returned service data, the currency is not displayed in the Currency drop-down list box.
\n'
+ },
+ codeFiles: ['custom-currency.vue']
+ },
+ {
+ demoId: 'digits-maxlen',
+ name: {
+ 'zh-CN': '金额设置',
+ 'en-US': 'Amount Setting'
+ },
+ desc: {
+ 'zh-CN':
+ '设置 digits
属性可指定金额小数位数,默认为 2 位。设置 max-len
属性指定整数位最大可输入长度,默认为 15 位。
\n',
+ 'en-US':
+ 'Set the digits
attribute to specify the number of decimal places of the amount. The default value is 2. Set the max-len
attribute to specify the maximum length of an integer. The default value is 15.
\n'
+ },
+ codeFiles: ['digits-maxlen.vue']
+ },
+ {
+ demoId: 'format',
+ name: {
+ 'zh-CN': '格式化',
+ 'en-US': 'Amount Setting'
+ },
+ desc: {
+ 'zh-CN': '通过 format
属性可设置金额的展示与精度等。',
+ 'en-US':
+ 'Set the digits
attribute to specify the number of decimal places of the amount. The default value is 2. Set the max-len
attribute to specify the maximum length of an integer. The default value is 15.
\n'
+ },
+ codeFiles: ['format.vue']
+ },
+ {
+ demoId: 'custom-service',
+ name: {
+ 'zh-CN': '自定义服务',
+ 'en-US': 'Custom Service '
+ },
+ desc: {
+ 'zh-CN':
+ 'fetchCurrency
指定自定义服务,fields
可指定显示字段和值设置在服务数据中的字段映射。
\n',
+ 'en-US':
+ 'fetchCurrency
specifies the custom service. fields
can specify the field mapping of the display field and value settings in the service data.
\n'
+ },
+ codeFiles: ['custom-service.vue']
+ },
+ {
+ demoId: 'amount-disable',
+ name: {
+ 'zh-CN': '禁用',
+ 'en-US': 'Disable'
+ },
+ desc: {
+ 'zh-CN': '通过 disabled
配置 Amount 组件禁用。
\n',
+ 'en-US': 'You can disable the Amount component by using disabled
.
\n'
+ },
+ codeFiles: ['amount-disable.vue']
+ },
+ {
+ demoId: 'hide-currency',
+ name: {
+ 'zh-CN': '隐藏币种',
+ 'en-US': 'Disable'
+ },
+ desc: {
+ 'zh-CN': '通过 `hide-currency` 属性可设置隐藏币种。该属性默认为 `false`。',
+ 'en-US': 'You can disable the Amount component by using disabled
.
\n'
+ },
+ codeFiles: ['hide-currency.vue']
+ },
+ {
+ demoId: 'hide-icon',
+ name: {
+ 'zh-CN': '隐藏金额图标',
+ 'en-US': 'Disable'
+ },
+ desc: {
+ 'zh-CN': '通过 `hide-icon` 属性可设置隐藏金额图标。该属性默认为 `false`。',
+ 'en-US': 'You can disable the Amount component by using disabled
.
\n'
+ },
+ codeFiles: ['hide-icon.vue']
+ },
+ {
+ demoId: 'negative',
+ name: {
+ 'zh-CN': '支持负值',
+ 'en-US': 'Disable'
+ },
+ desc: {
+ 'zh-CN': '设置 `negative` 属性可指定金额是否支持负值。类型为 `Boolean` 。默认为 `true`,表示支持负值。',
+ 'en-US': 'You can disable the Amount component by using disabled
.
\n'
+ },
+ codeFiles: ['negative.vue']
+ },
+ {
+ demoId: 'num-allow-empty',
+ name: {
+ 'zh-CN': '可清空输入',
+ 'en-US': 'Disable'
+ },
+ desc: {
+ 'zh-CN':
+ '可通过 `num-allow-empty` 属性设置金额组件内容的可清空特性。默认为 `false`,表示不可清空。 不可清空时,当输入值为空或清空内容区时,传入值为 0',
+ 'en-US': 'You can disable the Amount component by using disabled
.
\n'
+ },
+ codeFiles: ['num-allow-empty.vue']
+ },
+ {
+ demoId: 'hold-zero',
+ name: {
+ 'zh-CN': '精度细化',
+ 'en-US': 'Disable'
+ },
+ desc: {
+ 'zh-CN':
+ '通过设置`hold-zero`属性实现精度细化,默认为 true,当为 false 时, 输入框获得焦点时的显示与 v-model 绑定的值会去掉格式化后多于的 0 字附,如 0.100 显示 为 0.1',
+ 'en-US': 'You can disable the Amount component by using disabled
.
\n'
+ },
+ codeFiles: ['hold-zero.vue']
+ },
+ {
+ demoId: 'display-only',
+ name: {
+ 'zh-CN': '只读',
+ 'en-US': 'Disable'
+ },
+ desc: {
+ 'zh-CN': '通过设置`display-only`属性实现只读状态',
+ 'en-US': 'You can disable the Amount component by using disabled
.
\n'
+ },
+ codeFiles: ['display-only.vue']
+ },
+ {
+ demoId: 'pop-up',
+ name: {
+ 'zh-CN': '隐藏币种转换弹窗',
+ 'en-US': 'Disable'
+ },
+ desc: {
+ 'zh-CN': '通过设置`pop-up`属性实现币种转换弹窗隐藏,默认值为`true`',
+ 'en-US': 'You can disable the Amount component by using disabled
.
\n'
+ },
+ codeFiles: ['pop-up.vue']
+ },
+ {
+ demoId: 'string-mode',
+ name: {
+ 'zh-CN': '高精度',
+ 'en-US': 'Disable'
+ },
+ desc: {
+ 'zh-CN':
+ '当 JS 默认的 Number 不满足数字的长度与精度需求时,可以打开 string-mode 开关,同时绑定的数据传入字符串格式\n :::tip 提示\n 由于 IE 不支持 BigInt 类型数据,在配置 string-mode 为 true 时,高精度的数据在 IE 下点击加减按钮不能正常响应,需要将 [bignumber.js](https://github.com/MikeMcl/bignumber.js/) 以插件方式传给 plugin 参数\n :::',
+ 'en-US': 'You can disable the Amount component by using disabled
.
\n'
+ },
+ codeFiles: ['string-mode.vue']
+ },
+ {
+ demoId: 'filter',
+ name: {
+ 'zh-CN': '过滤器模式',
+ 'en-US': 'Disable'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 `shape="filter"` 切换至过滤器模式。 过滤器模式下可传入 `label` 显示标题,`tip` 显示提示信息,`clearable` 是否显示清除按钮,默认值为`true`。',
+ 'en-US': 'You can disable the Amount component by using disabled
.
\n'
+ },
+ codeFiles: ['filter.vue']
+ },
+ {
+ demoId: 'filter-box',
+ name: {
+ 'zh-CN': '过滤器模式筛选框',
+ 'en-US': 'Disable'
+ },
+ desc: {
+ 'zh-CN': '通过`filter`属性展示筛选框。',
+ 'en-US': 'You can disable the Amount component by using disabled
.
\n'
+ },
+ codeFiles: ['filter-box.vue']
+ },
+ {
+ demoId: 'filter-event',
+ name: {
+ 'zh-CN': '过滤器模式事件',
+ 'en-US': 'Disable'
+ },
+ desc: {
+ 'zh-CN': '过滤器模式下点击关闭图标,触发`clear`事件,通过点击筛选框触发`filter-change`事件',
+ 'en-US': 'You can disable the Amount component by using disabled
.
\n'
+ },
+ codeFiles: ['filter-event.vue']
+ }
+ ]
+}
diff --git a/examples/sites/demos/mobile-first/app/badge/webdoc/badge.js b/examples/sites/demos/mobile-first/app/badge/webdoc/badge.js
index fb11caa46..3bbd85b5e 100644
--- a/examples/sites/demos/mobile-first/app/badge/webdoc/badge.js
+++ b/examples/sites/demos/mobile-first/app/badge/webdoc/badge.js
@@ -22,7 +22,8 @@ export default {
},
desc: {
'zh-CN': '`type` 设置显示主题,可选值:danger(默认)、primary、success、warning、info
',
- 'en-US': '`type`Set the display theme. The options are danger (default), primary, success, warning, and info.
'
+ 'en-US':
+ '`type`Set the display theme. The options are danger (default), primary, success, warning, and info.
'
},
codeFiles: ['type.vue']
},
@@ -34,7 +35,8 @@ export default {
},
desc: {
'zh-CN': '`show-left` 设置是否向左展示,仅对圆点生效
',
- 'en-US': '`show-left` Sets whether to display the dots to the left. This parameter is valid only for dots.
'
+ 'en-US':
+ '`show-left` Sets whether to display the dots to the left. This parameter is valid only for dots.
'
},
codeFiles: ['type-left.vue']
},
@@ -122,23 +124,5 @@ export default {
},
codeFiles: ['props-content.vue']
}
- ],
- apis: [
- {
- 'name': 'Badge',
- 'type': 'component',
- 'props': [
- {
- 'name': 'show-Left',
- 'type': 'Boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置是否向左展示,仅对圆点生效。',
- 'en-US': 'Indicates whether to display the dots to the left. This parameter is valid only for dots.'
- },
- 'demoId': 'type-left'
- },
- ]
- },
]
}
diff --git a/examples/sites/demos/mobile-first/app/button-group/webdoc/button-group.js b/examples/sites/demos/mobile-first/app/button-group/webdoc/button-group.js
index a358c3215..9879cd9a2 100644
--- a/examples/sites/demos/mobile-first/app/button-group/webdoc/button-group.js
+++ b/examples/sites/demos/mobile-first/app/button-group/webdoc/button-group.js
@@ -53,6 +53,5 @@ export default {
},
codeFiles: ['enumeration.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/button/base-saas.vue b/examples/sites/demos/mobile-first/app/button/base-saas.vue
deleted file mode 100644
index 966ead566..000000000
--- a/examples/sites/demos/mobile-first/app/button/base-saas.vue
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
- 默认按钮
- 主要按钮
- 成功按钮
- 信息按钮
- 警告按钮
- 危险按钮
-
-
- 朴素按钮
- 主要按钮
- 成功按钮
- 信息按钮
- 警告按钮
- 危险按钮
-
-
-
-
-
-
-
diff --git a/examples/sites/demos/mobile-first/app/button/base.vue b/examples/sites/demos/mobile-first/app/button/basic-usage.vue
similarity index 100%
rename from examples/sites/demos/mobile-first/app/button/base.vue
rename to examples/sites/demos/mobile-first/app/button/basic-usage.vue
diff --git a/examples/sites/demos/mobile-first/app/button/image.vue b/examples/sites/demos/mobile-first/app/button/image.vue
index 4ae2ceb83..8f129456a 100644
--- a/examples/sites/demos/mobile-first/app/button/image.vue
+++ b/examples/sites/demos/mobile-first/app/button/image.vue
@@ -14,7 +14,7 @@ export default {
},
data() {
return {
- image: '/static/images/hae-logo.png'
+ image: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/hae-logo.png`
}
}
}
diff --git a/examples/sites/demos/mobile-first/app/button/slot-default.vue b/examples/sites/demos/mobile-first/app/button/slot-default.vue
index 44b42031e..6804ef93c 100644
--- a/examples/sites/demos/mobile-first/app/button/slot-default.vue
+++ b/examples/sites/demos/mobile-first/app/button/slot-default.vue
@@ -23,7 +23,7 @@ export default {
},
data() {
return {
- image: '/static/images/hae-logo.png'
+ image: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/hae-logo.png`
}
}
}
diff --git a/examples/sites/demos/mobile-first/app/button/webdoc/button.js b/examples/sites/demos/mobile-first/app/button/webdoc/button.js
index 291c49a51..706e9ea45 100644
--- a/examples/sites/demos/mobile-first/app/button/webdoc/button.js
+++ b/examples/sites/demos/mobile-first/app/button/webdoc/button.js
@@ -3,16 +3,16 @@ export default {
owner: '',
demos: [
{
- demoId: 'click',
+ demoId: 'basic-usage',
name: {
- 'zh-CN': '默认按钮',
+ 'zh-CN': '基本用法',
'en-US': 'basic usage'
},
desc: {
- 'zh-CN': '按钮的单击事件,该示例中单击按钮将会出现提示信息
',
- 'en-US': 'Click event of a button. In this example, a message is displayed when a button is clicked.
'
+ 'zh-CN': '',
+ 'en-US': ''
},
- codeFiles: ['click.vue']
+ codeFiles: ['basic-usage.vue']
},
{
demoId: 'text',
@@ -121,12 +121,12 @@ export default {
{
demoId: 'click',
name: {
- 'zh-CN': '事件',
- 'en-US': 'events'
+ 'zh-CN': '点击事件',
+ 'en-US': 'basic usage'
},
desc: {
- 'zh-CN': '按钮的单击事件,该示例中单击按钮将会出现提示信息。
',
- 'en-US': '
Click event of a button. In this example, a message is displayed when a button is clicked
'
+ 'zh-CN': '按钮的单击事件,该示例中单击按钮将会出现提示信息
',
+ 'en-US': 'Click event of a button. In this example, a message is displayed when a button is clicked.
'
},
codeFiles: ['click.vue']
},
@@ -202,40 +202,5 @@ export default {
},
codeFiles: ['round.vue']
}
- ],
- apis: [
- {
- 'name': 'Button',
- 'type': 'component',
- 'props': [
- {
- 'name': 'banner ',
- 'type': 'Boolean',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置通栏按钮', 'en-US': 'Setting the bar button' },
- 'demoId': 'banner'
- },
- {
- 'name': 'custom-class',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置 custom-class 属性定制按钮样式',
- 'en-US': 'Set the custom-class attribute to customize the button style'
- },
- 'demoId': 'button-class'
- },
- {
- 'name': 'href',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '通过设置 href 属性可跳转到指定页面',
- 'en-US': 'Set the href attribute to jump to a specified page'
- },
- 'demoId': 'link'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile-first/app/calendar-bar/render-today.vue b/examples/sites/demos/mobile-first/app/calendar-bar/render-today.vue
index f95412b01..2d037790e 100644
--- a/examples/sites/demos/mobile-first/app/calendar-bar/render-today.vue
+++ b/examples/sites/demos/mobile-first/app/calendar-bar/render-today.vue
@@ -11,7 +11,7 @@ export default {
},
data() {
return {
- value: '2022-12-18',
+ value: new Date().toLocaleDateString(),
config: {
renderItem: this.renderItem
}
diff --git a/examples/sites/demos/mobile-first/app/calendar-bar/webdoc/calendar-bar.js b/examples/sites/demos/mobile-first/app/calendar-bar/webdoc/calendar-bar.js
index 1ed700764..9cf42ff78 100644
--- a/examples/sites/demos/mobile-first/app/calendar-bar/webdoc/calendar-bar.js
+++ b/examples/sites/demos/mobile-first/app/calendar-bar/webdoc/calendar-bar.js
@@ -36,14 +36,10 @@ export default {
'en-US': 'Date Marker'
},
desc: {
- 'zh-CN': `使用 config.mark
配置一个方法,用于判断参数日期是否存在标记。
- 此方法返回空字符串表示不存在标记,返回非空字符串表示存在标记,且标记内容就是该字符串。
- 使用 config.markBackgroundColorClass
配置标记的颜色类名。
- 使用 config.showMarkMessage
配置是否开启标记 title
提示,默认值为 false
。
`,
- 'en-US': `Use config.mark
to configure a method to determine whether the parameter date has a mark.
- This method returns an empty string, indicating that the tag does not exist. A non-empty string is returned, indicating that the tag exists and the tag content is the string.
- Use config.markBackgroundColorClass
to configure the color class name of the tag.
- Use config.showMarkMessage
to configure whether to enable the flag title
prompt. The default value is false
.
`
+ 'zh-CN':
+ '使用 config.mark
配置一个方法,用于判断参数日期是否存在标记。
\n 此方法返回空字符串表示不存在标记,返回非空字符串表示存在标记,且标记内容就是该字符串。
\n 使用 config.markBackgroundColorClass
配置标记的颜色类名。
\n 使用 config.showMarkMessage
配置是否开启标记 title
提示,默认值为 false
。
',
+ 'en-US':
+ 'Use config.mark
to configure a method to determine whether the parameter date has a mark.
\n This method returns an empty string, indicating that the tag does not exist. A non-empty string is returned, indicating that the tag exists and the tag content is the string.
\n Use config.markBackgroundColorClass
to configure the color class name of the tag.
\n Use config.showMarkMessage
to configure whether to enable the flag title
prompt. The default value is false
.
'
},
codeFiles: ['marked.vue']
},
@@ -54,12 +50,10 @@ export default {
'en-US': 'Current Date'
},
desc: {
- 'zh-CN': `用户传入的日期为 当前日期
。
- 使用 config.currentColorClass
配置 当前日期
的字体颜色类名;
- 使用 config.currentBackgroundColorClass
配置 当前日期
的背景颜色类名。
`,
- 'en-US': `
The date transferred by the user is Current date
.
- Use config.currentColorClass
to configure the font color class name of Current Date
.
- Use config.currentBackgroundColorClass
to configure the background color class name of current date
.
`
+ 'zh-CN':
+ '用户传入的日期为 当前日期
。
\n 使用 config.currentColorClass
配置 当前日期
的字体颜色类名;
\n 使用 config.currentBackgroundColorClass
配置 当前日期
的背景颜色类名。
',
+ 'en-US':
+ '
The date transferred by the user is Current date
.
\n Use config.currentColorClass
to configure the font color class name of Current Date
.
\n Use config.currentBackgroundColorClass
to configure the background color class name of current date
.
'
},
codeFiles: ['render-current.vue']
},
@@ -97,14 +91,10 @@ export default {
'en-US': 'Workdays'
},
desc: {
- 'zh-CN': `用户传入的日期为 当前日期
,当前日期所在月份为 当前月份
,当前月份周六周日为 周末,非周六周日为 工作日。
- 使用 config.workday
配置一个方法,用于判断 工作日 是否作为真正的工作日;
- 使用 config.holiday
配置一个方法,用于判断 周末 是否作为真正的周末;
- 使用 config.workdayColorClass 和 config.holidayColorClass
配置工作日和周末的字体颜色类。
`,
- 'en-US': `
The date transferred by the user is Current Date
, and the month to which the current date belongs is Current Month
. Saturday and Sunday of the current month are weekends, and non-Saturday and Sunday are workdays.
- Use config.workday
to configure a method to determine whether a workday is a real workday.
- Use config.holiday
to configure a method to determine whether a weekend is a real weekend.
- Use config.workdayColorClass and config.holidayColorClass
to configure the font color classes for weekdays and weekends.
`
+ 'zh-CN':
+ '用户传入的日期为 当前日期
,当前日期所在月份为 当前月份
,当前月份周六周日为 周末,非周六周日为 工作日。
\n 使用 config.workday
配置一个方法,用于判断 工作日 是否作为真正的工作日;
\n 使用 config.holiday
配置一个方法,用于判断 周末 是否作为真正的周末;
\n 使用 config.workdayColorClass 和 config.holidayColorClass
配置工作日和周末的字体颜色类。
',
+ 'en-US':
+ '
The date transferred by the user is Current Date
, and the month to which the current date belongs is Current Month
. Saturday and Sunday of the current month are weekends, and non-Saturday and Sunday are workdays.
\n Use config.workday
to configure a method to determine whether a workday is a real workday.
\n Use config.holiday
to configure a method to determine whether a weekend is a real weekend.
\n Use config.workdayColorClass and config.holidayColorClass
to configure the font color classes for weekdays and weekends.
'
},
codeFiles: ['workday.vue']
},
@@ -115,7 +105,7 @@ export default {
'en-US': 'Expand Collapse Events'
},
desc: {
- 'zh-CN': `日历栏展开或收起时触发的事件;事件参数为 true 时代表展开状态,反之为收起状态。
`,
+ 'zh-CN': '
日历栏展开或收起时触发的事件;事件参数为 true 时代表展开状态,反之为收起状态。
',
'en-US':
'
Event triggered when the calendar bar is expanded or collapsed; If the event parameter is set to true, the event is expanded. Otherwise, the event is collapsed.
'
},
@@ -128,52 +118,12 @@ export default {
'en-US': 'Year and month selected location'
},
desc: {
- 'zh-CN': `使用 cascaderPosition 属性可以改变年月选择的位置;可选值为:start | center | end
默认值为center
`,
+ 'zh-CN':
+ '
使用 cascaderPosition 属性可以改变年月选择的位置;可选值为:start | center | end
默认值为center
',
'en-US':
'
You can use the cascaderPosition attribute to change the location of the year and month. The options are as follows: start | center | end
The default value is center
'
},
codeFiles: ['cascader-position.vue']
}
- ],
- apis: [
- {
- 'name': 'calendarBar',
- 'type': 'component',
- 'props': [
- {
- 'name': 'cascaderPosition',
- 'type': 'Object',
- 'defaultValue': '{}',
- 'desc': { 'zh-CN': '改变年月选择的位置', 'en-US': 'Change the location of the year and month selection' },
- 'demoId': 'cascader-position'
- },
- {
- 'name': 'config',
- 'type': 'Object',
- 'defaultValue': '{}',
- 'desc': { 'zh-CN': '传入用户日期配置信息', 'en-US': 'Transfer the user date configuration information.' },
- 'demoId': 'marked'
- },
- {
- 'name': 'v-model',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '数据绑定', 'en-US': 'Data Binding' },
- 'demoId': 'marked'
- }
- ],
- 'methods': [
- {
- 'name': 'expand',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '日历栏展开或收起时触发的事件',
- 'en-US': 'Event triggered when the calendar bar expands or collapses'
- },
- 'demoId': 'expand'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile-first/app/calendar-view/basic-usage.vue b/examples/sites/demos/mobile-first/app/calendar-view/basic-usage.vue
new file mode 100644
index 000000000..a66eefe1e
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/calendar-view/basic-usage.vue
@@ -0,0 +1,82 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/calendar-view/calendar-day-mark.vue b/examples/sites/demos/mobile-first/app/calendar-view/calendar-day-mark.vue
new file mode 100644
index 000000000..23f812ef9
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/calendar-view/calendar-day-mark.vue
@@ -0,0 +1,31 @@
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/calendar-view/calendar-disabled-day.vue b/examples/sites/demos/mobile-first/app/calendar-view/calendar-disabled-day.vue
new file mode 100644
index 000000000..361560249
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/calendar-view/calendar-disabled-day.vue
@@ -0,0 +1,23 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/calendar-view/calendar-event.vue b/examples/sites/demos/mobile-first/app/calendar-view/calendar-event.vue
new file mode 100644
index 000000000..80732c29e
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/calendar-view/calendar-event.vue
@@ -0,0 +1,45 @@
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/calendar-view/calendar-mode.vue b/examples/sites/demos/mobile-first/app/calendar-view/calendar-mode.vue
new file mode 100644
index 000000000..f86bfbaf8
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/calendar-view/calendar-mode.vue
@@ -0,0 +1,19 @@
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/calendar-view/calendar-schedule-slot.vue b/examples/sites/demos/mobile-first/app/calendar-view/calendar-schedule-slot.vue
new file mode 100644
index 000000000..3c786bb1b
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/calendar-view/calendar-schedule-slot.vue
@@ -0,0 +1,119 @@
+
+
+
+
+ {{ event.title }}
+ {{ event.content }}
+
+
+
+
+ {{ event.title }}
+ {{ event.content }}
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/calendar-view/calendar-timeline-range.vue b/examples/sites/demos/mobile-first/app/calendar-view/calendar-timeline-range.vue
new file mode 100644
index 000000000..7076b4323
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/calendar-view/calendar-timeline-range.vue
@@ -0,0 +1,83 @@
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/calendar-view/calendar-timeline-slot.vue b/examples/sites/demos/mobile-first/app/calendar-view/calendar-timeline-slot.vue
new file mode 100644
index 000000000..cd5a38d46
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/calendar-view/calendar-timeline-slot.vue
@@ -0,0 +1,145 @@
+
+
+
+
+ {{ event.title }}
+ {{ event.content }}
+
+
+
+
+ {{ event.title }}
+ {{ event.content }}
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/calendar-view/custom-calendar-toolbar.vue b/examples/sites/demos/mobile-first/app/calendar-view/custom-calendar-toolbar.vue
new file mode 100644
index 000000000..2a32b8f85
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/calendar-view/custom-calendar-toolbar.vue
@@ -0,0 +1,20 @@
+
+
+
+ 此处为自定义工具栏插槽
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/calendar-view/custom-day-bg-color.vue b/examples/sites/demos/mobile-first/app/calendar-view/custom-day-bg-color.vue
new file mode 100644
index 000000000..f2ea1d9c3
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/calendar-view/custom-day-bg-color.vue
@@ -0,0 +1,27 @@
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/calendar-view/custom-header.vue b/examples/sites/demos/mobile-first/app/calendar-view/custom-header.vue
new file mode 100644
index 000000000..7585973fa
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/calendar-view/custom-header.vue
@@ -0,0 +1,86 @@
+
+
+
+ {{ slotScope.date }} {{ slotScope.weekDay }}
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/calendar-view/hide-mode.vue b/examples/sites/demos/mobile-first/app/calendar-view/hide-mode.vue
new file mode 100644
index 000000000..9b09f0787
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/calendar-view/hide-mode.vue
@@ -0,0 +1,13 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/calendar-view/mode-combination.vue b/examples/sites/demos/mobile-first/app/calendar-view/mode-combination.vue
new file mode 100644
index 000000000..ddfe65631
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/calendar-view/mode-combination.vue
@@ -0,0 +1,14 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/calendar-view/multi-select.vue b/examples/sites/demos/mobile-first/app/calendar-view/multi-select.vue
new file mode 100644
index 000000000..37c4e1062
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/calendar-view/multi-select.vue
@@ -0,0 +1,32 @@
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/calendar-view/set-working-day.vue b/examples/sites/demos/mobile-first/app/calendar-view/set-working-day.vue
new file mode 100644
index 000000000..6ce20f095
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/calendar-view/set-working-day.vue
@@ -0,0 +1,65 @@
+
+
+
+ 工作日
+ 休息日
+ 节假日
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/calendar-view/webdoc/calendar-view.cn.md b/examples/sites/demos/mobile-first/app/calendar-view/webdoc/calendar-view.cn.md
new file mode 100644
index 000000000..fcd0e1a81
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/calendar-view/webdoc/calendar-view.cn.md
@@ -0,0 +1,11 @@
+---
+title: CalendarView 日历
+---
+
+# CalendarView 日历
+
+
+
+CalendarView 日历
+
+
diff --git a/examples/sites/demos/mobile-first/app/calendar-view/webdoc/calendar-view.en.md b/examples/sites/demos/mobile-first/app/calendar-view/webdoc/calendar-view.en.md
new file mode 100644
index 000000000..fcd0e1a81
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/calendar-view/webdoc/calendar-view.en.md
@@ -0,0 +1,11 @@
+---
+title: CalendarView 日历
+---
+
+# CalendarView 日历
+
+
+
+CalendarView 日历
+
+
diff --git a/examples/sites/demos/mobile-first/app/calendar-view/webdoc/calendar-view.js b/examples/sites/demos/mobile-first/app/calendar-view/webdoc/calendar-view.js
new file mode 100644
index 000000000..a0ab9010c
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/calendar-view/webdoc/calendar-view.js
@@ -0,0 +1,167 @@
+export default {
+ column: '1',
+ owner: '',
+ demos: [
+ {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '默认以月的形式展示当月的每一天。
\n',
+ 'en-US': 'By default, each day of the current month is displayed in the form of month.
\n'
+ },
+ codeFiles: ['basic-usage.vue']
+ },
+ {
+ demoId: 'calendar-mode',
+ name: {
+ 'zh-CN': '显示模式',
+ 'en-US': 'Display mode'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 mode
属性指定以年的形式显示,将展示当年的每个月份。可选值有 month
/ timeline
/ schedule
。
\n',
+ 'en-US':
+ 'The mode
attribute specifies that each month of the current year is displayed. The options are month
/ timeline
/ schedule
.
\n'
+ },
+ codeFiles: ['calendar-mode.vue']
+ },
+ {
+ demoId: 'calendar-disabled-day',
+ name: {
+ 'zh-CN': '日期禁用',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN': '通过 disabled
回调函数来禁用某些日期。
\n',
+ 'en-US': '\n'
+ },
+ codeFiles: ['calendar-disabled-day.vue']
+ },
+ {
+ demoId: 'calendar-schedule-slot',
+ name: {
+ 'zh-CN': '日程模式插槽',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN': '日程模式下内容区提供 weekday1-weekday7 这 7 个插槽,方便用户自定义日程展示。
\n',
+ 'en-US': '\n'
+ },
+ codeFiles: ['calendar-schedule-slot.vue']
+ },
+ {
+ demoId: 'calendar-timeline-slot',
+ name: {
+ 'zh-CN': '时间线插槽',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN': '时间下模式下提供 timeline1-timeline7 这 7 个插槽,方便用户自定义日程展示。
\n',
+ 'en-US': '\n'
+ },
+ codeFiles: ['calendar-timeline-slot.vue']
+ },
+ {
+ demoId: 'calendar-timeline-range',
+ name: {
+ 'zh-CN': '时间线范围配置',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN': '通过dayTimes属性配置时间线模式下所展示的时间范围,默认为[8,18],可配范围[0,23]。
\n',
+ 'en-US': '\n'
+ },
+ codeFiles: ['calendar-timeline-range.vue']
+ },
+ {
+ demoId: 'multi-select',
+ name: {
+ 'zh-CN': '日期多选',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN': '设置 mult-select = true 属性后,可开启日期多选。
\n',
+ 'en-US': '\n'
+ },
+ codeFiles: ['multi-select.vue']
+ },
+ {
+ demoId: 'calendar-day-mark',
+ name: {
+ 'zh-CN': '日期标记',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN':
+ '通过showMark回调函数来标记某些日期,markColor属性设置标记的颜色,此功能只在时间线模式和日程模式生效。markColor可选颜色同 theme
\n',
+ 'en-US': '\n'
+ },
+ codeFiles: ['calendar-day-mark.vue']
+ },
+ {
+ demoId: 'custom-header',
+ name: {
+ 'zh-CN': '自定义头部显示',
+ 'en-US': 'Display Selected Date'
+ },
+ desc: {
+ 'zh-CN': '通过作用域插槽 header 自定义需要显示的头部区域。
\n',
+ 'en-US': '\n'
+ },
+ codeFiles: ['custom-header.vue']
+ },
+ {
+ demoId: 'custom-calendar-toolbar',
+ name: {
+ 'zh-CN': '自定义工具栏',
+ 'en-US': 'Custom Toolbar'
+ },
+ desc: {
+ 'zh-CN': '通过作用域插槽 tool 自定义需要的工具栏。
\n',
+ 'en-US': 'Customize the required toolbar through the scope slot tool.
\n'
+ },
+ codeFiles: ['custom-calendar-toolbar.vue']
+ },
+ {
+ demoId: 'custom-day-bg-color',
+ name: {
+ 'zh-CN': '自定义单元格背景色',
+ 'en-US': 'Add Schedule Event'
+ },
+ desc: {
+ 'zh-CN':
+ '自定义日期单元格背景色。
\n目前只支持预置的颜色,可选颜色blue、green、red、yellow、purple、cyan、grey
\n',
+ 'en-US': '\n'
+ },
+ codeFiles: ['custom-day-bg-color.vue']
+ },
+ {
+ demoId: 'set-working-day',
+ name: {
+ 'zh-CN': '设置工作日或节假日',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN': '可以结合日期多选,自定义背景色,工具栏插槽等功能实现设置工作日或节假日的功能
\n',
+ 'en-US': '\n'
+ },
+ codeFiles: ['set-working-day.vue']
+ },
+ {
+ demoId: 'calendar-event',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN':
+ '日历抛出的事件有以下这些:
\nnew-schedule:新增日程按钮点击事件
\nselected-date-change:选中日期改变事件
\nprev-week-click:上一周按钮点击事件
\nnext-week-click:下一周按钮点击事件
\nweek-change:周改变事件
\nyear-change:年改变事件
\nmonth-change:月改变事件
\n',
+ 'en-US': '\n'
+ },
+ codeFiles: ['calendar-event.vue']
+ }
+ ]
+}
diff --git a/examples/sites/demos/mobile-first/app/card/basic-usage.vue b/examples/sites/demos/mobile-first/app/card/basic-usage.vue
index 1db61f157..d6c4570de 100644
--- a/examples/sites/demos/mobile-first/app/card/basic-usage.vue
+++ b/examples/sites/demos/mobile-first/app/card/basic-usage.vue
@@ -1,5 +1,5 @@
-
+
这是一段长文本内容,这是一段长文本内容,这是一段长文本内容,这是一段长文本内容,
这是一段长文本内容,这是一段长文本内容,这是一段长文本内容,这是一段长文本内容,
diff --git a/examples/sites/demos/mobile-first/app/card/card-type.vue b/examples/sites/demos/mobile-first/app/card/card-type.vue
index 4cfc5b73e..8521acfd7 100644
--- a/examples/sites/demos/mobile-first/app/card/card-type.vue
+++ b/examples/sites/demos/mobile-first/app/card/card-type.vue
@@ -7,7 +7,11 @@
-
+
这是一段长文本内容,这是一段长文本内容,这是一段长文本内容,这是一段长文本内容,
这是一段长文本内容,这是一段长文本内容,这是一段长文本内容,这是一段长文本内容,
@@ -25,7 +29,12 @@
-
+
这是一段长文本内容,这是一段长文本内容
这是一段长文本内容,这是一段长文本内容,这是一段长文本内容,这是一段长文本内容, 这是一段长文本内容,这是一段长文本内容,这是一段长文本内容,这是一段长文本内容,
这是一段长文本内容,这是一段长文本内容,这是一段长文本内容,这是一段长文本内容, 这是一段长文本内容,这是一段长文本内容,这是一段长文本内容,这是一段长文本内容, @@ -25,7 +25,8 @@ export default { }, data() { return { - value: ['1'] + checkboxValue: true, + radioValue: false } } } diff --git a/examples/sites/demos/mobile-first/app/card/slot.vue b/examples/sites/demos/mobile-first/app/card/slot.vue index 247cc763e..10782030c 100644 --- a/examples/sites/demos/mobile-first/app/card/slot.vue +++ b/examples/sites/demos/mobile-first/app/card/slot.vue @@ -34,7 +34,11 @@
刘小华
2023-03-20 10:10:10
diff --git a/examples/sites/demos/mobile-first/app/card/webdoc/card.js b/examples/sites/demos/mobile-first/app/card/webdoc/card.js index 272e7e69f..faf6e2789 100644 --- a/examples/sites/demos/mobile-first/app/card/webdoc/card.js +++ b/examples/sites/demos/mobile-first/app/card/webdoc/card.js @@ -82,8 +82,9 @@ export default { }, desc: { 'zh-CN': - '通过属性`check-type="checkbox"`设置卡片多选,通过属性`check-type="radio"`设置卡片单选,需同时设置 label。注意:目前仅支持在 text 类型开启多选
', - 'en-US': 'Use the `check-type="checkbox"` attribute to set multiple card selections, and use the `check-type="radio"` attribute to set single card selections. You need to set labels at the same time. Note: Currently, multiple selections can be enabled only for the text type.
' + '通过属性`check-type="checkbox"`设置卡片多选,通过属性`check-type="radio"`设置卡片单选,需同时设置 label。注意:目前仅支持在 text 类型开启多选
', + 'en-US': + 'Use the `check-type="checkbox"` attribute to set multiple card selections, and use the `check-type="radio"` attribute to set single card selections. You need to set labels at the same time. Note: Currently, multiple selections can be enabled only for the text type.
' }, codeFiles: ['check-type-checkbox.vue'] }, @@ -95,7 +96,8 @@ export default { }, desc: { 'zh-CN': '属性`card-class`可自定义卡片的 class,属性`height`可设置卡片内容区的高度。
', - 'en-US': 'The `card-class` attribute can be used to customize the card class, and the `height` attribute can be used to set the height of the card content area.
' + 'en-US': + 'The `card-class` attribute can be used to customize the card class, and the `height` attribute can be used to set the height of the card content area.
' }, codeFiles: ['custom-class.vue'] }, @@ -107,7 +109,8 @@ export default { }, desc: { 'zh-CN': '通过`options`属性配置操作栏,支持按钮的禁用(`disabled: true`)与隐藏(`hidden: true`)
', - 'en-US': 'Use the `options` attribute to configure the operation bar. Buttons can be disabled (`disabled: true`) and hidden (`hidden: true`).
' + 'en-US': + 'Use the `options` attribute to configure the operation bar. Buttons can be disabled (`disabled: true`) and hidden (`hidden: true`).
' }, codeFiles: ['operate-bar.vue'] }, @@ -119,7 +122,8 @@ export default { }, desc: { 'zh-CN': '`change` 事件:卡片勾选和取消勾选时触发;`icon-click` 事件:操作栏按钮点击时触发
', - 'en-US': '`change` event: triggered when a card is selected or deselected; `icon-click` event: triggered when a button in the operation bar is clicked
' + 'en-US': + '`change` event: triggered when a card is selected or deselected; `icon-click` event: triggered when a button in the operation bar is clicked
' }, codeFiles: ['card-events.vue'] }, @@ -135,189 +139,5 @@ export default { }, codeFiles: ['slot.vue'] } - ], - apis: [ - { - 'name': 'Card', - 'type': 'component', - 'props': [ - { - 'name': 'auto-width', - 'type': 'Boolean', - 'defaultValue': '', - 'desc': { 'zh-CN': '卡片的宽度是否自动撑开,设置后将不再给卡片设置固定宽度', - 'en-US': 'Indicates whether the card width is automatically expanded. After the setting, the card width is not fixed.' - }, - 'demoId': 'card-auto-width' - }, - { - 'name': 'check-type', - 'type': 'String', - 'defaultValue': '', - 'desc': { 'zh-CN': '设置卡片单选、多选,单选/radio;多选/checkbox,需同时设置 label。', - 'en-US': 'Set single-choice, multiple-choice, single-choice, and radio. Multi-choice/checkbox. You need to set the label at the same time.' - }, - 'demoId': 'check-type-checkbox' - }, - { - 'name': 'custom-class', - 'type': 'String', - 'defaultValue': '', - 'desc': { 'zh-CN': '卡片的class', - 'en-US': 'Class of the card' - }, - 'demoId': 'card-custom-class' - }, - { - 'name': 'disabled', - 'type': 'Boolean', - 'defaultValue': '', - 'desc': { 'zh-CN': '卡片禁用', - 'en-US': 'Card disabled' - }, - 'demoId': 'card-disabled' - }, - { - 'name': 'height', - 'type': 'String', - 'defaultValue': '', - 'desc': { 'zh-CN': '卡片内容区域的高度', - 'en-US': 'Height of the card content area' - }, - 'demoId': 'card-height' - }, - { - 'name': 'icon-more', - 'type': 'Object', - 'defaultValue': '', - 'desc': { 'zh-CN': '更多按钮图标,可传入一个svg图标对象进行替换', - 'en-US': 'More button icons can be replaced by a svg icon object.' - }, - 'demoId': 'card-icon-more' - }, - { - 'name': 'label', - 'type': 'String / Number', - 'defaultValue': '', - 'desc': { 'zh-CN': 'checkbox或radio的label', - 'en-US': 'Checkbox or radio label.' - }, - 'demoId': 'card-label' - }, - { - 'name': 'options ', - 'type': 'Array', - 'defaultValue': '', - 'desc': { 'zh-CN': '操作按钮配置', - 'en-US': 'Operation Button Configuration.' - }, - 'demoId': 'operate-bar' - }, - { - 'name': 'size', - 'type': 'String', - 'defaultValue': '', - 'desc': { 'zh-CN': '尺寸,支持large、medium、small、mini 4个尺寸,默认值为medium', - 'en-US': 'Size. The options are large, medium, small, and mini. The default value is medium.' - }, - 'demoId': 'card-size' - }, - { - 'name': 'src', - 'type': 'String', - 'defaultValue': '', - 'desc': { 'zh-CN': '图片或者视频的地址', - 'en-US': 'Address of a picture or video.' - }, - 'demoId': 'card-src' - }, - { - 'name': 'status', - 'type': 'String', - 'defaultValue': '', - 'desc': { 'zh-CN': '卡片状态,支持 success、warning、alerting、danger 4 种状态', - 'en-US': 'Card status. The value can be success, warning, alerting, or dangerous.' - }, - 'demoId': 'card-status' - }, - { - 'name': 'title', - 'type': 'String', - 'defaultValue': '', - 'desc': { 'zh-CN': '卡片的标题', - 'en-US': 'The title of the card.' - }, - 'demoId': 'card-title' - }, - { - 'name': 'type', - 'type': 'String', - 'defaultValue': '', - 'desc': { 'zh-CN': '设置卡片类型,支持 text、image、video、logo 4 种类型。', - 'en-US': 'Set the card type. The options are text, image, video, and logo.' - }, - 'demoId': 'card-type' - } - ], - 'events': [ - { - 'name': 'change', - 'type': 'Function()', - 'defaultValue': '', - 'desc': { - 'zh-CN': '组件选中/取消选中事件', - 'en-US': 'Component check/uncheck event' - }, - 'demoId': 'card-events' - }, - { - 'name': 'icon-click', - 'type': 'Function()', - 'defaultValue': '', - 'desc': { - 'zh-CN': '操作栏按钮点击事件', - 'en-US': 'Operation bar button click event' - }, - 'demoId': 'card-events' - } - ], - 'slots': [ - { - 'name': 'default', - 'type': '', - 'defaultValue': '', - 'desc': { 'zh-CN': '组件默认插槽', 'en-US': 'Component Default Slot' }, - 'demoId': 'slot' - }, - { - 'name': 'footer', - 'type': '', - 'defaultValue': '', - 'desc': { 'zh-CN': '组件默认插槽', 'en-US': 'Component Default Slot' }, - 'demoId': 'slot' - }, - { - 'name': 'title', - 'type': '', - 'defaultValue': '', - 'desc': { 'zh-CN': '标题插槽', 'en-US': 'Header Slot' }, - 'demoId': 'slot' - }, - { - 'name': 'title-left', - 'type': '', - 'defaultValue': '', - 'desc': { 'zh-CN': '标题左侧插槽', 'en-US': 'Header Left Slot' }, - 'demoId': 'slot' - }, - { - 'name': 'title-right', - 'type': '', - 'defaultValue': '', - 'desc': { 'zh-CN': '标题右侧插槽', 'en-US': 'Header right slot' }, - 'demoId': 'slot' - }, - ] - } ] } diff --git a/examples/sites/demos/mobile-first/app/carousel/close-loop.vue b/examples/sites/demos/mobile-first/app/carousel/close-loop.vue index b63ff6161..a1a930a1f 100644 --- a/examples/sites/demos/mobile-first/app/carousel/close-loop.vue +++ b/examples/sites/demos/mobile-first/app/carousel/close-loop.vue @@ -2,16 +2,16 @@走马灯指示器默认显示在幻灯片内容上,配置 `indicator-position` 为 outside 后,将显示在外部。
配置 `trigger` 为 click ,可以修改指示器触发方式为单击,默认鼠标悬停到指示器时,走马灯幻灯片就会对应切换。
The walk indicator is displayed on the slide by default. If `indicator-position` is set to outside, the indicator is displayed outside.
If `trigger` is set to click, you can change the indicator triggering mode to click. By default, when you hover the mouse over the indicator, the slideshow is switched accordingly.
走马灯指示器默认显示在幻灯片内容上,配置 `indicator-position` 为 outside 后,将显示在外部。
配置 `trigger` 为 click ,可以修改指示器触发方式为单击,默认鼠标悬停到指示器时,走马灯幻灯片就会对应切换。
The walk indicator is displayed on the slide by default. If `indicator-position` is set to outside, the indicator is displayed outside.
If `trigger` is set to click, you can change the indicator triggering mode to click. By default, when you hover the mouse over the indicator, the slideshow is switched accordingly.
调用 `setActiveItem()`、`next()`、`prev()` 方法可根据需要进行轮播。`initial-index` 属性可以指定初始激活的幻灯片索引。
', - 'en-US': '
Invoke the `setActiveItem()`, `next()`, and `prev()` methods to perform NVOD as required. The `initial-index` property specifies the slide index that is initially activated.
' + '调用 `setActiveItem()`、`next()`、`prev()` 方法可根据需要进行轮播。`initial-index` 属性可以指定初始激活的幻灯片索引。
', + 'en-US': + '
Invoke the `setActiveItem()`, `next()`, and `prev()` methods to perform NVOD as required. The `initial-index` property specifies the slide index that is initially activated.
' }, codeFiles: ['manual-play.vue'] }, @@ -48,8 +50,9 @@ export default { }, desc: { 'zh-CN': - '配置 `loop` 属性为 false 后,若走马灯幻灯片已切换到最后一项,则将不能再从第一项开始循环切换。即切换到最后一项时,右侧切换箭头不再显示,切换到第一项时,左侧切换箭头不再显示。
', - 'en-US': 'After the `loop` attribute is set to false, if the slide is switched to the last item, the slide cannot be switched cyclically from the first item. That is, when switching to the last item, the right toggle arrow is no longer displayed, and when switching to the first item, the left toggle arrow is no longer displayed.
' + '配置 `loop` 属性为 false 后,若走马灯幻灯片已切换到最后一项,则将不能再从第一项开始循环切换。即切换到最后一项时,右侧切换箭头不再显示,切换到第一项时,左侧切换箭头不再显示。
', + 'en-US': + 'After the `loop` attribute is set to false, if the slide is switched to the last item, the slide cannot be switched cyclically from the first item. That is, when switching to the last item, the right toggle arrow is no longer displayed, and when switching to the first item, the left toggle arrow is no longer displayed.
' }, codeFiles: ['close-loop.vue'] }, @@ -61,7 +64,8 @@ export default { }, desc: { 'zh-CN': '配置 `autoplay` 属性为 true 后,走马灯的幻灯片内容将自动轮播切换。
', - 'en-US': 'After the `autoplay` attribute is set to true, the slide content of the walking lantern is automatically switched in rotation.
' + 'en-US': + 'After the `autoplay` attribute is set to true, the slide content of the walking lantern is automatically switched in rotation.
' }, codeFiles: ['autoplay.vue'] }, @@ -73,7 +77,8 @@ export default { }, desc: { 'zh-CN': '走马灯幻灯片轮播间隔时间默认为 3000 毫秒,通过 `interval` 属性可以自定义。
', - 'en-US': 'The default interval is 3000 ms. You can customize the interval by using the `interval` attribute.
' + 'en-US': + 'The default interval is 3000 ms. You can customize the interval by using the `interval` attribute.
' }, codeFiles: ['play-interval.vue'] }, @@ -145,8 +150,9 @@ export default { }, desc: { 'zh-CN': - '`aspect-ratio` 属性可以设置轮播图的宽高比,如果设置了 height,会以 height 为主,默认值为 16:2,可以设置任意的整数宽高比例。 设置了`aspect-ratio`之后页面缩放时会按照设定的比例自动调整轮播器的高度。
', - 'en-US': 'The `aspect-ratio` attribute is used to set the aspect ratio of the carousel. If height is set, height is used as the primary value. The default value is 16:2. You can set any integer aspect ratio. After `aspect-ratio` is set, the height of the carousel is automatically adjusted according to the set scale when the page is zoomed in or out.
' + '`aspect-ratio` 属性可以设置轮播图的宽高比,如果设置了 height,会以 height 为主,默认值为 16:2,可以设置任意的整数宽高比例。 设置了`aspect-ratio`之后页面缩放时会按照设定的比例自动调整轮播器的高度。
', + 'en-US': + 'The `aspect-ratio` attribute is used to set the aspect ratio of the carousel. If height is set, height is used as the primary value. The default value is 16:2. You can set any integer aspect ratio. After `aspect-ratio` is set, the height of the carousel is automatically adjusted according to the set scale when the page is zoomed in or out.
' }, codeFiles: ['aspect-ratio.vue'] }, @@ -158,7 +164,8 @@ export default { }, desc: { 'zh-CN': '`indicator-style` 属性可以设置轮播图指示器样式,支持 light 与 dark 两种类型,默认为 light。
', - 'en-US': 'The `indicator-style` attribute can be used to set the indicator style of the carousel chart. The options are light and dark. The default value is light.
' + 'en-US': + 'The `indicator-style` attribute can be used to set the indicator style of the carousel chart. The options are light and dark. The default value is light.
' }, codeFiles: ['indicator-style.vue'] }, @@ -182,38 +189,10 @@ export default { }, desc: { 'zh-CN': - '主要包含change
事件。
当幻灯片切换时会触发该事件,回调函数可接收两个参数:当前幻灯片索引
和上一张幻灯片索引
。
主要包含change
事件。
当幻灯片切换时会触发该事件,回调函数可接收两个参数:当前幻灯片索引
和上一张幻灯片索引
。
After the type
attribute is set to card, the lantern is displayed as a card.
', - 'en-US': '
bbutton click
' - }, - codeFiles: ['cycle-roll.vue'] - }, { demoId: 'disabled-array', name: { @@ -89,6 +77,5 @@ export default { }, codeFiles: ['cities.vue'] } - ], - apis: [] + ] } diff --git a/examples/sites/demos/mobile-first/app/cascader-view/basic-usage.vue b/examples/sites/demos/mobile-first/app/cascader-view/basic-usage.vue index 387c69e97..f159fe1f5 100644 --- a/examples/sites/demos/mobile-first/app/cascader-view/basic-usage.vue +++ b/examples/sites/demos/mobile-first/app/cascader-view/basic-usage.vue @@ -1,5 +1,5 @@ -值:{{ value }}
:node-config="{ lazy: true, load:() => {...} }"load
设置属性 lazy: trueload
和 load
数据加载方法,开启异步加载。',
+ '通过 :node-config="{ lazy: true, load:() => {...} }"load
设置属性 lazy: trueload
和 load
数据加载方法,开启异步加载。
',
'en-US':
- 'Set the lazy: trueload
attribute and load
data loading method through :node-config="{lazy: true, load:() => {...}}"load
to enable asynchronous loading.'
+ 'Set the lazy: trueload
attribute and load
data loading method through :node-config="{lazy: true, load:() => {...}}"load
to enable asynchronous loading.'
},
codeFiles: ['lazyload.vue']
},
@@ -36,9 +36,9 @@ export default {
},
desc: {
'zh-CN':
- '通过 :node-config="{ checkStrictly: true }"
设置属性 checkStrictly: true
,开启父子层级互不关联,可选择非叶子节点,默认值为 false
显示到叶子节点。
',
+ '通过 :node-config="{ checkStrictly: true }"
设置属性 checkStrictly: true
,开启父子层级互不关联,可选择非叶子节点,默认值为 false
显示到叶子节点。
',
'en-US':
- 'You can set the checkStrictly: true
attribute in :node-config="{checkStrictly: true}"
to enable the disassociation between parent and child levels. You can select non-leaf nodes. The default value is false
.
'
+ 'You can set the checkStrictly: true
attribute in :node-config="{checkStrictly: true}"
to enable the disassociation between parent and child levels. You can select non-leaf nodes. The default value is false
.
'
},
codeFiles: ['check-strictly.vue']
},
@@ -51,7 +51,7 @@ export default {
desc: {
'zh-CN': '数据源里面带 disabled: true
渲染时自动禁用选项。
',
'en-US':
- 'The disabled: true
option is automatically disabled during rendering in the data source.
'
+ 'The disabled: true
option is automatically disabled during rendering in the data source.
'
},
codeFiles: ['disabled.vue']
},
@@ -63,251 +63,11 @@ export default {
},
desc: {
'zh-CN':
- '通过设置 emit-path
属性值为 false
不显示值路径,默认值为 true
显示值路径。
',
+ '通过设置 emit-path
属性值为 false
不显示值路径,默认值为 true
显示值路径。
',
'en-US':
- 'The value path is not displayed by setting the emit-path
attribute to false
. The default value is true
.
'
+ 'The value path is not displayed by setting the emit-path
attribute to false
. The default value is true
.
'
},
codeFiles: ['emit-path.vue']
}
- ],
- apis: [
- {
- 'name': 'CalendarView',
- 'type': 'component',
- 'props': [
- {
- 'name': 'day-times',
- 'type': 'Array',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '配置时间线模式下所展示的时间范围,默认为[8,18],可配范围[0,23]。',
- 'en-US': 'Time range displayed in timeline mode. The default value range is [8, 18]. The value range is [0, 23].'
- },
- 'demoId': ''
- },
- {
- 'name': 'disabled ',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '日期禁用',
- 'en-US': 'Date Disabled'
- },
- 'demoId': 'disabled'
- },
- {
- 'name': 'events',
- 'type': 'Array',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '日程事件',
- 'en-US': 'Scheduled Events'
- },
- 'demoId': ''
- },
- {
- 'name': 'height',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '日历高度',
- 'en-US': 'Calendar height'
- },
- 'demoId': ''
- },
- {
- 'name': 'mark-color',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点标记的颜色',
- 'en-US': 'Color of the dot marker'
- },
- 'demoId': ''
- },
- {
- 'name': 'mode',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '显示模式,可选值有 timeline-时间线模式、schedule-日程模式、month-月模式,默认为月模式。',
- 'en-US': 'Display mode. The options are timeline-timeline, schedule-schedule, and month-month. The default value is month.'
- },
- 'demoId': ''
- },
- {
- 'name': 'modes',
- 'type': 'Array',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '模式组,显示模式任意组合',
- 'en-US': 'Pattern group, any combination of display patterns'
- },
- 'demoId': ''
- },
- {
- 'name': 'month',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '日历当前显示月份',
- 'en-US': 'The calendar currently displays the month'
- },
- 'demoId': ''
- },
- {
- 'name': 'multi-select',
- 'type': 'Boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '日期多选',
- 'en-US': 'Multiple Dates'
- },
- 'demoId': ''
- },
- {
- 'name': 'set-day-bg-color',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置日期背景色',
- 'en-US': 'Set Date Background Color'
- },
- 'demoId': ''
- },
- {
- 'name': 'show-mark',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '显示点标记',
- 'en-US': 'Show Point Markers'
- },
- 'demoId': ''
- },
- {
- 'name': 'show-new-schedule',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '显示新增日程按钮',
- 'en-US': 'Show the button for adding a schedule'
- },
- 'demoId': ''
- },
- {
- 'name': 'year',
- 'type': 'Number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '日历当前显示年份',
- 'en-US': 'Calendar Current Display Year'
- },
- 'demoId': ''
- },
- ],
- 'events': [
- {
- 'name': 'month-change',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '月改变事件',
- 'en-US': 'Month Change Event'
- },
- 'demoId': ''
- },
- {
- 'name': 'new-schedule',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '新增日程按钮点击事件',
- 'en-US': 'Event for adding a schedule button.'
- },
- 'demoId': ''
- },
- {
- 'name': 'next-week-click',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '下一周按钮点击事件',
- 'en-US': 'Next week button click event'
- },
- 'demoId': ''
- },
- {
- 'name': 'prev-week-click',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '上一周按钮点击事件',
- 'en-US': 'Button click event of the previous week'
- },
- 'demoId': ''
- },
- {
- 'name': 'selected-date-change',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '选中日期改变事件',
- 'en-US': 'Select Date Change Event'
- },
- 'demoId': ''
- },
- {
- 'name': 'week-change',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '周改变事件',
- 'en-US': 'Week Change Event'
- },
- 'demoId': ''
- },
- {
- 'name': 'year-change',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '年改变事件',
- 'en-US': 'Year Change Event'
- },
- 'demoId': ''
- },
- ],
- 'slot': [
- {
- 'name': 'header',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '头部插槽', 'en-US': 'Head slot' },
- 'demoId': ''
- },
- {
- 'name': 'timeline',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '时间线插槽,有timeline1-timeline7 7个插槽', 'en-US': 'Timeline slots, with 7 slots timeline1-timeline7' },
- 'demoId': ''
- },
- {
- 'name': 'tool',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '工具栏插槽', 'en-US': 'Toolbar Slot' },
- 'demoId': ''
- },
- {
- 'name': 'weekday',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '日程插槽,有weekday1-weekday7 7个插槽', 'en-US': 'Schedule slots, with 7 slots weekday1-weekday7' },
- 'demoId': ''
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile-first/app/cascader/basic-usage.vue b/examples/sites/demos/mobile-first/app/cascader/basic-usage.vue
new file mode 100644
index 000000000..440a01e2c
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/cascader/basic-usage.vue
@@ -0,0 +1,168 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/cascader/check-strictly.vue b/examples/sites/demos/mobile-first/app/cascader/check-strictly.vue
new file mode 100644
index 000000000..358198003
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/cascader/check-strictly.vue
@@ -0,0 +1,168 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/cascader/disabled-items.vue b/examples/sites/demos/mobile-first/app/cascader/disabled-items.vue
new file mode 100644
index 000000000..0840f843a
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/cascader/disabled-items.vue
@@ -0,0 +1,172 @@
+
+
+ {{ disabled ? '切换激活' : '切换禁用' }}
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/cascader/filter-method.vue b/examples/sites/demos/mobile-first/app/cascader/filter-method.vue
new file mode 100644
index 000000000..b5b715cb5
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/cascader/filter-method.vue
@@ -0,0 +1,186 @@
+
+
+
+ {{ checkStrictly ? '切换到不严格关联' : '切换到严格关联' }}
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/cascader/lazy-load.vue b/examples/sites/demos/mobile-first/app/cascader/lazy-load.vue
new file mode 100644
index 000000000..ed3e6c96b
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/cascader/lazy-load.vue
@@ -0,0 +1,185 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/cascader/level-title.vue b/examples/sites/demos/mobile-first/app/cascader/level-title.vue
new file mode 100644
index 000000000..c64c29596
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/cascader/level-title.vue
@@ -0,0 +1,169 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/cascader/placeholder.vue b/examples/sites/demos/mobile-first/app/cascader/placeholder.vue
new file mode 100644
index 000000000..e67a3bbd0
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/cascader/placeholder.vue
@@ -0,0 +1,168 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/cascader/title.vue b/examples/sites/demos/mobile-first/app/cascader/title.vue
new file mode 100644
index 000000000..2c7838444
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/cascader/title.vue
@@ -0,0 +1,168 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/cascader/webdoc/cascader.cn.md b/examples/sites/demos/mobile-first/app/cascader/webdoc/cascader.cn.md
new file mode 100644
index 000000000..4eb0de0f2
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/cascader/webdoc/cascader.cn.md
@@ -0,0 +1,9 @@
+---
+title: Cascader 级联选择
+---
+
+# Cascader 级联选择
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/cascader/webdoc/cascader.en.md b/examples/sites/demos/mobile-first/app/cascader/webdoc/cascader.en.md
new file mode 100644
index 000000000..0e91818df
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/cascader/webdoc/cascader.en.md
@@ -0,0 +1,9 @@
+---
+title: Cascader
+---
+
+# Cascader
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/cascader/webdoc/cascader.js b/examples/sites/demos/mobile-first/app/cascader/webdoc/cascader.js
new file mode 100644
index 000000000..2088bc393
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/cascader/webdoc/cascader.js
@@ -0,0 +1,112 @@
+export default {
+ column: '2',
+ owner: '',
+ demos: [
+ {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '基本用法
',
+ 'en-US': '
Basic Usage
'
+ },
+ codeFiles: ['basic-usage.vue']
+ },
+ {
+ demoId: 'title',
+ name: {
+ 'zh-CN': '标题',
+ 'en-US': 'Custom title'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 title 来设置小屏时,弹窗顶部的标题名字。 通过 showHeader 来设置小屏时,是否显示标题,默认为true。
',
+ 'en-US':
+ '
The title name at the top of the pop-up window when the small screen is set by title. Whether to display the title when using showHeader to set the small screen. The default is true.
'
+ },
+ codeFiles: ['title.vue']
+ },
+ {
+ demoId: 'level-title',
+ name: {
+ 'zh-CN': '级联标题',
+ 'en-US': 'Cascade header'
+ },
+ desc: {
+ 'zh-CN': '通过 level-title 来设置小屏时,弹窗级联各列的标题,默认显示为 "请选择"
',
+ 'en-US': '
Basic Usage
'
+ },
+ codeFiles: ['level-title.vue']
+ },
+ {
+ demoId: 'filter-method',
+ name: {
+ 'zh-CN': '自定义搜索逻辑',
+ 'en-US': 'Customized search logic'
+ },
+ desc: {
+ 'zh-CN':
+ 'filter-method
自定义搜索逻辑,第一个参数是节点 node,第二个参数是搜索关键词 keyword,通过返回布尔值表示是否命中,如果需要搜索到父级,通过 props.checkStrictly = true 来设置父子节点取消选中关联,从而达到选择任意一级选项的目的。默认单选模式下,只能选择叶子节点。
\n',
+ 'en-US':
+ 'filter-method
customizes the search logic. The first parameter is node, and the second parameter is keyword. A boolean value is returned to indicate whether the search is hit. To select a parent, set props.checkStrictly = true to deselect the parent and child nodes. In this way, the purpose of selecting any level of option is achieved. In the default single-choice mode, only leaf nodes can be selected.
\n'
+ },
+ codeFiles: ['filter-method.vue']
+ },
+ {
+ demoId: 'check-strictly',
+ name: {
+ 'zh-CN': '父子级不相关联',
+ 'en-US': 'The parent and child levels are not associated.'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 props.checkStrictly = true
来设置父子节点取消选中关联,从而达到选择任意一级选项的目的。默认单选模式下,只能选择叶子节点。
\n',
+ 'en-US':
+ 'The props.checkStrictly = true
is used to set the association between the parent and child nodes. In this way, any level of options can be selected. In the default single-choice mode, only leaf nodes can be selected.
\n'
+ },
+ codeFiles: ['check-strictly.vue']
+ },
+ {
+ demoId: 'disabled-items',
+ name: {
+ 'zh-CN': '禁用选项',
+ 'en-US': 'Disable Options'
+ },
+ desc: {
+ 'zh-CN':
+ '\n
通过在数据源option
中设置 disabled
字段来声明该选项是禁用的,在默认情况下,Cascader 会检查数据中每一项的 disabled
字段是否为 true
。\n 也可以通过直接设置 disabled
可以禁用组件。\n
',
+ 'en-US':
+ '\n
Declare that the option is disabled by setting the disabled
field in the data source; by default, Cascader checks to see if the disabled
field is true
for each item in the data. \n Components can also be disabled by setting disabled
directly.\n
'
+ },
+ codeFiles: ['disabled-items.vue']
+ },
+ {
+ demoId: 'auto-load',
+ name: {
+ 'zh-CN': '动态加载',
+ 'en-US': 'Dynamic loading'
+ },
+ desc: {
+ 'zh-CN':
+ '\n \n
当选中某一级时,动态加载该级下的选项。\n 通过 props
属性中的 lazy
开启动态加载,并通过 lazyload
来设置加载数据源的方法。\n lazyload
方法有两个参数,第一个参数 node 为当前点击的节点,第二个 resolve 为数据加载完成的回调(必须调用)。\n \n
为了更准确的显示节点的状态,默认地(默认指没有设置props.leaf
)可以使用leaf
字段。\n 表明此节点是否为叶子节点,否则会简单地以有无子节点来判断是否为叶子节点。\n \n \n ',
+ 'en-US':
+ '\n \n
When a level is selected, dynamically loads the options under that level. \n enables dynamic loading with lazy
in the props
property, and sets the method of loading the data source with lazyload
. \n Thelazyload
method takes two arguments, node for the current clicked node, and resolve for the callback (which must be called) when the data is loaded. \n \n
In order to more accurately display the state of the node, the leaf
field can be used by default (the default means that props.leaf
is not set). \n indicates whether this node is a leaf, otherwise it is simply determined by the presence or absence of child nodes. \n \n \n '
+ },
+ codeFiles: ['lazy-load.vue']
+ },
+ {
+ demoId: 'placeholder',
+ name: {
+ 'zh-CN': '占位符',
+ 'en-US': 'Placeholder'
+ },
+ desc: {
+ 'zh-CN': '通过设置 placeholder 来设置占位符。
',
+ 'en-US': '
Placeholders are set by setting placeholder.
'
+ },
+ codeFiles: ['placeholder.vue']
+ }
+ ]
+}
diff --git a/examples/sites/demos/mobile-first/app/cell/webdoc/cell.js b/examples/sites/demos/mobile-first/app/cell/webdoc/cell.js
index 9a6aecd39..7512141b9 100644
--- a/examples/sites/demos/mobile-first/app/cell/webdoc/cell.js
+++ b/examples/sites/demos/mobile-first/app/cell/webdoc/cell.js
@@ -62,44 +62,5 @@ export default {
},
codeFiles: ['icon.vue']
}
- ],
- apis: [
- {
- 'name': 'Cell',
- 'type': 'component',
- 'props': [
- {
- 'name': 'data',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '数据', 'en-US': 'data' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'disabled',
- 'type': 'Boolean',
- 'defaultValue': 'true',
- 'desc': { 'zh-CN': '禁用', 'en-US': 'disabled' },
- 'demoId': 'disabled'
- },
- {
- 'name': 'icon',
- 'type': 'Object',
- 'defaultValue': '{}',
- 'desc': { 'zh-CN': '设置图标', 'en-US': 'Set icon' },
- 'demoId': 'icon'
- },
- {
- 'name': 'placeholder',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '占位文本',
- 'en-US': 'Placeholder Text'
- },
- 'demoId': 'placeholder'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile-first/app/checkbox/button-chek-box.vue b/examples/sites/demos/mobile-first/app/checkbox/button-chek-box.vue
deleted file mode 100644
index 1ae4d28cc..000000000
--- a/examples/sites/demos/mobile-first/app/checkbox/button-chek-box.vue
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
diff --git a/examples/sites/demos/mobile-first/app/checkbox/checkbox-button.vue b/examples/sites/demos/mobile-first/app/checkbox/checkbox-button.vue
index 82888c9fa..173fd61b8 100644
--- a/examples/sites/demos/mobile-first/app/checkbox/checkbox-button.vue
+++ b/examples/sites/demos/mobile-first/app/checkbox/checkbox-button.vue
@@ -1,32 +1,21 @@
-
-
-
-
- 获取文本
-
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/collapse/webdoc/collapse.js b/examples/sites/demos/mobile-first/app/collapse/webdoc/collapse.js
index 106370ec8..2b2a4ba4b 100644
--- a/examples/sites/demos/mobile-first/app/collapse/webdoc/collapse.js
+++ b/examples/sites/demos/mobile-first/app/collapse/webdoc/collapse.js
@@ -155,23 +155,5 @@ export default {
},
codeFiles: ['slot-icon.vue']
}
- ],
- apis: [
- {
- 'name': 'Collapse',
- 'type': 'component',
- 'slots': [
- {
- 'name': 'icon',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '展开收起icon插槽',
- 'en-US': 'Expand and collapse icon slot'
- },
- 'demoId': 'slot-icon'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile-first/app/column-list-item/basic-usage.vue b/examples/sites/demos/mobile-first/app/column-list-item/basic-usage.vue
index 207f9cf4f..683e934c0 100644
--- a/examples/sites/demos/mobile-first/app/column-list-item/basic-usage.vue
+++ b/examples/sites/demos/mobile-first/app/column-list-item/basic-usage.vue
@@ -3,7 +3,7 @@
-
+
- 智能手机智能手机
diff --git a/examples/sites/demos/mobile-first/app/column-list-item/custom-width.vue b/examples/sites/demos/mobile-first/app/column-list-item/custom-width.vue
index 5283e6fa9..c1f2df70d 100644
--- a/examples/sites/demos/mobile-first/app/column-list-item/custom-width.vue
+++ b/examples/sites/demos/mobile-first/app/column-list-item/custom-width.vue
@@ -1,6 +1,11 @@
-
+
- 智能手机智能手机
diff --git a/examples/sites/demos/mobile-first/app/column-list-item/icon-click-event.vue b/examples/sites/demos/mobile-first/app/column-list-item/icon-click-event.vue
index 312982da5..eafc65f7f 100644
--- a/examples/sites/demos/mobile-first/app/column-list-item/icon-click-event.vue
+++ b/examples/sites/demos/mobile-first/app/column-list-item/icon-click-event.vue
@@ -1,6 +1,10 @@
-
+
- 智能手机智能手机
diff --git a/examples/sites/demos/mobile-first/app/column-list-item/icon-disabled.vue b/examples/sites/demos/mobile-first/app/column-list-item/icon-disabled.vue
index 6e6955f1a..e3fa84b40 100644
--- a/examples/sites/demos/mobile-first/app/column-list-item/icon-disabled.vue
+++ b/examples/sites/demos/mobile-first/app/column-list-item/icon-disabled.vue
@@ -1,6 +1,10 @@
-
+
- 智能手机智能手机
diff --git a/examples/sites/demos/mobile-first/app/column-list-item/size.vue b/examples/sites/demos/mobile-first/app/column-list-item/size.vue
index eec25d645..ed51158d5 100644
--- a/examples/sites/demos/mobile-first/app/column-list-item/size.vue
+++ b/examples/sites/demos/mobile-first/app/column-list-item/size.vue
@@ -3,7 +3,7 @@
-
+
- 智能手机智能手机
diff --git a/examples/sites/demos/mobile-first/app/column-list-item/webdoc/column-list-item.js b/examples/sites/demos/mobile-first/app/column-list-item/webdoc/column-list-item.js
index 7909ccad0..d2ef436c4 100644
--- a/examples/sites/demos/mobile-first/app/column-list-item/webdoc/column-list-item.js
+++ b/examples/sites/demos/mobile-first/app/column-list-item/webdoc/column-list-item.js
@@ -14,7 +14,6 @@ export default {
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'size',
name: {
@@ -23,7 +22,8 @@ export default {
},
desc: {
'zh-CN': '通过 `size` 属性可以设置分区列表项的大小,支持 small 和 medium 两种尺寸。
',
- 'en-US': 'You can use the `size` attribute to set the size of the partition list item. The size can be small or medium.
'
+ 'en-US':
+ 'You can use the `size` attribute to set the size of the partition list item. The size can be small or medium.
'
},
codeFiles: ['size.vue']
},
@@ -35,7 +35,8 @@ export default {
},
desc: {
'zh-CN': '通过 `#column1、#column2、#column3、#column4` 可以设置内容区插槽,最多支持 4 个内容插槽。
',
- 'en-US': '
You can use `#column1, #column2, #column3, and #column4` to set the content area slots. A maximum of four content slots are supported.
'
+ 'en-US':
+ 'You can use `#column1, #column2, #column3, and #column4` to set the content area slots. A maximum of four content slots are supported.
'
},
codeFiles: ['content-slot.vue']
},
@@ -48,7 +49,8 @@ export default {
desc: {
'zh-CN':
'通过 `flex-basis` 属性可以设置内容插槽的宽度,flex-basis 类型为数组,最多能传入 4 个值,支持百分比,固定宽度及固有的尺寸关键词,默认为 auto,详情见 flex 的 flex-basis 属性。
通过设置`flex-grow`属性可以设置每一项在 flex 容器中分配剩余空间的相对比例,默认为 1。如果不想自动撑满主容器,可以设为 0,详情见 flex 的 flex-grow 属性。
flex-grow 举例:`:flex-grow="[0, 0]" :flex-grow="[2, 1]" :flex-grow="[2, 1,1,1]"`
flex-basis 举例:`:flex-basis="["200px", "100px","300px"]" :flex-basis="["75%", "25%"]" :flex-basis="["40%", "20%", "20%", "20%"]"`
',
- 'en-US': 'You can use the `flex-basis` attribute to set the width of the content slot. The flex-basis type is an array. A maximum of four values can be transferred. The percentage, fixed width, and inherent size keywords are supported. The default value is auto. For details, see the flex-basis attribute of Flex.
By setting the `flex-grow` property, you can set the relative proportion of the remaining space allocated to each item in the flex container. The default value is 1. If you do not want to automatically fill the main container, set this parameter to 0. For details, see the flex-grow attribute of flex.
flex-grow举例:`:flex-grow="[0, 0]":flex-grow="[2, 1]":flex-grow="[2,1,1]"`
flex-basis例如:`:flex-basis="["200px","100px","300px"]":flex-basis="["75%","25%"]":flex-basis="["40%","20%","20%"]"`
'
+ 'en-US':
+ 'You can use the `flex-basis` attribute to set the width of the content slot. The flex-basis type is an array. A maximum of four values can be transferred. The percentage, fixed width, and inherent size keywords are supported. The default value is auto. For details, see the flex-basis attribute of Flex.
By setting the `flex-grow` property, you can set the relative proportion of the remaining space allocated to each item in the flex container. The default value is 1. If you do not want to automatically fill the main container, set this parameter to 0. For details, see the flex-grow attribute of flex.
flex-grow举例:`:flex-grow="[0, 0]":flex-grow="[2, 1]":flex-grow="[2,1,1]"`
flex-basis例如:`:flex-basis="["200px","100px","300px"]":flex-basis="["75%","25%"]":flex-basis="["40%","20%","20%"]"`
'
},
codeFiles: ['custom-width.vue']
},
@@ -72,7 +74,8 @@ export default {
},
desc: {
'zh-CN': '操作列配置项 options 中添加属性 hidden 可以隐藏按钮,可以通过 disabled 属性禁用操作按钮。
',
- 'en-US': 'The hidden attribute is added to the options configuration item in the Operation column to hide the button. The disabled attribute can be used to disable the operation button.
'
+ 'en-US':
+ 'The hidden attribute is added to the options configuration item in the Operation column to hide the button. The disabled attribute can be used to disable the operation button.
'
},
codeFiles: ['icon-disabled.vue']
},
@@ -96,7 +99,8 @@ export default {
},
desc: {
'zh-CN': '通过属性`show-radio`设置卡片单选,需同时设置 label,`disabled` 属性可以禁用单选按钮 。
',
- 'en-US': 'Use the `show-radio` attribute to set the card radio option. You need to set the label and `disabled` attribute to disable the radio option button.
'
+ 'en-US':
+ 'Use the `show-radio` attribute to set the card radio option. You need to set the label and `disabled` attribute to disable the radio option button.
'
},
codeFiles: ['show-radio.vue']
},
@@ -108,7 +112,8 @@ export default {
},
desc: {
'zh-CN': '通过属性`show-checkbox`设置卡片多选,需同时设置 label,`disabled` 属性可以禁用复选按钮 。
',
- 'en-US': 'Use the `show-checkbox` attribute to set multiple card selections. You need to set the label at the same time. The `disabled` attribute can disable the check button.
'
+ 'en-US':
+ 'Use the `show-checkbox` attribute to set multiple card selections. You need to set the label at the same time. The `disabled` attribute can disable the check button.
'
},
codeFiles: ['show-checkbox.vue']
},
@@ -121,203 +126,10 @@ export default {
desc: {
'zh-CN':
'通过引入`column-list-group`组件来对列表进行分组,使用列表组结合复选功能时,需要给 item 设置 label,以此来记录选中的列表项。
',
- 'en-US': 'The `column-list-group` component is introduced to group lists. When the list group and check function are used, you need to set labels for items to record the selected list items.
'
+ 'en-US':
+ 'The `column-list-group` component is introduced to group lists. When the list group and check function are used, you need to set labels for items to record the selected list items.
'
},
codeFiles: ['list-group.vue']
}
- ],
- apis: [
- {
- 'name': 'ColumnListItem',
- 'type': 'component',
- 'props': [
- {
- 'name': 'auto-width',
- 'type': 'Boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '卡片的宽度是否自动撑开,设置后将不再给卡片设置固定宽度',
- 'en-US': 'Indicates whether the card width is automatically expanded. After the setting, the card width is not fixed.'
- },
- 'demoId': ''
- },
- {
- 'name': 'disabled',
- 'type': 'Boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '卡片禁用勾选',
- 'en-US': 'Card Disable Check'
- },
- 'demoId': 'icon-disabled'
- },
- {
- 'name': 'round',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '通过 round 设置是否展示圆形',
- 'en-US': 'Use round to set whether to display a circle.'
- },
- 'demoId': ''
- },
- {
- 'name': 'flex-basis',
- 'type': 'Array',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置内容插槽的宽度,最多能传入 4 个值,支持百分比,固定宽度及固有的尺寸关键词,默认为 auto。',
- 'en-US': 'Set the width of the content slot. A maximum of four values can be transferred. The percentage, fixed width, and inherent size keywords are supported. The default value is auto.'
- },
- 'demoId': ''
- },
- {
- 'name': 'flex-grow',
- 'type': 'Array',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置每一项在 flex 容器中分配剩余空间的相对比例,默认为 [1, 1, 1, 1]。',
- 'en-US': 'Indicates the relative proportion of the remaining space allocated to each item in the flex container. The default value is [1, 1, 1, 1].'
- },
- 'demoId': ''
- },
- {
- 'name': 'icon-more',
- 'type': 'Object',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '更多按钮图标,可传入一个svg图标对象进行替换',
- 'en-US': 'More button icons can be replaced by a svg icon object.'
- },
- 'demoId': ''
- },
- {
- 'name': 'image',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '图片地址',
- 'en-US': 'Picture Address'
- },
- 'demoId': ''
- },
- {
- 'name': 'label',
- 'type': 'String / Number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': 'checkbox或radio的label',
- 'en-US': 'Checkbox or radio label'
- },
- 'demoId': ''
- },
- {
- 'name': 'options',
- 'type': 'Array',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '操作按钮配置',
- 'en-US': 'Operation Button Configuration'
- },
- 'demoId': ''
- },
- {
- 'name': 'show-checkbox',
- 'type': 'Boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '显示checkbox按钮',
- 'en-US': 'Show the checkbox button'
- },
- 'demoId': 'show-checkbox'
- },
- {
- 'name': 'show-radio',
- 'type': 'Boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '显示radio按钮',
- 'en-US': 'Show radio button'
- },
- 'demoId': 'show-radio'
- },
- {
- 'name': 'size',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '尺寸,支持medium、small 2个尺寸,默认值为medium',
- 'en-US': 'Indicates the size. The options are medium and small. The default value is medium.'
- },
- 'demoId': 'size'
- }
- ],
- 'events': [
- {
- 'name': 'change',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '组件选中/取消选中事件',
- 'en-US': 'Component check/uncheck event'
- },
- 'demoId': ''
- },
- {
- 'name': 'icon-click',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '操作栏按钮点击事件',
- 'en-US': 'Operation bar button click event'
- },
- 'demoId': 'icon-click-event'
- }
- ],
- 'slots': [
- {
- 'name': 'column1',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '内容插槽1', 'en-US': 'Content Slot 1' },
- 'demoId': 'content-slot'
- },
- {
- 'name': 'column2',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '内容插槽2', 'en-US': 'Content Slot 2' },
- 'demoId': 'content-slot'
- },
- {
- 'name': 'column3',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '内容插槽3', 'en-US': 'Content Slot 3' },
- 'demoId': 'content-slot'
- },
- {
- 'name': 'column4',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '内容插槽4', 'en-US': 'Content Slot 4' },
- 'demoId': 'content-slot'
- },
- {
- 'name': 'image',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '图片插槽', 'en-US': 'Picture Slot' },
- 'demoId': 'image-operate-slot'
- },
- {
- 'name': 'operate',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '操作栏插槽', 'en-US': 'Action Bar Slots' },
- 'demoId': 'image-operate-slot'
- }
- ]
- },
]
}
diff --git a/examples/sites/demos/mobile-first/app/currency/basic-usage.vue b/examples/sites/demos/mobile-first/app/currency/basic-usage.vue
new file mode 100644
index 000000000..37c7472ad
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/currency/basic-usage.vue
@@ -0,0 +1,38 @@
+
+
+ 选择币种
+
+ 当前选中值:{{ value }}
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/currency/custom-service.vue b/examples/sites/demos/mobile-first/app/currency/custom-service.vue
new file mode 100644
index 000000000..b07ccb28f
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/currency/custom-service.vue
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/currency/mode-form.vue b/examples/sites/demos/mobile-first/app/currency/mode-form.vue
new file mode 100644
index 000000000..47c23f19d
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/currency/mode-form.vue
@@ -0,0 +1,28 @@
+
+
+
+ 当前选中值:{{ value }}
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/currency/multiple.vue b/examples/sites/demos/mobile-first/app/currency/multiple.vue
new file mode 100644
index 000000000..22e10c498
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/currency/multiple.vue
@@ -0,0 +1,35 @@
+
+
+ 选择币种
+
+ 当前选中值:{{ value }}
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/currency/webdoc/currency.cn.md b/examples/sites/demos/mobile-first/app/currency/webdoc/currency.cn.md
new file mode 100644
index 000000000..4792337f0
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/currency/webdoc/currency.cn.md
@@ -0,0 +1,8 @@
+---
+title: Currency
+---
+
+# Currency Used to display and select currency names. The options are obtained by configuring the data source.
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/currency/webdoc/currency.en.md b/examples/sites/demos/mobile-first/app/currency/webdoc/currency.en.md
new file mode 100644
index 000000000..b625ab753
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/currency/webdoc/currency.en.md
@@ -0,0 +1,8 @@
+---
+title: Currency 币种
+---
+
+# Currency 币种组件,用于货币名称展示及选择,通过配置数据源获取选项
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/currency/webdoc/currency.js b/examples/sites/demos/mobile-first/app/currency/webdoc/currency.js
new file mode 100644
index 000000000..4d252915e
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/currency/webdoc/currency.js
@@ -0,0 +1,43 @@
+export default {
+ column: '2',
+ owner: '',
+ demos: [
+ {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'basic usage'
+ },
+ desc: {
+ 'zh-CN': '',
+ 'en-US': ''
+ },
+ codeFiles: ['basic-usage.vue']
+ },
+ {
+ demoId: 'multiple',
+ name: {
+ 'zh-CN': '多选',
+ 'en-US': 'Multiselect'
+ },
+ desc: {
+ 'zh-CN': '',
+ 'en-US': ''
+ },
+ codeFiles: ['multiple.vue']
+ },
+ {
+ demoId: 'custom-service',
+ name: {
+ 'zh-CN': '自定义服务',
+ 'en-US': 'Custom Service'
+ },
+ desc: {
+ 'zh-CN':
+ '\n
通过 fetch-currency 属性可以指定一个方法,在方法中可实现请求自定义的服务。
\n 通过 searchConfig 属性开启远程搜索,其中 options 为搜索面板列表, searchMethod 为自定义搜索方法。
\n 自定义服务时,通过 fields 属性可以指定显示内容和值在数据中对应的字段。
\n ',
+ 'en-US': ''
+ },
+ codeFiles: ['custom-service.vue']
+ }
+ ]
+}
diff --git a/examples/sites/demos/mobile-first/app/date-picker-mobile/basic-usage.vue b/examples/sites/demos/mobile-first/app/date-picker-mobile/basic-usage.vue
index bbee84e53..4a5f14a49 100644
--- a/examples/sites/demos/mobile-first/app/date-picker-mobile/basic-usage.vue
+++ b/examples/sites/demos/mobile-first/app/date-picker-mobile/basic-usage.vue
@@ -1,5 +1,5 @@
-
+
日期选择器组件
值:{{ value }}
格式化值:{{ formatValue }}
diff --git a/examples/sites/demos/mobile-first/app/date-picker-mobile/date-range.vue b/examples/sites/demos/mobile-first/app/date-picker-mobile/date-range.vue
index d6e43779c..30dddf605 100644
--- a/examples/sites/demos/mobile-first/app/date-picker-mobile/date-range.vue
+++ b/examples/sites/demos/mobile-first/app/date-picker-mobile/date-range.vue
@@ -1,5 +1,5 @@
-
+
日期选择器组件
值:{{ value }}
格式化值:{{ formatValue }}
diff --git a/examples/sites/demos/mobile-first/app/date-picker-mobile/datetime-range.vue b/examples/sites/demos/mobile-first/app/date-picker-mobile/datetime-range.vue
index 1d0c9ed5f..899af32a8 100644
--- a/examples/sites/demos/mobile-first/app/date-picker-mobile/datetime-range.vue
+++ b/examples/sites/demos/mobile-first/app/date-picker-mobile/datetime-range.vue
@@ -1,5 +1,5 @@
-
+
日期选择器组件
值:{{ value }}
格式化值:{{ formatValue }}
diff --git a/examples/sites/demos/mobile-first/app/date-picker-mobile/datetime.vue b/examples/sites/demos/mobile-first/app/date-picker-mobile/datetime.vue
index 3c4eae11e..8b87d89c8 100644
--- a/examples/sites/demos/mobile-first/app/date-picker-mobile/datetime.vue
+++ b/examples/sites/demos/mobile-first/app/date-picker-mobile/datetime.vue
@@ -1,5 +1,5 @@
-
+
日期时间选择器
值:{{ value }}
格式化值:{{ formatValue }}
diff --git a/examples/sites/demos/mobile-first/app/date-picker-mobile/disabled.vue b/examples/sites/demos/mobile-first/app/date-picker-mobile/disabled.vue
index f5b409b5b..ba4bfca1d 100644
--- a/examples/sites/demos/mobile-first/app/date-picker-mobile/disabled.vue
+++ b/examples/sites/demos/mobile-first/app/date-picker-mobile/disabled.vue
@@ -1,5 +1,5 @@
-
+
日期选择器组件
值:{{ value }}
格式化值:{{ formatValue }}
diff --git a/examples/sites/demos/mobile-first/app/date-picker-mobile/webdoc/date-picker-mobile.js b/examples/sites/demos/mobile-first/app/date-picker-mobile/webdoc/date-picker-mobile.js
index 604be69ee..3ad352134 100644
--- a/examples/sites/demos/mobile-first/app/date-picker-mobile/webdoc/date-picker-mobile.js
+++ b/examples/sites/demos/mobile-first/app/date-picker-mobile/webdoc/date-picker-mobile.js
@@ -14,7 +14,6 @@ export default {
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'datetime',
name: {
@@ -103,6 +102,5 @@ export default {
},
codeFiles: ['year-month-disabled.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/date-picker-mobile/year-month-disabled.vue b/examples/sites/demos/mobile-first/app/date-picker-mobile/year-month-disabled.vue
index 74804d8f5..2d41fe8fa 100644
--- a/examples/sites/demos/mobile-first/app/date-picker-mobile/year-month-disabled.vue
+++ b/examples/sites/demos/mobile-first/app/date-picker-mobile/year-month-disabled.vue
@@ -1,5 +1,5 @@
-
+
年月选择器
值:{{ value }}
格式化值:{{ formatValue }}
diff --git a/examples/sites/demos/mobile-first/app/date-picker-mobile/year-month-range.vue b/examples/sites/demos/mobile-first/app/date-picker-mobile/year-month-range.vue
index b517d180d..1bc8de63a 100644
--- a/examples/sites/demos/mobile-first/app/date-picker-mobile/year-month-range.vue
+++ b/examples/sites/demos/mobile-first/app/date-picker-mobile/year-month-range.vue
@@ -1,5 +1,5 @@
-
+
年月选择器
值:{{ value }}
格式化值:{{ formatValue }}
diff --git a/examples/sites/demos/mobile-first/app/date-picker-mobile/year-month.vue b/examples/sites/demos/mobile-first/app/date-picker-mobile/year-month.vue
index dd1c917be..74753f974 100644
--- a/examples/sites/demos/mobile-first/app/date-picker-mobile/year-month.vue
+++ b/examples/sites/demos/mobile-first/app/date-picker-mobile/year-month.vue
@@ -1,5 +1,5 @@
-
+
年月选择器
值:{{ value }}
格式化值:{{ formatValue }}
diff --git a/examples/sites/demos/mobile-first/app/dialog-box/basic-usage.vue b/examples/sites/demos/mobile-first/app/dialog-box/basic-usage.vue
new file mode 100644
index 000000000..e15e3d19c
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/dialog-box/basic-usage.vue
@@ -0,0 +1,57 @@
+
+
+
+ 默认属性配置
+ 隐藏头部
+ 隐藏关闭按钮
+
+
+
+ 自定义内容
+
+
+ 自定义内容
+
+ 自定义内容
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/dialog-box/dialog-before-close.vue b/examples/sites/demos/mobile-first/app/dialog-box/dialog-before-close.vue
new file mode 100644
index 000000000..c947ba075
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/dialog-box/dialog-before-close.vue
@@ -0,0 +1,48 @@
+
+
+ 弹出Dialog{{ boxVisibility }}
+
+ dialog-box内容
+
+ 确定
+ 取消
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/dialog-box/dialog-destroy-close.vue b/examples/sites/demos/mobile-first/app/dialog-box/dialog-destroy-close.vue
new file mode 100644
index 000000000..9e906750e
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/dialog-box/dialog-destroy-close.vue
@@ -0,0 +1,40 @@
+
+
+
+ 关闭时销毁
+ 关闭时不销毁
+
+
+ 打开弹框
+
+ dialog-box内容
+
+ 确定
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/dialog-box/dialog-fullscreen.vue b/examples/sites/demos/mobile-first/app/dialog-box/dialog-fullscreen.vue
new file mode 100644
index 000000000..66a1cac68
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/dialog-box/dialog-fullscreen.vue
@@ -0,0 +1,38 @@
+
+
+ 全屏打开
+ 自定义内容
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/dialog-box/dialog-modal.vue b/examples/sites/demos/mobile-first/app/dialog-box/dialog-modal.vue
new file mode 100644
index 000000000..903430d37
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/dialog-box/dialog-modal.vue
@@ -0,0 +1,35 @@
+
+
+ 关闭遮罩层
+ 自定义内容
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/dialog-box/dialog-slot.vue b/examples/sites/demos/mobile-first/app/dialog-box/dialog-slot.vue
new file mode 100644
index 000000000..f0f62ff24
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/dialog-box/dialog-slot.vue
@@ -0,0 +1,50 @@
+
+
+
+ 内容插槽
+ 底部插槽
+
+
+
+ 自定义内容
+
+
+
+ 自定义按钮1 自定义按钮2
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/dialog-box/webdoc/dialog-box.cn.md b/examples/sites/demos/mobile-first/app/dialog-box/webdoc/dialog-box.cn.md
new file mode 100644
index 000000000..4a4ba2677
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/dialog-box/webdoc/dialog-box.cn.md
@@ -0,0 +1,9 @@
+---
+title: Dialog-Box 弹窗组件
+---
+
+# Dialog-Box 弹窗组件
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/dialog-box/webdoc/dialog-box.en.md b/examples/sites/demos/mobile-first/app/dialog-box/webdoc/dialog-box.en.md
new file mode 100644
index 000000000..6d68e88a8
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/dialog-box/webdoc/dialog-box.en.md
@@ -0,0 +1,9 @@
+---
+title: Drawer drawer assembly
+---
+
+# Drawer drawer assembly
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/dialog-box/webdoc/dialog-box.js b/examples/sites/demos/mobile-first/app/dialog-box/webdoc/dialog-box.js
new file mode 100644
index 000000000..1c6225931
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/dialog-box/webdoc/dialog-box.js
@@ -0,0 +1,87 @@
+export default {
+ column: '2',
+ owner: '',
+ demos: [
+ {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN':
+ 'show-header
:显示头部,默认值为true
;show-close
:显示头部关闭按钮,默认值为false
',
+ 'en-US':
+ 'show-header
: displays the header. The default value is true
. show-close
: button for closing the display header. The default value is false
.'
+ },
+ codeFiles: ['basic-usage.vue']
+ },
+ {
+ demoId: 'dialog-before-close',
+ name: {
+ 'zh-CN': '拦截弹窗关闭',
+ 'en-US': 'Intercept pop-up window closed'
+ },
+ desc: {
+ 'zh-CN':
+ '添加before-close
属性可以配置一个拦截弹窗关闭的方法。如果方法返回false
值,则拦截弹窗关闭;否则不拦截
',
+ 'en-US':
+ 'Add the before-close
attribute to configure a method for blocking pop-up window closure. If the method returns the false
value, the pop-up window is closed. Otherwise, the pop-up window is not blocked
'
+ },
+ codeFiles: ['dialog-before-close.vue']
+ },
+ {
+ demoId: 'dialog-destroy-close',
+ name: {
+ 'zh-CN': '关闭时销毁 Dialog-box 中的元素',
+ 'en-US': 'Destroy elements in Dialog-box when closed'
+ },
+ desc: {
+ 'zh-CN':
+ '添加destroy-on-close
控制是否在关闭时销毁Dialog-box
中的元素,默认值为false
',
+ 'en-US':
+ '
The destroy-on-close
parameter is added to control whether to destroy the elements in the Dialog-box
when the function is disabled. The default value is false
.
'
+ },
+ codeFiles: ['dialog-destroy-close.vue']
+ },
+ {
+ demoId: 'dialog-fullscreen',
+ name: {
+ 'zh-CN': '全屏功能',
+ 'en-US': 'Full Screen Function'
+ },
+ desc: {
+ 'zh-CN': '添加fullscreen
属性设置全屏打开,默认值为false
',
+ 'en-US':
+ '
The fullscreen
attribute is added to enable full screen. The default value is false
.
'
+ },
+ codeFiles: ['dialog-fullscreen.vue']
+ },
+ {
+ demoId: 'dialog-modal',
+ name: {
+ 'zh-CN': '遮罩层',
+ 'en-US': 'Masking layer one'
+ },
+ desc: {
+ 'zh-CN':
+ '添加modal
属性可以关闭遮罩层,默认值为true
。设置close-on-click-modal
为false
后将禁用该功能,默认值为true
',
+ 'en-US':
+ 'Add the modal
attribute to disable the mask layer. The default value is true
. If close-on-click-modal
is set to false, this function is disabled. The default value is true.
'
+ },
+ codeFiles: ['dialog-modal.vue']
+ },
+ {
+ demoId: 'dialog-slot',
+ name: {
+ 'zh-CN': '弹窗插槽',
+ 'en-US': 'Pop-up slot'
+ },
+ desc: {
+ 'zh-CN': 'default
: 内容默认插槽。footer
: 底部插槽
',
+ 'en-US': 'code>default: content default slot. footer
: bottom slot
'
+ },
+ codeFiles: ['dialog-slot.vue']
+ }
+ ]
+}
diff --git a/examples/sites/demos/mobile-first/app/drawer/webdoc/drawer.js b/examples/sites/demos/mobile-first/app/drawer/webdoc/drawer.js
index 227d84454..500e5f00b 100644
--- a/examples/sites/demos/mobile-first/app/drawer/webdoc/drawer.js
+++ b/examples/sites/demos/mobile-first/app/drawer/webdoc/drawer.js
@@ -9,8 +9,8 @@ export default {
'en-US': 'Basic Usage'
},
desc: {
- 'zh-CN': '<、p>',
- 'en-US': '
'
+ 'zh-CN': '',
+ 'en-US': ''
},
codeFiles: ['basic-usage.vue']
},
@@ -121,6 +121,5 @@ export default {
},
codeFiles: ['event.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/dropdown/disabled.vue b/examples/sites/demos/mobile-first/app/dropdown/disabled.vue
new file mode 100644
index 000000000..926b809ea
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/dropdown/disabled.vue
@@ -0,0 +1,45 @@
+
+
+
+ 下拉菜单
+
+
+ 黄金糕
+ 狮子头
+ 螺蛳粉
+ 不能选择
+ 蚵仔煎
+
+
+
+
+
+
+
+
+
+ 下拉菜单
+
+
+ 黄金糕
+ 狮子头
+ 螺蛳粉
+ 双皮奶
+ 蚵仔煎
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/dropdown/hide-on-click.vue b/examples/sites/demos/mobile-first/app/dropdown/hide-on-click.vue
new file mode 100644
index 000000000..7e63f74b8
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/dropdown/hide-on-click.vue
@@ -0,0 +1,26 @@
+
+
+ 下拉菜单
+
+
+ 黄金糕
+ 狮子头
+ 螺蛳粉
+ 双皮奶
+ 蚵仔煎
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/dropdown/pop-direction.vue b/examples/sites/demos/mobile-first/app/dropdown/pop-direction.vue
index bee12f931..21b406e84 100644
--- a/examples/sites/demos/mobile-first/app/dropdown/pop-direction.vue
+++ b/examples/sites/demos/mobile-first/app/dropdown/pop-direction.vue
@@ -2,11 +2,11 @@
- 下居右
+ 默认
更多
-
+
选择一
选择二
选择三
diff --git a/examples/sites/demos/mobile-first/app/dropdown/round.vue b/examples/sites/demos/mobile-first/app/dropdown/round.vue
new file mode 100644
index 000000000..68cfd842b
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/dropdown/round.vue
@@ -0,0 +1,26 @@
+
+
+ 下拉菜单
+
+
+ 黄金糕
+ 狮子头
+ 螺蛳粉
+ 双皮奶
+ 蚵仔煎
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/dropdown/webdoc/dropdown.js b/examples/sites/demos/mobile-first/app/dropdown/webdoc/dropdown.js
index 695e146ee..8bd13a915 100644
--- a/examples/sites/demos/mobile-first/app/dropdown/webdoc/dropdown.js
+++ b/examples/sites/demos/mobile-first/app/dropdown/webdoc/dropdown.js
@@ -14,7 +14,6 @@ export default {
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'checked-status',
name: {
@@ -211,84 +210,44 @@ export default {
'en-US': 'The maximum height of the drop-down can be set by adding the `max-height` attribute.
'
},
codeFiles: ['max-height.vue']
- }
- ],
- apis: [
- {
- 'name': 'Dropdown',
- 'type': 'component',
- 'props': [
- {
- 'name': 'show-self-icon ',
- 'type': 'Boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '更多图标下拉菜单。',
- 'en-US': 'More icon drop-down list.'
- },
- 'demoId': 'many-dropdown'
- },
- {
- 'name': 'single-button',
- 'type': 'Boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '下拉触发元素呈现为按钮组。',
- 'en-US': 'The drop-down trigger element is rendered as a button group.'
- },
- 'demoId': 'button-dropdown'
- }
- ]
},
{
- 'name': 'Dropdown-Menu',
- 'type': '属性',
- 'props': [
- {
- 'name': 'custom-class',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置弹出下拉自定义样式。',
- 'en-US': 'Set the custom style of the pop-up drop-down list.'
- }
- },
- {
- 'name': 'max-height',
- 'type': 'Number | String',
- 'defaultValue': '400',
- 'desc': {
- 'zh-CN': '设置下拉最大高度。',
- 'en-US': 'Sets the maximum pull-down height. '
- },
- 'demoId': 'max-height'
- },
- {
- 'name': 'multi-stage',
- 'type': 'Boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '设置二级下拉菜单。',
- 'en-US': 'Sets the level-2 drop-down list. '
- },
- 'demoId': 'multi-stage'
- }
- ]
+ demoId: 'disabled',
+ name: {
+ 'zh-CN': '禁用',
+ 'en-US': 'Disabled'
+ },
+ desc: {
+ 'zh-CN': 'Dropdown、DropdownItem 两个组件分别可以通过 disabled 属性设置禁用状态。
',
+ 'en-US': 'The Dropdown and DropdownItem components can be disabled through the disabled attribute.
'
+ },
+ codeFiles: ['disabled.vue']
},
{
- 'name': 'Dropdown-Item',
- 'type': '属性',
- 'props': [
- {
- 'name': 'level',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置二级下拉菜单标志',
- 'en-US': 'Sets the level-2 drop-down menu flag.'
- }
- }
- ]
+ demoId: 'hide-on-click',
+ name: {
+ 'zh-CN': '菜单隐藏方式',
+ 'en-US': 'Menu Hiding Mode'
+ },
+ desc: {
+ 'zh-CN':
+ '下拉菜单默认在点击菜单项后会被隐藏,由 `hide-on-click` 属性控制,默认为 `true`,设置为 `false` 可以关闭此功能。
',
+ 'en-US':
+ 'By default, the drop-down menu is hidden after a menu item is clicked. The drop-down menu is controlled by the `hide-on-click` attribute. The default value is `true`. You can set this parameter to `false` to disable this function.
'
+ },
+ codeFiles: ['hide-on-click.vue']
+ },
+ {
+ demoId: 'round',
+ name: {
+ 'zh-CN': '圆角',
+ 'en-US': 'Round'
+ },
+ desc: {
+ 'zh-CN': '`border` 为 `true` 时,通过 `round` 属性设置是否为圆角。
',
+ 'en-US': 'When `border` is set to `true`, the `round` attribute is used to set whether to round corners.
'
+ },
+ codeFiles: ['round.vue']
}
]
}
diff --git a/examples/sites/demos/mobile-first/app/exception/webdoc/exception.js b/examples/sites/demos/mobile-first/app/exception/webdoc/exception.js
index f1d582c0f..edbf0a9c6 100644
--- a/examples/sites/demos/mobile-first/app/exception/webdoc/exception.js
+++ b/examples/sites/demos/mobile-first/app/exception/webdoc/exception.js
@@ -1,7 +1,8 @@
export default {
column: '2',
owner: '',
- demos: [{
+ demos: [
+ {
demoId: 'message',
name: {
'zh-CN': '基本用法',
@@ -20,8 +21,10 @@ export default {
'en-US': 'Page-level void'
},
desc: {
- 'zh-CN': '通过添加`page-empty`属性展示页面级空态,其中 type 类型有`pagenoperm`、 `pageweaknet`、 `pagenothing`、 `pageservererror`
对应场景:
`pagenoperm` :无访问权限
`pageweaknet` :网络异常
`pagenothing` :你访问的页面不存在
`pageservererror`:服务器异常
',
- 'en-US': 'The page-level empty state is displayed by adding the `page-empty` attribute. The type types include `pagenoperm`, `pageweaknet`, `pagenothing`, and `pageservererror`.
Scenario:
`pagenoperm`: no access permission
`pageweaknet`: network exception
`pagenothing`: The page you access does not exist
`pageservererror`: The server is abnormal
'
+ 'zh-CN':
+ '通过添加`page-empty`属性展示页面级空态,其中 type 类型有`pagenoperm`、 `pageweaknet`、 `pagenothing`、 `pageservererror`
对应场景:
`pagenoperm` :无访问权限
`pageweaknet` :网络异常
`pagenothing` :你访问的页面不存在
`pageservererror`:服务器异常
',
+ 'en-US':
+ 'The page-level empty state is displayed by adding the `page-empty` attribute. The type types include `pagenoperm`, `pageweaknet`, `pagenothing`, and `pageservererror`.
Scenario:
`pagenoperm`: no access permission
`pageweaknet`: network exception
`pagenothing`: The page you access does not exist
`pageservererror`: The server is abnormal
'
},
codeFiles: ['page-empty.vue']
},
@@ -32,8 +35,10 @@ export default {
'en-US': 'Component-level empty state'
},
desc: {
- 'zh-CN': '通过添加`component-empty`属性展示组件级空态,其中 type 类型有`noperm、 nodata、 weaknet、noresult、 nonews`
对应场景:
`noperm` :无访问权限
`nodata` :暂无数据
`weaknet` :网络不给力
`noresult`:无相关搜索结果
`nonews`:暂无最新消息
',
- 'en-US': 'Add the `component-empty` attribute to display the component-level empty state. The type type can be `noperm, nodata, weaknet, noresult, or nonews`
The corresponding scenario is as follows:
`noperm`: No access
`nodata`: no data
`weaknet`: network is not powerful
`noresult`: no related search results
`nonews`: no latest news
'
+ 'zh-CN':
+ '通过添加`component-empty`属性展示组件级空态,其中 type 类型有`noperm、 nodata、 weaknet、noresult、 nonews`
对应场景:
`noperm` :无访问权限
`nodata` :暂无数据
`weaknet` :网络不给力
`noresult`:无相关搜索结果
`nonews`:暂无最新消息
',
+ 'en-US':
+ 'Add the `component-empty` attribute to display the component-level empty state. The type type can be `noperm, nodata, weaknet, noresult, or nonews`
The corresponding scenario is as follows:
`noperm`: No access
`nodata`: no data
`weaknet`: network is not powerful
`noresult`: no related search results
`nonews`: no latest news
'
},
codeFiles: ['component-empty.vue']
},
@@ -73,81 +78,5 @@ export default {
},
codeFiles: ['content-slot.vue']
}
- ],
- apis: [{
- 'name': 'Exception',
- 'type': 'component',
- 'props': [{
- 'name': 'component-page',
- 'type': 'Boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置组件级空态',
- 'en-US': 'Set component-level empty state'
- },
- 'demoId': 'component-empty'
- },
- {
- 'name': 'exception-class',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置自定义类',
- 'en-US': 'Setting Custom Classes'
- },
- 'demoId': ''
- },
- {
- 'name': 'page-empty ',
- 'type': 'Boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置页面级空态',
- 'en-US': 'Set page-level empty status'
- },
- 'demoId': 'page-empty'
- },
- {
- 'name': 'sub-message',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置二级标题',
- 'en-US': 'Set Level-2 Title'
- },
- 'demoId': 'sub-message'
- },
- {
- 'name': 'type',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置页面级空态类型。默认值为nodata',
- 'en-US': 'Sets the page-level empty state type. The default value is nodata.'
- },
- 'demoId': 'page-empty'
- }
- ],
- 'slots': [{
- 'name': 'content',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '内容插槽。可以设置自定义展示内容',
- 'en-US': 'Content slot. Custom display content can be set.'
- },
- 'demoId': 'content-slot'
- },
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '默认插槽',
- 'en-US': 'Default Slot'
- },
- 'demoId': ''
- }
- ]
- }]
-}
\ No newline at end of file
+ ]
+}
diff --git a/examples/sites/demos/mobile-first/app/file-upload/display-only-picture.vue b/examples/sites/demos/mobile-first/app/file-upload/display-only-picture.vue
index fd74c0f22..036ac7c05 100644
--- a/examples/sites/demos/mobile-first/app/file-upload/display-only-picture.vue
+++ b/examples/sites/demos/mobile-first/app/file-upload/display-only-picture.vue
@@ -21,23 +21,23 @@ export default {
fileList1: [
{
name: 'Snipaste_2022-12-02_18-05-51.png',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
}
],
fileList2: [
{
name: 'test1.png',
- url: '/static/images/ld.png',
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`,
status: 'uploading',
percentage: '50'
},
{
name: 'test2',
- url: '/static/images/ry.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ry.png`
},
{
name: 'test3',
- url: '/static/images/ld.png',
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`,
status: 'fail'
}
]
diff --git a/examples/sites/demos/mobile-first/app/file-upload/download-picture.vue b/examples/sites/demos/mobile-first/app/file-upload/download-picture.vue
index 17e14734a..a0b810ee5 100644
--- a/examples/sites/demos/mobile-first/app/file-upload/download-picture.vue
+++ b/examples/sites/demos/mobile-first/app/file-upload/download-picture.vue
@@ -33,23 +33,23 @@ export default {
fileList1: [
{
name: 'Snipaste_2022-12-02_18-05-51.png',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
}
],
fileList2: [
{
name: 'test1.png',
- url: '/static/images/ld.png',
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`,
status: 'uploading',
percentage: '50'
},
{
name: 'test2',
- url: '/static/images/ry.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ry.png`
},
{
name: 'test3',
- url: '/static/images/ld.png',
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`,
status: 'fail'
}
]
diff --git a/examples/sites/demos/mobile-first/app/file-upload/drag-file-list.vue b/examples/sites/demos/mobile-first/app/file-upload/drag-file-list.vue
index 767e8b512..e0ad5e5c0 100644
--- a/examples/sites/demos/mobile-first/app/file-upload/drag-file-list.vue
+++ b/examples/sites/demos/mobile-first/app/file-upload/drag-file-list.vue
@@ -28,7 +28,7 @@ export default {
fileList1: [
{
name: 'ld.png',
- url: '/static/images/ld.png',
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`,
status: 'uploading',
percentage: 30
}
@@ -36,13 +36,13 @@ export default {
fileList2: [
{
name: 'ld.png',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
}
],
fileList3: [
{
name: 'ld.png',
- url: '/static/images/ld.png',
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`,
status: 'fail'
}
]
diff --git a/examples/sites/demos/mobile-first/app/file-upload/file-list.vue b/examples/sites/demos/mobile-first/app/file-upload/file-list.vue
index 29564cc5b..9c77e5b74 100644
--- a/examples/sites/demos/mobile-first/app/file-upload/file-list.vue
+++ b/examples/sites/demos/mobile-first/app/file-upload/file-list.vue
@@ -3,12 +3,11 @@
diff --git a/examples/sites/demos/mobile-first/app/file-upload/picture-card.vue b/examples/sites/demos/mobile-first/app/file-upload/picture-card.vue
index 29be53ba7..3f3830513 100644
--- a/examples/sites/demos/mobile-first/app/file-upload/picture-card.vue
+++ b/examples/sites/demos/mobile-first/app/file-upload/picture-card.vue
@@ -18,17 +18,17 @@ export default {
fileList: [
{
name: 'test1.png',
- url: '/static/images/ld.png',
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`,
status: 'uploading',
percentage: '50'
},
{
name: 'test2',
- url: '/static/images/ry.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ry.png`
},
{
name: 'test3',
- url: '/static/images/ld.png',
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`,
status: 'fail'
}
]
diff --git a/examples/sites/demos/mobile-first/app/file-upload/picture-show-name.vue b/examples/sites/demos/mobile-first/app/file-upload/picture-show-name.vue
index 512a0fffd..99e1fac01 100644
--- a/examples/sites/demos/mobile-first/app/file-upload/picture-show-name.vue
+++ b/examples/sites/demos/mobile-first/app/file-upload/picture-show-name.vue
@@ -18,17 +18,17 @@ export default {
fileList: [
{
name: 'Snipaste_2022-12-02_18-05-51.png',
- url: '/static/images/ld.png',
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`,
status: 'uploading',
percentage: '50'
},
{
name: 'test2',
- url: '/static/images/ry.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ry.png`
},
{
name: 'test1',
- url: '/static/images/ld.png',
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`,
status: 'fail'
}
]
diff --git a/examples/sites/demos/mobile-first/app/file-upload/picture.vue b/examples/sites/demos/mobile-first/app/file-upload/picture.vue
index 6b0159beb..3005e73ec 100644
--- a/examples/sites/demos/mobile-first/app/file-upload/picture.vue
+++ b/examples/sites/demos/mobile-first/app/file-upload/picture.vue
@@ -15,7 +15,7 @@ export default {
fileList: [
{
name: 'Snipaste_2022-12-02_18-05-51.png',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
}
]
}
diff --git a/examples/sites/demos/mobile-first/app/file-upload/preview-picture.vue b/examples/sites/demos/mobile-first/app/file-upload/preview-picture.vue
index 2f07c3d7b..ba4d25884 100644
--- a/examples/sites/demos/mobile-first/app/file-upload/preview-picture.vue
+++ b/examples/sites/demos/mobile-first/app/file-upload/preview-picture.vue
@@ -23,23 +23,23 @@ export default {
fileList1: [
{
name: 'Snipaste_2022-12-02_18-05-51.png',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
}
],
fileList2: [
{
name: 'test1.png',
- url: '/static/images/ld.png',
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`,
status: 'uploading',
percentage: '50'
},
{
name: 'test2',
- url: '/static/images/ry.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ry.png`
},
{
name: 'test3',
- url: '/static/images/ld.png',
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`,
status: 'fail'
}
]
diff --git a/examples/sites/demos/mobile-first/app/file-upload/re-upload-picture.vue b/examples/sites/demos/mobile-first/app/file-upload/re-upload-picture.vue
index 1ce4959af..bdc976e0d 100644
--- a/examples/sites/demos/mobile-first/app/file-upload/re-upload-picture.vue
+++ b/examples/sites/demos/mobile-first/app/file-upload/re-upload-picture.vue
@@ -17,7 +17,7 @@ export default {
fileList: [
{
name: 'test3',
- url: '/static/images/ld.png',
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`,
status: 'fail'
}
]
diff --git a/examples/sites/demos/mobile-first/app/file-upload/webdoc/file-upload.js b/examples/sites/demos/mobile-first/app/file-upload/webdoc/file-upload.js
index 7d8805017..a8c58f069 100644
--- a/examples/sites/demos/mobile-first/app/file-upload/webdoc/file-upload.js
+++ b/examples/sites/demos/mobile-first/app/file-upload/webdoc/file-upload.js
@@ -14,7 +14,6 @@ export default {
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'file-type',
name: {
@@ -330,15 +329,39 @@ export default {
{
demoId: 'assist-content',
name: {
- 'zh-CN': '插槽',
- 'en-US': 'events'
+ 'zh-CN': '辅助内容插槽',
+ 'en-US': 'Secondary Content Slot'
},
desc: {
- 'zh-CN': '`assist-content` 辅助内容插槽
',
- 'en-US': '
button click
'
+ 'zh-CN': 'assist-content
辅助内容插槽。
',
+ 'en-US': '
assist-content
secondary content slot.
'
},
codeFiles: ['assist-content.vue']
},
+ {
+ demoId: 'slot-operate',
+ name: {
+ 'zh-CN': '操作区域插槽',
+ 'en-US': 'Operating Area Slot'
+ },
+ desc: {
+ 'zh-CN': 'operate
定义操作区域插槽。
',
+ 'en-US': '
operate
Define operation area slot.
'
+ },
+ codeFiles: ['slot-operate.vue']
+ },
+ {
+ demoId: 'notice',
+ name: {
+ 'zh-CN': '公告通知插槽',
+ 'en-US': 'Bulletin Notification Slot'
+ },
+ desc: {
+ 'zh-CN': 'notice
定义公告通知插槽。
',
+ 'en-US': '
notice
Defines the bulletin notification slot.
'
+ },
+ codeFiles: ['notice.vue']
+ },
{
demoId: 'encrypt-config',
name: {
@@ -346,11 +369,12 @@ export default {
'en-US': 'Watermark and Encryption Configuration'
},
desc: {
- 'zh-CN': `设置 :encrypt-config: { enabled: true, ... }
开启水印和加密弹窗配置,encrypt-config
默认值为 { enabled: false, encrypt: false, watermark: '' }
`,
- 'en-US': `
Set the :encrypt-config: {enabled: true, ...}
to enable the watermark and encryption pop-up window configuration. encrypt-config
The default value is {enabled: false, encrypt: false, watermark: ''}
`
+ 'zh-CN':
+ "
设置 :encrypt-config: { enabled: true, ... }
开启水印和加密弹窗配置,encrypt-config
默认值为 { enabled: false, encrypt: false, watermark: '' }
",
+ 'en-US':
+ "
Set the :encrypt-config: {enabled: true, ...}
to enable the watermark and encryption pop-up window configuration. encrypt-config
The default value is {enabled: false, encrypt: false, watermark: ''}
"
},
codeFiles: ['encrypt-config.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/filter-bar/webdoc/filter-bar.js b/examples/sites/demos/mobile-first/app/filter-bar/webdoc/filter-bar.js
index 84068d85c..078453a42 100644
--- a/examples/sites/demos/mobile-first/app/filter-bar/webdoc/filter-bar.js
+++ b/examples/sites/demos/mobile-first/app/filter-bar/webdoc/filter-bar.js
@@ -38,67 +38,5 @@ export default {
},
codeFiles: ['slot.vue']
}
- ],
- apis: [
- {
- 'name': 'FilterBar',
- 'type': 'component',
- 'props': [
- {
- 'name': 'data',
- 'type': 'Array',
- 'defaultValue': '[]',
- 'desc': { 'zh-CN': '过滤栏列表数据。', 'en-US': 'Filter bar list data.' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'v-model',
- 'type': 'Array',
- 'defaultValue': '[]',
- 'desc': { 'zh-CN': '绑定值', 'en-US': 'Bind Value' },
- 'demoId': 'basic-usage'
- }
- ],
- 'methods': [
- {
- 'name': 'click(index) ',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '过滤项点击方法,index 是当前项索引。',
- 'en-US': 'Method of clicking a filtering item. index indicates the index of the current item.'
- },
- 'demoId': 'readonly'
- }
- ],
- 'events': [
- {
- 'name': 'click',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '过滤项点击事件。',
- 'en-US': 'Indicates the click event of a filtering item.'
- },
- 'demoId': 'readonly'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '过滤项插槽。', 'en-US': 'Filter item slot.' },
- 'demoId': 'slot'
- },
- {
- 'name': 'icon',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '组件右侧图标插槽。', 'en-US': 'Icon slot on the right of the component.' },
- 'demoId': 'slot'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile-first/app/filter/webdoc/filter.js b/examples/sites/demos/mobile-first/app/filter/webdoc/filter.js
index 5cf3add9e..bf7efb1e2 100644
--- a/examples/sites/demos/mobile-first/app/filter/webdoc/filter.js
+++ b/examples/sites/demos/mobile-first/app/filter/webdoc/filter.js
@@ -9,30 +9,10 @@ export default {
'en-US': 'basic usage'
},
desc: {
- 'zh-CN': `
- 注意
- 1、multiple
为 true 时初始第一个过滤项为 全部
,指全量数据未做过滤时的状态,并不表示全部过滤条件都选上
;
- 2、当选中任意过滤条件时,全部
选项自动去勾选。
- data 属性说明
- type
:类型可选值有:标签、列表 (tag | list);
- multiple
:是否开启多选,默认 false;
- placeholder
:当没有选中项时显示的占位文本;
- label
:面板的过滤组的说明文本;
- options
:面板的过滤组数据;
- panel-class
:面板的自定义样式,设置该属性会让面板取消max-height: 70%
的最高高度限制。
- 过滤类型 type
包括 标签、列表 (tag | list)
,通过 multiple
开启多选功能
-
`,
- 'en-US': `Note
- 1. When multiple
is set to true, the initial first filter item is All
, indicating that full data is not filtered. It does not mean that all filter criteria are selected.
- 2. When any filter condition is selected, All
is automatically deselected.
- data Attribute Description
- type
: type. The options are tag and tag | list.
- multiple
: indicates whether to enable multiple choices. The default value is false.
- placeholder
: placeholder text displayed when no item is selected.
- label
: description text of the filter group on the panel.
- options
: Filter group data of the panel.
- panel-class
: custom style of a panel. Setting this attribute will cancel the maximum height limit of max-height: 70%
.
- Filtering type type
includes tag and tag | list
. You can use multiple
to enable the multi-choice function.
`
+ 'zh-CN':
+ '\n 注意
\n 1、multiple
为 true 时初始第一个过滤项为 全部
,指全量数据未做过滤时的状态,并不表示全部过滤条件都选上
;
\n 2、当选中任意过滤条件时,全部
选项自动去勾选。
\n data 属性说明
\n type
:类型可选值有:标签、列表 (tag | list);
\n multiple
:是否开启多选,默认 false;
\n placeholder
:当没有选中项时显示的占位文本;
\n label
:面板的过滤组的说明文本;
\n options
:面板的过滤组数据;
\n panel-class
:面板的自定义样式,设置该属性会让面板取消max-height: 70%
的最高高度限制。
\n 过滤类型 type
包括 标签、列表 (tag | list)
,通过 multiple
开启多选功能\n
',
+ 'en-US':
+ 'Note
\n 1. When multiple
is set to true, the initial first filter item is All
, indicating that full data is not filtered. It does not mean that all filter criteria are selected.
\n 2. When any filter condition is selected, All
is automatically deselected.
\n data Attribute Description
\n type
: type. The options are tag and tag | list.
\n multiple
: indicates whether to enable multiple choices. The default value is false.
\n placeholder
: placeholder text displayed when no item is selected.
\n label
: description text of the filter group on the panel.
\n options
: Filter group data of the panel.
\n panel-class
: custom style of a panel. Setting this attribute will cancel the maximum height limit of max-height: 70%
.
\n Filtering type type
includes tag and tag | list
. You can use multiple
to enable the multi-choice function.
'
},
codeFiles: ['basic-usage.vue']
},
@@ -97,8 +77,10 @@ export default {
'en-US': 'Enumerated single-choice'
},
desc: {
- 'zh-CN': `设置过滤类型 type: 'list'
时,当前数据为枚举单选,通过 showAll: true
显示 全部
选择项。
`,
- 'en-US': `When the filter type type:'list'
is set, the current data is an enumerated single option. showAll: true
is used to display all
options.
`
+ 'zh-CN':
+ "设置过滤类型 type: 'list'
时,当前数据为枚举单选,通过 showAll: true
显示 全部
选择项。
",
+ 'en-US':
+ "When the filter type type:'list'
is set, the current data is an enumerated single option. showAll: true
is used to display all
options.
"
},
codeFiles: ['enumeration.vue']
},
@@ -114,121 +96,5 @@ export default {
},
codeFiles: ['slot.vue']
}
- ],
- apis: [
- {
- 'name': 'Filter',
- 'type': 'component',
- 'props': [
- {
- 'name': 'column-num',
- 'type': 'Number',
- 'defaultValue': '3',
- 'desc': {
- 'zh-CN': '面板每行的列数,默认值为 3。',
- 'en-US': 'Number of columns in each row of the panel. The default value is 3.'
- },
- 'demoId': 'column-num'
- },
- {
- 'name': 'custom-class',
- 'type': 'Array',
- 'defaultValue': '[]',
- 'desc': { 'zh-CN': '自定义组件 class 样式。', 'en-US': 'Customize the class style of the component.' }
- },
- {
- 'name': 'data',
- 'type': 'Array',
- 'defaultValue': '[]',
- 'desc': { 'zh-CN': '过滤列表数据。', 'en-US': 'Customized text of the close button' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'filter-value',
- 'type': 'Array',
- 'defaultValue': '[]',
- 'desc': {
- 'zh-CN': '过滤组绑定的值。',
- 'en-US': 'Indicates the value bound to the filtering group.'
- },
- 'demoId': 'filter-group'
- },
- {
- 'name': 'manual',
- 'type': 'Array',
- 'defaultValue': '[]',
- 'desc': {
- 'zh-CN': '过滤选项自定义对接外部组件,一般和 panel 面板事件一起使用。',
- 'en-US':
- 'Filtering options are customized to connect to external components. Generally, the filtering options are used together with panel events.'
- },
- 'demoId': 'manual'
- },
- {
- 'name': 'panel-class',
- 'type': 'Array',
- 'defaultValue': '[]',
- 'desc': { 'zh-CN': '自定义组件面板 class 样式。', 'en-US': 'Customize the Palette class style.' }
- },
- {
- 'name': 'v-model',
- 'type': 'Array',
- 'defaultValue': '[]',
- 'desc': { 'zh-CN': '绑定值', 'en-US': 'Bind Value' },
- 'demoId': 'basic-usage'
- }
- ],
- 'events': [
- {
- 'name': 'cancel',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '关闭面板时触发的事件。',
- 'en-US': 'Event triggered when a panel is closed.'
- }
- },
- {
- 'name': 'panel',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '打开面板时触发的事件。',
- 'en-US': 'Event triggered when a panel is opened.'
- },
- 'demoId': 'manual'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '过滤项插槽。', 'en-US': 'Filter item slot.' },
- 'demoId': 'slot'
- },
- {
- 'name': 'footer',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '面板底部按钮组插槽,提供了 cancel、reset、confirm 方法。',
- 'en-US':
- 'Button group slot at the bottom of the panel, which provides the cancel, reset, and confirm methods.'
- },
- 'demoId': 'slot'
- },
- {
- 'name': 'icon',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '过滤图标插槽,提供了参数 active,index。',
- 'en-US': 'Filter icon slot. The active and index parameters are provided.'
- },
- 'demoId': 'slot'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile-first/app/floating-button/animated.vue b/examples/sites/demos/mobile-first/app/floating-button/animated.vue
new file mode 100644
index 000000000..17a6c15b3
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/floating-button/animated.vue
@@ -0,0 +1,35 @@
+
+
+ 自定义滚动窗口
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/floating-button/basic-usage.vue b/examples/sites/demos/mobile-first/app/floating-button/basic-usage.vue
new file mode 100644
index 000000000..44bb81a47
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/floating-button/basic-usage.vue
@@ -0,0 +1,13 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/floating-button/button-bgcolor.vue b/examples/sites/demos/mobile-first/app/floating-button/button-bgcolor.vue
new file mode 100644
index 000000000..de782c695
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/floating-button/button-bgcolor.vue
@@ -0,0 +1,13 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/floating-button/button-position.vue b/examples/sites/demos/mobile-first/app/floating-button/button-position.vue
new file mode 100644
index 000000000..fb172cfac
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/floating-button/button-position.vue
@@ -0,0 +1,13 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/floating-button/custom-icon.vue b/examples/sites/demos/mobile-first/app/floating-button/custom-icon.vue
new file mode 100644
index 000000000..68b21391a
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/floating-button/custom-icon.vue
@@ -0,0 +1,19 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/floating-button/event.vue b/examples/sites/demos/mobile-first/app/floating-button/event.vue
new file mode 100644
index 000000000..3e4fc49d4
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/floating-button/event.vue
@@ -0,0 +1,45 @@
+
+
+
+ 主按钮
+ 拓展按钮
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/floating-button/expand.vue b/examples/sites/demos/mobile-first/app/floating-button/expand.vue
new file mode 100644
index 000000000..d6dd00751
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/floating-button/expand.vue
@@ -0,0 +1,45 @@
+
+
+
+ 默认
+ 居中
+ 向左
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/floating-button/mask.vue b/examples/sites/demos/mobile-first/app/floating-button/mask.vue
new file mode 100644
index 000000000..7da5202f9
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/floating-button/mask.vue
@@ -0,0 +1,67 @@
+
+
+ 切换模糊背景
+ 切换遮罩背景
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/floating-button/reclick.vue b/examples/sites/demos/mobile-first/app/floating-button/reclick.vue
new file mode 100644
index 000000000..48a679e06
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/floating-button/reclick.vue
@@ -0,0 +1,18 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/floating-button/webdoc/floating-button.cn.md b/examples/sites/demos/mobile-first/app/floating-button/webdoc/floating-button.cn.md
new file mode 100644
index 000000000..7194cd69b
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/floating-button/webdoc/floating-button.cn.md
@@ -0,0 +1,9 @@
+---
+title: FloatingButton 悬浮按钮
+---
+
+# FloatingButton 悬浮按钮
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/floating-button/webdoc/floating-button.en.md b/examples/sites/demos/mobile-first/app/floating-button/webdoc/floating-button.en.md
new file mode 100644
index 000000000..0a20a9f7d
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/floating-button/webdoc/floating-button.en.md
@@ -0,0 +1,9 @@
+---
+title: FloatingButton
+---
+
+# FloatingButton
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/floating-button/webdoc/floating-button.js b/examples/sites/demos/mobile-first/app/floating-button/webdoc/floating-button.js
new file mode 100644
index 000000000..b3e0f7d25
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/floating-button/webdoc/floating-button.js
@@ -0,0 +1,116 @@
+export default {
+ column: '2',
+ owner: '',
+ demos: [
+ {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'basic usage'
+ },
+ desc: {
+ 'zh-CN': '',
+ 'en-US': ''
+ },
+ codeFiles: ['basic-usage.vue']
+ },
+ {
+ demoId: 'button-position',
+ name: {
+ 'zh-CN': '位置',
+ 'en-US': 'Position'
+ },
+ desc: {
+ 'zh-CN': '通过 position
改变悬浮按钮位置,分别为居左、居右、居中。
',
+ 'en-US': ''
+ },
+ codeFiles: ['button-position.vue']
+ },
+ {
+ demoId: 'button-bgcolor',
+ name: {
+ 'zh-CN': '可选背景色',
+ 'en-US': 'Optional background color'
+ },
+ desc: {
+ 'zh-CN': '通过 background-color
设置按钮背景色,仅支持蓝色(默认)和白色。
',
+ 'en-US': ''
+ },
+ codeFiles: ['button-bgcolor.vue']
+ },
+ {
+ demoId: 'custom-icon',
+ name: {
+ 'zh-CN': '自定义图标',
+ 'en-US': 'Custom icon'
+ },
+ desc: {
+ 'zh-CN': '通过 icon
改变悬浮按钮图标。
',
+ 'en-US': ''
+ },
+ codeFiles: ['custom-icon.vue']
+ },
+ {
+ demoId: 'animated',
+ name: {
+ 'zh-CN': '交互动效',
+ 'en-US': 'Animation'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 animated
设置悬浮按钮动画。\n
\n悬浮按钮基于 body
或者 document
进行定位。
\n若 body
或者 document
元素超出 window
屏幕高度时,通过添加 animated
属性设置当页面滚动到指定位置时可实现动效。
\n若 body
或者 document
元素被内联框架(如:iframe)等外在元素包裹时会使动画失效。
\n此时可通过添加 element-selector
属性传入自定义元素的类名或者id名,当传入元素的子元素高度超出传入元素高度时,可设置 animated
属性实现滚动动效。
\n ',
+ 'en-US': ''
+ },
+ codeFiles: ['animated.vue']
+ },
+ {
+ demoId: 'event',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': 'Events'
+ },
+ desc: {
+ 'zh-CN': '通过 click
监听悬浮按钮点击事件。
',
+ 'en-US': ''
+ },
+ codeFiles: ['event.vue']
+ },
+ {
+ demoId: 'reclick',
+ name: {
+ 'zh-CN': '防重点击',
+ 'en-US': 'Prevent reclick'
+ },
+ desc: {
+ 'zh-CN': '通过 reset-time
设置点击防重延迟时间。
',
+ 'en-US': ''
+ },
+ codeFiles: ['reclick.vue']
+ },
+ {
+ demoId: 'expand',
+ name: {
+ 'zh-CN': '拓展按钮',
+ 'en-US': 'Expand button'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 is-expand
设置拓展按钮,通过 expand-list
属性传入数据。\n
\n expand-list 属性参数列表
\n 1、icon
需要传入的图标
\n 2、title
需要传入的标题,只展示前 4 个字符
\n \n ',
+ 'en-US': ''
+ },
+ codeFiles: ['expand.vue']
+ },
+ {
+ demoId: 'mask',
+ name: {
+ 'zh-CN': '遮罩层',
+ 'en-US': 'Mask'
+ },
+ desc: {
+ 'zh-CN': '通过 vague
设置模糊层,通过 mask
设置遮罩层。
',
+ 'en-US': ''
+ },
+ codeFiles: ['mask.vue']
+ }
+ ]
+}
diff --git a/examples/sites/demos/mobile-first/app/flowchart/basic-usage.vue b/examples/sites/demos/mobile-first/app/flowchart/basic-usage.vue
index 597ab2ce0..457818fce 100644
--- a/examples/sites/demos/mobile-first/app/flowchart/basic-usage.vue
+++ b/examples/sites/demos/mobile-first/app/flowchart/basic-usage.vue
@@ -12,10 +12,9 @@
diff --git a/examples/sites/demos/mobile-first/app/flowchart/node-size.vue b/examples/sites/demos/mobile-first/app/flowchart/node-size.vue
new file mode 100644
index 000000000..aed55cb54
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/flowchart/node-size.vue
@@ -0,0 +1,128 @@
+
+
+ 切换节点尺寸:
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/flowchart/webdoc/flowchart.js b/examples/sites/demos/mobile-first/app/flowchart/webdoc/flowchart.js
index 0e6ad0793..dc1195c6b 100644
--- a/examples/sites/demos/mobile-first/app/flowchart/webdoc/flowchart.js
+++ b/examples/sites/demos/mobile-first/app/flowchart/webdoc/flowchart.js
@@ -1,7 +1,8 @@
export default {
column: '2',
owner: '',
- demos: [{
+ demos: [
+ {
demoId: 'basic-usage',
name: {
'zh-CN': '垂直图形',
@@ -9,7 +10,8 @@ export default {
},
desc: {
'zh-CN': '节点设置在不同的列data.nodes[i].info.row,就可以创建垂直图形
',
- 'en-US': 'Nodes are set in different columns data.nodes[i].info.row, and vertical graphics can be created.
'
+ 'en-US':
+ 'Nodes are set in different columns data.nodes[i].info.row, and vertical graphics can be created.
'
},
codeFiles: ['basic-usage.vue']
},
@@ -21,7 +23,8 @@ export default {
},
desc: {
'zh-CN': '节点设置在不同的列data.nodes[i].info.col,就可以创建水平图形
',
- 'en-US': 'Nodes are set in different columns data.nodes[i].info.col, and horizontal graphics can be created.
'
+ 'en-US':
+ 'Nodes are set in different columns data.nodes[i].info.col, and horizontal graphics can be created.
'
},
codeFiles: ['horizon.vue']
},
@@ -73,6 +76,32 @@ export default {
},
codeFiles: ['dot-vertical-async.vue']
},
+ {
+ demoId: 'node-size',
+ name: {
+ 'zh-CN': '节点尺寸',
+ 'en-US': 'Node Size'
+ },
+ desc: {
+ 'zh-CN':
+ "使用属性 config.nodeSize
可以设置节点尺寸,可选值为 'mini'
, 'small'
, 'medium'
。
",
+ 'en-US':
+ "
Using the attribute config.nodeSize
, you can set the node size to 'mini'
, 'small'
, or 'medium'
.
"
+ },
+ codeFiles: ['node-size.vue']
+ },
+ {
+ demoId: 'link-path',
+ name: {
+ 'zh-CN': '定制连线',
+ 'en-US': 'Link Path'
+ },
+ desc: {
+ 'zh-CN': '使用属性 config.linkPath,可以定制连线。
',
+ 'en-US': '
Use the attribute config.linkpath
to customize the links.
'
+ },
+ codeFiles: ['link-path.vue']
+ },
{
demoId: 'holistic',
name: {
@@ -97,6 +126,5 @@ export default {
},
codeFiles: ['holistic-fork.vue']
}
- ],
- apis: []
-}
\ No newline at end of file
+ ]
+}
diff --git a/examples/sites/demos/mobile-first/app/form/form-in-row.vue b/examples/sites/demos/mobile-first/app/form/form-in-row.vue
index 6eb502561..9fcd1ecd2 100644
--- a/examples/sites/demos/mobile-first/app/form/form-in-row.vue
+++ b/examples/sites/demos/mobile-first/app/form/form-in-row.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/examples/sites/demos/mobile-first/app/form/frequently-used-form.vue b/examples/sites/demos/mobile-first/app/form/frequently-used-form.vue
index 115b6cadb..0f6dafc23 100644
--- a/examples/sites/demos/mobile-first/app/form/frequently-used-form.vue
+++ b/examples/sites/demos/mobile-first/app/form/frequently-used-form.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/examples/sites/demos/mobile-first/app/form/webdoc/form.js b/examples/sites/demos/mobile-first/app/form/webdoc/form.js
index 96844fdc8..e744baa0a 100644
--- a/examples/sites/demos/mobile-first/app/form/webdoc/form.js
+++ b/examples/sites/demos/mobile-first/app/form/webdoc/form.js
@@ -216,6 +216,5 @@ export default {
},
codeFiles: ['validate-debounce.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/grid/basic-usage.vue b/examples/sites/demos/mobile-first/app/grid/basic-usage.vue
index 70f131b88..dae1ef230 100644
--- a/examples/sites/demos/mobile-first/app/grid/basic-usage.vue
+++ b/examples/sites/demos/mobile-first/app/grid/basic-usage.vue
@@ -1,10 +1,16 @@
-
- 表格视图
- 卡片视图
+
+ 表格视图
+ 卡片视图
+ 列表视图
+ 甘特视图
+
-
+
-
-
+
+
+
+
+
+
+
+ - 名称:{{ row.name }}
+ - 所属区域:{{ row.area }}
+ - 地址:{{ row.address }}
+
+
+
+
+ -
+
{{ row.tag1 }}
+ {{ row.tag2 }}
+ {{ row.tag3 }}
+
+ - 公司简介:{{ row.introduction }}
+
+
+
+
+
+
+ {{ rows.length }}
+
diff --git a/examples/sites/demos/mobile-first/app/grid/webdoc/grid.js b/examples/sites/demos/mobile-first/app/grid/webdoc/grid.js
index d218b1e46..36de9327d 100644
--- a/examples/sites/demos/mobile-first/app/grid/webdoc/grid.js
+++ b/examples/sites/demos/mobile-first/app/grid/webdoc/grid.js
@@ -5,11 +5,11 @@ export default {
{
demoId: 'basic-usage',
name: {
- 'zh-CN': '枚举单选',
+ 'zh-CN': '标签式',
'en-US': 'Enumerated single-choice'
},
desc: {
- 'zh-CN': '',
+ 'zh-CN': '配置 SaaS
主题,并指定具体的视图类型,可切换表格显示样式
',
'en-US': 'bbutton click
'
},
codeFiles: ['basic-usage.vue']
@@ -21,7 +21,8 @@ export default {
'en-US': 'column anchor point'
},
desc: {
- 'zh-CN': '',
+ 'zh-CN':
+ '\n \n
表格属性 columnAnchor
支持配置一组列锚点,单个锚点配置支持三种格式:
\n A、字符串。即直接指定列名称。\n B、字符串数组。指定列名称、别名和自定义渲染函数。\n C、对象。指定列名称、别名、是否激活、自定义渲染函数和滚动延时。\n 默认激活第一个列锚点,可以通过对象格式指定激活某一个列锚点。\n \n ',
'en-US': 'bbutton click
'
},
codeFiles: ['column-anchor.vue']
@@ -33,11 +34,24 @@ export default {
'en-US': 'Operation column'
},
desc: {
- 'zh-CN': '',
+ 'zh-CN':
+ '列类型 type
设置为 operation
,并通过 operation-config
指定操作列配置
',
'en-US': ''
},
codeFiles: ['operation-column.vue']
+ },
+ {
+ demoId: 'height-auto',
+ name: {
+ 'zh-CN': '自动高度',
+ 'en-US': 'Operation column'
+ },
+ desc: {
+ 'zh-CN':
+ '指定表格容器高度,并设置表格高度 height
为 auto
,同时设置 auto-resize
响应容器高度改变
',
+ 'en-US': ''
+ },
+ codeFiles: ['height-auto.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/image/auto-fit-container-size.vue b/examples/sites/demos/mobile-first/app/image/auto-fit-container-size.vue
index 025b02a48..04bec3471 100644
--- a/examples/sites/demos/mobile-first/app/image/auto-fit-container-size.vue
+++ b/examples/sites/demos/mobile-first/app/image/auto-fit-container-size.vue
@@ -17,7 +17,7 @@ export default {
data() {
return {
fits: ['fill', 'contain', 'cover', 'none', 'scale-down'],
- url: '/static/images/1.jpg'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`
}
}
}
diff --git a/examples/sites/demos/mobile-first/app/image/basic-usage.vue b/examples/sites/demos/mobile-first/app/image/basic-usage.vue
index 7a58f1947..ded52a140 100644
--- a/examples/sites/demos/mobile-first/app/image/basic-usage.vue
+++ b/examples/sites/demos/mobile-first/app/image/basic-usage.vue
@@ -11,7 +11,7 @@ export default {
},
data() {
return {
- url: '/static/images/1.jpg'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`
}
}
}
diff --git a/examples/sites/demos/mobile-first/app/image/custom-placeholder.vue b/examples/sites/demos/mobile-first/app/image/custom-placeholder.vue
index 8a3130aca..1c0e96256 100644
--- a/examples/sites/demos/mobile-first/app/image/custom-placeholder.vue
+++ b/examples/sites/demos/mobile-first/app/image/custom-placeholder.vue
@@ -2,11 +2,11 @@
默认
-
+
自定义
-
+
加载中...
@@ -24,7 +24,7 @@ export default {
},
data() {
return {
- url: '/static/images/9.jpg'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/9.jpg`
}
}
}
diff --git a/examples/sites/demos/mobile-first/app/image/lazy-load.vue b/examples/sites/demos/mobile-first/app/image/lazy-load.vue
index 969d31bef..a3da332f4 100644
--- a/examples/sites/demos/mobile-first/app/image/lazy-load.vue
+++ b/examples/sites/demos/mobile-first/app/image/lazy-load.vue
@@ -14,9 +14,11 @@ export default {
data() {
return {
srcList: [
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- 'https://his-beta.huawei.com/opentiny/webnova/static/img/featuremap.c5e796e.png'
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/4.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/5.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/6.jpg`
]
}
}
diff --git a/examples/sites/demos/mobile-first/app/image/load-event.vue b/examples/sites/demos/mobile-first/app/image/load-event.vue
index b9da235ff..cf7112fac 100644
--- a/examples/sites/demos/mobile-first/app/image/load-event.vue
+++ b/examples/sites/demos/mobile-first/app/image/load-event.vue
@@ -11,7 +11,7 @@ export default {
},
data() {
return {
- url: '/static/images/1.jpg'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`
}
},
methods: {
diff --git a/examples/sites/demos/mobile-first/app/image/menu-modal-view.vue b/examples/sites/demos/mobile-first/app/image/menu-modal-view.vue
index 07a0a6fdd..0f3020715 100644
--- a/examples/sites/demos/mobile-first/app/image/menu-modal-view.vue
+++ b/examples/sites/demos/mobile-first/app/image/menu-modal-view.vue
@@ -53,24 +53,24 @@ export default {
teleport: true,
pageOnly: false,
srcList: [
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg'
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`
]
}
},
diff --git a/examples/sites/demos/mobile-first/app/image/menu-rename.vue b/examples/sites/demos/mobile-first/app/image/menu-rename.vue
index 1202e4069..397cfc497 100644
--- a/examples/sites/demos/mobile-first/app/image/menu-rename.vue
+++ b/examples/sites/demos/mobile-first/app/image/menu-rename.vue
@@ -19,24 +19,24 @@ export default {
return {
show: false,
srcList: [
- { url: '/static/images/3.jpg', name: '名称1' },
- { url: '/static/images/1.jpg', name: '名称2' },
- { url: '/static/images/3.jpg', name: '名称3' },
- { url: '/static/images/1.jpg', name: '名称4' },
- { url: '/static/images/3.jpg', name: '名称5' },
- { url: '/static/images/1.jpg', name: '名称6' },
- { url: '/static/images/3.jpg', name: '名称7' },
- { url: '/static/images/1.jpg', name: '名称8' },
- { url: '/static/images/3.jpg', name: '名称9' },
- { url: '/static/images/1.jpg', name: '名称10' },
- { url: '/static/images/3.jpg', name: '名称11' },
- { url: '/static/images/1.jpg', name: '名称12' },
- { url: '/static/images/3.jpg', name: '名称13' },
- { url: '/static/images/1.jpg', name: '名称14' },
- { url: '/static/images/3.jpg', name: '名称15' },
- { url: '/static/images/1.jpg', name: '名称16' },
- { url: '/static/images/3.jpg', name: '名称17' },
- { url: '/static/images/1.jpg', name: '名称18' }
+ { url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`, name: '名称1' },
+ { url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`, name: '名称2' },
+ { url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`, name: '名称3' },
+ { url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`, name: '名称4' },
+ { url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`, name: '名称5' },
+ { url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`, name: '名称6' },
+ { url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`, name: '名称7' },
+ { url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`, name: '名称8' },
+ { url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`, name: '名称9' },
+ { url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`, name: '名称10' },
+ { url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`, name: '名称11' },
+ { url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`, name: '名称12' },
+ { url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`, name: '名称13' },
+ { url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`, name: '名称14' },
+ { url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`, name: '名称15' },
+ { url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`, name: '名称16' },
+ { url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`, name: '名称17' },
+ { url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`, name: '名称18' }
]
}
},
diff --git a/examples/sites/demos/mobile-first/app/image/menu-view.vue b/examples/sites/demos/mobile-first/app/image/menu-view.vue
index 926cba8cd..8ffc67dce 100644
--- a/examples/sites/demos/mobile-first/app/image/menu-view.vue
+++ b/examples/sites/demos/mobile-first/app/image/menu-view.vue
@@ -19,38 +19,38 @@ export default {
return {
show: false,
srcList: [
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg'
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`
]
}
},
diff --git a/examples/sites/demos/mobile-first/app/image/menu-viewer-bg.vue b/examples/sites/demos/mobile-first/app/image/menu-viewer-bg.vue
index c36ee9436..3132157d4 100644
--- a/examples/sites/demos/mobile-first/app/image/menu-viewer-bg.vue
+++ b/examples/sites/demos/mobile-first/app/image/menu-viewer-bg.vue
@@ -25,24 +25,24 @@ export default {
return {
show: false,
srcList: [
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg',
- '/static/images/3.jpg',
- '/static/images/1.jpg'
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`
]
}
},
diff --git a/examples/sites/demos/mobile-first/app/image/preview-in-dialog.vue b/examples/sites/demos/mobile-first/app/image/preview-in-dialog.vue
index a812298d5..7e1cb3cd0 100644
--- a/examples/sites/demos/mobile-first/app/image/preview-in-dialog.vue
+++ b/examples/sites/demos/mobile-first/app/image/preview-in-dialog.vue
@@ -20,8 +20,11 @@ export default {
data() {
return {
visible3: false,
- url: '/static/images/1.jpg',
- srcList: ['/static/images/1.jpg', '/static/images/3.jpg']
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ srcList: [
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/3.jpg`
+ ]
}
}
}
diff --git a/examples/sites/demos/mobile-first/app/image/preview-src-list.vue b/examples/sites/demos/mobile-first/app/image/preview-src-list.vue
index fd5b68e96..e95507594 100644
--- a/examples/sites/demos/mobile-first/app/image/preview-src-list.vue
+++ b/examples/sites/demos/mobile-first/app/image/preview-src-list.vue
@@ -1,16 +1,9 @@
-
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/input/webdoc/input.js b/examples/sites/demos/mobile-first/app/input/webdoc/input.js
index f64089662..9ba46d3a5 100644
--- a/examples/sites/demos/mobile-first/app/input/webdoc/input.js
+++ b/examples/sites/demos/mobile-first/app/input/webdoc/input.js
@@ -14,7 +14,6 @@ export default {
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'clearable',
name: {
@@ -126,30 +125,6 @@ export default {
},
codeFiles: ['suffix-icon.vue']
},
- {
- demoId: 'slot-prefix',
- name: {
- 'zh-CN': '可通过 slot="prefix" 设置头部图标',
- 'en-US': 'events'
- },
- desc: {
- 'zh-CN': '',
- 'en-US': '
bbutton click
'
- },
- codeFiles: ['slot-prefix.vue']
- },
- {
- demoId: 'slot-suffix',
- name: {
- 'zh-CN': '可通过 slot="suffix" 设置尾部图标',
- 'en-US': 'events'
- },
- desc: {
- 'zh-CN': '',
- 'en-US': '
bbutton click
'
- },
- codeFiles: ['slot-suffix.vue']
- },
{
demoId: 'resize',
name: {
@@ -490,6 +465,20 @@ export default {
},
codeFiles: ['method-select.vue']
},
+ {
+ demoId: 'mask',
+ name: {
+ 'zh-CN': '掩码',
+ 'en-US': 'Mask'
+ },
+ desc: {
+ 'zh-CN':
+ '\n
可通过 mask 属性启用掩码功能,只在 disabled 和 display-only 状态下生效。
\n 注意:不要与 type="password" 和 show-password 一同使用
\n ',
+ 'en-US':
+ '\n
The mask attribute can be used to enable the mask function, which takes effect only in the disabled and display-only states.
\n Note: Do not use
with type="password" and show-password\n '
+ },
+ codeFiles: ['mask.vue']
+ },
{
demoId: 'custom-class',
name: {
@@ -514,6 +503,5 @@ export default {
},
codeFiles: ['display-only-content.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/loading/background.vue b/examples/sites/demos/mobile-first/app/loading/background.vue
index d39253309..002d5d7b6 100644
--- a/examples/sites/demos/mobile-first/app/loading/background.vue
+++ b/examples/sites/demos/mobile-first/app/loading/background.vue
@@ -10,7 +10,8 @@ export default {
Loading.service({
text: '自定义背景颜色和透明度',
target: document.getElementById('boxtwo'),
- background: 'rgba(0, 0, 0, 0.3)'
+ background: 'rgba(0, 0, 0, 0.3)',
+ tiny_mode: 'mobile-first'
})
}
}
diff --git a/examples/sites/demos/mobile-first/app/loading/basic-usage.vue b/examples/sites/demos/mobile-first/app/loading/basic-usage.vue
index 6970d203a..cec61aeec 100644
--- a/examples/sites/demos/mobile-first/app/loading/basic-usage.vue
+++ b/examples/sites/demos/mobile-first/app/loading/basic-usage.vue
@@ -19,7 +19,8 @@ export default {
},
mounted() {
this.loadingInstance = Loading.service({
- target: document.getElementById('tiny-loading1')
+ target: document.getElementById('tiny-loading1'),
+ tiny_mode: 'mobile-first'
})
},
methods: {
diff --git a/examples/sites/demos/mobile-first/app/loading/body.vue b/examples/sites/demos/mobile-first/app/loading/body.vue
index b0387082a..634e54483 100644
--- a/examples/sites/demos/mobile-first/app/loading/body.vue
+++ b/examples/sites/demos/mobile-first/app/loading/body.vue
@@ -1,6 +1,8 @@
- 设置v-loading.body的值为true
+
+ 设置v-loading.body的值为 {{ !isBody }}
+
@@ -19,22 +21,6 @@ export default {
return {
isBody: false
}
- },
- mounted() {
- Loading.service({
- lock: true,
- text: '同 v——loading 指令中的 body 修饰符',
- target: document.getElementById('boxnine'),
- background: 'rgba(0, 0, 0, 0.7)'
- })
- },
- methods: {
- handleClick() {
- this.isBody = true
- setTimeout(() => {
- this.isBody = false
- }, 20000)
- }
}
}
diff --git a/examples/sites/demos/mobile-first/app/loading/custom-class.vue b/examples/sites/demos/mobile-first/app/loading/custom-class.vue
index 114f2e51b..876b251b4 100644
--- a/examples/sites/demos/mobile-first/app/loading/custom-class.vue
+++ b/examples/sites/demos/mobile-first/app/loading/custom-class.vue
@@ -11,14 +11,15 @@ export default {
text: '自定义loading类名',
customClass: 'new-loading',
target: document.getElementById('tiny-loading'),
- background: 'rgba(0, 0, 0, 0.7)'
+ background: 'rgba(0, 0, 0, 0.7)',
+ tiny_mode: 'mobile-first'
})
}
}
diff --git a/examples/sites/demos/mobile-first/app/loading/fullscreen.vue b/examples/sites/demos/mobile-first/app/loading/fullscreen.vue
index 164cebda2..d0c6a863d 100644
--- a/examples/sites/demos/mobile-first/app/loading/fullscreen.vue
+++ b/examples/sites/demos/mobile-first/app/loading/fullscreen.vue
@@ -33,7 +33,8 @@ export default {
const loading = this.$loading({
lock: true,
text: 'Loading',
- background: 'rgba(0, 0, 0, 0.7)'
+ background: 'rgba(0, 0, 0, 0.7)',
+ tiny_mode: 'mobile-first'
})
setTimeout(() => {
loading.close()
diff --git a/examples/sites/demos/mobile-first/app/loading/loading-size.vue b/examples/sites/demos/mobile-first/app/loading/loading-size.vue
index 44ace4b7f..e836dea25 100644
--- a/examples/sites/demos/mobile-first/app/loading/loading-size.vue
+++ b/examples/sites/demos/mobile-first/app/loading/loading-size.vue
@@ -15,8 +15,9 @@ export default {
Loading.service({
lock: true,
text: '加载中',
- target: '#boxeight', // 可传DOM节点对应ID名或类名字符串,也可以传入DOM对象,例如:domObj,let domObj = document.getElementById('boxeight')
- size: '' // 可设置large、medium、small、mini四种尺寸大小
+ target: '#boxeight', // 可传DOM节点对应ID名或类名字符串,也可以传入DOM对象,例如:domObj,let domObj = document.getElementById('boxeight').
+ size: 'mini',
+ tiny_mode: 'mobile-first'
})
}
}
diff --git a/examples/sites/demos/mobile-first/app/loading/loading-tip-text.vue b/examples/sites/demos/mobile-first/app/loading/loading-tip-text.vue
index 60a7b45d5..3dae87942 100644
--- a/examples/sites/demos/mobile-first/app/loading/loading-tip-text.vue
+++ b/examples/sites/demos/mobile-first/app/loading/loading-tip-text.vue
@@ -9,6 +9,7 @@ export default {
mounted() {
Loading.service({
text: '加载中',
+ tiny_mode: 'mobile-first',
target: document.getElementById('boxone')
})
}
diff --git a/examples/sites/demos/mobile-first/app/loading/spinner.vue b/examples/sites/demos/mobile-first/app/loading/spinner.vue
index d0cd1bde4..ccf568452 100644
--- a/examples/sites/demos/mobile-first/app/loading/spinner.vue
+++ b/examples/sites/demos/mobile-first/app/loading/spinner.vue
@@ -12,7 +12,8 @@ export default {
text: '自定义loading图标',
spinner: IconLoading(), // 添加自定义类名,动画需要自己实现
target: document.getElementById('boxseven'),
- background: 'rgba(0, 0, 0, 0.7)'
+ background: 'rgba(0, 0, 0, 0.7)',
+ tiny_mode: 'mobile-first'
})
}
}
diff --git a/examples/sites/demos/mobile-first/app/loading/target.vue b/examples/sites/demos/mobile-first/app/loading/target.vue
deleted file mode 100644
index 84ad671ce..000000000
--- a/examples/sites/demos/mobile-first/app/loading/target.vue
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
diff --git a/examples/sites/demos/mobile-first/app/loading/webdoc/loading.js b/examples/sites/demos/mobile-first/app/loading/webdoc/loading.js
index 0213f5e6f..328bb653d 100644
--- a/examples/sites/demos/mobile-first/app/loading/webdoc/loading.js
+++ b/examples/sites/demos/mobile-first/app/loading/webdoc/loading.js
@@ -14,7 +14,6 @@ export default {
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'loading-tip-text',
name: {
@@ -88,18 +87,6 @@ export default {
},
codeFiles: ['spinner.vue']
},
- {
- demoId: 'target',
- name: {
- 'zh-CN': '区域加载',
- 'en-US': 'events'
- },
- desc: {
- 'zh-CN': '通过 `target` 指定 Loading 需要覆盖的 DOM 节点。
',
- 'en-US': '
bbutton click
'
- },
- codeFiles: ['target.vue']
- },
{
demoId: 'loading-size',
name: {
@@ -113,6 +100,5 @@ export default {
},
codeFiles: ['loading-size.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/menu/webdoc/menu.js b/examples/sites/demos/mobile-first/app/menu/webdoc/menu.js
index dd8a527bd..70f90a5c4 100644
--- a/examples/sites/demos/mobile-first/app/menu/webdoc/menu.js
+++ b/examples/sites/demos/mobile-first/app/menu/webdoc/menu.js
@@ -9,9 +9,8 @@ export default {
'en-US': 'events'
},
desc: {
- 'zh-CN': `通过 data
设置树形菜单的数据。
- 注意:由于树形菜单是通过节点 id 来查找子节点和关联父节点的,所以必须保证 id 的必填性和唯一性。
- 树形菜单移动端最多只能展示两层数据结构
`,
+ 'zh-CN':
+ '
通过 data
设置树形菜单的数据。
\n 注意:由于树形菜单是通过节点 id 来查找子节点和关联父节点的,所以必须保证 id 的必填性和唯一性。
\n 树形菜单移动端最多只能展示两层数据结构
',
'en-US': '
bbutton click
'
},
codeFiles: ['basic-usage.vue']
@@ -124,6 +123,5 @@ export default {
},
codeFiles: ['with-icon.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/message/webdoc/message.js b/examples/sites/demos/mobile-first/app/message/webdoc/message.js
index e147cdfec..2827ec920 100644
--- a/examples/sites/demos/mobile-first/app/message/webdoc/message.js
+++ b/examples/sites/demos/mobile-first/app/message/webdoc/message.js
@@ -51,6 +51,5 @@ export default {
},
codeFiles: ['id.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/modal/webdoc/modal.js b/examples/sites/demos/mobile-first/app/modal/webdoc/modal.js
index 1fd4bcca3..1ac00c787 100644
--- a/examples/sites/demos/mobile-first/app/modal/webdoc/modal.js
+++ b/examples/sites/demos/mobile-first/app/modal/webdoc/modal.js
@@ -281,7 +281,7 @@ export default {
codeFiles: ['zoom-event.vue']
},
{
- demoId: 'value',
+ demoId: 'default-slot',
name: {
'zh-CN': '默认插槽',
'en-US': 'events'
@@ -329,6 +329,5 @@ export default {
},
codeFiles: ['before-close.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/numeric/webdoc/numeric.js b/examples/sites/demos/mobile-first/app/numeric/webdoc/numeric.js
index 7cd5b2dba..3ff26d98c 100644
--- a/examples/sites/demos/mobile-first/app/numeric/webdoc/numeric.js
+++ b/examples/sites/demos/mobile-first/app/numeric/webdoc/numeric.js
@@ -14,7 +14,6 @@ export default {
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'numeric-size',
name: {
@@ -118,7 +117,7 @@ export default {
{
demoId: 'blur-event',
name: {
- 'zh-CN': 'blur event',
+ 'zh-CN': '失焦事件',
'en-US': 'events'
},
desc: {
@@ -139,6 +138,5 @@ export default {
},
codeFiles: ['change-event.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/pager/pager-events-current-change.vue b/examples/sites/demos/mobile-first/app/pager/current-change.vue
similarity index 100%
rename from examples/sites/demos/mobile-first/app/pager/pager-events-current-change.vue
rename to examples/sites/demos/mobile-first/app/pager/current-change.vue
diff --git a/examples/sites/demos/mobile-first/app/pager/custom-layout.vue b/examples/sites/demos/mobile-first/app/pager/custom-layout.vue
deleted file mode 100644
index 0b7f09d55..000000000
--- a/examples/sites/demos/mobile-first/app/pager/custom-layout.vue
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
- 我是插槽
-
-
-
-
-
diff --git a/examples/sites/demos/mobile-first/app/pager/pager-events-nextclick.vue b/examples/sites/demos/mobile-first/app/pager/next-click.vue
similarity index 100%
rename from examples/sites/demos/mobile-first/app/pager/pager-events-nextclick.vue
rename to examples/sites/demos/mobile-first/app/pager/next-click.vue
diff --git a/examples/sites/demos/mobile-first/app/pager/page-append-to-body.vue b/examples/sites/demos/mobile-first/app/pager/page-append-to-body.vue
deleted file mode 100644
index c7cb1a3d2..000000000
--- a/examples/sites/demos/mobile-first/app/pager/page-append-to-body.vue
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
diff --git a/examples/sites/demos/mobile-first/app/pager/pager-count.vue b/examples/sites/demos/mobile-first/app/pager/pager-count.vue
deleted file mode 100644
index 67d3324da..000000000
--- a/examples/sites/demos/mobile-first/app/pager/pager-count.vue
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
diff --git a/examples/sites/demos/mobile-first/app/pager/pager-custom-total.vue b/examples/sites/demos/mobile-first/app/pager/pager-custom-total.vue
deleted file mode 100644
index 40a100f29..000000000
--- a/examples/sites/demos/mobile-first/app/pager/pager-custom-total.vue
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/examples/sites/demos/mobile-first/app/pager/pager-events.vue b/examples/sites/demos/mobile-first/app/pager/pager-events.vue
deleted file mode 100644
index 420eb212f..000000000
--- a/examples/sites/demos/mobile-first/app/pager/pager-events.vue
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
diff --git a/examples/sites/demos/mobile-first/app/pager/pager-in-grid.vue b/examples/sites/demos/mobile-first/app/pager/pager-in-grid.vue
deleted file mode 100644
index 6b185ce08..000000000
--- a/examples/sites/demos/mobile-first/app/pager/pager-in-grid.vue
+++ /dev/null
@@ -1,440 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/examples/sites/demos/mobile-first/app/pager/pager-mode-fixed.vue b/examples/sites/demos/mobile-first/app/pager/pager-mode-fixed.vue
deleted file mode 100644
index 6a6e23c79..000000000
--- a/examples/sites/demos/mobile-first/app/pager/pager-mode-fixed.vue
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/examples/sites/demos/mobile-first/app/pager/pager-mode-number.vue b/examples/sites/demos/mobile-first/app/pager/pager-mode-number.vue
deleted file mode 100644
index a5478bf4d..000000000
--- a/examples/sites/demos/mobile-first/app/pager/pager-mode-number.vue
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/examples/sites/demos/mobile-first/app/pager/pager-mode-simple.vue b/examples/sites/demos/mobile-first/app/pager/pager-mode-simple.vue
deleted file mode 100644
index cde1da631..000000000
--- a/examples/sites/demos/mobile-first/app/pager/pager-mode-simple.vue
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/examples/sites/demos/mobile-first/app/pager/pager-mode.vue b/examples/sites/demos/mobile-first/app/pager/pager-mode.vue
deleted file mode 100644
index d31abb37b..000000000
--- a/examples/sites/demos/mobile-first/app/pager/pager-mode.vue
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/examples/sites/demos/mobile-first/app/pager/pager-show-total-loading.vue b/examples/sites/demos/mobile-first/app/pager/pager-show-total-loading.vue
deleted file mode 100644
index b185577b4..000000000
--- a/examples/sites/demos/mobile-first/app/pager/pager-show-total-loading.vue
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/examples/sites/demos/mobile-first/app/pager/pager-events-prev-click.vue b/examples/sites/demos/mobile-first/app/pager/prev-click.vue
similarity index 100%
rename from examples/sites/demos/mobile-first/app/pager/pager-events-prev-click.vue
rename to examples/sites/demos/mobile-first/app/pager/prev-click.vue
diff --git a/examples/sites/demos/mobile-first/app/pager/webdoc/pager.cn.md b/examples/sites/demos/mobile-first/app/pager/webdoc/pager.cn.md
index 4bcaf4016..1a426b383 100644
--- a/examples/sites/demos/mobile-first/app/pager/webdoc/pager.cn.md
+++ b/examples/sites/demos/mobile-first/app/pager/webdoc/pager.cn.md
@@ -1,9 +1,7 @@
---
-title: Filter 过滤器
+title: Pager 分页
---
-# Filter 过滤器
+# Pager 分页
-
-
-
+当数据量过多时,使用分页分解数据,常用于 Grid 和 Repeater 组件。
diff --git a/examples/sites/demos/mobile-first/app/pager/webdoc/pager.en.md b/examples/sites/demos/mobile-first/app/pager/webdoc/pager.en.md
index 4bcaf4016..6fa31bd31 100644
--- a/examples/sites/demos/mobile-first/app/pager/webdoc/pager.en.md
+++ b/examples/sites/demos/mobile-first/app/pager/webdoc/pager.en.md
@@ -1,9 +1,7 @@
---
-title: Filter 过滤器
+title: Pager Pagination
---
-# Filter 过滤器
+# Pager Pagination
-
-
-
+When there is a large amount of data, data is split by page. This function is usually used in Grid and Repeater components.
diff --git a/examples/sites/demos/mobile-first/app/pager/webdoc/pager.js b/examples/sites/demos/mobile-first/app/pager/webdoc/pager.js
index a358c3215..ef01e7a47 100644
--- a/examples/sites/demos/mobile-first/app/pager/webdoc/pager.js
+++ b/examples/sites/demos/mobile-first/app/pager/webdoc/pager.js
@@ -9,50 +9,106 @@ export default {
'en-US': 'basic usage'
},
desc: {
- 'zh-CN':
- '过滤类型 type
包括 单选、多选、枚举单选 (radio | checkbox | enum-radio)。
',
- 'en-US': 'button type
'
+ 'zh-CN': '',
+ 'en-US': ''
},
codeFiles: ['basic-usage.vue']
},
{
- demoId: 'column-num',
+ demoId: 'current-page',
name: {
- 'zh-CN': '面板每行标签数',
- 'en-US': 'button round'
+ 'zh-CN': '当前页',
+ 'en-US': ''
},
desc: {
- 'zh-CN': '通过 column-num
属性设置面板每行标签数,默认值为 3。
',
- 'en-US': 'button round
'
+ 'zh-CN': '通过 `current-page` 设置初始加载页码数, 通过 `total` 设置总条数',
+ 'en-US': ''
},
- codeFiles: ['column-num.vue']
+ codeFiles: ['current-page.vue']
},
{
- demoId: 'filter-group',
+ demoId: 'page-size',
name: {
- 'zh-CN': '过滤组',
- 'en-US': '过滤组'
+ 'zh-CN': '每页显示数量',
+ 'en-US': ''
},
desc: {
- 'zh-CN':
- '通过 filter-group
属性开启过滤组功能,filter-value
绑定过滤组的值。过滤组类型 type
包括 单选、多选 (radio | checkbox)
。
',
- 'en-US': '
bbutton click
'
+ 'zh-CN': '`page-sizes` 和 `page-size` 结合使用调整每页显示数量',
+ 'en-US': ''
},
- codeFiles: ['filter-group.vue']
+ codeFiles: ['page-size.vue']
},
{
- demoId: 'enumeration',
+ demoId: 'hide-on-single-page',
name: {
- 'zh-CN': '枚举单选',
- 'en-US': 'events'
+ 'zh-CN': '只有一页时隐藏分页',
+ 'en-US': ''
},
desc: {
- 'zh-CN':
- '设置过滤类型 type: "enum-radio"
时,当前数据为枚举单选,通过 showAll: true
显示 全部
选择项。
',
- 'en-US': '
bbutton click
'
+ 'zh-CN': '`hide-on-single-page` 只有一页时隐藏分页',
+ 'en-US': ''
},
- codeFiles: ['enumeration.vue']
+ codeFiles: ['hide-on-single-page.vue']
+ },
+ {
+ demoId: 'custom-next-prev-text',
+ name: {
+ 'zh-CN': '自定义上下页按钮文本',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN': '`prev-text` ,`next-text` 自定义上下页按钮文本',
+ 'en-US': ''
+ },
+ codeFiles: ['custom-next-prev-text.vue']
+ },
+ {
+ demoId: 'current-change',
+ name: {
+ 'zh-CN': '当前页改变事件',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN': '`current-change` 切换当前页码时触发',
+ 'en-US': ''
+ },
+ codeFiles: ['current-change.vue']
+ },
+ {
+ demoId: 'prev-click',
+ name: {
+ 'zh-CN': '上一页事件',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN': '`prev-click` 切换至前一页时触发',
+ 'en-US': ''
+ },
+ codeFiles: ['prev-click.vue']
+ },
+ {
+ demoId: 'next-click',
+ name: {
+ 'zh-CN': '下一页事件',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN': '`next-click` 切换至后一页时触发',
+ 'en-US': ''
+ },
+ codeFiles: ['next-click.vue']
+ },
+ {
+ demoId: 'before-page-change',
+ name: {
+ 'zh-CN': '切换分页前事件',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN': '`before-page-change` 切换分页前事件',
+ 'en-US': ''
+ },
+ codeFiles: ['before-page-change.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/popconfirm/basic-usage.vue b/examples/sites/demos/mobile-first/app/popconfirm/basic-usage.vue
index dee9e0c06..30aa3d972 100644
--- a/examples/sites/demos/mobile-first/app/popconfirm/basic-usage.vue
+++ b/examples/sites/demos/mobile-first/app/popconfirm/basic-usage.vue
@@ -3,7 +3,7 @@
悬浮我提示
@@ -18,7 +18,7 @@
trigger="click"
placement="right"
:cancel-button="false"
- content="内容很短"
+ message="内容很短"
>
点击弹出,info 信息,右侧显示
@@ -27,7 +27,7 @@
-
+
默认悬浮弹出,warning 警告,下面显示
diff --git a/examples/sites/demos/mobile-first/app/popconfirm/webdoc/popconfirm.js b/examples/sites/demos/mobile-first/app/popconfirm/webdoc/popconfirm.js
index 066f9df8e..d2631090d 100644
--- a/examples/sites/demos/mobile-first/app/popconfirm/webdoc/popconfirm.js
+++ b/examples/sites/demos/mobile-first/app/popconfirm/webdoc/popconfirm.js
@@ -14,6 +14,5 @@ export default {
},
codeFiles: ['basic-usage.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/popover/webdoc/popover.js b/examples/sites/demos/mobile-first/app/popover/webdoc/popover.js
index b4ad41892..a465608f5 100644
--- a/examples/sites/demos/mobile-first/app/popover/webdoc/popover.js
+++ b/examples/sites/demos/mobile-first/app/popover/webdoc/popover.js
@@ -14,7 +14,6 @@ export default {
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'popover-content',
name: {
@@ -204,6 +203,5 @@ export default {
},
codeFiles: ['popover-events.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/progress/progress-type-circle.vue b/examples/sites/demos/mobile-first/app/progress/progress-type-circle.vue
index 6eec89a27..5c17d6756 100644
--- a/examples/sites/demos/mobile-first/app/progress/progress-type-circle.vue
+++ b/examples/sites/demos/mobile-first/app/progress/progress-type-circle.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/examples/sites/demos/mobile-first/app/progress/status-loading.vue b/examples/sites/demos/mobile-first/app/progress/status-loading.vue
new file mode 100644
index 000000000..7e53f8435
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/progress/status-loading.vue
@@ -0,0 +1,52 @@
+
+
+ 上传中:
+
+
+ 安装进度
+
+ 暂停
+ 取消
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/progress/status-reloading.vue b/examples/sites/demos/mobile-first/app/progress/status-reloading.vue
new file mode 100644
index 000000000..52ecac0cd
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/progress/status-reloading.vue
@@ -0,0 +1,55 @@
+
+
+ 失败可重试:
+
+
+ 安装进度
+
+
+
+
+
+ 安装失败,请重试
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/progress/status-sucess.vue b/examples/sites/demos/mobile-first/app/progress/status-sucess.vue
new file mode 100644
index 000000000..a4015817d
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/progress/status-sucess.vue
@@ -0,0 +1,32 @@
+
+
+ 成功:
+
+
+ 安装进度
+
+
+
+
+ 安装成功
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/progress/webdoc/progress.js b/examples/sites/demos/mobile-first/app/progress/webdoc/progress.js
index c578cf9d4..16ce4b3a0 100644
--- a/examples/sites/demos/mobile-first/app/progress/webdoc/progress.js
+++ b/examples/sites/demos/mobile-first/app/progress/webdoc/progress.js
@@ -14,7 +14,6 @@ export default {
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'progress-type',
name: {
@@ -59,7 +58,7 @@ export default {
'en-US': 'events'
},
desc: {
- 'zh-CN': 'stroke-width自定义进度条的宽度,单位 px',
+ 'zh-CN': '
stroke-width自定义进度条的宽度,单位 px。',
'en-US': '
bbutton click
'
},
codeFiles: ['progress-width.vue']
@@ -67,15 +66,63 @@ export default {
{
demoId: 'progress-status',
name: {
- 'zh-CN': '状态',
- 'en-US': 'events'
+ 'zh-CN': '进度条状态',
+ 'en-US': 'Progress bar status'
},
desc: {
- 'zh-CN': 'status
进度条当前状态(success/exception/warning)
',
- 'en-US': '
bbutton click
'
+ 'zh-CN': 'status
进度条状态(success/exception/warning)。
',
+ 'en-US': '
status
Progress bar status (success/exception/warning).
'
},
codeFiles: ['progress-status.vue']
},
+ {
+ demoId: 'status-loading',
+ name: {
+ 'zh-CN': '定义加载状态',
+ 'en-US': 'Defines the loading status'
+ },
+ desc: {
+ 'zh-CN': '定义加载状态。
',
+ 'en-US': '
Defines the loading status.
'
+ },
+ codeFiles: ['status-loading.vue']
+ },
+ {
+ demoId: 'status-error',
+ name: {
+ 'zh-CN': '定义错误状态',
+ 'en-US': 'Defines the error status'
+ },
+ desc: {
+ 'zh-CN': '定义错误状态。
',
+ 'en-US': '
Defines the error status.
'
+ },
+ codeFiles: ['status-error.vue']
+ },
+ {
+ demoId: 'status-reloading',
+ name: {
+ 'zh-CN': '定义重载状态',
+ 'en-US': 'Defines the overload status'
+ },
+ desc: {
+ 'zh-CN': '定义重载状态。
',
+ 'en-US': '
Defines the overload status.
'
+ },
+ codeFiles: ['status-reloading.vue']
+ },
+ {
+ demoId: 'status-sucess',
+ name: {
+ 'zh-CN': '定义成功状态',
+ 'en-US': 'Define Success Status'
+ },
+ desc: {
+ 'zh-CN': '定义成功状态。
',
+ 'en-US': '
Define Success Status.
'
+ },
+ codeFiles: ['status-sucess.vue']
+ },
{
demoId: 'text-inside-or-no-text',
name: {
@@ -125,6 +172,5 @@ export default {
},
codeFiles: ['dynamic-control-changes.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/pull-refresh/webdoc/pull-refresh.js b/examples/sites/demos/mobile-first/app/pull-refresh/webdoc/pull-refresh.js
index 52ef77a3f..1d81903ea 100644
--- a/examples/sites/demos/mobile-first/app/pull-refresh/webdoc/pull-refresh.js
+++ b/examples/sites/demos/mobile-first/app/pull-refresh/webdoc/pull-refresh.js
@@ -1,7 +1,8 @@
export default {
column: '2',
owner: '',
- demos: [{
+ demos: [
+ {
demoId: 'basic-usage',
name: {
'zh-CN': '基本用法',
@@ -80,8 +81,9 @@ export default {
'en-US': 'Head height when pulling down'
},
desc: {
- 'zh-CN': `设置属性 head-height
为数字或字符串,例如:100/'100'/'100px'/'6rem'
`,
- 'en-US': `Set the property head-height
to a number or string, for example: 100/'100'/'100px'/'6rem'
`
+ 'zh-CN': "设置属性 head-height
为数字或字符串,例如:100/'100'/'100px'/'6rem'
",
+ 'en-US':
+ "Set the property head-height
to a number or string, for example: 100/'100'/'100px'/'6rem'
"
},
codeFiles: ['head-height.vue']
},
@@ -109,222 +111,5 @@ export default {
},
codeFiles: ['pull-refresh-slot.vue']
}
- ],
- apis: [{
- 'name': 'pull-refresh',
- 'type': 'component',
- 'props': [{
- 'name': ' animationDuration',
- 'type': '[Number, String]',
- 'defaultValue': '默认值是300',
- 'desc': {
- 'zh-CN': '刷新成功后头部延时消失时间',
- 'en-US': 'Header delay disappearing time after successful refresh'
- },
- 'demoId': 'animation-duration'
- },
- {
- 'name': 'disabled',
- 'type': 'Boolean',
- 'defaultValue': '默认值是false',
- 'desc': {
- 'zh-CN': '是否禁用下拉刷新',
- 'en-US': 'Whether to disable pull-down refresh'
- },
- 'demoId': 'disabled'
- },
- {
- 'name': 'headHeight',
- 'type': '[Number, String]',
- 'defaultValue': '默认值是50',
- 'desc': {
- 'zh-CN': '组件头部提示区域的高度',
- 'en-US': 'Height of the component head prompt area'
- },
- 'demoId': 'head-height'
- },
- {
- 'name': 'loadingOptions',
- 'type': 'Object',
- 'defaultValue': '默认值是空对象{}',
- 'desc': {
- 'zh-CN': '不使用loading插槽时,内置加载组件Loading的参数:Loading.service(options)',
- 'en-US': 'When the loading slot is not used, the loading parameter of the built-in loading component is Loading.service(options).'
- },
- 'demoId': ''
- },
- {
- 'name': 'loadingText',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '数据刷新过程的提示文本',
- 'en-US': 'Prompt text for the data refresh process'
- },
- 'demoId': ''
- },
- {
- 'name': 'loosingText',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '向下拖动超过阈值后可松开进行刷新的提示文本',
- 'en-US': 'Drag down to release the prompt text for refresh after the threshold is exceeded.'
- },
- 'demoId': 'loosing-text'
- },
- {
- 'name': 'modelValue',
- 'type': 'Boolean',
- 'defaultValue': '默认值是false',
- 'desc': {
- 'zh-CN': '是否正在进行下拉刷新',
- 'en-US': 'Is the pull-down refresh in progress'
- },
- 'demoId': ''
- },
- {
- 'name': 'pullDistance',
- 'type': '[Number, String]',
- 'defaultValue': '默认值是属性 `headHeight` 的值',
- 'desc': {
- 'zh-CN': '拖拽产生刷新的距离',
- 'en-US': 'Refreshing distance generated by dragging'
- },
- 'demoId': ''
- },
- {
- 'name': 'pullingText',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '向下拖动过程的提示文本',
- 'en-US': 'Drag down the prompt text for the procedure'
- },
- 'demoId': 'pulling-text'
- },
- {
- 'name': 'selfSimulate',
- 'type': 'Boolean',
- 'defaultValue': '默认值是false',
- 'desc': {
- 'zh-CN': '是否开启自模拟Touch事件。如果开启,那么组件只处理自身产生的模拟Touch事件,忽略冒泡上来的非自身模拟事件。正常非模拟Touch事件始终不会跳过处理',
- 'en-US': 'Indicates whether to enable the self-simulation Touch event. If this function is enabled, the component only processes simulated Touch events generated by itself and ignores non-simulated events generated by itself. Normal non-simulated Touch events never skip processing'
- },
- 'demoId': ''
- },
- {
- 'name': 'successDuration',
- 'type': '[Number, String]',
- 'defaultValue': '默认值是500',
- 'desc': {
- 'zh-CN': '刷新成功提示文本延时消失时间',
- 'en-US': 'Time for the text to disappear after the refresh is successful.'
- },
- 'demoId': 'success-duration'
- },
- {
- 'name': 'successText',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '刷新成功的提示文本',
- 'en-US': 'Text of the message indicating that the refresh is successful'
- },
- 'demoId': 'success-text'
- }
- ],
- 'events': [{
- 'name': 'change',
- 'type': 'Function({ status, distance })',
- 'defaultValue': 'status:{String 组件当前状态},distance:{Number 当前的拖动距离}',
- 'desc': {
- 'zh-CN': '在组件状态改变时抛出',
- 'en-US': 'Thrown when the component state changes'
- },
- 'demoId': ''
- },
- {
- 'name': 'refresh',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '在组件状态进入 loading 刷新数据时抛出',
- 'en-US': 'Thrown when the component enters the loading state to refresh data'
- },
- 'demoId': ''
- },
- {
- 'name': 'update:modelValue',
- 'type': 'Function(isLoading)',
- 'defaultValue': 'isLoading:{Boolean 组件是否处于 loading}',
- 'desc': {
- 'zh-CN': '在组件状态进入 loading 刷新数据时抛出',
- 'en-US': 'Thrown when the component enters the loading state to refresh data'
- },
- 'demoId': ''
- }
- ],
- 'slots': [{
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '组件默认插槽',
- 'en-US': 'Component Default Slot'
- },
- 'demoId': 'pull-refresh-slot'
- },
- {
- 'name': 'loading',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '组件 loading 插槽,自定义 loading 状态的提示',
- 'en-US': 'Component loading slot, which is used to customize the loading status prompt.'
- },
- 'demoId': 'pull-refresh-slot'
- },
- {
- 'name': 'loosing',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '组件 loosing 插槽,自定义 loosing 状态的提示',
- 'en-US': 'Component loosing slot, which is used to customize the loosing status prompt.'
- },
- 'demoId': 'pull-refresh-slot'
- },
- {
- 'name': 'normal',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '组件 normal 插槽,自定义 normal 状态的提示',
- 'en-US': 'Indicates the normal slot of the component. The prompt for the normal status is customized.'
- },
- 'demoId': 'pull-refresh-slot'
- },
- {
- 'name': 'pulling',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '组件 pulling 插槽,自定义 pulling 状态的提示',
- 'en-US': 'Pull slot of the component, which is used to customize the prompt of the pull status.'
- },
- 'demoId': 'pull-refresh-slot'
- },
- {
- 'name': 'success',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '组件 success 插槽,自定义 success 状态的提示',
- 'en-US': 'Indicates the success slot of the component. The success status is customized.'
- },
- 'demoId': 'pull-refresh-slot'
- }
- ]
- }]
-}
\ No newline at end of file
+ ]
+}
diff --git a/examples/sites/demos/mobile-first/app/radio-block/webdoc/radio-block.js b/examples/sites/demos/mobile-first/app/radio-block/webdoc/radio-block.js
index 6c0284ec9..ccb276a81 100644
--- a/examples/sites/demos/mobile-first/app/radio-block/webdoc/radio-block.js
+++ b/examples/sites/demos/mobile-first/app/radio-block/webdoc/radio-block.js
@@ -9,14 +9,12 @@ export default {
'en-US': 'basic usage'
},
desc: {
- 'zh-CN': `通过 v-model
绑定变量,设置的变量值为默认选中的 Radio,变量值对应 label
属性的值。
- 通过 text
也可以配置显示文本,与默认插槽配置纯文本的结果一致
- label
可以是 String、Number 或 Boolean
。
`,
+ 'zh-CN':
+ '通过 v-model
绑定变量,设置的变量值为默认选中的 Radio,变量值对应 label
属性的值。
\n 通过 text
也可以配置显示文本,与默认插槽配置纯文本的结果一致
\n label
可以是 String、Number 或 Boolean
。
',
'en-US': 'button type
'
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'dynamic-disable',
name: {
@@ -24,7 +22,7 @@ export default {
'en-US': 'events'
},
desc: {
- 'zh-CN': `设置 disabled
属性即可启动禁用状态,默认为 false 。
`,
+ 'zh-CN': '
设置 disabled
属性即可启动禁用状态,默认为 false 。
',
'en-US': '
bbutton click
'
},
codeFiles: ['dynamic-disable.vue']
@@ -86,12 +84,11 @@ export default {
'en-US': 'events'
},
desc: {
- 'zh-CN': `通过添加show-tips
属性设置是否展示 tips 提示图标,通过添加tip-content
属性设置 tips 内容
- 仅支持通过 label
属性可以设置 Radio
的内容时生效,自定义插槽下不生效
`,
+ 'zh-CN':
+ '
通过添加show-tips
属性设置是否展示 tips 提示图标,通过添加tip-content
属性设置 tips 内容
\n 仅支持通过 label
属性可以设置 Radio
的内容时生效,自定义插槽下不生效
',
'en-US': '
bbutton click
'
},
codeFiles: ['radio-tips.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/radio/webdoc/radio.js b/examples/sites/demos/mobile-first/app/radio/webdoc/radio.js
index 1537a9a80..a1fe7efc8 100644
--- a/examples/sites/demos/mobile-first/app/radio/webdoc/radio.js
+++ b/examples/sites/demos/mobile-first/app/radio/webdoc/radio.js
@@ -9,14 +9,12 @@ export default {
'en-US': 'basic usage'
},
desc: {
- 'zh-CN': `通过 v-model
绑定变量,设置的变量值为默认选中的 Radio,变量值对应 label
属性的值。
- 通过 text
也可以配置显示文本,与默认插槽配置纯文本的结果一致
- label
可以是 String
、Number
或 Boolean
。
`,
+ 'zh-CN':
+ '通过 v-model
绑定变量,设置的变量值为默认选中的 Radio,变量值对应 label
属性的值。
\n 通过 text
也可以配置显示文本,与默认插槽配置纯文本的结果一致
\n label
可以是 String
、Number
或 Boolean
。
',
'en-US': 'button type
'
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'group-options',
name: {
@@ -24,11 +22,8 @@ export default {
'en-US': 'events'
},
desc: {
- 'zh-CN': `提供 options
属性,支持通过配置对象数组数据的形式来渲染单选组。
- 使用该属性后,可以不用再在标签中以插槽的形式插入
或
标签。
- options
对象数组中包括三个字段:label
、text
、events
。
- 另外还提供 type
属性,配合 options
属性一起使用,默认值为 radio
。
- 还可以配置为 button
,配置后单选组将以按钮的形式展示。
`,
+ 'zh-CN':
+ '
提供 options
属性,支持通过配置对象数组数据的形式来渲染单选组。
\n 使用该属性后,可以不用再在标签中以插槽的形式插入
或
标签。
\n options
对象数组中包括三个字段:label
、text
、events
。
\n 另外还提供 type
属性,配合 options
属性一起使用,默认值为 radio
。
\n 还可以配置为 button
,配置后单选组将以按钮的形式展示。
',
'en-US': '
bbutton click
'
},
codeFiles: ['group-options.vue']
@@ -96,7 +91,7 @@ export default {
codeFiles: ['radio-events.vue']
},
{
- demoId: 'group-options',
+ demoId: 'group-options1',
name: {
'zh-CN': '循环配置',
'en-US': 'events'
@@ -131,6 +126,5 @@ export default {
},
codeFiles: ['read-only.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/rate/webdoc/rate.js b/examples/sites/demos/mobile-first/app/rate/webdoc/rate.js
index 7c1f6e530..d0b4c316f 100644
--- a/examples/sites/demos/mobile-first/app/rate/webdoc/rate.js
+++ b/examples/sites/demos/mobile-first/app/rate/webdoc/rate.js
@@ -14,7 +14,6 @@ export default {
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'custom-3-threshold-colors',
name: {
@@ -208,6 +207,5 @@ export default {
},
codeFiles: ['rate-events.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/record/webdoc/record.js b/examples/sites/demos/mobile-first/app/record/webdoc/record.js
index 066f9df8e..d2631090d 100644
--- a/examples/sites/demos/mobile-first/app/record/webdoc/record.js
+++ b/examples/sites/demos/mobile-first/app/record/webdoc/record.js
@@ -14,6 +14,5 @@ export default {
},
codeFiles: ['basic-usage.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/scrollbar/webdoc/scrollbar.js b/examples/sites/demos/mobile-first/app/scrollbar/webdoc/scrollbar.js
index d3d1b67c0..e77b6b7c8 100644
--- a/examples/sites/demos/mobile-first/app/scrollbar/webdoc/scrollbar.js
+++ b/examples/sites/demos/mobile-first/app/scrollbar/webdoc/scrollbar.js
@@ -26,6 +26,5 @@ export default {
},
codeFiles: ['horizon.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/search/size.vue b/examples/sites/demos/mobile-first/app/search/size.vue
new file mode 100644
index 000000000..5e8741142
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/search/size.vue
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/search/webdoc/search.js b/examples/sites/demos/mobile-first/app/search/webdoc/search.js
index 644a99e6e..bf73be3e8 100644
--- a/examples/sites/demos/mobile-first/app/search/webdoc/search.js
+++ b/examples/sites/demos/mobile-first/app/search/webdoc/search.js
@@ -14,7 +14,6 @@ export default {
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'clearable',
name: {
@@ -27,6 +26,20 @@ export default {
},
codeFiles: ['clearable.vue']
},
+ {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '尺寸',
+ 'en-US': 'Size'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 size
定义输入框尺寸,可选项有 medium
、small
、mini
,默认为 small
。
',
+ 'en-US':
+ 'Set size
to define the text box size. The options include medium
, small
, and mini
. The default value is small
.
'
+ },
+ codeFiles: ['size.vue']
+ },
{
demoId: 'big-mode',
name: {
@@ -159,44 +172,5 @@ export default {
},
codeFiles: ['change-bg.vue']
}
- ],
- apis: [
- {
- 'name': 'Search',
- 'type': 'component',
- 'props': [
- {
- 'name': 'big',
- 'type': 'Boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '大尺寸,配置为true时,搜索框高度将变高。',
- 'en-US': 'Large size. If this parameter is set to true, the height of the search box increases.'
- },
- 'demoId': 'big-mode'
- },
- {
- 'name': 'change-bg-color',
- 'type': 'Boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '可通过 change-bg-color 属性切换背景色(只针对移动端有效)。',
- 'en-US':
- 'You can use the change-bg-color attribute to switch the background color (only for mobile devices)'
- },
- 'demoId': 'change-bg'
- },
- {
- 'name': 'show-button',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '可通过 show-button 属性对移动端设置按钮搜索。',
- 'en-US': 'You can use the show-button attribute to set button search for mobile devices.'
- },
- 'demoId': 'search-types'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile-first/app/select-mobile/webdoc/select-mobile.js b/examples/sites/demos/mobile-first/app/select-mobile/webdoc/select-mobile.js
index 6ac08abc3..769bb1d9c 100644
--- a/examples/sites/demos/mobile-first/app/select-mobile/webdoc/select-mobile.js
+++ b/examples/sites/demos/mobile-first/app/select-mobile/webdoc/select-mobile.js
@@ -14,7 +14,6 @@ export default {
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'multiple',
name: {
@@ -77,6 +76,5 @@ export default {
},
codeFiles: ['mode-form.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/select-view/webdoc/select-view.js b/examples/sites/demos/mobile-first/app/select-view/webdoc/select-view.js
index 3f144cf8c..fa2b0b919 100644
--- a/examples/sites/demos/mobile-first/app/select-view/webdoc/select-view.js
+++ b/examples/sites/demos/mobile-first/app/select-view/webdoc/select-view.js
@@ -14,7 +14,6 @@ export default {
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'field',
name: {
@@ -90,6 +89,5 @@ export default {
},
codeFiles: ['place-holder.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/select/allow-create.vue b/examples/sites/demos/mobile-first/app/select/allow-create.vue
new file mode 100644
index 000000000..518f81374
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/allow-create.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/automatic-dropdown.vue b/examples/sites/demos/mobile-first/app/select/automatic-dropdown.vue
new file mode 100644
index 000000000..03bf6ea6b
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/automatic-dropdown.vue
@@ -0,0 +1,52 @@
+
+
+ 点击获取焦点
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/basic-usage.vue b/examples/sites/demos/mobile-first/app/select/basic-usage.vue
new file mode 100644
index 000000000..bce6d25ad
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/basic-usage.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/binding-obj.vue b/examples/sites/demos/mobile-first/app/select/binding-obj.vue
new file mode 100644
index 000000000..23b9b0795
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/binding-obj.vue
@@ -0,0 +1,46 @@
+
+
+
+
+
+ {{ value }}
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/cache-usage.vue b/examples/sites/demos/mobile-first/app/select/cache-usage.vue
new file mode 100644
index 000000000..36c5c212b
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/cache-usage.vue
@@ -0,0 +1,50 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/clearable.vue b/examples/sites/demos/mobile-first/app/select/clearable.vue
new file mode 100644
index 000000000..19c46b7b4
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/clearable.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/close-by-mask.vue b/examples/sites/demos/mobile-first/app/select/close-by-mask.vue
new file mode 100644
index 000000000..2e11f40b4
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/close-by-mask.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/collapse-tags.vue b/examples/sites/demos/mobile-first/app/select/collapse-tags.vue
new file mode 100644
index 000000000..b01915245
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/collapse-tags.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/custom-icon.vue b/examples/sites/demos/mobile-first/app/select/custom-icon.vue
new file mode 100644
index 000000000..51772eba9
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/custom-icon.vue
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/custom-options.vue b/examples/sites/demos/mobile-first/app/select/custom-options.vue
new file mode 100644
index 000000000..8cfb22b1e
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/custom-options.vue
@@ -0,0 +1,48 @@
+
+
+
+ {{ item.label }}
+
+ {{ item.value }}
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/custom-prefix.vue b/examples/sites/demos/mobile-first/app/select/custom-prefix.vue
new file mode 100644
index 000000000..bd57a89d8
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/custom-prefix.vue
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/custom-select-dropdown-style.vue b/examples/sites/demos/mobile-first/app/select/custom-select-dropdown-style.vue
new file mode 100644
index 000000000..244885577
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/custom-select-dropdown-style.vue
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/disable-grid-select-radio.vue b/examples/sites/demos/mobile-first/app/select/disable-grid-select-radio.vue
new file mode 100644
index 000000000..d8d0c5232
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/disable-grid-select-radio.vue
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/disabled-options.vue b/examples/sites/demos/mobile-first/app/select/disabled-options.vue
new file mode 100644
index 000000000..2dc0a89b3
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/disabled-options.vue
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/disabled.vue b/examples/sites/demos/mobile-first/app/select/disabled.vue
new file mode 100644
index 000000000..fd1d49712
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/disabled.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/envts-change.vue b/examples/sites/demos/mobile-first/app/select/envts-change.vue
new file mode 100644
index 000000000..267206001
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/envts-change.vue
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/envts-remove.vue b/examples/sites/demos/mobile-first/app/select/envts-remove.vue
new file mode 100644
index 000000000..a0f1dce77
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/envts-remove.vue
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/filter-method.vue b/examples/sites/demos/mobile-first/app/select/filter-method.vue
new file mode 100644
index 000000000..c16b1f5ce
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/filter-method.vue
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/filter-mode.vue b/examples/sites/demos/mobile-first/app/select/filter-mode.vue
new file mode 100644
index 000000000..d99e991a3
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/filter-mode.vue
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/focus-remote-method.vue b/examples/sites/demos/mobile-first/app/select/focus-remote-method.vue
new file mode 100644
index 000000000..051915c4d
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/focus-remote-method.vue
@@ -0,0 +1,192 @@
+
+
+ 聚焦时触发搜索,配置属性 :remote-config="{ autoSearch: true }"
+
+
+
+
+ 失焦清空查询数据,显示下拉图标,配置属性 :remote-config="{ clearData: true, showIcon: true }"
+
+
+
+
+
+ 聚焦时触发搜索,失焦清空查询数据,显示下拉图标,配置属性 :remote-config="{ autoSearch: true, clearData: true,
+ showIcon: true }"
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/hide-select-input-border.vue b/examples/sites/demos/mobile-first/app/select/hide-select-input-border.vue
new file mode 100644
index 000000000..db147c500
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/hide-select-input-border.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/hover-expand-disabled.vue b/examples/sites/demos/mobile-first/app/select/hover-expand-disabled.vue
new file mode 100644
index 000000000..9325c1412
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/hover-expand-disabled.vue
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/hover-expand.vue b/examples/sites/demos/mobile-first/app/select/hover-expand.vue
new file mode 100644
index 000000000..13a7aca32
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/hover-expand.vue
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/is-drop-inherit-width.vue b/examples/sites/demos/mobile-first/app/select/is-drop-inherit-width.vue
new file mode 100644
index 000000000..c88023cfb
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/is-drop-inherit-width.vue
@@ -0,0 +1,51 @@
+
+
+ 未设置属性is-drop-inherit-width,下拉选项默认撑开:
+
+
+
+ 设置了属性is-drop-inherit-width,下拉选项跟随输入框宽度:
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/manual-focus-blur.vue b/examples/sites/demos/mobile-first/app/select/manual-focus-blur.vue
new file mode 100644
index 000000000..3a18a007a
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/manual-focus-blur.vue
@@ -0,0 +1,60 @@
+
+
+
+ 单击按钮 Select 将获取焦点
+
+
+ 单击按钮 Select 将失去焦点
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/memoize-usage.vue b/examples/sites/demos/mobile-first/app/select/memoize-usage.vue
new file mode 100644
index 000000000..63f82c79a
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/memoize-usage.vue
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/multiple-limit.vue b/examples/sites/demos/mobile-first/app/select/multiple-limit.vue
new file mode 100644
index 000000000..b29a62196
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/multiple-limit.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/multiple-mix.vue b/examples/sites/demos/mobile-first/app/select/multiple-mix.vue
new file mode 100644
index 000000000..7c537e66c
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/multiple-mix.vue
@@ -0,0 +1,146 @@
+
+
+ display-only/{{ displayOnly }}
+
+ 边框为表单范围
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/multiple.vue b/examples/sites/demos/mobile-first/app/select/multiple.vue
new file mode 100644
index 000000000..d3ffb270d
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/multiple.vue
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/name.vue b/examples/sites/demos/mobile-first/app/select/name.vue
new file mode 100644
index 000000000..8119f7d61
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/name.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/nest-checkbox-tree-lazy.vue b/examples/sites/demos/mobile-first/app/select/nest-checkbox-tree-lazy.vue
new file mode 100644
index 000000000..70061f07a
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/nest-checkbox-tree-lazy.vue
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/nest-checkbox-tree.vue b/examples/sites/demos/mobile-first/app/select/nest-checkbox-tree.vue
new file mode 100644
index 000000000..990d7e9bc
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/nest-checkbox-tree.vue
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/nest-filterable-tree.vue b/examples/sites/demos/mobile-first/app/select/nest-filterable-tree.vue
new file mode 100644
index 000000000..1a056a110
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/nest-filterable-tree.vue
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/nest-radio-tree-lazy.vue b/examples/sites/demos/mobile-first/app/select/nest-radio-tree-lazy.vue
new file mode 100644
index 000000000..3079b169b
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/nest-radio-tree-lazy.vue
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/nest-radio-tree.vue b/examples/sites/demos/mobile-first/app/select/nest-radio-tree.vue
new file mode 100644
index 000000000..777187ccc
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/nest-radio-tree.vue
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/nest-remote-grid.vue b/examples/sites/demos/mobile-first/app/select/nest-remote-grid.vue
new file mode 100644
index 000000000..6f05726c9
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/nest-remote-grid.vue
@@ -0,0 +1,221 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/no-data-text.vue b/examples/sites/demos/mobile-first/app/select/no-data-text.vue
new file mode 100644
index 000000000..f39a74dd8
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/no-data-text.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/no-match-text.vue b/examples/sites/demos/mobile-first/app/select/no-match-text.vue
new file mode 100644
index 000000000..8763160e4
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/no-match-text.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/optimization.vue b/examples/sites/demos/mobile-first/app/select/optimization.vue
new file mode 100644
index 000000000..2ce2529b4
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/optimization.vue
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/option-group-disable.vue b/examples/sites/demos/mobile-first/app/select/option-group-disable.vue
new file mode 100644
index 000000000..0463b17b0
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/option-group-disable.vue
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/option-group.vue b/examples/sites/demos/mobile-first/app/select/option-group.vue
new file mode 100644
index 000000000..aae8a9e75
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/option-group.vue
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/popup-style-position.vue b/examples/sites/demos/mobile-first/app/select/popup-style-position.vue
new file mode 100644
index 000000000..254b5be17
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/popup-style-position.vue
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/remote-method.vue b/examples/sites/demos/mobile-first/app/select/remote-method.vue
new file mode 100644
index 000000000..8d09b6995
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/remote-method.vue
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/remote-search-allow-copy.vue b/examples/sites/demos/mobile-first/app/select/remote-search-allow-copy.vue
new file mode 100644
index 000000000..56585192a
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/remote-search-allow-copy.vue
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/required-option.vue b/examples/sites/demos/mobile-first/app/select/required-option.vue
new file mode 100644
index 000000000..5284115a4
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/required-option.vue
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/search-allow-copy.vue b/examples/sites/demos/mobile-first/app/select/search-allow-copy.vue
new file mode 100644
index 000000000..617a1a6d4
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/search-allow-copy.vue
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/set-input-value.vue b/examples/sites/demos/mobile-first/app/select/set-input-value.vue
new file mode 100644
index 000000000..efa9a4056
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/set-input-value.vue
@@ -0,0 +1,52 @@
+
+
+ 设置value值
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/show-alloption.vue b/examples/sites/demos/mobile-first/app/select/show-alloption.vue
new file mode 100644
index 000000000..5b111c5ce
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/show-alloption.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/show-tip.vue b/examples/sites/demos/mobile-first/app/select/show-tip.vue
new file mode 100644
index 000000000..339cee4ba
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/show-tip.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/size-medium.vue b/examples/sites/demos/mobile-first/app/select/size-medium.vue
new file mode 100644
index 000000000..ac3390362
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/size-medium.vue
@@ -0,0 +1,40 @@
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/size-mini.vue b/examples/sites/demos/mobile-first/app/select/size-mini.vue
new file mode 100644
index 000000000..732f271bd
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/size-mini.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/size-small.vue b/examples/sites/demos/mobile-first/app/select/size-small.vue
new file mode 100644
index 000000000..bb4b860b0
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/size-small.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/slot-default.vue b/examples/sites/demos/mobile-first/app/select/slot-default.vue
new file mode 100644
index 000000000..7cc8683f5
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/slot-default.vue
@@ -0,0 +1,46 @@
+
+
+
+ {{ item.label }}
+ {{ item.value }}
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/slot-empty.vue b/examples/sites/demos/mobile-first/app/select/slot-empty.vue
new file mode 100644
index 000000000..7dc2d7bc8
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/slot-empty.vue
@@ -0,0 +1,28 @@
+
+
+
+ 没有选项
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/slot-label.vue b/examples/sites/demos/mobile-first/app/select/slot-label.vue
new file mode 100644
index 000000000..89ca2e9e5
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/slot-label.vue
@@ -0,0 +1,85 @@
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/tag-copy-all-split.vue b/examples/sites/demos/mobile-first/app/select/tag-copy-all-split.vue
new file mode 100644
index 000000000..a4957f3b5
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/tag-copy-all-split.vue
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/tag-copy-all.vue b/examples/sites/demos/mobile-first/app/select/tag-copy-all.vue
new file mode 100644
index 000000000..ebabbc00c
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/tag-copy-all.vue
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/tag-select.vue b/examples/sites/demos/mobile-first/app/select/tag-select.vue
new file mode 100644
index 000000000..38f73560b
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/tag-select.vue
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/title.vue b/examples/sites/demos/mobile-first/app/select/title.vue
new file mode 100644
index 000000000..65762c300
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/title.vue
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/select/webdoc/select.cn.md b/examples/sites/demos/mobile-first/app/select/webdoc/select.cn.md
new file mode 100644
index 000000000..82a65cdd9
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/webdoc/select.cn.md
@@ -0,0 +1,7 @@
+---
+title: Select 选择器
+---
+
+# Select 选择器
+
+Select 选择器是一种通过点击弹出下拉列表展示数据并进行选择的 UI 组件。
diff --git a/examples/sites/demos/mobile-first/app/select/webdoc/select.en.md b/examples/sites/demos/mobile-first/app/select/webdoc/select.en.md
new file mode 100644
index 000000000..a5ab4f292
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/webdoc/select.en.md
@@ -0,0 +1,7 @@
+---
+title: Select Selector
+---
+
+# Select Selector
+
+Select selector is a UI component that displays and selects data from a drop-down list box.
diff --git a/examples/sites/demos/mobile-first/app/select/webdoc/select.js b/examples/sites/demos/mobile-first/app/select/webdoc/select.js
new file mode 100644
index 000000000..195c9346f
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/select/webdoc/select.js
@@ -0,0 +1,715 @@
+export default {
+ column: '2',
+ owner: '',
+ demos: [
+ {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '`v-model` 的值为当前被选中的 `tiny-option` 的 `value` 属性值。',
+ 'en-US':
+ 'Set the value
attribute value of the selected tiny-option
by v-model
.
\n'
+ },
+ codeFiles: ['basic-usage.vue']
+ },
+ {
+ demoId: 'multiple',
+ name: {
+ 'zh-CN': '多选',
+ 'en-US': 'Multiple'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 multiple
属性启用多选功能,此时 v-model
的值为当前选中值所组成的数组。默认选中值会以标签(Tag 组件)展示。
\n',
+ 'en-US':
+ 'Enable the multi-selection function through the multiple
attribute, where the value of the v-model
is an array composed of the currently selected values. The default selected value will be displayed as a tag component.
\n'
+ },
+ codeFiles: ['multiple.vue']
+ },
+ {
+ demoId: 'collapse-tags',
+ name: {
+ 'zh-CN': '折叠标签',
+ 'en-US': 'Collapse tags'
+ },
+ desc: {
+ 'zh-CN': '通过 collapse-tags
属性设置选中多个选项时,多个标签缩略展示。
\n',
+ 'en-US':
+ 'When multiple options are selected through the collapse-tags
attribute settings, multiple tags will be abbreviated and displayed.
\n'
+ },
+ codeFiles: ['collapse-tags.vue']
+ },
+ {
+ demoId: 'multiple-limit',
+ name: {
+ 'zh-CN': '选择个数限制',
+ 'en-US': 'Select number limit'
+ },
+ desc: {
+ 'zh-CN': '通过 multiple-limit
属性限制最多可选择的个数,默认为 0 不限制。
\n',
+ 'en-US':
+ 'Limit the maximum number of choices through the multiple-limit
attribute, with a default value of 0 and no limit.
\n'
+ },
+ codeFiles: ['multiple-limit.vue']
+ },
+ {
+ demoId: 'hover-expand',
+ name: {
+ 'zh-CN': '折叠 Tag, hover 展开',
+ 'en-US': 'Select number limit'
+ },
+ desc: {
+ 'zh-CN':
+ '多选时通过设置 `hover-expand` 为 `true` ,默认折叠 tag, hover 时展示所有 tag。tag 超出隐藏并展示 tooltip。',
+ 'en-US':
+ 'Limit the maximum number of choices through the multiple-limit
attribute, with a default value of 0 and no limit.
\n'
+ },
+ codeFiles: ['hover-expand.vue']
+ },
+ {
+ demoId: 'required-option',
+ name: {
+ 'zh-CN': '必选选项',
+ 'en-US': 'Select number limit'
+ },
+ desc: {
+ 'zh-CN':
+ '多选时,通过给 `option` 标签配置 `required` 或者在 `options` 配置项中添加 `required` 属性,来设置必选选项。',
+ 'en-US':
+ 'Limit the maximum number of choices through the multiple-limit
attribute, with a default value of 0 and no limit.
\n'
+ },
+ codeFiles: ['required-option.vue']
+ },
+ {
+ demoId: 'multiple-mix',
+ name: {
+ 'zh-CN': '综合场景',
+ 'en-US': 'Select number limit'
+ },
+ desc: {
+ 'zh-CN': 'Form 表单内 Select 组件不同尺寸设置 hover-expand 和 display-only 属性的综合应用。',
+ 'en-US':
+ 'Limit the maximum number of choices through the multiple-limit
attribute, with a default value of 0 and no limit.
\n'
+ },
+ codeFiles: ['multiple-mix.vue']
+ },
+ {
+ demoId: 'disabled',
+ name: {
+ 'zh-CN': '禁用',
+ 'en-US': 'Disabled'
+ },
+ desc: {
+ 'zh-CN': '设置 `disabled` 属性后整个选择器不可用。',
+ 'en-US':
+ 'Set the disabled status of the dropdown or dropdown item through the disabled
attribute.
\n'
+ },
+ codeFiles: ['disabled.vue']
+ },
+ {
+ demoId: 'disabled-options',
+ name: {
+ 'zh-CN': '选项禁用',
+ 'en-US': 'Option disabled'
+ },
+ desc: {
+ 'zh-CN': '设置 `disabled` 属性后整个选择器不可用。',
+ 'en-US':
+ 'Set the disabled status of the dropdown or dropdown item through the disabled
attribute.
\n'
+ },
+ codeFiles: ['disabled-options.vue']
+ },
+ {
+ demoId: 'hover-expand-disabled',
+ name: {
+ 'zh-CN': '多选 hover-expand 模式下禁用',
+ 'en-US': 'Disabled'
+ },
+ desc: {
+ 'zh-CN':
+ '多选且 `hover-expand` 为 `true`时 , 设置 `disabled` 时,可配置 `disabled-tooltip-content` 自定义 tooltip 内容。',
+ 'en-US':
+ 'Set the disabled status of the dropdown or dropdown item through the disabled
attribute.
\n'
+ },
+ codeFiles: ['hover-expand-disabled.vue']
+ },
+ {
+ demoId: 'size-medium',
+ name: {
+ 'zh-CN': '中尺寸',
+ 'en-US': 'Size'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 `size` 属性定义输入框尺寸,可选项有 medium、small、mini 。 通过 `options` 配置 Select 数据项,使用后不需要再配置 tiny-option。',
+ 'en-US':
+ 'Set the input box size through the size
attribute, with optional values of medium / small / mini.
'
+ },
+ codeFiles: ['size-medium.vue']
+ },
+ {
+ demoId: 'size-small',
+ name: {
+ 'zh-CN': '小尺寸',
+ 'en-US': 'Size'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 `size` 属性定义输入框尺寸,可选项有 medium、small、mini 。 通过 `options` 配置 Select 数据项,使用后不需要再配置 tiny-option。',
+ 'en-US':
+ 'Set the input box size through the size
attribute, with optional values of medium / small / mini.
'
+ },
+ codeFiles: ['size-small.vue']
+ },
+ {
+ demoId: 'size-mini',
+ name: {
+ 'zh-CN': 'mini尺寸',
+ 'en-US': 'Size'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 `size` 属性定义输入框尺寸,可选项有 medium、small、mini 。 通过 `options` 配置 Select 数据项,使用后不需要再配置 tiny-option。',
+ 'en-US':
+ 'Set the input box size through the size
attribute, with optional values of medium / small / mini.
'
+ },
+ codeFiles: ['size-mini.vue']
+ },
+ {
+ demoId: 'option-group',
+ name: {
+ 'zh-CN': '分组',
+ 'en-US': 'Group'
+ },
+ desc: {
+ 'zh-CN':
+ '使用 tiny-option-group
组件对备选项进行分组。通过 label
属性设置分组名,disabled
属性设置该分组下所有选项为禁用。
\n',
+ 'en-US':
+ 'Use the tiny-option-group
component to group alternative options. Set the group name through the label
attribute, and set all options under the group to disabled through the disabled
attribute.
\n'
+ },
+ codeFiles: ['option-group.vue']
+ },
+ {
+ demoId: 'option-group-disable',
+ name: {
+ 'zh-CN': '分组禁用部分选项',
+ 'en-US': 'Group'
+ },
+ desc: {
+ 'zh-CN': '使用 `tiny-option-group` 对备选项进行分组,禁用部分分组。',
+ 'en-US':
+ 'Use the tiny-option-group
component to group alternative options. Set the group name through the label
attribute, and set all options under the group to disabled through the disabled
attribute.
\n'
+ },
+ codeFiles: ['option-group-disable.vue']
+ },
+ {
+ demoId: 'custom-icon',
+ name: {
+ 'zh-CN': '自定义图标',
+ 'en-US': 'Group'
+ },
+ desc: {
+ 'zh-CN': '通过 `dropdown-icon` 属性可自定义下拉图标。',
+ 'en-US':
+ 'Use the tiny-option-group
component to group alternative options. Set the group name through the label
attribute, and set all options under the group to disabled through the disabled
attribute.
\n'
+ },
+ codeFiles: ['custom-icon.vue']
+ },
+ {
+ demoId: 'custom-select-dropdown-style',
+ name: {
+ 'zh-CN': '自定义下拉框样式',
+ 'en-US': 'Group'
+ },
+ desc: {
+ 'zh-CN': '通过 `drop-style` 属性可自定义下拉选项样式。',
+ 'en-US':
+ 'Use the tiny-option-group
component to group alternative options. Set the group name through the label
attribute, and set all options under the group to disabled through the disabled
attribute.
\n'
+ },
+ codeFiles: ['custom-select-dropdown-style.vue']
+ },
+ {
+ demoId: 'envts-change',
+ name: {
+ 'zh-CN': 'change clear blur focus dropdown-icon 事件',
+ 'en-US': 'Clearable'
+ },
+ desc: {
+ 'zh-CN':
+ ':::tip 事件说明\n change:选中值发生变化时触发,回调参数为目前的选中值\n clear:可清空的单选模式下用户点击清空按钮时触发\n blur:当 input 失去焦点时触发\n focus:当 input 获得焦点时触发\n dropdown-icon:当点击下拉图标时触发\n :::',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['envts-change.vue']
+ },
+ {
+ demoId: 'envts-remove',
+ name: {
+ 'zh-CN': 'visible-change remove-tag 事件',
+ 'en-US': 'Clearable'
+ },
+ desc: {
+ 'zh-CN':
+ ':::tip 事件说明\n visible-change:下拉框出现/隐藏时触发,回调参数为:出现则为 true,隐藏则为 false\n remove-tag:多选模式下移除 tag 时触发,回调参数为移除的 tag 值\n :::',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['envts-remove.vue']
+ },
+ {
+ demoId: 'filter-method',
+ name: {
+ 'zh-CN': '可搜索',
+ 'en-US': 'Filterable'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 `filterable` 属性可启用搜索功能。默认情况下,Select 会找出所有 `label` 属性包含输入值的选项。如果希望使用其他的搜索逻辑,可以通过传入一个 `filter-method` 来实现。`filter-method` 为一个 Function,它会在输入值发生变化时调用,参数为当前输入值。',
+ 'en-US':
+ 'Enable search functionality through the filterable
attribute filter-method
customize the filtering method no-match-text
the text displayed when there is no match between attribute customization and search criteria.
\n'
+ },
+ codeFiles: ['filter-method.vue']
+ },
+ {
+ demoId: 'search-allow-copy',
+ name: {
+ 'zh-CN': '搜索允许复制',
+ 'en-US': 'Clearable'
+ },
+ desc: {
+ 'zh-CN':
+ '搜索单选场景,不能复制输入框的内容,需要添加属性 allow-copy 才能复制。属性 allow-copy 默认为 false。\n 在鼠标悬浮在输入框上时,按下鼠标左键并移动鼠标,可选中之前输入文本;\n 在鼠标悬浮在输入框上时,点击鼠标左键,还是原有行为,即输入内容变为 placeholder,内容清空,进入输入状态;',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['search-allow-copy.vue']
+ },
+ {
+ demoId: 'allow-create',
+ name: {
+ 'zh-CN': '创建条目',
+ 'en-US': 'Create Entry'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 `allow-create` 属性可通过在输入框中输入文字来创建选项中并不存在的新的条目。注意此时 `filterable` 属性必须为真。而`default-first-option` 属性设置为 true 后,通过按下回车就可以选中当前选项列表中的第一个选项,无需使用鼠标或键盘方向键进行定位。',
+ 'en-US':
+ 'By using the allow-create
and filterable
attributes, the search field can be created as a new entry when it is not in an existing option. By combining the default-first-option
attribute, you can press the Enter key to select the first matching option.
\n'
+ },
+ codeFiles: ['allow-create.vue']
+ },
+ {
+ demoId: 'remote-method',
+ name: {
+ 'zh-CN': '远程搜索',
+ 'en-US': 'Remote search'
+ },
+ desc: {
+ 'zh-CN':
+ '为了启用远程搜索,需要将 `filterable` 和 `remote` 设置为 `true`,同时传入一个 `remote-method`。`remote-method` 为一个 Function,它会在输入值发生变化时调用,参数为当前输入值。`reserve-keyword` 属性在多选且可搜索时,可以在选中一个选项后保留当前的搜索关键词。',
+ 'en-US':
+ 'Set remote search through the use of three attributes:filterable
,remote
, and remote-method
. When setting multiple searchable options through the reserve-keyword
attribute, the current search keyword can be retained after selecting an option.
'
+ },
+ codeFiles: ['remote-method.vue']
+ },
+ {
+ demoId: 'focus-remote-method',
+ name: {
+ 'zh-CN': '获焦时触发远程搜索',
+ 'en-US': 'Clearable'
+ },
+ desc: {
+ 'zh-CN': '',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['focus-remote-method.vue']
+ },
+ {
+ demoId: 'remote-search-allow-copy',
+ name: {
+ 'zh-CN': '远程搜索允许复制',
+ 'en-US': 'Clearable'
+ },
+ desc: {
+ 'zh-CN':
+ '远程搜索单选场景,不能复制输入框的内容,需要添加属性 allow-copy 才能复制。属性 allow-copy 默认为 false。\n 在鼠标悬浮在输入框上时,按下鼠标左键并移动鼠标,可选中之前输入文本;\n 在鼠标悬浮在输入框上时,点击鼠标左键,还是原有行为,即输入内容变为 placeholder,内容清空,进入输入状态;',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['remote-search-allow-copy.vue']
+ },
+ {
+ demoId: 'clearable',
+ name: {
+ 'zh-CN': '选项可清除',
+ 'en-US': 'Clearable'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 `clearable` 属性可将选择器清空,鼠标悬停于选择器上时,会出现清除图标。需要注意的是,`clearable` 属性仅适用于单选。',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['clearable.vue']
+ },
+ {
+ demoId: 'name',
+ name: {
+ 'zh-CN': 'name',
+ 'en-US': 'name'
+ },
+ desc: {
+ 'zh-CN': '通过 `name` 属性可已设置 name 的属性',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['name.vue']
+ },
+ {
+ demoId: 'tag-select',
+ name: {
+ 'zh-CN': '选择器选项可复制',
+ 'en-US': 'name'
+ },
+ desc: {
+ 'zh-CN': '设置 `tag-selectable` 属性后,输入框中已选择的选项可通过鼠标选择,然后按 Ctrl + C 或右键进行复制。',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['tag-select.vue']
+ },
+ {
+ demoId: 'tag-copy-all',
+ name: {
+ 'zh-CN': '选择器选项支持复制所有',
+ 'en-US': 'Clearable'
+ },
+ desc: {
+ 'zh-CN': '设置 `copyable` 属性后,可以复制所有的 `tag` 文本内容默认以逗号分隔',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['tag-copy-all.vue']
+ },
+ {
+ demoId: 'tag-copy-all-split',
+ name: {
+ 'zh-CN': '使用 copyable 的情况下,支持配置复制文本分隔符',
+ 'en-US': 'Clearable'
+ },
+ desc: {
+ 'zh-CN': '设置 `copyable` 属性后,通过设置 `text-split` 属性,自定义复制文本内容的分隔符',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['tag-copy-all-split.vue']
+ },
+ {
+ demoId: 'binding-obj',
+ name: {
+ 'zh-CN': '绑定值为对象',
+ 'en-US': 'Clearable'
+ },
+ desc: {
+ 'zh-CN': '如果绑定值为对象时,则必须要配置 `value-key` 属性指定 value 唯一标识的键名。',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['binding-obj.vue']
+ },
+ {
+ demoId: 'no-match-text',
+ name: {
+ 'zh-CN': '自定义无匹配搜索文字',
+ 'en-US': 'Clearable'
+ },
+ desc: {
+ 'zh-CN': '通过 `no-match-text` 属性可自定义搜索条件无匹配时显示的文字。',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['no-match-text.vue']
+ },
+ {
+ demoId: 'no-data-text',
+ name: {
+ 'zh-CN': '空数据文本',
+ 'en-US': 'Empty data text'
+ },
+ desc: {
+ 'zh-CN': '通过 `no-data-text` 属性可以自定义选项为空时显示的文字。',
+ 'en-US':
+ 'By setting theno-data-text
attribute to display text when the option is empty, and by setting the show-empty-image
attribute to display empty data images, it is not displayed by default.
\n'
+ },
+ codeFiles: ['no-data-text.vue']
+ },
+ {
+ demoId: 'popup-style-position',
+ name: {
+ 'zh-CN': '弹框样式与定位',
+ 'en-US': 'Bullet Box Style and Positioning'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 `popper-class` 属性可自定义下拉弹框的样式。`popper-append-to-body` 指定是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false 。',
+ 'en-US':
+ 'You can customize the style by setting the class name of the dropdown pop-up box through the popper-class
attribute placement
set the pop-up position popper-append-to-body
set whether to insert the pop-up dom element into the body element, default to true.
\n'
+ },
+ codeFiles: ['popup-style-position.vue']
+ },
+ {
+ demoId: 'automatic-dropdown',
+ name: {
+ 'zh-CN': '获取焦点既弹出下拉菜单',
+ 'en-US': 'Clearable'
+ },
+ desc: {
+ 'zh-CN':
+ '设置 `automatic-dropdown` 属性为 true 后,对于不可搜索的 Select,在输入框获得焦点后将自动弹出选项菜单。',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['automatic-dropdown.vue']
+ },
+ {
+ demoId: 'custom-prefix',
+ name: {
+ 'zh-CN': '自定义头部内容',
+ 'en-US': 'Clearable'
+ },
+ desc: {
+ 'zh-CN': '通过 `prefix` 插槽自定义输入框头部内容。',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['custom-prefix.vue']
+ },
+ {
+ demoId: 'custom-options',
+ name: {
+ 'zh-CN': '自定义下拉内容',
+ 'en-US': 'Clearable'
+ },
+ desc: {
+ 'zh-CN': '通过 Option 的默认插槽实现,将自定义的 HTML 模板插入 `tiny-option` 的 slot 中即可。',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['custom-options.vue']
+ },
+ {
+ demoId: 'show-alloption',
+ name: {
+ 'zh-CN': '不展示全选',
+ 'en-US': 'Hide Select All'
+ },
+ desc: {
+ 'zh-CN': '通过 show-alloption
属性设置多选时不展示 全选
选项,默认展示 。
\n',
+ 'en-US':
+ 'By setting the show-allocation
attribute, do not display the select all
option when multiple selections are made, and display by default.
\n'
+ },
+ codeFiles: ['show-alloption.vue']
+ },
+ {
+ demoId: 'set-input-value',
+ name: {
+ 'zh-CN': '改变输入框的值',
+ 'en-US': 'Hide Select All'
+ },
+ desc: {
+ 'zh-CN': '改变输入框的值',
+ 'en-US':
+ 'By setting the show-allocation
attribute, do not display the select all
option when multiple selections are made, and display by default.
\n'
+ },
+ codeFiles: ['set-input-value.vue']
+ },
+ {
+ demoId: 'manual-focus-blur',
+ name: {
+ 'zh-CN': '手动聚焦失焦',
+ 'en-US': 'Manual focusing out of focus'
+ },
+ desc: {
+ 'zh-CN': '通过 focus()
方法聚焦,blur()
方法失焦。
\n',
+ 'en-US':
+ 'Focusing is achieved through the focus()
method, while the blur()
method is out of focus.
\n'
+ },
+ codeFiles: ['manual-focus-blur.vue']
+ },
+ {
+ demoId: 'is-drop-inherit-width',
+ name: {
+ 'zh-CN': '下拉列表跟随输入框宽度',
+ 'en-US': 'Inherit width'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 `is-drop-inherit-width` 属性设置下拉列表是否跟随输入框宽度。默认为 `false` 表示不跟随,内容可撑开下拉列表宽度,设置为 `true` 则跟随宽度。',
+ 'en-US':
+ 'Set whether the width of the dropdown pop-up box is consistent with the input box through the is-drop-inherit-width
attribute. By default, when the width of the input box is exceeded, it is supported by the content.
\n'
+ },
+ codeFiles: ['is-drop-inherit-width.vue']
+ },
+ {
+ demoId: 'slot-empty',
+ name: {
+ 'zh-CN': '空数据插槽',
+ 'en-US': 'Empty data slot'
+ },
+ desc: {
+ 'zh-CN': '通过 empty
插槽自定义没有选项列表时显示的 HTML 模板。
\n',
+ 'en-US':
+ 'Customize the HTML template displayed when there is no option list through the empty
slot.
'
+ },
+ codeFiles: ['slot-empty.vue']
+ },
+ {
+ demoId: 'slot-default',
+ name: {
+ 'zh-CN': '选项插槽',
+ 'en-US': 'Option slot'
+ },
+ desc: {
+ 'zh-CN': '通过 tiny-option 的 default
插槽自定义选项的 HTML 模板。
\n',
+ 'en-US': 'HTML template for customizing options through the default
slot of tiny-option.
'
+ },
+ codeFiles: ['slot-default.vue']
+ },
+ {
+ demoId: 'slot-label',
+ name: {
+ 'zh-CN': 'label插槽',
+ 'en-US': 'Empty data slot'
+ },
+ desc: {
+ 'zh-CN': '`multiple` 为 `true` 时,通过 `label` 插槽自定义 `tag` 内容 。',
+ 'en-US':
+ 'Customize the HTML template displayed when there is no option list through the empty
slot.
'
+ },
+ codeFiles: ['slot-label.vue']
+ },
+ {
+ demoId: 'filter-mode',
+ name: {
+ 'zh-CN': '过滤器模式',
+ 'en-US': 'Clearable'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 `shape="filter"` 属性切换至过滤器模式。过滤器模式下可传入 label 显示标题,tip 显示提示信息,clearable 是否显示清除按钮,placeholder 显示占位符。',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['filter-mode.vue']
+ },
+ {
+ demoId: 'nest-radio-tree',
+ name: {
+ 'zh-CN': '嵌套单选 Tree',
+ 'en-US': 'Clearable'
+ },
+ desc: {
+ 'zh-CN': '',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['nest-radio-tree.vue']
+ },
+ {
+ demoId: 'nest-checkbox-tree',
+ name: {
+ 'zh-CN': '嵌套多选 Tree',
+ 'en-US': 'Clearable'
+ },
+ desc: {
+ 'zh-CN': '',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['nest-checkbox-tree.vue']
+ },
+ {
+ demoId: 'nest-filterable-tree',
+ name: {
+ 'zh-CN': '可搜索 Tree',
+ 'en-US': 'Clearable'
+ },
+ desc: {
+ 'zh-CN': '',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['nest-filterable-tree.vue']
+ },
+ {
+ demoId: 'nest-radio-tree-lazy',
+ name: {
+ 'zh-CN': '嵌套单选 Tree 懒加载',
+ 'en-US': 'Clearable'
+ },
+ desc: {
+ 'zh-CN': '通过配置 `tree-op` 属性中的 `lazy` 和 `load` 方法设置懒加载,具体配置同 `tree` 组件。',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['nest-radio-tree-lazy.vue']
+ },
+ {
+ demoId: 'nest-checkbox-tree-lazy',
+ name: {
+ 'zh-CN': '嵌套多选 Tree 懒加载',
+ 'en-US': 'Clearable'
+ },
+ desc: {
+ 'zh-CN': '通过配置 `tree-op` 属性中的 `lazy` 和 `load` 方法设置懒加载,具体配置同 `tree` 组件。',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['nest-checkbox-tree-lazy.vue']
+ },
+ {
+ demoId: 'optimization',
+ name: {
+ 'zh-CN': '虚拟滚动',
+ 'en-US': 'Virtual scrolling'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 optimization
开启大数据虚拟滚动功能。仅配置式(使用 options 属性)时支持。\n多选模式下,最大选中项数 multiple-limit
默认值为 20,如果选中项比较多,建议开启 collapse-tags
进行折叠显示。
\n',
+ 'en-US':
+ 'Enable the big data virtual scrolling function through optimization
. Supported only when configuring (using the options attribute). In n multiple selection mode, the maximum number of selected items is multiple-limit
with a default value of 20. If there are many selected items, it is recommended to turn on collapse-tags
for collapsed display.
\n'
+ },
+ codeFiles: ['optimization.vue']
+ },
+ {
+ demoId: 'title',
+ name: {
+ 'zh-CN': '弹框标题',
+ 'en-US': 'Clearable'
+ },
+ desc: {
+ 'zh-CN': '`title` 属性用于设置弹出框标题,仅小屏下生效。',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['title.vue']
+ },
+ {
+ demoId: 'close-by-mask',
+ name: {
+ 'zh-CN': '点击遮罩是否关闭弹框',
+ 'en-US': 'Clearable'
+ },
+ desc: {
+ 'zh-CN': '设置 `close-by-mask="true"` 点击遮罩可以关闭弹框,默认为`true`,仅小屏下生效。',
+ 'en-US':
+ 'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
+ },
+ codeFiles: ['close-by-mask.vue']
+ }
+ ]
+}
diff --git a/examples/sites/demos/mobile-first/app/selected-box/webdoc/selected-box.js b/examples/sites/demos/mobile-first/app/selected-box/webdoc/selected-box.js
index a358c3215..9879cd9a2 100644
--- a/examples/sites/demos/mobile-first/app/selected-box/webdoc/selected-box.js
+++ b/examples/sites/demos/mobile-first/app/selected-box/webdoc/selected-box.js
@@ -53,6 +53,5 @@ export default {
},
codeFiles: ['enumeration.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/signature/basic-usage.vue b/examples/sites/demos/mobile-first/app/signature/basic-usage.vue
new file mode 100644
index 000000000..984e4a9ea
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/signature/basic-usage.vue
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/signature/bgcolor.vue b/examples/sites/demos/mobile-first/app/signature/bgcolor.vue
new file mode 100644
index 000000000..82d97f5fc
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/signature/bgcolor.vue
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/signature/button-text.vue b/examples/sites/demos/mobile-first/app/signature/button-text.vue
new file mode 100644
index 000000000..169830cdb
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/signature/button-text.vue
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/signature/get-image.vue b/examples/sites/demos/mobile-first/app/signature/get-image.vue
new file mode 100644
index 000000000..ed7b295ec
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/signature/get-image.vue
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+ 生成图片
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/signature/in-dialogbox.vue b/examples/sites/demos/mobile-first/app/signature/in-dialogbox.vue
new file mode 100644
index 000000000..45bcadf72
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/signature/in-dialogbox.vue
@@ -0,0 +1,27 @@
+
+
+ 默认属性配置
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/signature/line-style.vue b/examples/sites/demos/mobile-first/app/signature/line-style.vue
new file mode 100644
index 000000000..c32a79892
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/signature/line-style.vue
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/signature/placeholder.vue b/examples/sites/demos/mobile-first/app/signature/placeholder.vue
new file mode 100644
index 000000000..a54d49035
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/signature/placeholder.vue
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/signature/preview.vue b/examples/sites/demos/mobile-first/app/signature/preview.vue
new file mode 100644
index 000000000..ffd6a58ae
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/signature/preview.vue
@@ -0,0 +1,30 @@
+
+
+
+
+
+ 点击确认按钮生成预览图片:
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/signature/value.vue b/examples/sites/demos/mobile-first/app/signature/value.vue
new file mode 100644
index 000000000..bdd7a99eb
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/signature/value.vue
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/signature/webdoc/signature.cn.md b/examples/sites/demos/mobile-first/app/signature/webdoc/signature.cn.md
new file mode 100644
index 000000000..e12968f31
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/signature/webdoc/signature.cn.md
@@ -0,0 +1,9 @@
+---
+title: Signature 手写签名组件
+---
+
+# Signature 手写签名组件
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/signature/webdoc/signature.en.md b/examples/sites/demos/mobile-first/app/signature/webdoc/signature.en.md
new file mode 100644
index 000000000..e12968f31
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/signature/webdoc/signature.en.md
@@ -0,0 +1,9 @@
+---
+title: Signature 手写签名组件
+---
+
+# Signature 手写签名组件
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/signature/webdoc/signature.js b/examples/sites/demos/mobile-first/app/signature/webdoc/signature.js
new file mode 100644
index 000000000..4c0d4e39c
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/signature/webdoc/signature.js
@@ -0,0 +1,130 @@
+export default {
+ column: '2',
+ owner: '',
+ demos: [
+ {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'basic usage'
+ },
+ desc: {
+ 'zh-CN': '通过 height
属性设置画布高度。
',
+ 'en-US': 'Set the canvas height through the height
attribute.
'
+ },
+ codeFiles: ['basic-usage.vue']
+ },
+ {
+ demoId: 'bgcolor',
+ name: {
+ 'zh-CN': '自定义背景颜色',
+ 'en-US': 'basic usage'
+ },
+ desc: {
+ 'zh-CN': '通过 backgroundColor
属性设画布背景颜色。
',
+ 'en-US': 'Set the canvas height through the height
attribute.
'
+ },
+ codeFiles: ['bgcolor.vue']
+ },
+ {
+ demoId: 'button-text',
+ name: {
+ 'zh-CN': '自定义按钮文本',
+ 'en-US': 'basic usage'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 rewriteButtonText
和 submitButtonText
属性分别设置重写按钮和确认按钮的文案。
',
+ 'en-US': 'Set the canvas height through the height
attribute.
'
+ },
+ codeFiles: ['button-text.vue']
+ },
+ {
+ demoId: 'events',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': 'basic usage'
+ },
+ desc: {
+ 'zh-CN':
+ '\n \n
\n -
submit
: 点击确认按钮触发的事件。 \n -
rewrite
: 点击重写按钮触发的事件。 \n -
start
: 每一次书写开始时触发的事件。 \n -
signing
: 正在进行书写触发的事件。 \n -
end
: 每一次书写完成写触发的事件。 \n
\n \n ',
+ 'en-US': 'Set the canvas height through the height
attribute.
'
+ },
+ codeFiles: ['events.vue']
+ },
+ {
+ demoId: 'get-image',
+ name: {
+ 'zh-CN': '获取签名后的图片',
+ 'en-US': 'basic usage'
+ },
+ desc: {
+ 'zh-CN': '通过组件实例的 getSignatureImage
方法可以获取签名预览图片。
',
+ 'en-US': 'Set the canvas height through the height
attribute.
'
+ },
+ codeFiles: ['get-image.vue']
+ },
+ {
+ demoId: 'in-dialogbox',
+ name: {
+ 'zh-CN': '弹窗中使用签名组件',
+ 'en-US': 'basic usage'
+ },
+ desc: {
+ 'zh-CN': '弹窗中使用签名组件。
',
+ 'en-US': 'Set the canvas height through the height
attribute.
'
+ },
+ codeFiles: ['in-dialogbox.vue']
+ },
+ {
+ demoId: 'line-style',
+ name: {
+ 'zh-CN': '签名线条样式',
+ 'en-US': 'basic usage'
+ },
+ desc: {
+ 'zh-CN':
+ '\n 通过 penColor
属性设置签名线条颜色。
\n 通过 lineWidth
属性设置签名线条宽度。
\n ',
+ 'en-US': 'Set the canvas height through the height
attribute.
'
+ },
+ codeFiles: ['line-style.vue']
+ },
+ {
+ demoId: 'placeholder',
+ name: {
+ 'zh-CN': '定制占位符',
+ 'en-US': 'basic usage'
+ },
+ desc: {
+ 'zh-CN': ' 通过 placeholder
属性设置默认占位符。
',
+ 'en-US': 'Set the canvas height through the height
attribute.
'
+ },
+ codeFiles: ['placeholder.vue']
+ },
+ {
+ demoId: 'preview',
+ name: {
+ 'zh-CN': '签名预览',
+ 'en-US': 'basic usage'
+ },
+ desc: {
+ 'zh-CN':
+ '\n 当点击确认按钮时,组件会触发 submit
事件,事件的第一个参数为 data
,包含以下字段:\n image
:签名对应的图片,为 base64 字符串格式。若签名为空,则返回空字符串。\n canvas
:Canvas 元素。
\n ',
+ 'en-US': 'Set the canvas height through the height
attribute.
'
+ },
+ codeFiles: ['preview.vue']
+ },
+ {
+ demoId: 'value',
+ name: {
+ 'zh-CN': '签名回显',
+ 'en-US': 'basic usage'
+ },
+ desc: {
+ 'zh-CN': ' 通过 value
属性可以回显手写签名图片。
',
+ 'en-US': 'Set the canvas height through the height
attribute.
'
+ },
+ codeFiles: ['value.vue']
+ }
+ ]
+}
diff --git a/examples/sites/demos/mobile-first/app/slider-button/webdoc/slider-button.cn.md b/examples/sites/demos/mobile-first/app/slider-button/webdoc/slider-button.cn.md
index 364a3699b..6bead718c 100644
--- a/examples/sites/demos/mobile-first/app/slider-button/webdoc/slider-button.cn.md
+++ b/examples/sites/demos/mobile-first/app/slider-button/webdoc/slider-button.cn.md
@@ -1,9 +1,5 @@
---
-title: Radio 单选框
+title: SliderButton 滑动按钮组
---
-# Radio 单选框
-
-
-用于配置不同场景的选项,在一组备选项中进行单选
-
+# SliderButton 滑动按钮组
diff --git a/examples/sites/demos/mobile-first/app/slider-button/webdoc/slider-button.en.md b/examples/sites/demos/mobile-first/app/slider-button/webdoc/slider-button.en.md
index 364a3699b..6bead718c 100644
--- a/examples/sites/demos/mobile-first/app/slider-button/webdoc/slider-button.en.md
+++ b/examples/sites/demos/mobile-first/app/slider-button/webdoc/slider-button.en.md
@@ -1,9 +1,5 @@
---
-title: Radio 单选框
+title: SliderButton 滑动按钮组
---
-# Radio 单选框
-
-
-用于配置不同场景的选项,在一组备选项中进行单选
-
+# SliderButton 滑动按钮组
diff --git a/examples/sites/demos/mobile-first/app/slider-button/webdoc/slider-button.js b/examples/sites/demos/mobile-first/app/slider-button/webdoc/slider-button.js
index 819293674..6d1e03bc8 100644
--- a/examples/sites/demos/mobile-first/app/slider-button/webdoc/slider-button.js
+++ b/examples/sites/demos/mobile-first/app/slider-button/webdoc/slider-button.js
@@ -9,14 +9,12 @@ export default {
'en-US': 'basic usage'
},
desc: {
- 'zh-CN': `通过 v-model
绑定变量,设置的变量值为默认选中的 Button
,变量值对应 label 属性的值。
- 通过 text
也可以配置显示文本,与默认插槽配置纯文本的结果一致
- label
可以是 String、Number 或 Boolean
。
`,
+ 'zh-CN':
+ '通过 v-model
绑定变量,设置的变量值为默认选中的 Button
,变量值对应 label
属性的值。
\n 通过 text
也可以配置显示文本,与默认插槽配置纯文本的结果一致
\n label
可以是 String、Number 或 Boolean
。
',
'en-US': 'button type
'
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'slider-button-type',
name: {
@@ -24,11 +22,11 @@ export default {
'en-US': 'events'
},
desc: {
- 'zh-CN': `通过type
属性设置按钮展示类型,可选值为text(默认)、icon
。
- 可在 SliderButton、SliderButtonGroup 组件上设置 change
事件,当绑定值变化时触发,回调函数为选中的 SliderButton label
值。
`,
+ 'zh-CN':
+ '
通过type
属性设置按钮展示类型,可选值为text(默认)、icon
。
\n 可在 SliderButton、SliderButtonGroup 组件上设置 change
事件,当绑定值变化时触发,回调函数为选中的 SliderButton label
值。
',
'en-US': '
bbutton click
'
},
- codeFiles: ['gslider-button-type.vue']
+ codeFiles: ['slider-button-type.vue']
},
{
demoId: 'slider-button-size',
@@ -38,7 +36,7 @@ export default {
},
desc: {
'zh-CN':
- '可对按钮形式的 SliderButton
或带有边框的SliderButton
设置 size
属性,以改变其尺寸,包括 small(默认)、large
两个尺寸选项。当插入的是图标类型时,还可配置`medium`尺寸。
',
+ '
可对按钮形式的 SliderButton
或带有边框的SliderButton
设置 size
属性,以改变其尺寸,包括 small(默认)、large
两个尺寸选项。当插入的是图标类型时,还可配置 medium
尺寸。
',
'en-US': '
bbutton click
'
},
codeFiles: ['slider-button-size.vue']
@@ -50,7 +48,7 @@ export default {
'en-US': 'events'
},
desc: {
- 'zh-CN': '通过 label
或者text
属性可以设置 Radio 的内容
',
+ 'zh-CN': '
通过 label
或者text
属性可以设置 Button
的内容
',
'en-US': '
bbutton click
'
},
codeFiles: ['custom-content.vue']
@@ -92,6 +90,5 @@ export default {
},
codeFiles: ['slider-disabled.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/slider/webdoc/slider.js b/examples/sites/demos/mobile-first/app/slider/webdoc/slider.js
index 901d97d9d..725a6f4c2 100644
--- a/examples/sites/demos/mobile-first/app/slider/webdoc/slider.js
+++ b/examples/sites/demos/mobile-first/app/slider/webdoc/slider.js
@@ -14,7 +14,6 @@ export default {
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'max-min',
name: {
@@ -187,6 +186,5 @@ export default {
},
codeFiles: ['left-right-slot.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/standard-list-item/basic-usage.vue b/examples/sites/demos/mobile-first/app/standard-list-item/basic-usage.vue
index 3a67fa127..5bf6cfccf 100644
--- a/examples/sites/demos/mobile-first/app/standard-list-item/basic-usage.vue
+++ b/examples/sites/demos/mobile-first/app/standard-list-item/basic-usage.vue
@@ -40,7 +40,7 @@ export default {
userHeadOption: {
type: 'image',
size: 40,
- value: '/static/images/1.jpg',
+ value: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
round: true
},
iconOptions: [
diff --git a/examples/sites/demos/mobile-first/app/standard-list-item/content-slot.vue b/examples/sites/demos/mobile-first/app/standard-list-item/content-slot.vue
index bf4098660..642baf7cd 100644
--- a/examples/sites/demos/mobile-first/app/standard-list-item/content-slot.vue
+++ b/examples/sites/demos/mobile-first/app/standard-list-item/content-slot.vue
@@ -24,7 +24,7 @@ export default {
userHeadOption: {
type: 'image',
size: 40,
- value: '/static/images/1.jpg',
+ value: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
round: true
},
iconOptions: [
diff --git a/examples/sites/demos/mobile-first/app/standard-list-item/custom-class.vue b/examples/sites/demos/mobile-first/app/standard-list-item/custom-class.vue
new file mode 100644
index 000000000..b3736e538
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/standard-list-item/custom-class.vue
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/standard-list-item/type.vue b/examples/sites/demos/mobile-first/app/standard-list-item/type.vue
index c40323220..f012f5348 100644
--- a/examples/sites/demos/mobile-first/app/standard-list-item/type.vue
+++ b/examples/sites/demos/mobile-first/app/standard-list-item/type.vue
@@ -41,7 +41,7 @@ export default {
userHeadOption: {
type: 'image',
size: 40,
- value: '/static/images/1.jpg',
+ value: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
round: true
},
iconOptions: [
diff --git a/examples/sites/demos/mobile-first/app/standard-list-item/webdoc/standard-list-item.js b/examples/sites/demos/mobile-first/app/standard-list-item/webdoc/standard-list-item.js
index 6ee79c7a6..ffe570f9a 100644
--- a/examples/sites/demos/mobile-first/app/standard-list-item/webdoc/standard-list-item.js
+++ b/examples/sites/demos/mobile-first/app/standard-list-item/webdoc/standard-list-item.js
@@ -11,11 +11,11 @@ export default {
desc: {
'zh-CN':
'通过设置`:show-image="true"`可以显示图片区域
`user-head` 属性可以配置头像的类型、大小、背景色等,具体可查看 UserHead 用户头像组件的属性配置
传入`icon` 属性可以将头像区域替换为 icon 图标
',
- 'en-US': 'You can set `:show-image="true"` to display the image area.
The `user-head` attribute can be used to configure the avatar type, size, and background color. For details, see the attribute configuration of the UserHead avatar component.
The `icon` attribute can be transferred to replace the avatar area with an icon.
'
+ 'en-US':
+ 'You can set `:show-image="true"` to display the image area.
The `user-head` attribute can be used to configure the avatar type, size, and background color. For details, see the attribute configuration of the UserHead avatar component.
The `icon` attribute can be transferred to replace the avatar area with an icon.
'
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'type',
name: {
@@ -24,7 +24,8 @@ export default {
},
desc: {
'zh-CN': '通过 `type` 属性可以设置标准列表项的模式,支持 card 和 list 两种模式。
',
- 'en-US': 'You can use the `type` attribute to set the mode of a standard list item. The card and list modes are supported.
'
+ 'en-US':
+ 'You can use the `type` attribute to set the mode of a standard list item. The card and list modes are supported.
'
},
codeFiles: ['type.vue']
},
@@ -60,7 +61,8 @@ export default {
},
desc: {
'zh-CN': '操作列配置项 `options` 中添加属性 hidden 可以隐藏按钮,可以通过 disabled 属性禁用操作按钮。
',
- 'en-US': 'The hidden attribute is added to the `options` configuration item in the Operation column to hide the button. The disabled attribute can be used to disable the operation button.
'
+ 'en-US':
+ 'The hidden attribute is added to the `options` configuration item in the Operation column to hide the button. The disabled attribute can be used to disable the operation button.
'
},
codeFiles: ['icon-disabled.vue']
},
@@ -75,163 +77,18 @@ export default {
'en-US': 'Avatar and Action Column Slots
'
},
codeFiles: ['image-operate-slot.vue']
- }
- ],
- apis: [
- {
- 'name': 'StandardListItem',
- 'type': 'component',
- 'props': [
- {
- 'name': 'data',
- 'type': 'Object',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '列表数据源',
- 'en-US': 'List Data Sources'
- },
- 'demoId': ''
- },
- {
- 'name': 'icon',
- 'type': 'Object',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': 'icon配置项',
- 'en-US': 'icon configuration item'
- },
- 'demoId': ''
- },
- {
- 'name': 'icon-more',
- 'type': 'Object',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '更多按钮图标,可传入一个svg图标对象进行替换',
- 'en-US': 'More button icons can be replaced by a svg icon object.'
- },
- 'demoId': ''
- },
- {
- 'name': 'options',
- 'type': 'Array',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '操作按钮配置项',
- 'en-US': 'Operation button configuration item'
- },
- 'demoId': ''
- },
- {
- 'name': 'selected',
- 'type': 'Boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '是否选中列表项,为true表示选中列表项。',
- 'en-US': 'Indicates whether to select a list item. The value true indicates that a list item is selected.'
- },
- 'demoId': ''
- },
- {
- 'name': 'show-image',
- 'type': 'Boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '显示图片',
- 'en-US': 'Show Pictures'
- },
- 'demoId': ''
- },
- {
- 'name': 'tag',
- 'type': 'Object',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '标签配置项',
- 'en-US': 'Label configuration items'
- },
- 'demoId': ''
- },
- {
- 'name': 'title-option',
- 'type': 'Object',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '标题配置项',
- 'en-US': 'Title configuration item'
- },
- 'demoId': ''
- },
- {
- 'name': 'type',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '类型,支持 card 和 list 两种模式',
- 'en-US': 'Indicates the type. The options are card and list.'
- },
- 'demoId': 'type'
- },
- {
- 'name': 'user-head',
- 'type': 'Object',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '用户头像配置项',
- 'en-US': 'User avatar configuration items'
- },
- 'demoId': ''
- }
- ],
- 'events': [
- {
- 'name': 'icon-click',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '操作栏按钮点击事件',
- 'en-US': 'Operation bar button click event'
- },
- 'demoId': 'icon-click-event'
- }
- ],
- 'slot': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '组件默认插槽', 'en-US': 'Component Default Slot' },
- 'demoId': 'content-slot'
- },
- {
- 'name': 'image',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '图片插槽', 'en-US': 'Picture Slot' },
- 'demoId': 'image-operate-slot'
- },
- {
- 'name': 'operate',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '操作栏插槽', 'en-US': 'Action Bar Slots' },
- 'demoId': 'image-operate-slot'
- },
- {
- 'name': 'tag',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '标签插槽', 'en-US': 'Label Slot' },
- 'demoId': 'content-slot'
- },
- {
- 'name': 'title',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '标题插槽', 'en-US': 'Header Slot' },
- 'demoId': ''
- }
- ],
},
+ {
+ demoId: 'custom-class',
+ name: {
+ 'zh-CN': '自定义class',
+ 'en-US': 'Customized class'
+ },
+ desc: {
+ 'zh-CN': '用户自定义class,可覆盖组件默认class
',
+ 'en-US': 'User-defined class, which can overwrite the default class of the component
'
+ },
+ codeFiles: ['custom-class.vue']
+ }
]
}
diff --git a/examples/sites/demos/mobile-first/app/steps/webdoc/steps.js b/examples/sites/demos/mobile-first/app/steps/webdoc/steps.js
index 7b3740668..456e89903 100644
--- a/examples/sites/demos/mobile-first/app/steps/webdoc/steps.js
+++ b/examples/sites/demos/mobile-first/app/steps/webdoc/steps.js
@@ -66,7 +66,6 @@ export default {
},
codeFiles: ['advanced-no-arrow.vue']
},
-
{
demoId: 'slot-item',
name: {
@@ -104,7 +103,6 @@ export default {
},
codeFiles: ['slot-bottom.vue']
},
-
{
demoId: 'duration',
name: {
@@ -119,7 +117,6 @@ export default {
},
codeFiles: ['duration.vue']
},
-
{
demoId: 'complicated',
name: {
@@ -132,93 +129,5 @@ export default {
},
codeFiles: ['complicated.vue']
}
- ],
- apis: [
- {
- 'name': 'Steps',
- 'type': 'component',
- 'props': [
- {
- 'name': 'advanced',
- 'type': 'Boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否开启高级向导模式', 'en-US': 'Enable Advanced Wizard Mode' },
- 'demoId': 'advanced-steps'
- },
- {
- 'name': 'description-field',
- 'type': 'String',
- 'defaultValue': 'description',
- 'desc': { 'zh-CN': '描述字段', 'en-US': 'Description field' }
- },
- {
- 'name': 'duration',
- 'type': 'Number',
- 'defaultValue': '300',
- 'desc': {
- 'zh-CN':
- '设置节点左右滚动的持续时间,默认值为 300(单位 ms),设置 0 则无滚动动画,仅开启 advanced 高级向导模式有效',
- 'en-US':
- 'Duration for scrolling left and right of a node. The default value is 300 (unit: ms). If this parameter is set to 0, there is no scrolling animation. This parameter is valid only when the advanced wizard mode is enabled.'
- },
- 'demoId': 'duration'
- },
- {
- 'name': 'no-arrow ',
- 'type': 'Boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '添加属性 no-arrow 隐藏左右箭头,在 PC 端按住 shift+鼠标滚轮 进行节点左右滚动,移动端触屏左右滑动即可,仅开启 advanced 高级向导模式有效。',
- 'en-US':
- 'Add the no-arrow attribute to hide the left and right arrows. On the PC, press Shift and scroll the mouse wheel to scroll the node left and right. Swipe left and right on the touch screen of the mobile end. This function is valid only when the advanced wizard mode is enabled.'
- },
- 'demoId': 'advanced-no-arrow'
- },
- {
- 'name': 'vertical',
- 'type': 'Boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否开启垂直单链型',
- 'en-US': 'Indicates whether to enable the vertical single chain mode.'
- },
- 'demoId': 'vertical'
- },
- {
- 'name': 'visible-num',
- 'type': 'Number',
- 'defaultValue': '5',
- 'desc': {
- 'zh-CN': '显示模块数量,超出隐藏',
- 'en-US': 'Display the number of modules. The number of modules exceeds the hidden value'
- },
- 'demoId': 'vertical'
- }
- ],
- 'slots': [
- {
- 'name': 'block-bottom ',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '滚动块底部插槽,仅开启 advanced 高级向导模式有效。',
- 'en-US':
- 'Slot at the bottom of the scroll block. This parameter is valid only when the advanced wizard mode is enabled.'
- },
- 'demoId': 'slot-bottom'
- },
- {
- 'name': 'prefix ',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '前置插槽,仅开启 advanced 高级向导模式有效。',
- 'en-US': 'Front slot, valid only when the advanced wizard mode is enabled.'
- },
- 'demoId': 'slot'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile-first/app/switch/custom-true-false-value.vue b/examples/sites/demos/mobile-first/app/switch/custom-true-false-value.vue
index 99eac25cf..bfbadef12 100644
--- a/examples/sites/demos/mobile-first/app/switch/custom-true-false-value.vue
+++ b/examples/sites/demos/mobile-first/app/switch/custom-true-false-value.vue
@@ -8,7 +8,7 @@
否
- 当前值:{{ value }}
+ 当前值: {{ value }}
diff --git a/examples/sites/demos/mobile-first/app/switch/mini-mode.vue b/examples/sites/demos/mobile-first/app/switch/mini-mode.vue
index f8bcae66b..f7e3d7fa3 100644
--- a/examples/sites/demos/mobile-first/app/switch/mini-mode.vue
+++ b/examples/sites/demos/mobile-first/app/switch/mini-mode.vue
@@ -27,6 +27,9 @@ import { Switch } from '@opentiny/vue'
export default {
components: {
TinySwitch: Switch
+ },
+ data() {
+ return { value1: true }
}
}
diff --git a/examples/sites/demos/mobile-first/app/switch/webdoc/switch.js b/examples/sites/demos/mobile-first/app/switch/webdoc/switch.js
index 3b27b12ed..3bb12b17c 100644
--- a/examples/sites/demos/mobile-first/app/switch/webdoc/switch.js
+++ b/examples/sites/demos/mobile-first/app/switch/webdoc/switch.js
@@ -14,7 +14,6 @@ export default {
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'mini-mode',
name: {
@@ -55,7 +54,7 @@ export default {
{
demoId: 'loading-mode',
name: {
- 'zh-CN': '加载态开关',
+ 'zh-CN': '加载状态开关',
'en-US': 'events'
},
desc: {
@@ -101,6 +100,5 @@ export default {
},
codeFiles: ['custom-true-false-value.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/tabbar/custom-icon.vue b/examples/sites/demos/mobile-first/app/tabbar/custom-icon.vue
new file mode 100644
index 000000000..f1ce49cf2
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/tabbar/custom-icon.vue
@@ -0,0 +1,27 @@
+
+
+ 工作台
+
+ 我的
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/tabbar/slot-icon.vue b/examples/sites/demos/mobile-first/app/tabbar/slot-icon.vue
index 25efef604..1b544dd09 100644
--- a/examples/sites/demos/mobile-first/app/tabbar/slot-icon.vue
+++ b/examples/sites/demos/mobile-first/app/tabbar/slot-icon.vue
@@ -28,8 +28,8 @@ export default {
IconMarkOn: IconMarkOn(),
IconUser: IconUser(),
icon: {
- active: 'https://his-beta.huawei.com/opentiny/webnova/static/img/tiny3bg.b5dd307.jpg',
- inactive: '/static/images/3.jpg'
+ active: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/mountain.png`,
+ inactive: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/fruit.jpg`
}
}
}
diff --git a/examples/sites/demos/mobile-first/app/tabbar/webdoc/tabbar.js b/examples/sites/demos/mobile-first/app/tabbar/webdoc/tabbar.js
index 51bd2b41d..98d7db3d4 100644
--- a/examples/sites/demos/mobile-first/app/tabbar/webdoc/tabbar.js
+++ b/examples/sites/demos/mobile-first/app/tabbar/webdoc/tabbar.js
@@ -91,157 +91,18 @@ export default {
'The show-number
attribute is used to set the number of displayed items. The default value is 5. You can set the item-list
attribute on the Tabbar component to configure TabbarItem cyclically.
'
},
codeFiles: ['options.vue']
- }
- ],
- apis: [
- {
- 'name': 'Tabbar',
- 'type': 'component',
- 'props': [
- {
- 'name': 'active-color',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置被激活时的颜色', 'en-US': 'Sets the color when activated' },
- 'demoId': 'active-inactive-color'
- },
- {
- 'name': 'border',
- 'type': 'Boolean',
- 'defaultValue': 'true',
- 'desc': { 'zh-CN': '设置底部导航上边框', 'en-US': 'Set bottom navigation top border' },
- 'demoId': 'custom-close'
- },
- {
- 'name': 'inactive-color',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置底部导航未被激活颜色',
- 'en-US': 'Set the color of the bottom navigation that is not activated'
- },
- 'demoId': 'active-inactive-color'
- },
- {
- 'name': 'item-list',
- 'type': 'Object[]',
- 'defaultValue': '[]',
- 'desc': {
- 'zh-CN': '设置底部导航虚幻遍历需要放的数组;',
- 'en-US': 'Sets the array to be placed in the bottom navigation illusory traversal.'
- },
- 'demoId': 'options'
- },
- {
- 'name': 'show-number',
- 'type': 'Number',
- 'defaultValue': '5',
- 'desc': {
- 'zh-CN': '设置底部导航需要展示的项数',
- 'en-US': 'Set the number of items to be displayed in the bottom navigation.'
- },
- 'demoId': 'options'
- },
- {
- 'name': 'v-model',
- 'type': 'Number | String',
- 'defaultValue': '0',
- 'desc': { 'zh-CN': '设置底部导航双向数据绑定', 'en-US': 'Set bottom navigation bidirectional data binding' },
- 'demoId': 'base'
- }
- ],
- 'events': [
- {
- 'name': 'change',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '选项改变时触发的事件',
- 'en-US': 'Event triggered when the alert function is disabled'
- },
- 'demoId': 'event-change'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '底部导航每一项', 'en-US': 'Bottom navigation for each item' },
- 'demoId': 'base'
- }
- ]
},
{
- 'name': 'TabbarItem',
- 'type': 'component',
- 'props': [
- {
- 'name': 'badge',
- 'type': 'Number | String',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置底部导航选项徽标', 'en-US': 'Set bottom navigation option logo' },
- 'demoId': 'badge'
- },
- {
- 'name': 'custom-icon',
- 'type': 'Boolean',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置底部导航个性化图标', 'en-US': 'Set bottom navigation personalization icon' }
- },
- {
- 'name': 'dot',
- 'type': 'Boolean',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置底部导航选项点', 'en-US': 'Set bottom navigation option points' },
- 'demoId': 'badge'
- },
- {
- 'name': 'icon',
- 'type': 'Object',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置底部导航上自定义图标', 'en-US': 'Set custom icons on bottom navigation' },
- 'demoId': 'slot-icon'
- },
- {
- 'name': 'name',
- 'type': 'Number | String',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置底部导航选项标题', 'en-US': 'Set bottom navigation option title' },
- 'demoId': 'base'
- },
- {
- 'name': 'text',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置底部导航循环时设定的标题',
- 'en-US': 'Sets the title set when the bottom navigation loop'
- },
- 'demoId': 'base'
- }
- ],
- 'events': [
- {
- 'name': 'click',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '选项点击时触发的事件',
- 'en-US': 'Event triggered when an option is clicked'
- },
- 'demoId': 'event-change'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '底部导航每一项', 'en-US': 'Bottom navigation for each item' },
- 'demoId': 'base'
- }
- ]
+ demoId: 'custom-icon',
+ name: {
+ 'zh-CN': '自定义图标',
+ 'en-US': 'Custom icon'
+ },
+ desc: {
+ 'zh-CN': '通过添加custom-icon
属性设置自定义图标。
',
+ 'en-US': 'Set the custom icon by adding the custom-icon
attribute.
'
+ },
+ codeFiles: ['custom-icon.vue']
}
]
}
diff --git a/examples/sites/demos/mobile-first/app/tabs/optimized-lazy.vue b/examples/sites/demos/mobile-first/app/tabs/optimized-lazy.vue
new file mode 100644
index 000000000..6f9b097d5
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/tabs/optimized-lazy.vue
@@ -0,0 +1,28 @@
+
+
+
+ 表单组件,具有与用户交互,并可完成数据采集功能的控件。
+
+
+ 数据组件,提供了非常强大数据表格功能,在Grid可以展示数据列表,可以对数据列表进行选择、编辑等
+
+ 导航组件,帮助网站访问者浏览站点的组件.
+ 业务组件,与业务紧密相关实现某种业务功能的组件集
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/tabs/optimized.vue b/examples/sites/demos/mobile-first/app/tabs/optimized.vue
new file mode 100644
index 000000000..218b5f467
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/tabs/optimized.vue
@@ -0,0 +1,26 @@
+
+
+ 表单组件,具有与用户交互,并可完成数据采集功能的控件。
+
+ 数据组件,提供了非常强大数据表格功能,在Grid可以展示数据列表,可以对数据列表进行选择、编辑等
+
+ 导航组件,帮助网站访问者浏览站点的组件.
+ 业务组件,与业务紧密相关实现某种业务功能的组件集
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/tabs/reactive.vue b/examples/sites/demos/mobile-first/app/tabs/reactive.vue
new file mode 100644
index 000000000..7ff36ce67
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/tabs/reactive.vue
@@ -0,0 +1,70 @@
+
+
+ value={{ value }} select={{ select }}
+
+ value={{ value }} select={{ select }}
+
+ 表单组件,具有与用户交互,并可完成数据采集功能的控件。
+
+
+ 数据组件,提供了非常强大数据表格功能,在Grid可以展示数据列表,可以对数据列表进行选择、编辑等
+
+
+ value={{ value }}
+
+ select={{ select }}
+
+
+
+
+ 业务组件,与业务紧密相关实现某种业务功能的组件集
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/tabs/size.vue b/examples/sites/demos/mobile-first/app/tabs/size.vue
new file mode 100644
index 000000000..8800c7811
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/tabs/size.vue
@@ -0,0 +1,26 @@
+
+
+ 表单组件,具有与用户交互,并可完成数据采集功能的控件。
+
+ 数据组件,提供了非常强大数据表格功能,在Grid可以展示数据列表,可以对数据列表进行选择、编辑等
+
+ 导航组件,帮助网站访问者浏览站点的组件.
+ 业务组件,与业务紧密相关实现某种业务功能的组件集
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/tabs/stretch-wh.vue b/examples/sites/demos/mobile-first/app/tabs/stretch-wh.vue
index 0fcd4a2c5..7b9db4e42 100644
--- a/examples/sites/demos/mobile-first/app/tabs/stretch-wh.vue
+++ b/examples/sites/demos/mobile-first/app/tabs/stretch-wh.vue
@@ -1,13 +1,13 @@
-
+
表单组件,具有与用户交互,并可完成数据采集功能的控件。
-
- 数据组件,提供了非常强大数据表格功能,在Grid可以展示数据列表,可以对数据列表进行选择、编辑等。
+
+ 当页签容器足够大时,页签的宽度随整体容器宽度自动撑开
- 导航组件,帮助网站访问者浏览站点的组件。
- 业务组件,与业务紧密相关实现某种业务功能的组件集。
+ 导航组件,帮助网站访问者浏览站点的组件.
+ 业务组件,与业务紧密相关实现某种业务功能的组件集
diff --git a/examples/sites/demos/mobile-first/app/tabs/webdoc/tabs.js b/examples/sites/demos/mobile-first/app/tabs/webdoc/tabs.js
index c82eabb71..1b65b1350 100644
--- a/examples/sites/demos/mobile-first/app/tabs/webdoc/tabs.js
+++ b/examples/sites/demos/mobile-first/app/tabs/webdoc/tabs.js
@@ -216,15 +216,68 @@ export default {
{
demoId: 'tabs-separator',
name: {
- 'zh-CN': '标签页嵌套2',
- 'en-US': 'events'
+ 'zh-CN': '分隔符',
+ 'en-US': 'Separator'
},
desc: {
'zh-CN': ' 通过 separator
属性设置分隔符
',
'en-US': 'Set the separator using the separator
attribute.
'
},
codeFiles: ['tabs-separator.vue']
+ },
+ {
+ demoId: 'optimized',
+ name: {
+ 'zh-CN': '优化渲染',
+ 'en-US': 'Optimize Rendering'
+ },
+ desc: {
+ 'zh-CN':
+ '多端标签默认开启优化渲染,只渲染当前标签的内容。可以通过设置 optimized
为 false
关闭优化渲染。默认值为 true
。
',
+ 'en-US':
+ 'By default, optimized rendering is enabled for multi-end tags. Only the content of the current tag is rendered. You can turn off optimized rendering by setting optimized
to false
. The default value is true
.
'
+ },
+ codeFiles: ['optimized.vue']
+ },
+ {
+ demoId: 'optimized-lazy',
+ name: {
+ 'zh-CN': '标签项延时加载',
+ 'en-US': 'Delayed loading of label items'
+ },
+ desc: {
+ 'zh-CN':
+ '在关闭优化渲染时,可以设置标签项的 lazy
属性为 true
,使标签项内容延时加载。默认值为 false
。
',
+ 'en-US':
+ 'When you disable optimized rendering, you can set the lazy
attribute of a tag item to true
to delay loading of the tag item content. The default value is false
.
'
+ },
+ codeFiles: ['optimized-lazy.vue']
+ },
+ {
+ demoId: 'reactive',
+ name: {
+ 'zh-CN': '标签项内容的响应性',
+ 'en-US': 'Responsiveness of Tag Item Content'
+ },
+ desc: {
+ 'zh-CN': '标签项中状态改变时,标签项可以正常更新.
',
+ 'en-US': 'When the status of a label item changes, the label item can be updated normally.
'
+ },
+ codeFiles: ['reactive.vue']
+ },
+ {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '尺寸',
+ 'en-US': 'Size'
+ },
+ desc: {
+ 'zh-CN':
+ '可通过 size
设置 tabs
标签页尺寸,该属性可选值为 large
。
',
+ 'en-US':
+ 'You can use size
to set the size of the tabs
tab page. The value of this attribute can be large
.
'
+ },
+ codeFiles: ['size.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/tag-group/webdoc/tag-group.js b/examples/sites/demos/mobile-first/app/tag-group/webdoc/tag-group.js
index cb9b7c326..1ab7221e6 100644
--- a/examples/sites/demos/mobile-first/app/tag-group/webdoc/tag-group.js
+++ b/examples/sites/demos/mobile-first/app/tag-group/webdoc/tag-group.js
@@ -14,7 +14,6 @@ export default {
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'tag-group-type',
name: {
@@ -24,7 +23,8 @@ export default {
desc: {
'zh-CN':
'`type`可以为标签设置相应的类型,可选值(success / warning / alerting / error / info / default),默认值为 info。
',
- 'en-US': '`type`You can set the corresponding type for a tag. The value can be (success / warning / alerting / error / info / default), and the default value is info.
'
+ 'en-US':
+ '`type`You can set the corresponding type for a tag. The value can be (success / warning / alerting / error / info / default), and the default value is info.
'
},
codeFiles: ['tag-group-type.vue']
},
@@ -35,8 +35,10 @@ export default {
'en-US': 'Size'
},
desc: {
- 'zh-CN': '可通过 `size` 设置 TagGroup 标签组标签大小,可选值(medium / small / mini),默认值为 medium。
',
- 'en-US': 'You can use `size` to set the tag size of the TagGroup tag group. The value can be medium, small, or mini. The default value is medium.
'
+ 'zh-CN':
+ '可通过 `size` 设置 TagGroup 标签组标签大小,可选值(medium / small / mini),默认值为 medium。
',
+ 'en-US':
+ 'You can use `size` to set the tag size of the TagGroup tag group. The value can be medium, small, or mini. The default value is medium.
'
},
codeFiles: ['tag-group-size.vue']
},
@@ -49,7 +51,8 @@ export default {
desc: {
'zh-CN':
'可通过 `effect` 设置 TagGroup 标签组 标签主题,可选值(dark / light / plain),默认值为 light。
',
- 'en-US': 'You can use `effect` to set the tag theme of the TagGroup tag group. The value can be dark, light, or plain. The default value is light.
'
+ 'en-US':
+ 'You can use `effect` to set the tag theme of the TagGroup tag group. The value can be dark, light, or plain. The default value is light.
'
},
codeFiles: ['tag-group-effect.vue']
},
@@ -61,59 +64,10 @@ export default {
},
desc: {
'zh-CN': 'TagGroup 标签组提供了`item-click`事件,`item-click`事件默认提供的参数有 `item,index,event`
',
- 'en-US': 'The TagGroup tag group provides the `item-click` event. The `item-click` event provides the following parameters by default: `item, index, and event`
'
+ 'en-US':
+ 'The TagGroup tag group provides the `item-click` event. The `item-click` event provides the following parameters by default: `item, index, and event`
'
},
codeFiles: ['tag-group-event.vue']
}
- ],
- apis: [
- {
- 'name': 'TagGroup',
- 'type': 'component',
- 'props': [
- {
- 'name': 'data',
- 'type': 'Array',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '数据源',
- 'en-US': 'Data source'
- },
- 'demoId': ''
- },
- {
- 'name': 'effect',
- 'type': 'String',
- 'defaultValue': '该属性的可选值为 dark / light / plain,默认值为 light',
- 'desc': {
- 'zh-CN': '主题',
- 'en-US': 'Subject'
- },
- 'demoId': 'tag-group-effect'
- },
- {
- 'name': 'size',
- 'type': 'String',
- 'defaultValue': '该属性的可选值为 medium / small / mini,默认为medium。',
- 'desc': {
- 'zh-CN': '尺寸',
- 'en-US': 'Size'
- },
- 'demoId': 'tag-group-size'
- }
- ],
- 'events': [
- {
- 'name': 'item-click',
- 'type': 'Function()',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '单个标签的点击事件',
- 'en-US': 'Click event of a single tag.'
- },
- 'demoId': 'tag-group-event'
- }
- ],
- },
]
}
diff --git a/examples/sites/demos/mobile-first/app/tag/webdoc/tag.js b/examples/sites/demos/mobile-first/app/tag/webdoc/tag.js
index db5b600e2..e30672562 100644
--- a/examples/sites/demos/mobile-first/app/tag/webdoc/tag.js
+++ b/examples/sites/demos/mobile-first/app/tag/webdoc/tag.js
@@ -14,7 +14,6 @@ export default {
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'color3',
name: {
@@ -35,7 +34,8 @@ export default {
},
desc: {
'zh-CN': '可通过 `hit` 设置标签边框,可选值(true/false)true 为有边框,false 无边框,默认值为 false。
',
- 'en-US': 'You can use `hit` to set the label border. The options are true and false. The default value is false.
'
+ 'en-US':
+ 'You can use `hit` to set the label border. The options are true and false. The default value is false.
'
},
codeFiles: ['hit.vue']
},
@@ -47,7 +47,8 @@ export default {
},
desc: {
'zh-CN': '可通过 `size` 设置 Tag 标签大小,可选值(medium / small / mini),默认值为 medium。
',
- 'en-US': 'You can use `size` to set the tag size. The value can be medium, small, or mini. The default value is medium.
'
+ 'en-US':
+ 'You can use `size` to set the tag size. The value can be medium, small, or mini. The default value is medium.
'
},
codeFiles: ['tag-size.vue']
},
@@ -60,7 +61,8 @@ export default {
desc: {
'zh-CN':
'可通过 `effect` 设置 Tag 标签主题,可选值(dark / light / plain),默认值为 light。
`type`可以为标签设置相应的类型,可选值(success / warning / alerting / error / default / info),默认值为 info。
',
- 'en-US': 'You can use `effect` to set the tag theme. The value can be dark, light, or plain. The default value is light.
`type`You can set the corresponding type for the tag. The value can be (success / warning / alerting / error / default / info). The default value is info.
'
+ 'en-US':
+ 'You can use `effect` to set the tag theme. The value can be dark, light, or plain. The default value is light.
`type`You can set the corresponding type for the tag. The value can be (success / warning / alerting / error / default / info). The default value is info.
'
},
codeFiles: ['effect.vue']
},
@@ -72,7 +74,8 @@ export default {
},
desc: {
'zh-CN': '通过点击`+ New Tag`在文本框中输入你要定义的标签名就能在标签列表中最后一个创建标签 。
',
- 'en-US': 'Click `+ New Tag` and enter the name of the tag you want to define in the text box to create a tag in the last tag list.
'
+ 'en-US':
+ 'Click `+ New Tag` and enter the name of the tag you want to define in the text box to create a tag in the last tag list.
'
},
codeFiles: ['create.vue']
},
@@ -132,7 +135,8 @@ export default {
},
desc: {
'zh-CN': '可通过 `theme` 设置其他颜色的标签,目前新增的彩色标签有 pink、purple、cyan。
',
- 'en-US': 'You can use `theme` to set labels of other colors. Currently, the new color labels include pink, purple, and cyan.
'
+ 'en-US':
+ 'You can use `theme` to set labels of other colors. Currently, the new color labels include pink, purple, and cyan.
'
},
codeFiles: ['colorful-tag.vue']
},
@@ -148,53 +152,5 @@ export default {
},
codeFiles: ['content.vue']
}
- ],
- apis: [
- {
- 'name': 'Tag',
- 'type': 'component',
- 'props': [
- {
- 'name': 'custom-class',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '标签class',
- 'en-US': 'Tag class'
- },
- 'demoId': ''
- },
- {
- 'name': 'operable',
- 'type': 'Boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '是否可操作',
- 'en-US': 'Operable or Not'
- },
- 'demoId': ''
- },
- {
- 'name': 'theme',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '彩色标签,该属性的可选值为 pink、purple、cyan',
- 'en-US': 'Color label. The value can be pink, purple, or cyan.'
- },
- 'demoId': 'colorful-tag'
- },
- {
- 'name': 'type',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '该属性的可选值为 success / warning / alerting / error / default / info,默认值为 info',
- 'en-US': 'The value of this attribute can be success / warning / alerting / error / default / info. The default value is info.'
- },
- 'demoId': 'effect'
- },
- ]
- },
]
}
diff --git a/examples/sites/demos/mobile-first/app/time-line/auto-slot.vue b/examples/sites/demos/mobile-first/app/time-line/auto-slot.vue
index 677e35d05..495bf53b8 100644
--- a/examples/sites/demos/mobile-first/app/time-line/auto-slot.vue
+++ b/examples/sites/demos/mobile-first/app/time-line/auto-slot.vue
@@ -35,7 +35,7 @@ export default {
},
data() {
return {
- imgUrl: '/static/images/1.jpg',
+ imgUrl: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
data: [{ title: '节点标题1' }, { title: '节点标题2' }, { title: '节点标题3' }, { title: '节点标题4' }],
data1: [
{ title: '节点标题1' },
diff --git a/examples/sites/demos/mobile-first/app/time-line/single-status.vue b/examples/sites/demos/mobile-first/app/time-line/single-status.vue
index e0f319966..36ac5b045 100644
--- a/examples/sites/demos/mobile-first/app/time-line/single-status.vue
+++ b/examples/sites/demos/mobile-first/app/time-line/single-status.vue
@@ -15,7 +15,8 @@ import { IconCopy, IconLoading } from '@opentiny/vue-icon'
export default {
components: {
- TinyTimeLine: TimeLine
+ TinyTimeLine: TimeLine,
+ IconCopy: IconCopy()
},
data() {
return {
diff --git a/examples/sites/demos/mobile-first/app/time-line/webdoc/time-line.js b/examples/sites/demos/mobile-first/app/time-line/webdoc/time-line.js
index 49f01308a..a1ebda820 100644
--- a/examples/sites/demos/mobile-first/app/time-line/webdoc/time-line.js
+++ b/examples/sites/demos/mobile-first/app/time-line/webdoc/time-line.js
@@ -47,7 +47,8 @@ export default {
desc: {
'zh-CN':
'通过在`data`里面的属性`autoColor`设置自定义状态。对应场景: `success` :成功 `error` :失败 `info` :等待
',
- 'en-US': 'Set the user-defined state through the `autoColor` attribute in `data`. Scenario: `success`: success; error`: failure; info`: waiting
'
+ 'en-US':
+ 'Set the user-defined state through the `autoColor` attribute in `data`. Scenario: `success`: success; error`: failure; info`: waiting
'
},
codeFiles: ['many-status.vue']
},
@@ -71,7 +72,8 @@ export default {
},
desc: {
'zh-CN': '当节点超过七项时,自动折叠节点,仅展示最近三项,点击后展开
',
- 'en-US': 'When there are more than seven nodes, the system automatically collapses the nodes and displays only the latest three nodes.
'
+ 'en-US':
+ 'When there are more than seven nodes, the system automatically collapses the nodes and displays only the latest three nodes.
'
},
codeFiles: ['fold-time.vue']
},
@@ -84,47 +86,10 @@ export default {
desc: {
'zh-CN':
'通过 `slot` 为 `left` 可以自定义步骤条右侧内容。`data`中自定义属性名应避免`name`(正标题)、`tips`(副标题)、`time`(时间)属性
',
- 'en-US': 'You can set `slot` to `left` to customize the content on the right of the step bar. User-defined attribute names in `data` should avoid `name` (head title), `tips` (subtitle), and `time` (time) attributes.
'
+ 'en-US':
+ 'You can set `slot` to `left` to customize the content on the right of the step bar. User-defined attribute names in `data` should avoid `name` (head title), `tips` (subtitle), and `time` (time) attributes.
'
},
codeFiles: ['auto-slot.vue']
}
- ],
- apis: [
- {
- 'name': 'Timeline',
- 'type': 'component',
- 'props': [
- {
- 'name': 'auto-color-field',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '显示组件二级标题内容,默认值为 autoColor',
- 'en-US': 'Displays the level-2 title of the component. The default value is autoColor.'
- },
- 'demoId': ''
- },
- {
- 'name': 'sub-field',
- 'type': 'Boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置时间线两侧展示',
- 'en-US': 'Set the display on both sides of the timeline.'
- },
- 'demoId': 'sub-field'
- },
- {
- 'name': 'tips-field',
- 'type': 'String',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '显示组件二级标题内容,默认值为 tips',
- 'en-US': 'Displays the level-2 title of the component. The default value is tips.'
- },
- 'demoId': ''
- },
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile-first/app/time-picker-mobile/webdoc/time-picker-mobile.js b/examples/sites/demos/mobile-first/app/time-picker-mobile/webdoc/time-picker-mobile.js
index 066f9df8e..d2631090d 100644
--- a/examples/sites/demos/mobile-first/app/time-picker-mobile/webdoc/time-picker-mobile.js
+++ b/examples/sites/demos/mobile-first/app/time-picker-mobile/webdoc/time-picker-mobile.js
@@ -14,6 +14,5 @@ export default {
},
codeFiles: ['basic-usage.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/app/tooltip/webdoc/tooltip.js b/examples/sites/demos/mobile-first/app/tooltip/webdoc/tooltip.js
index 4155bbaa2..10b04d12e 100644
--- a/examples/sites/demos/mobile-first/app/tooltip/webdoc/tooltip.js
+++ b/examples/sites/demos/mobile-first/app/tooltip/webdoc/tooltip.js
@@ -1,7 +1,8 @@
export default {
column: '2',
owner: '',
- demos: [{
+ demos: [
+ {
demoId: 'basic-usage',
name: {
'zh-CN': '基本用法',
@@ -13,7 +14,6 @@ export default {
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'dynamic-disable',
name: {
@@ -33,8 +33,10 @@ export default {
'en-US': 'Manual control'
},
desc: {
- 'zh-CN': '手动控制模式,通过设置 `manual` 属性为 true 后,mouseenter 和 mouseleave 事件将不会生效,然后可以通过设置 `v-model` 动态控制显示和隐藏
',
- 'en-US': 'Manual control mode. After the `manual` attribute is set to true, the mouseenter and mouseleave events do not take effect. You can set the `v-model` to dynamically control the display and hiding of the events.
'
+ 'zh-CN':
+ '手动控制模式,通过设置 `manual` 属性为 true 后,mouseenter 和 mouseleave 事件将不会生效,然后可以通过设置 `v-model` 动态控制显示和隐藏
',
+ 'en-US':
+ 'Manual control mode. After the `manual` attribute is set to true, the mouseenter and mouseleave events do not take effect. You can set the `v-model` to dynamically control the display and hiding of the events.
'
},
codeFiles: ['manual-control-tip.vue']
},
@@ -57,8 +59,10 @@ export default {
'en-US': 'Auto-hide and delay time'
},
desc: {
- 'zh-CN': '通过 `hide-after` 属性设置 Tooltip 组件出现后自动隐藏延时,单位毫秒,为 0 则不会自动隐藏。通过 `open-delay` 属性设置 Tooltip 组件延迟出现的时间,单位毫秒。
',
- 'en-US': '
The `hide-after` attribute is used to set the automatic hiding delay of the Tooltip component, in milliseconds. If the value is 0, the Tooltip component is not automatically hidden. The `open-delay` property is used to set the delay for the Tooltip component to appear, in milliseconds.
'
+ 'zh-CN':
+ '通过 `hide-after` 属性设置 Tooltip 组件出现后自动隐藏延时,单位毫秒,为 0 则不会自动隐藏。通过 `open-delay` 属性设置 Tooltip 组件延迟出现的时间,单位毫秒。
',
+ 'en-US':
+ '
The `hide-after` attribute is used to set the automatic hiding delay of the Tooltip component, in milliseconds. If the value is 0, the Tooltip component is not automatically hidden. The `open-delay` property is used to set the delay for the Tooltip component to appear, in milliseconds.
'
},
codeFiles: ['open-delay.vue']
},
@@ -106,7 +110,7 @@ export default {
},
desc: {
'zh-CN': '通过 `popper-class` 属性为 Tooltip 的 popper 添加类名。
',
- 'en-US': 'Use the `popper-class` attribute to add a class name to the tooltip\'s popper.
'
+ 'en-US': "Use the `popper-class` attribute to add a class name to the tooltip's popper.
"
},
codeFiles: ['popper-class.vue']
},
@@ -129,8 +133,10 @@ export default {
'en-US': 'Popper Configuration'
},
desc: {
- 'zh-CN': '通过 `popper-options` 属性为 Tooltip 的 popper 配置参数,具体可参考[popper.js](https://popper.js.org/)
',
- 'en-US': 'Use the `popper-options` attribute to configure popper parameters for Tooltip. For details, see [popper.js](https://popper.js.org/).
'
+ 'zh-CN':
+ '通过 `popper-options` 属性为 Tooltip 的 popper 配置参数,具体可参考[popper.js](https://popper.js.org/)
',
+ 'en-US':
+ 'Use the `popper-options` attribute to configure popper parameters for Tooltip. For details, see [popper.js](https://popper.js.org/).
'
},
codeFiles: ['popper-options.vue']
},
@@ -142,7 +148,8 @@ export default {
},
desc: {
'zh-CN': 'popperOptions.bubbling 配置为 true 时,所有的父元素包含滚动条,滚动时都会动态改变 tip 的位置
',
- 'en-US': 'When popperOptions.bubbling is set to true, all parent elements contain scroll bars. During scrolling, the position of tip is dynamically changed.
'
+ 'en-US':
+ 'When popperOptions.bubbling is set to true, all parent elements contain scroll bars. During scrolling, the position of tip is dynamically changed.
'
},
codeFiles: ['popper-options-bubbling.vue']
},
@@ -154,7 +161,8 @@ export default {
},
desc: {
'zh-CN': '通过配置 `tabindex`, 配置的属性会自动添加到该组件的触发原上。
',
- 'en-US': 'By configuring `tabindex`, the configured attributes are automatically added to the trigger source of the component.
'
+ 'en-US':
+ 'By configuring `tabindex`, the configured attributes are automatically added to the trigger source of the component.
'
},
codeFiles: ['tabindex.vue']
},
@@ -165,8 +173,10 @@ export default {
'en-US': 'Text Preformatting'
},
desc: {
- 'zh-CN': '配置 `pre` 为 `true`,就会预格式化 `content` 文本。
被包围在 `
` 标签元素中的文本会保留空格和换行符,文本也会呈现为等宽字体。',
- 'en-US': 'If `pre` is set to `true`, the `content` text is preformatted.
Text enclosed in the `
` tag element retains spaces and newline characters, and the text is rendered in an equal-width font.'
+ 'zh-CN':
+ '配置 `pre` 为 `true`,就会预格式化 `content` 文本。
被包围在 `
` 标签元素中的文本会保留空格和换行符,文本也会呈现为等宽字体。',
+ 'en-US':
+ 'If `pre` is set to `true`, the `content` text is preformatted.
Text enclosed in the `
` tag element retains spaces and newline characters, and the text is rendered in an equal-width font.'
},
codeFiles: ['content-pre.vue']
},
@@ -189,11 +199,12 @@ export default {
'en-US': 'z-index'
},
desc: {
- 'zh-CN': '设置`z-index`属性为`relative`时,弹出层样式属性 zIndex 值参考 Reference 及其父级 Dom。
设置`z-index`属性为默认值`next`时,弹出层样式属性 zIndex 值由组件库内部维护。
',
- 'en-US': 'When the `z-index` attribute is set to `relative`, the value of zIndex of the pop-up layer style attribute is Reference and its parent Dom.
When the `z-index` attribute is set to the default value `next`, the value of the pop-up layer style attribute zIndex is maintained by the component library.
'
+ 'zh-CN':
+ '设置`z-index`属性为`relative`时,弹出层样式属性 zIndex 值参考 Reference 及其父级 Dom。
设置`z-index`属性为默认值`next`时,弹出层样式属性 zIndex 值由组件库内部维护。
',
+ 'en-US':
+ 'When the `z-index` attribute is set to `relative`, the value of zIndex of the pop-up layer style attribute is Reference and its parent Dom.
When the `z-index` attribute is set to the default value `next`, the value of the pop-up layer style attribute zIndex is maintained by the component library.
'
},
codeFiles: ['z-index.vue']
}
- ],
- apis: []
-}
\ No newline at end of file
+ ]
+}
diff --git a/examples/sites/demos/mobile-first/app/user-head/basic-usage.vue b/examples/sites/demos/mobile-first/app/user-head/basic-usage.vue
index 2808796c6..9a7f09e02 100644
--- a/examples/sites/demos/mobile-first/app/user-head/basic-usage.vue
+++ b/examples/sites/demos/mobile-first/app/user-head/basic-usage.vue
@@ -30,7 +30,7 @@ export default {
return {
text: '中文',
textEn: 'Meta',
- imgUrl: '/static/images/1.jpg'
+ imgUrl: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`
}
}
}
diff --git a/examples/sites/demos/mobile-first/app/user-head/user-head-event.vue b/examples/sites/demos/mobile-first/app/user-head/user-head-event.vue
new file mode 100644
index 000000000..14ad40b24
--- /dev/null
+++ b/examples/sites/demos/mobile-first/app/user-head/user-head-event.vue
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile-first/app/user-head/user-head-group.vue b/examples/sites/demos/mobile-first/app/user-head/user-head-group.vue
index 693f6497a..ed477aab5 100644
--- a/examples/sites/demos/mobile-first/app/user-head/user-head-group.vue
+++ b/examples/sites/demos/mobile-first/app/user-head/user-head-group.vue
@@ -117,67 +117,67 @@ export default {
imageList1: [
{
type: 'image',
- modelValue: '/static/images/1.jpg',
+ modelValue: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
round: true
},
{
type: 'image',
- modelValue: '/static/images/1.jpg',
+ modelValue: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
round: true
}
],
imageList2: [
{
type: 'image',
- modelValue: '/static/images/1.jpg',
+ modelValue: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
round: true
},
{
type: 'image',
- modelValue: '/static/images/1.jpg',
+ modelValue: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
round: true
},
{
type: 'image',
- modelValue: '/static/images/1.jpg',
+ modelValue: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
round: true
}
],
imageList3: [
{
type: 'image',
- modelValue: '/static/images/1.jpg',
+ modelValue: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
round: true
},
{
type: 'image',
- modelValue: '/static/images/1.jpg',
+ modelValue: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
round: true
},
{
type: 'image',
- modelValue: '/static/images/1.jpg',
+ modelValue: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
round: true
},
{
type: 'image',
- modelValue: '/static/images/1.jpg',
+ modelValue: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
round: true
},
{
type: 'image',
- modelValue: '/static/images/1.jpg',
+ modelValue: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
round: true
},
{
type: 'image',
- modelValue: '/static/images/1.jpg',
+ modelValue: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`,
round: true
}
],
text: '中文',
textEn: 'Meta',
- imgUrl: '/static/images/1.jpg'
+ imgUrl: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`
}
}
}
diff --git a/examples/sites/demos/mobile-first/app/user-head/user-head-size.vue b/examples/sites/demos/mobile-first/app/user-head/user-head-size.vue
index 7db7d0dd3..f40eb7271 100644
--- a/examples/sites/demos/mobile-first/app/user-head/user-head-size.vue
+++ b/examples/sites/demos/mobile-first/app/user-head/user-head-size.vue
@@ -63,7 +63,7 @@ export default {
data() {
return {
text: '文字',
- imgUrl: '/static/images/1.jpg'
+ imgUrl: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/1.jpg`
}
}
}
diff --git a/examples/sites/demos/mobile-first/app/user-head/webdoc/user-head.js b/examples/sites/demos/mobile-first/app/user-head/webdoc/user-head.js
index 9883ad8c5..bc0e3558b 100644
--- a/examples/sites/demos/mobile-first/app/user-head/webdoc/user-head.js
+++ b/examples/sites/demos/mobile-first/app/user-head/webdoc/user-head.js
@@ -9,21 +9,20 @@ export default {
'en-US': 'basic usage'
},
desc: {
- 'zh-CN': '',
- 'en-US': 'button type
'
+ 'zh-CN': '可通过type="icon"
属性设置头像类型
',
+ 'en-US': 'The type="icon"
attribute can be used to set the avatar type.
'
},
codeFiles: ['basic-usage.vue']
},
-
{
demoId: 'user-head-style',
name: {
'zh-CN': '圆形头像',
- 'en-US': 'events'
+ 'en-US': 'Round head'
},
desc: {
- 'zh-CN': '可通过 `round` 设置圆形头像。
',
- 'en-US': '
bbutton click
'
+ 'zh-CN': '可通过round
设置圆形头像。
',
+ 'en-US': '
You can use round
to set a round avatar.
'
},
codeFiles: ['user-head-style.vue']
},
@@ -31,11 +30,11 @@ export default {
demoId: 'user-head-size',
name: {
'zh-CN': '头像尺寸',
- 'en-US': 'events'
+ 'en-US': 'Head size'
},
desc: {
- 'zh-CN': '可通过 `size` 设置圆形头像尺寸大小。
',
- 'en-US': '
bbutton click
'
+ 'zh-CN': '可通过size
设置圆形头像尺寸大小。
',
+ 'en-US': 'You can use size
to set the size of a round avatar.
'
},
codeFiles: ['user-head-size.vue']
},
@@ -43,15 +42,29 @@ export default {
demoId: 'user-head-group',
name: {
'zh-CN': '群组头像',
- 'en-US': 'events'
+ 'en-US': 'Group avatar'
},
desc: {
'zh-CN':
- '通过`group-size`属性设置群组头像整体尺寸大小,通过`list`传入对应数据
type:表示粗腰传入的类型
modelValue:文字头像传入字符串,图标头像不传,图片头像传入图片链接
round:是否展示圆形
群组头像最多只展示 4 个头像
',
- 'en-US': '
bbutton click
'
+ '通过group-size
属性设置群组头像整体尺寸大小,通过list
传入对应数据
type
:表示传入的类型
modelValue
:文字头像传入字符串,图标头像不传,图片头像传入图片链接
round
:是否展示圆形
群组头像最多只展示 4 个头像
',
+ 'en-US':
+ 'Use the group-size
attribute to set the overall size of the group avatar, and use the list
to transfer the corresponding data
type
. Indicates the input type.
modelValue
: The character string is transferred for the text avatar. The icon avatar is not transferred. The image avatar is transferred for the image link.
round
: Indicates whether to display round
Group avatars. A maximum of four avatars can be displayed.
'
},
codeFiles: ['user-head-group.vue']
+ },
+ {
+ demoId: 'user-head-event',
+ name: {
+ 'zh-CN': '头像事件',
+ 'en-US': 'Avatar events'
+ },
+ desc: {
+ 'zh-CN':
+ '通过click
属性设置头像点击,hover
属性设置头像悬浮提示,horizontal
设置圆形头像横向布局,show-max
展示最大显示数为 6 个,默认为 4 个。
',
+ 'en-US':
+ 'Theclick
attribute is used to set the avatar clicking and hover
attribute is used to set the avatar floating prompt,horizontal
sets the horizontal layout of round avatars. show-max
can display a maximum of six portraits. The default value is 4.
'
+ },
+ codeFiles: ['user-head-event.vue']
}
- ],
- apis: []
+ ]
}
diff --git a/examples/sites/demos/mobile-first/menus.js b/examples/sites/demos/mobile-first/menus.js
index b81c4112d..ac265edc6 100644
--- a/examples/sites/demos/mobile-first/menus.js
+++ b/examples/sites/demos/mobile-first/menus.js
@@ -39,7 +39,8 @@ export const cmpMenus = [
{ name: 'Scrollbar', nameCn: '滚动条', key: 'scrollbar' },
{ name: 'CascaderSelect', nameCn: '级联选择', key: 'cascader-select' },
{ name: 'CascaderMobile', nameCn: '级联选择移动', key: 'cascader-mobile' },
- { name: 'CascaderView', nameCn: '级联选择视图', key: 'cascader-view' }
+ { name: 'CascaderView', nameCn: '级联选择视图', key: 'cascader-view' },
+ { name: 'DialogBox', nameCn: '对话框', key: 'dialog-box' }
]
},
{
@@ -57,13 +58,16 @@ export const cmpMenus = [
{ name: 'Radio', nameCn: '单选框', key: 'radio' },
{ name: 'RadioButton', nameCn: '单选块', key: 'radio-block' },
{ name: 'Search', nameCn: '搜索', key: 'search' },
+ { name: 'Select', nameCn: '选择器', key: 'select' },
{ name: 'SelectMobile', nameCn: '面板选择器', key: 'select-mobile' },
{ name: 'SelectView', nameCn: '页面选择器', key: 'select-view' },
{ name: 'Slider', nameCn: '滑块', key: 'slider' },
{ name: 'SliderButton', nameCn: '滑动按钮组', key: 'slider-button' },
{ name: 'Switch', nameCn: '开关', key: 'switch' },
{ name: 'FileUpload', nameCn: '文件上传', key: 'file-upload' },
- { name: 'Record', nameCn: '语音录入', key: 'record' }
+ { name: 'Record', nameCn: '语音录入', key: 'record' },
+ { name: 'Signature', nameCn: '手写签名', key: 'signature' },
+ { name: 'Cascader', nameCn: '级联选择器', key: 'cascader' }
]
},
{
@@ -71,13 +75,19 @@ export const cmpMenus = [
labelEn: 'Data',
key: 'cmp_data_components',
children: [
- { name: 'Grid', nameCn: '表格', key: 'grid' },
{ name: 'ColumnListItem', nameCn: '分区列表项', key: 'column-list-item' },
{ name: 'StandardListItem', nameCn: '标准列表项', key: 'standard-list-item' },
{ name: 'Progress', nameCn: '进度条', key: 'progress' },
- { name: 'PullRefresh', nameCn: '下拉刷新', key: 'pull-refresh' }
+ { name: 'PullRefresh', nameCn: '下拉刷新', key: 'pull-refresh' },
+ { name: 'Pager', nameCn: '分页', key: 'pager' }
]
},
+ {
+ 'label': '表格组件',
+ 'labelEn': 'Table Components',
+ 'key': 'cmp_table_components',
+ 'children': [{ 'nameCn': '基本用法', 'name': 'Grid', 'key': 'grid' }]
+ },
{
label: '提示组件',
labelEn: 'Tooltip',
@@ -104,7 +114,11 @@ export const cmpMenus = [
{ name: 'Rate', nameCn: '评分', key: 'rate' },
{ name: 'Tag', nameCn: '标签', key: 'tag' },
{ name: 'TagGroup', nameCn: '标签组', key: 'tag-group' },
- { name: 'UserHead', nameCn: '用户头像', key: 'user-head' }
+ { name: 'UserHead', nameCn: '用户头像', key: 'user-head' },
+ { name: 'Amount', nameCn: '金额', key: 'amount' },
+ { name: 'currency', nameCn: '币种', key: 'currency' },
+ { name: 'CalendarView', nameCn: '日历', key: 'calendar-view' },
+ { name: 'FloatingButton', nameCn: '悬浮按钮', key: 'floating-button' }
]
}
]
diff --git a/examples/sites/demos/mobile/app/actionsheet/webdoc/actionsheet.js b/examples/sites/demos/mobile/app/actionsheet/webdoc/actionsheet.js
index 019b9979f..ef7934846 100644
--- a/examples/sites/demos/mobile/app/actionsheet/webdoc/actionsheet.js
+++ b/examples/sites/demos/mobile/app/actionsheet/webdoc/actionsheet.js
@@ -50,89 +50,5 @@ export default {
},
codeFiles: ['slot-action.vue']
}
- ],
- apis: [
- {
- name: 'actionsheet ', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'ellipsis',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否省略显示,该属性默认为false
',
- 'en-US': 'display different button'
- },
- demoId: 'ellipsis'
- },
- {
- name: 'menus',
- type: 'Array',
- defaultValue: '50',
- desc: {
- 'zh-CN': '列表数组
',
- 'en-US': 'display different button'
- },
- demoId: 'ellipsis'
- },
- {
- name: 'visible',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '上划列表显示隐藏,该属性默认为false
',
- 'en-US': 'display different button'
- },
- demoId: 'ellipsis'
- }
- ],
- methods: [
- {
- name: 'visibleHandle',
- type: 'string',
- defaultValue: '',
- desc: {
- 'zh-CN': '菜单列表隐藏方法
',
- 'en-US': 'Click'
- },
- demoId: 'slot-item'
- }
- ],
- events: [
- {
- name: 'click',
- type: 'Function()',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置组件点击列表项时触发的回调函数
',
- 'en-US': 'Click'
- },
- demoId: 'clickfn'
- }
- ],
- slot: [
- {
- name: 'action',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '自定义操作项内容
',
- 'en-US': 'Click'
- },
- demoId: 'slot-action'
- },
- {
- name: ' item',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '自定义列表项内容
',
- 'en-US': 'Click'
- },
- demoId: 'slot-item'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/alert/webdoc/alert.js b/examples/sites/demos/mobile/app/alert/webdoc/alert.js
index 93eca9452..6b4a50c78 100644
--- a/examples/sites/demos/mobile/app/alert/webdoc/alert.js
+++ b/examples/sites/demos/mobile/app/alert/webdoc/alert.js
@@ -3,15 +3,18 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'base',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'base',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN':
'通过 type
设置不同的类型 可选值:success | warning | info | error ,默认值:success。
同时可通过 default
默认插槽自定义提示内容。',
'en-US':
'Set different types through type
. The options are success | warning | info | error. The default value is success.
You can customize the prompt content through the default
slot. '
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
demoId: 'custom-close',
@@ -38,13 +41,16 @@ export default {
codeFiles: ['icon.vue']
},
{
- 'demoId': 'center',
- 'name': { 'zh-CN': '文字居中', 'en-US': 'Center text' },
- 'desc': {
+ demoId: 'center',
+ name: {
+ 'zh-CN': '文字居中',
+ 'en-US': 'Center text'
+ },
+ desc: {
'zh-CN': '通过 center
属性可使文字显示居中。
\n',
'en-US': 'You can use the center
property to center the text.
\n'
},
- 'codeFiles': ['center.vue']
+ codeFiles: ['center.vue']
},
{
demoId: 'size',
@@ -82,115 +88,5 @@ export default {
},
codeFiles: ['slot-default.vue']
}
- ],
- apis: [
- {
- name: 'alert', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- 'name': 'center',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '文字是否居中', 'en-US': 'Whether the text is centered' },
- 'demoId': 'center'
- },
- {
- name: 'closable',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '设置警告是否可以关闭,该属性的默认值为 true
',
- 'en-US': 'Is fixed top'
- },
- demoId: 'custom-close'
- },
- {
- name: 'close-text',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '关闭按钮自定义文本
',
- 'en-US': 'Is show left arrow'
- },
- demoId: 'custom-close'
- },
- {
- name: 'description',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置警告的提示内容,默认为空
',
- 'en-US': 'Is show right arrow'
- },
- demoId: 'custom-close'
- },
- {
- name: 'icon',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置警告的图标,默认会根据 type 值自动使用对应图标
',
- 'en-US': 'Is show right text'
- },
- demoId: 'icon'
- },
- {
- name: 'size',
- type: 'String',
- defaultValue: 'normal',
- desc: {
- 'zh-CN': '设置警告的大小 normal/large, 缺省为 normal。
',
- 'en-US': 'Is show left text'
- },
- demoId: 'size'
- },
- {
- name: 'target',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '挂载容器的ref值,通过该属性可以让组件展示在对应容器的顶部',
- 'en-US':
- 'Mounted container reference, this property allows the component to be displayed at the top of the corresponding container.'
- },
- demoId: 'target'
- },
- {
- name: 'type',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置警告的类型
',
- 'en-US': 'set sub-title'
- },
- demoId: 'size'
- }
- ],
- events: [
- {
- name: 'close',
- type: 'Function()',
- defaultValue: '',
- desc: {
- 'zh-CN': '关闭 alert 时触发的事件
',
- 'en-US': 'Click'
- },
- demoId: 'custom-close'
- }
- ],
- slot: [
- {
- name: 'default',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '组件默认插槽
',
- 'en-US': 'Click'
- },
- demoId: 'slot-default'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/avatar/avatar-size.vue b/examples/sites/demos/mobile/app/avatar/avatar-size.vue
index bce9c1a52..dcb4b52c2 100644
--- a/examples/sites/demos/mobile/app/avatar/avatar-size.vue
+++ b/examples/sites/demos/mobile/app/avatar/avatar-size.vue
@@ -28,7 +28,7 @@ export default {
},
data() {
return {
- circleUrl: '/static/images/circle.png'
+ circleUrl: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/circle.png`
}
}
}
diff --git a/examples/sites/demos/mobile/app/avatar/avatar-src-set.vue b/examples/sites/demos/mobile/app/avatar/avatar-src-set.vue
index 145cac37f..35abdc2b6 100644
--- a/examples/sites/demos/mobile/app/avatar/avatar-src-set.vue
+++ b/examples/sites/demos/mobile/app/avatar/avatar-src-set.vue
@@ -17,11 +17,12 @@ export default {
TinyAvatar: Avatar
},
data() {
+ const urlPrefix = import.meta.env.VITE_APP_BUILD_BASE_URL
return {
IconClockWork: iconClockWork(),
- circleUrl: '/static/images/circle.png',
- circleUrlfit: '/static/images/dog1.png',
- srcSet: '/static/images/dog1.png 100w,/static/images/dog2.png 300w,/static/images/dog3.png 500w',
+ circleUrl: `${urlPrefix}static/images/circle.png`,
+ circleUrlfit: `${urlPrefix}static/images/dog1.png`,
+ srcSet: `${urlPrefix}static/images/dog1.png 100w,${urlPrefix}static/images/dog2.png 300w,${urlPrefix}static/images/dog3.png 500w`,
errorUrl: 'error.png', // 使用错误路径
onError() {
console.log('加载失败')
diff --git a/examples/sites/demos/mobile/app/avatar/webdoc/avatar.js b/examples/sites/demos/mobile/app/avatar/webdoc/avatar.js
index 36bc83ee6..d337018f8 100644
--- a/examples/sites/demos/mobile/app/avatar/webdoc/avatar.js
+++ b/examples/sites/demos/mobile/app/avatar/webdoc/avatar.js
@@ -22,117 +22,11 @@ export default {
'en-US': 'button round'
},
desc: {
- 'zh-CN': `
- src
设置img
的展示源,img
原生属性
- srcSet
设置img
在不同情况下的图片源的集合,img
原生属性
- icon
设置图标头像
- fit
设置填充样式,默认为cover
可选fill,contain,cover,none,scale-down
- error
设置img
标签的onerror
函数
- shape
设置形状,默认为circle可选circle,square
-
`,
+ 'zh-CN':
+ '\n src
设置img
的展示源,img
原生属性
\n srcSet
设置img
在不同情况下的图片源的集合,img
原生属性
\n icon
设置图标头像
\n fit
设置填充样式,默认为cover
可选fill,contain,cover,none,scale-down
\n error
设置img
标签的onerror
函数
\n shape
设置形状,默认为circle可选circle,square
\n
',
'en-US': 'button round
'
},
codeFiles: ['avatar-src-set.vue']
}
- ],
- apis: [
- {
- name: 'avatar', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'alt',
- type: 'Function',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置图片的备用文字描述
',
- 'en-US': 'display different button'
- },
- demoId: 'avatar-src-set'
- },
- {
- name: 'error',
- type: 'Function()',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置img 标签的 onerror 函数
',
- 'en-US': 'display different button'
- },
- demoId: 'avatar-src-set'
- },
- {
- name: 'fit',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置图片的 object-fit
',
- 'en-US': 'display different button'
- },
- demoId: 'avatar-src-set'
- },
- {
- name: 'icon',
- type: 'Object',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置显示内容为icon
',
- 'en-US': 'display different button'
- },
- demoId: 'avatar-src-set'
- },
- {
- name: 'shape',
- type: 'String',
- defaultValue: 'circle',
- desc: {
- 'zh-CN': '该属性的可选值为 circle | square
',
- 'en-US': 'display different button'
- },
- demoId: 'avatar-src-set'
- },
- {
- name: 'size',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '该属性的可选值为 large|medium|small
',
- 'en-US': 'display different button'
- },
- demoId: 'avatar-size'
- },
- {
- name: 'src',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置图片链接地址
',
- 'en-US': 'display different button'
- },
- demoId: 'avatar-src-set'
- },
- {
- name: 'src-set',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置源图容器
',
- 'en-US': 'display different button'
- },
- demoId: 'avatar-src-set'
- }
- ],
- slot: [
- {
- name: 'default',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '组件默认插槽
',
- 'en-US': 'Click'
- },
- demoId: 'avatar-src-set'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/badge/webdoc/badge.js b/examples/sites/demos/mobile/app/badge/webdoc/badge.js
index f5dd787c5..b6cfc8fd0 100644
--- a/examples/sites/demos/mobile/app/badge/webdoc/badge.js
+++ b/examples/sites/demos/mobile/app/badge/webdoc/badge.js
@@ -74,105 +74,5 @@ export default {
},
codeFiles: ['type.vue']
}
- ],
- apis: [
- {
- name: 'Badge', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'hidden',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '禁隐藏 badge,该属性的默认值为 false
',
- 'en-US': 'display different button'
- },
- demoId: 'hidden'
- },
- {
- name: 'href',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '指定跳转的链接地址。
',
- 'en-US': 'display different button'
- },
- demoId: 'href-target'
- },
- {
- name: 'is-dot',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '设置是否显示为小圆点, 该属性默认值为false。
',
- 'en-US': 'display different button'
- },
- demoId: 'is-dot'
- },
- {
- name: 'is-mini',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '设置小尺寸,该属性默认为false
',
- 'en-US': 'display different button'
- },
- demoId: 'is-mini'
- },
- {
- name: 'target',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '指定点击徽章 Dom 节点时链接到目标页面的跳转方式,仅在 href 属性存在时使用。
',
- 'en-US': 'display different button'
- },
- demoId: 'href-target'
- },
- {
- name: 'max',
- type: 'Number',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置最大值
',
- 'en-US': 'display different button'
- },
- demoId: 'is-mini'
- },
- {
- name: 'value',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '',
- 'en-US': ''
- },
- demoId: 'content'
- }
- ],
- slot: [
- {
- name: 'default',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '
组件默认插槽
',
- 'en-US': 'Click'
- },
- demoId: 'content'
- },
- {
- name: 'content',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '消息提示内容
',
- 'en-US': 'Click'
- },
- demoId: 'content'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/button/webdoc/button.js b/examples/sites/demos/mobile/app/button/webdoc/button.js
index 9d4099645..55feb0c1b 100644
--- a/examples/sites/demos/mobile/app/button/webdoc/button.js
+++ b/examples/sites/demos/mobile/app/button/webdoc/button.js
@@ -86,107 +86,5 @@ export default {
},
codeFiles: ['event.vue']
}
- ],
- apis: [
- {
- name: 'Button', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'disabled',
- type: 'boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '设置按钮是否被禁用,该属性默认为false
',
- 'en-US': 'display different button'
- },
- demoId: 'disabled'
- },
- {
- name: 'icon',
- type: 'VueComponent',
- defaultValue: '',
- desc: {
- 'zh-CN': 'svg 图片对象
',
- 'en-US': 'display different button'
- },
- demoId: 'icon'
- },
- {
- name: 'loading',
- type: 'boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': 'svg 是否加载中状态,该属性默认为false
',
- 'en-US': 'display different button'
- },
- demoId: 'loading'
- },
- {
- name: 'reset-time',
- type: 'number',
- defaultValue: '0',
- desc: {
- 'zh-CN': '设置按钮禁用时间,防止重复提交,单位毫秒,该属性默认为1000
',
- 'en-US': 'display different button'
- },
- demoId: 'reset-time'
- },
- {
- name: 'size',
- type: 'string',
- defaultValue: '"large" | "medium" | "small" | "mini"',
- desc: {
- 'zh-CN': '尺寸
',
- 'en-US': 'display different button'
- },
- demoId: 'size'
- },
- {
- name: 'type',
- type: '"primary" | "secondary" | "text" |"icon" | "danger"',
- defaultValue: '',
- desc: {
- 'zh-CN': '类型
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- },
- {
- name: 'text',
- type: 'string',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置按钮显示的文本,可配置国际化
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- }
- ],
- events: [
- {
- name: 'click',
- type: '(event: PointEvent) => void',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置当按钮被点击时触发的回调函数。
',
- 'en-US': 'Click'
- },
- demoId: 'event'
- }
- ],
- slots: [
- {
- name: 'default',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '组件默认插槽
',
- 'en-US': 'Click'
- },
- demoId: ''
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/checkbox/webdoc/checkbox.js b/examples/sites/demos/mobile/app/checkbox/webdoc/checkbox.js
index 99aab3776..8546a5422 100644
--- a/examples/sites/demos/mobile/app/checkbox/webdoc/checkbox.js
+++ b/examples/sites/demos/mobile/app/checkbox/webdoc/checkbox.js
@@ -91,129 +91,5 @@ export default {
},
codeFiles: ['event-change.vue']
}
- ],
- apis: [
- {
- name: 'Checkbox', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'checked',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否选中
',
- 'en-US': 'whether checked
'
- },
- demoId: ''
- },
- {
- name: 'disabled',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否禁用
',
- 'en-US': 'whether disabled
'
- },
- demoId: 'disabled'
- },
- {
- name: 'false-label',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '未选中的值
',
- 'en-US': 'alue when no option is selected
'
- },
- demoId: 'custom-value'
- },
- {
- name: 'icon-position',
- type: 'String',
- defaultValue: 'center',
- desc: {
- 'zh-CN': "图标与文本的对齐方式,可选值:'center' | 'top'
",
- 'en-US': "Alignment of icon and text, optional value: 'center' | 'top'
"
- },
- demoId: 'icon-position'
- },
- {
- name: 'true-label',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '选中时的值
',
- 'en-US': 'selected value
'
- },
- demoId: 'custom-value'
- },
- {
- name: 'indeterminate',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '设置 indeterminate 状态,只负责样式控制,该属性默认为 false
',
- 'en-US':
- 'Setting an indeterminate state, which only controls the style, and this property by default is false.
'
- },
- demoId: 'indeterminate'
- },
- {
- name: 'label',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '选中状态的值(只有在checkbox-group或者绑定对象类型为array时有效)
',
- 'en-US':
- 'The value of the selected state (only valid for checkbox-group or when the bound object is of type array)
'
- },
- demoId: 'basic-usage'
- },
- {
- name: 'name',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '原生 name 属性
',
- 'en-US': 'native name attribute.
'
- },
- demoId: ''
- },
- {
- name: 'v-model / modelValue',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '绑定值
',
- 'en-US': 'value
'
- },
- demoId: 'basic-usage'
- }
- ],
- events: [
- {
- name: 'change',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '当绑定值变化时触发的事件,该事件可获取更新后的值
',
- 'en-US': 'This event is triggered when the binding value changes
'
- },
- demoId: 'event-change'
- }
- ],
- slots: [
- {
- name: 'default',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '标签文本内容
',
- 'en-US': 'label content
'
- },
- demoId: ''
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/checkboxgroup/webdoc/checkboxgroup.js b/examples/sites/demos/mobile/app/checkboxgroup/webdoc/checkboxgroup.js
index 2dafb4864..8fdbd79b8 100644
--- a/examples/sites/demos/mobile/app/checkboxgroup/webdoc/checkboxgroup.js
+++ b/examples/sites/demos/mobile/app/checkboxgroup/webdoc/checkboxgroup.js
@@ -49,77 +49,5 @@ export default {
},
codeFiles: ['vertical.vue']
}
- ],
- apis: [
- {
- name: 'CheckboxGroup', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'disabled',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否禁用,该属性默认为false
',
- 'en-US': 'display different button'
- },
- demoId: 'disabled'
- },
-
- {
- name: 'max',
- type: 'Number',
- defaultValue: '',
- desc: {
- 'zh-CN': '可被勾选的 checkbox 的最大数量
',
- 'en-US': 'display different button'
- },
- demoId: 'min-max'
- },
- {
- name: 'min',
- type: 'Number',
- defaultValue: '',
- desc: {
- 'zh-CN': '可被勾选的 checkbox 的最小数量
',
- 'en-US': 'display different button'
- },
- demoId: 'min-max'
- },
- {
- name: 'value / v-model',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '绑定值
',
- 'en-US': 'display different button'
- },
- demoId: 'dedisabled'
- },
-
- {
- name: 'vertical',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否竖向模式
',
- 'en-US': 'display different button'
- },
- demoId: 'vertical'
- }
- ],
- events: [
- {
- name: 'change',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '当绑定值变化时触发的事件,该事件可获取更新后的值
',
- 'en-US': 'Click'
- },
- demoId: 'event-change'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/container/webdoc/container.js b/examples/sites/demos/mobile/app/container/webdoc/container.js
index 28a3eb434..3617dd09a 100644
--- a/examples/sites/demos/mobile/app/container/webdoc/container.js
+++ b/examples/sites/demos/mobile/app/container/webdoc/container.js
@@ -3,78 +3,28 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基础用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基础用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '基础用法',
'en-US': 'base'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'custom-width',
- 'name': { 'zh-CN': '自定义宽度和高度', 'en-US': 'Custom width ' },
- 'desc': {
+ demoId: 'custom-width',
+ name: {
+ 'zh-CN': '自定义宽度和高度',
+ 'en-US': 'Custom width '
+ },
+ desc: {
'zh-CN': '自定义宽度',
'en-US': 'custom width'
},
- 'codeFiles': ['custom-width.vue']
- }
- ],
- apis: [
- {
- 'name': 'container',
- 'type': 'component',
- 'props': [
- {
- 'name': 'pattern',
- 'type': `'default' | 'classic'`,
- 'defaultValue': '"default"',
- 'desc': {
- 'zh-CN': '版型类型',
- 'en-US': 'Measurement type'
- },
- 'demoId': 'basic-usaage'
- },
- {
- 'name': 'left-width',
- 'type': 'number | string',
- 'defaultValue': '60',
- 'desc': { 'zh-CN': '左侧宽度', 'en-US': 'Left width' },
- 'demoId': 'custom-width'
- },
- {
- 'name': 'right-width',
- 'type': 'number | string',
- 'defaultValue': '44',
- 'desc': { 'zh-CN': '右侧宽度', 'en-US': 'right width' },
- 'demoId': 'custom-width'
- }
- ],
- 'events': [],
- 'slots': [
- {
- 'name': 'left',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '左侧内容插槽', 'en-US': 'Title Slot' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'center',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '中部内容插槽', 'en-US': 'Renter Slot' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'right',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '右侧内容插槽', 'en-US': 'Right Slot' },
- 'demoId': 'basic-usage'
- }
- ]
+ codeFiles: ['custom-width.vue']
}
]
}
diff --git a/examples/sites/demos/mobile/app/dialogbox/webdoc/dialogbox.js b/examples/sites/demos/mobile/app/dialogbox/webdoc/dialogbox.js
index 9f0af26d0..c96d46493 100644
--- a/examples/sites/demos/mobile/app/dialogbox/webdoc/dialogbox.js
+++ b/examples/sites/demos/mobile/app/dialogbox/webdoc/dialogbox.js
@@ -110,159 +110,5 @@ export default {
},
codeFiles: ['lock-scroll.vue']
}
- ],
- apis: [
- {
- name: 'Dialogbox', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: ' append-to-body',
- type: 'Boolean',
- defaultValue: '',
- desc: {
- 'zh-CN': 'DialogBox 本身是否插入到 body 上
',
- 'en-US': 'Is fixed top'
- },
- demoId: 'append-to-body'
- },
- {
- name: 'close-on-click-modal',
- type: 'Boolean',
- defaultValue: '',
- desc: {
- 'zh-CN':
- '是否可以通过点击遮罩层关闭弹窗,默认为 true ,可以在标签上设置:close-on-click-modal="false"不能通过点击遮罩层关闭弹窗。
',
- 'en-US': 'Is show left arrow'
- },
- demoId: 'close-on-click-modal'
- },
- {
- name: 'lock-scroll',
- type: 'Boolean',
- defaultValue: '',
- desc: {
- 'zh-CN': 'Dialog弹出时是否禁用滚动条,该属性默认为true
',
- 'en-US': 'Is show right arrow'
- },
- demoId: 'lock-scroll'
- },
- {
- name: 'modal-append-to-body',
- type: 'Boolean',
- defaultValue: '',
- desc: {
- 'zh-CN':
- '遮罩层是否应用到 body 上,为 false 时遮罩层会应用到 DialogBox 的父元素上,该属性默认为true
',
- 'en-US': 'Is show right text'
- },
- demoId: 'slot-title'
- },
- {
- name: 'show-header',
- type: 'Boolean',
- defaultValue: '',
- desc: {
- 'zh-CN': '是否显示弹窗头部 header,默认值为 true 。
',
- 'en-US': 'Is show left text'
- },
- demoId: 'show-header'
- },
- {
- name: ' title',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': 'Dialog 的标题,也可通过具名 slot (见下表)传入
',
- 'en-US': 'set sub-title'
- },
- demoId: 'show-header'
- },
- {
- name: 'visible',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '控制弹出框显示与关闭
',
- 'en-US': 'set main-title'
- },
- demoId: 'with-input'
- }
- ],
- events: [
- {
- name: ' cancel',
- type: 'Function()',
- defaultValue: '',
- desc: {
- 'zh-CN': 'Dialog 取消按钮的的回调
',
- 'en-US': 'Click'
- },
- demoId: 'cancel-confirm'
- },
- {
- name: 'close',
- type: 'Function()',
- defaultValue: '',
- desc: {
- 'zh-CN': 'Dialog 关闭的回调
',
- 'en-US': 'Click'
- },
- demoId: 'events-open-close'
- },
- {
- name: 'confirm',
- type: 'Function()',
- defaultValue: '',
- desc: {
- 'zh-CN': 'Dialog 确定按钮的的回调
',
- 'en-US': 'Click'
- },
- demoId: 'cancel-confirm'
- },
- {
- name: 'open',
- type: 'Function()',
- defaultValue: '',
- desc: {
- 'zh-CN': 'Dialog 打开的回调
',
- 'en-US': 'Click'
- },
- demoId: 'events-open-close'
- }
- ],
- slot: [
- {
- name: 'default',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': 'Dialog 的内容
',
- 'en-US': 'Click'
- },
- demoId: 'slot-title'
- },
- {
- name: 'footer',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': 'Dialog 按钮操作区的内容
',
- 'en-US': 'Click'
- },
- demoId: 'slot-footer'
- },
- {
- name: 'title',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': 'Dialog 标题区的内容
',
- 'en-US': 'Click'
- },
- demoId: 'slot-title'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/dropdownmenu/webdoc/dropdownmenu.js b/examples/sites/demos/mobile/app/dropdownmenu/webdoc/dropdownmenu.js
index a79ef9159..eb9759e38 100644
--- a/examples/sites/demos/mobile/app/dropdownmenu/webdoc/dropdownmenu.js
+++ b/examples/sites/demos/mobile/app/dropdownmenu/webdoc/dropdownmenu.js
@@ -158,245 +158,5 @@ export default {
},
codeFiles: ['type.vue']
}
- ],
- apis: [
- {
- name: 'DropdownMenu', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'active-color',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '标题和选项的选中态颜色
',
- 'en-US': 'display different button'
- },
- demoId: 'activeColor'
- },
- {
- name: 'close-on-click-outside',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '设置点击外部元素后关闭菜单,默认问true
',
- 'en-US': 'display different button'
- },
- demoId: 'closeOnClickOutside'
- },
- {
- name: 'close-on-click-overlay',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '设置点击遮罩层后关闭菜单,默认为true设置点击遮罩层后关闭菜单,默认为true
',
- 'en-US': 'display different button'
- },
- demoId: 'closeOnClickOverlay'
- },
- {
- name: 'direction',
- type: 'String',
- defaultValue: 'down',
- desc: {
- 'zh-CN': '设置弹出框弹出框展开方向,默认为down
',
- 'en-US': 'display different button'
- },
- demoId: 'direction'
- },
- {
- name: 'duration',
- type: 'Number',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置弹出框的动画时长
',
- 'en-US': 'display different button'
- },
- demoId: 'duration'
- },
- {
- name: 'overlay',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '设置是否显示遮罩层,默认为true
',
- 'en-US': 'display different button'
- },
- demoId: 'overlay'
- }
- ],
- slots: [
- {
- name: 'default',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '定义菜单内容
',
- 'en-US': 'Click'
- },
- demoId: 'slot'
- }
- ]
- },
- {
- name: 'DropdownItem', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'disabled',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '设置是否禁用,默认为false
',
- 'en-US': 'display different button'
- },
- demoId: 'disabled'
- },
- {
- name: 'icon',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置菜单选项项左侧icon
',
- 'en-US': 'display different button'
- },
- demoId: 'icon'
- },
- {
- name: 'options',
- type: 'Array',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置选项数据
',
- 'en-US': 'display different button'
- },
- demoId: 'screen-funnel'
- },
- {
- name: 'title',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '菜单项标题
',
- 'en-US': 'display different button'
- },
- demoId: 'screen-funnel'
- },
- {
- name: 'title-class',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '标题类名
',
- 'en-US': 'display different button'
- },
- demoId: 'title-class'
- },
- {
- name: 'type',
- type: 'String',
- defaultValue: 'selection',
- desc: {
- 'zh-CN': '设置菜单项类型,可选值为 filter | sort | selection,默认值为 selection
',
- 'en-US': 'display different button'
- },
- demoId: 'title-class'
- },
- {
- name: 'value',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '当前选中项对应的 value,可以通过v-model双向绑定
',
- 'en-US': 'display different button'
- },
- demoId: 'activeColor'
- }
- ],
- events: [
- {
- name: 'change',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '点击选项时触发,type为 selection 时启用
',
- 'en-US': 'Click'
- },
- demoId: 'event'
- },
- {
- name: 'close',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '关闭菜单时触发
',
- 'en-US': 'Click'
- },
- demoId: 'event'
- },
- {
- name: 'open',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '打开菜单时触发
',
- 'en-US': 'Click'
- },
- demoId: 'event'
- },
- {
- name: 'open',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '重置选项时触发,type 为 filter 时启用
',
- 'en-US': 'Click'
- },
- demoId: 'event'
- },
- {
- name: 'open',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '点击确定按钮时触发,type 为 filter 时启用
',
- 'en-US': 'Click'
- },
- demoId: 'event'
- }
- ],
- slots: [
- {
- name: 'default',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '定义菜单内容
',
- 'en-US': 'Click'
- },
- demoId: 'slot'
- },
- {
- name: 'icon',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '当type为selection时选项左侧内容
',
- 'en-US': 'Click'
- },
- demoId: 'slot'
- },
- {
- name: 'title',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '当type为selection时选项内容
',
- 'en-US': 'Click'
- },
- demoId: 'slot'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/exception/buttonText.vue b/examples/sites/demos/mobile/app/exception/buttonText.vue
index b01608676..19761f526 100644
--- a/examples/sites/demos/mobile/app/exception/buttonText.vue
+++ b/examples/sites/demos/mobile/app/exception/buttonText.vue
@@ -3,7 +3,7 @@
diff --git a/examples/sites/demos/mobile/app/exception/exceptionClass.vue b/examples/sites/demos/mobile/app/exception/exceptionClass.vue
index b01608676..19761f526 100644
--- a/examples/sites/demos/mobile/app/exception/exceptionClass.vue
+++ b/examples/sites/demos/mobile/app/exception/exceptionClass.vue
@@ -3,7 +3,7 @@
diff --git a/examples/sites/demos/mobile/app/exception/message.vue b/examples/sites/demos/mobile/app/exception/message.vue
index c522b4526..fd4bdff18 100644
--- a/examples/sites/demos/mobile/app/exception/message.vue
+++ b/examples/sites/demos/mobile/app/exception/message.vue
@@ -3,7 +3,7 @@
diff --git a/examples/sites/demos/mobile/app/exception/type.vue b/examples/sites/demos/mobile/app/exception/type.vue
index b01608676..19761f526 100644
--- a/examples/sites/demos/mobile/app/exception/type.vue
+++ b/examples/sites/demos/mobile/app/exception/type.vue
@@ -3,7 +3,7 @@
diff --git a/examples/sites/demos/mobile/app/exception/webdoc/exception.js b/examples/sites/demos/mobile/app/exception/webdoc/exception.js
index b86ff3902..796152ae2 100644
--- a/examples/sites/demos/mobile/app/exception/webdoc/exception.js
+++ b/examples/sites/demos/mobile/app/exception/webdoc/exception.js
@@ -74,108 +74,5 @@ export default {
},
codeFiles: ['type.vue']
}
- ],
- apis: [
- {
- name: 'Exception', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'imageUrl',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '自定义图片
',
- 'en-US': 'display different button'
- },
- demoId: 'buttonText'
- },
- {
- name: 'exceptionClass',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '自定义缺省页类名
',
- 'en-US': 'display different button'
- },
- demoId: 'exceptionClass'
- },
- {
- name: 'message',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '主图片文字,在图片下方
',
- 'en-US': 'display different button'
- },
- demoId: 'message'
- },
- {
- name: 'subMessage',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '副文本内容,在描述文字的下方
',
- 'en-US': 'display different button'
- },
- demoId: 'subMessage'
- },
- {
- name: 'type',
- type: 'String',
- defaultValue: 'nodata',
- desc: {
- 'zh-CN':
- '设置缺省页类型,默认为nodata,可选值有 weaknet || noperm || busy || build || weaknet || pcview
',
- 'en-US': 'display different button'
- },
- demoId: 'type'
- },
- {
- name: 'buttonText',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '按钮文字/p>',
- 'en-US': 'display different button'
- },
- demoId: 'buttonText'
- }
- ],
- events: [
- {
- name: 'click',
- type: 'Function()',
- defaultValue: '',
- desc: {
- 'zh-CN': '
点击按钮时触发,type 为 nodata 时启用
',
- 'en-US': 'Click'
- },
- demoId: 'message'
- }
- ],
- slot: [
- {
- name: 'content',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置内容
',
- 'en-US': 'Click'
- },
- demoId: 'mobileexception'
- },
- {
- name: 'footer',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置底部内容
',
- 'en-US': 'Click'
- },
- demoId: 'mobileexception'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/file-upload/clear-files.vue b/examples/sites/demos/mobile/app/file-upload/clear-files.vue
index 29c927580..10d003fd6 100644
--- a/examples/sites/demos/mobile/app/file-upload/clear-files.vue
+++ b/examples/sites/demos/mobile/app/file-upload/clear-files.vue
@@ -26,11 +26,11 @@ export default {
fileList: [
{
name: 'test1',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
},
{
name: 'test2',
- url: '/static/images/ry.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ry.png`
}
]
}
diff --git a/examples/sites/demos/mobile/app/file-upload/custom-prefix.vue b/examples/sites/demos/mobile/app/file-upload/custom-prefix.vue
index 799c06491..3b8d9d1d5 100644
--- a/examples/sites/demos/mobile/app/file-upload/custom-prefix.vue
+++ b/examples/sites/demos/mobile/app/file-upload/custom-prefix.vue
@@ -30,11 +30,11 @@ export default {
fileList: [
{
name: 'test1',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
},
{
name: 'test2',
- url: '/static/images/ry.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ry.png`
}
]
}
diff --git a/examples/sites/demos/mobile/app/file-upload/custom-upload-request.vue b/examples/sites/demos/mobile/app/file-upload/custom-upload-request.vue
index 80e1fb748..d8c8c3e53 100644
--- a/examples/sites/demos/mobile/app/file-upload/custom-upload-request.vue
+++ b/examples/sites/demos/mobile/app/file-upload/custom-upload-request.vue
@@ -27,7 +27,7 @@ export default {
fileList: [
{
name: 'test1',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
}
],
headers: {
diff --git a/examples/sites/demos/mobile/app/file-upload/dynamic-disable.vue b/examples/sites/demos/mobile/app/file-upload/dynamic-disable.vue
index a417961de..1bbeb11d6 100644
--- a/examples/sites/demos/mobile/app/file-upload/dynamic-disable.vue
+++ b/examples/sites/demos/mobile/app/file-upload/dynamic-disable.vue
@@ -20,7 +20,7 @@ export default {
fileList: [
{
name: 'test1',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
}
]
}
diff --git a/examples/sites/demos/mobile/app/file-upload/file-icon-list.vue b/examples/sites/demos/mobile/app/file-upload/file-icon-list.vue
index 3c8cba176..af4264a4c 100644
--- a/examples/sites/demos/mobile/app/file-upload/file-icon-list.vue
+++ b/examples/sites/demos/mobile/app/file-upload/file-icon-list.vue
@@ -21,7 +21,7 @@ export default {
fileList: [
{
name: 'test1名字很长名字很长名字很长名字很长名字很长名字很长',
- url: '/static/images/ld.png',
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`,
size: '1M',
fileType: 'png'
},
@@ -34,11 +34,11 @@ export default {
],
iconList: [
{
- url: '/static/images/dog2.png',
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog2.png`,
type: 'png'
},
{
- url: '/static/images/dog1.png',
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog1.png`,
type: 'xlsx'
}
]
diff --git a/examples/sites/demos/mobile/app/file-upload/file-picture-card.vue b/examples/sites/demos/mobile/app/file-upload/file-picture-card.vue
index 9cdbdfd69..e11c1d117 100644
--- a/examples/sites/demos/mobile/app/file-upload/file-picture-card.vue
+++ b/examples/sites/demos/mobile/app/file-upload/file-picture-card.vue
@@ -1,7 +1,7 @@
-
+
@@ -47,27 +47,27 @@ export default {
fileList: [
{
name: 'test1',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
},
{
name: 'test2',
- url: '/static/images/ry.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ry.png`
},
{
name: 'test1',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
},
{
name: 'test2',
- url: '/static/images/ry.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ry.png`
},
{
name: 'test1',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
},
{
name: 'test2',
- url: '/static/images/ry.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ry.png`
}
]
}
diff --git a/examples/sites/demos/mobile/app/file-upload/mini-mode.vue b/examples/sites/demos/mobile/app/file-upload/mini-mode.vue
index 069c3bdd7..b236408a0 100644
--- a/examples/sites/demos/mobile/app/file-upload/mini-mode.vue
+++ b/examples/sites/demos/mobile/app/file-upload/mini-mode.vue
@@ -21,7 +21,7 @@ export default {
fileList: [
{
name: 'test1',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
}
]
}
diff --git a/examples/sites/demos/mobile/app/file-upload/picture-card.vue b/examples/sites/demos/mobile/app/file-upload/picture-card.vue
index 87c3649ea..694521dcc 100644
--- a/examples/sites/demos/mobile/app/file-upload/picture-card.vue
+++ b/examples/sites/demos/mobile/app/file-upload/picture-card.vue
@@ -50,37 +50,37 @@ export default {
fileList1: [
{
name: 'test1',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
},
{
name: 'test2',
- url: '/static/images/ry.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ry.png`
},
{
name: 'test1',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
},
{
name: 'test2',
- url: '/static/images/ry.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ry.png`
},
{
name: 'test1',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
},
{
name: 'test2',
- url: '/static/images/ry.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ry.png`
}
],
fileList2: [
{
name: 'test1',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
},
{
name: 'test2',
- url: '/static/images/ry.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ry.png`
}
]
}
diff --git a/examples/sites/demos/mobile/app/file-upload/prevent-delete-file.vue b/examples/sites/demos/mobile/app/file-upload/prevent-delete-file.vue
index 43f6f3bc5..86c0647ef 100644
--- a/examples/sites/demos/mobile/app/file-upload/prevent-delete-file.vue
+++ b/examples/sites/demos/mobile/app/file-upload/prevent-delete-file.vue
@@ -27,7 +27,7 @@ export default {
fileList: [
{
name: 'test1',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
}
]
}
diff --git a/examples/sites/demos/mobile/app/file-upload/prevent-upload-file.vue b/examples/sites/demos/mobile/app/file-upload/prevent-upload-file.vue
index 876a29c60..1d095294c 100644
--- a/examples/sites/demos/mobile/app/file-upload/prevent-upload-file.vue
+++ b/examples/sites/demos/mobile/app/file-upload/prevent-upload-file.vue
@@ -21,7 +21,7 @@ export default {
fileList: [
{
name: 'test1',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
}
]
}
diff --git a/examples/sites/demos/mobile/app/file-upload/upload-events.vue b/examples/sites/demos/mobile/app/file-upload/upload-events.vue
index 1a42814da..d51ed7134 100644
--- a/examples/sites/demos/mobile/app/file-upload/upload-events.vue
+++ b/examples/sites/demos/mobile/app/file-upload/upload-events.vue
@@ -35,11 +35,11 @@ export default {
fileList: [
{
name: 'test1',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
},
{
name: 'test2',
- url: '/static/images/ry.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ry.png`
}
]
}
diff --git a/examples/sites/demos/mobile/app/file-upload/upload-file-list.vue b/examples/sites/demos/mobile/app/file-upload/upload-file-list.vue
index 956241600..3df0e131d 100644
--- a/examples/sites/demos/mobile/app/file-upload/upload-file-list.vue
+++ b/examples/sites/demos/mobile/app/file-upload/upload-file-list.vue
@@ -21,11 +21,11 @@ export default {
fileList: [
{
name: 'test1',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
},
{
name: 'test2',
- url: '/static/images/ry.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ry.png`
}
]
}
diff --git a/examples/sites/demos/mobile/app/file-upload/upload-http-request.vue b/examples/sites/demos/mobile/app/file-upload/upload-http-request.vue
index 4a8f06924..7636a5367 100644
--- a/examples/sites/demos/mobile/app/file-upload/upload-http-request.vue
+++ b/examples/sites/demos/mobile/app/file-upload/upload-http-request.vue
@@ -24,7 +24,7 @@ export default {
fileList: [
{
name: 'test1',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
}
]
}
diff --git a/examples/sites/demos/mobile/app/file-upload/upload-request.vue b/examples/sites/demos/mobile/app/file-upload/upload-request.vue
index 15f7c7d88..4627c0973 100644
--- a/examples/sites/demos/mobile/app/file-upload/upload-request.vue
+++ b/examples/sites/demos/mobile/app/file-upload/upload-request.vue
@@ -27,7 +27,7 @@ export default {
fileList: [
{
name: 'test1',
- url: '/static/images/ld.png'
+ url: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
}
],
headers: {
diff --git a/examples/sites/demos/mobile/app/file-upload/webdoc/file-upload.js b/examples/sites/demos/mobile/app/file-upload/webdoc/file-upload.js
index 8c9a3e725..5cbf9a435 100644
--- a/examples/sites/demos/mobile/app/file-upload/webdoc/file-upload.js
+++ b/examples/sites/demos/mobile/app/file-upload/webdoc/file-upload.js
@@ -1,806 +1,4 @@
export default {
column: '2',
- owner: '',
- // demos: [
- // {
- // demoId: 'abort-quest',
- // name: {
- // 'zh-CN': '手动取消上传请求',
- // 'en-US': 'button type',
- // },
- // desc: {
- // 'zh-CN': '调用组件abort方法,取消上传请求
',
- // 'en-US': 'button type
',
- // },
- // codeFiles: ['abort-quest.vue'],
- // },
- // {
- // demoId: 'accept-file-image',
- // name: {
- // 'zh-CN': '可上传的文件类型',
- // 'en-US': 'button round',
- // },
- // desc: {
- // 'zh-CN': '通过配置 accept(image) 来限制上传文件的格式为 image
',
- // 'en-US': 'button round
',
- // },
- // codeFiles: ['accept-file-image.vue'],
- // },
- // {
- // demoId: 'clear-files',
- // name: {
- // 'zh-CN': '可上传的文件类型',
- // 'en-US': 'clear-files',
- // },
- // desc: {
- // 'zh-CN': '通过配置 accept(.doc,.docx) 来限制上传文件的格式为 .doc .docx
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['clear-files.vue'],
- // },
- // {
- // demoId: 'accept-file',
- // name: {
- // 'zh-CN': '可上传的文件类型',
- // 'en-US': 'accept-file',
- // },
- // desc: {
- // 'zh-CN': '通过配置 accept(.doc,.docx) 来限制上传文件的格式为 .doc .docx
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['accept-file.vue'],
- // },
- // {
- // demoId: 'custom-prefix',
- // name: {
- // 'zh-CN': '钩子函数',
- // 'en-US': 'event',
- // },
- // desc: {
- // 'zh-CN': 'before-remove 删除文件之前的钩子,参数为上传的文件和文件列表,若返回 false 或者返回 Promise 且被 reject,则停止删除。
before-upload 上传文件之前的钩子,参数为上传的文件,若返回 false 或者返回 Promise 且被 reject,则停止上传。
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['custom-prefix.vue'],
- // },
- // {
- // demoId: 'custom-trigger',
- // name: {
- // 'zh-CN': '自定义触发文件选项框',
- // 'en-US': 'max',
- // },
- // desc: {
- // 'zh-CN': '可在组件中写一个名为trigger的插槽,来触发弹出文件选项框
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['custom-trigger.vue'],
- // },
- // {
- // demoId: 'custom-upload-request',
- // name: {
- // 'zh-CN': '自定义上传请求',
- // 'en-US': 'placeholder',
- // },
- // desc: {
- // 'zh-CN': '通过配置 headers ,设置自定义上传请求头信息
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['custom-upload-request.vue'],
- // },
- // {
- // demoId: 'custom-upload-tip',
- // name: {
- // 'zh-CN': '自定义上传提示',
- // 'en-US': 'precision',
- // },
- // desc: {
- // 'zh-CN': '可通过 tip 插槽来自定义上传提示
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['custom-upload-tip.vue'],
- // },
- // {
- // demoId: 'data',
- // name: {
- // 'zh-CN': '参数',
- // 'en-US': 'precision',
- // },
- // desc: {
- // 'zh-CN': '通过 data 属性可以上传时附带的额外参数。
通过 file-title 属性可以设置头部标题,该属性默认为‘附件’。
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['data.vue'],
- // },
- // {
- // demoId: 'drag-select-file',
- // name: {
- // 'zh-CN': '拖拽上传',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': '可配置drag(type:boolean),来控制组件是否可以拖拽文件
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['drag-select-file.vue'],
- // },
- // {
- // demoId: 'drag-upload',
- // name: {
- // 'zh-CN': '是否可以拖拽文件上传',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': '可配置 drag(type:boolean),来控制组件是否可以拖拽文件上传,如果配置了 accept 属性,可通过 @drop-error 事件获取不合规的拖拽文件。
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['drag-upload.vue'],
- // },
- // {
- // demoId: 'dynamic-disable',
- // name: {
- // 'zh-CN': '禁用',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': '可配置disabled(type:boolean),来控制组件是否禁用
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['dynamic-disable.vue'],
- // },
- // {
- // demoId: 'file-icon-list',
- // name: {
- // 'zh-CN': '特殊属性',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': '配置文件上传显示的图标路径
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['file-icon-list.vue'],
- // },
- // {
- // demoId: 'file-picture-card',
- // name: {
- // 'zh-CN': '文件缩略图',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': '文件缩略图
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['file-picture-card.vue'],
- // },
- // {
- // demoId: 'file-title',
- // name: {
- // 'zh-CN': '特殊属性',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': '设置头部标题
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['file-title.vue'],
- // },
- // {
- // demoId: 'header-show',
- // name: {
- // 'zh-CN': '特殊属性',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': '是否显示头部
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['header-show.vue'],
- // },
- // {
- // demoId: 'image-size',
- // name: {
- // 'zh-CN': '获取上传图片的长宽尺寸',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': '获取上传的片的原始尺寸
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['image-size.vue'],
- // },
- // {
- // demoId: 'manual-upload',
- // name: {
- // 'zh-CN': '手动上传',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': '通过 action 配置上传地址,通过 submit 设置手动上传
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['manual-upload.vue'],
- // },
- // {
- // demoId: 'max-file-count',
- // name: {
- // 'zh-CN': '最大上传文件数',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': '可通过配置limit(type:Number,大于0的整数)来限制上传文件的个数
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['max-file-count.vue'],
- // },
- // {
- // demoId: 'mini-mode',
- // name: {
- // 'zh-CN': 'mini 模式',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': '可通过配置 mini-mode,设置显示 mini 模式
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['mini-mode.vue'],
- // },
- // {
- // demoId: 'multiple-file',
- // name: {
- // 'zh-CN': '文件多选',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': '文件选择默认单选可配置multiple ="true"实现文件多选
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['multiple-file'],
- // },
- // {
- // demoId: 'picture-card',
- // name: {
- // 'zh-CN': '照片墙',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': '可配置list-type = "picture-card"开启照片墙模式
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['picture-card'],
- // },
- // {
- // demoId: 'prevent-delete-file',
- // name: {
- // 'zh-CN': '阻止删除文件',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': ':before-remove(移除文件前回调事件),方法里面return true/false,表示是否可以删除
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['prevent-delete-file'],
- // },
- // {
- // demoId: 'prevent-upload-file',
- // name: {
- // 'zh-CN': '阻止上传文件',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': 'before-upload(上传前回调事件),方法里面 return true/false,表示是否可以进行上传文件
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['prevent-upload-file'],
- // },
- // {
- // demoId: 'size',
- // name: {
- // 'zh-CN': '设置组件大小',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': '可选值为medium,small,mini
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['size'],
- // },
- // {
- // demoId: 'upload-events',
- // name: {
- // 'zh-CN': '事件',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': 'preview 点击文件列表中已上传的文件时触发的事件。
remove 文件列表移除文件时触发的事件。
error 文件上传失败时触发的事件。
exceed 文件超出个数限制时触发的事件。
progress 文件上传时触发的事件。
change 文件状态改变时触发的事件,添加文件、上传成功和上传失败时都会被触发。
success 文件上传成功时触发的事件。
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['upload-events'],
- // },
- // {
- // demoId: 'upload-file-list',
- // name: {
- // 'zh-CN': '上传的文件列表',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': '可配置:file-list(type:Object)来显示已上传的文件名和地址
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['upload-file-list'],
- // },
- // {
- // demoId: 'upload-http-request',
- // name: {
- // 'zh-CN': '覆盖默认请求',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': 'http-request,覆盖默认的上传行为,可以自定义上传的实现
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['upload-http-request'],
- // },
- // {
- // demoId: 'upload-limit',
- // name: {
- // 'zh-CN': '最大上传限制',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': '',
- // 'en-US': '
bbutton click
',
- // },
- // codeFiles: ['upload-limit'],
- // },
- // {
- // demoId: 'upload-request',
- // name: {
- // 'zh-CN': '上传请求',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': '可通过配置 action 为上传地址,可通过配置 headers 为头部请求信息
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['upload-request'],
- // },
- // {
- // demoId: 'upload-user-head',
- // name: {
- // 'zh-CN': '用户头像上传',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': '用户头像上传
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['upload-user-head'],
- // },
- // {
- // demoId: 'with-credentials',
- // name: {
- // 'zh-CN': '支持发送cookie
凭证信息',
- // 'en-US': 'step',
- // },
- // desc: {
- // 'zh-CN': '可通过配置:with-credentials = "true"
开启访问服务器携带cookie
,默认为true
。
',
- // 'en-US': 'bbutton click
',
- // },
- // codeFiles: ['with-credentials'],
- // },
- // ],
- apis: [
- {
- name: 'fileupload', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'accept',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '接受上传的文件类型(thumbnail-mode 模式下此参数无效)
',
- 'en-US': 'display different button'
- },
- demoId: 'accept-file-image'
- },
- {
- name: 'action',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '上传的地址,当不配置 action 时,会生成默认网关链接
',
- 'en-US': 'display different button'
- },
- demoId: 'accept-file'
- },
- {
- name: 'auto-upload',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '是否在选取文件后立即进行上传,该属性默认为true。
',
- 'en-US': 'display different button'
- },
- demoId: 'manual-upload'
- },
- {
- name: 'before-remove',
- type: 'function(file, fileList)',
- defaultValue: '',
- desc: {
- 'zh-CN':
- '删除文件之前的钩子,参数为上传的文件和文件列表,若返回 false 或者返回 Promise 且被 reject,则停止删除。
',
- 'en-US': 'display different button'
- },
- demoId: 'custom-prefix'
- },
- {
- name: 'before-upload',
- type: 'function(file,)',
- defaultValue: '',
- desc: {
- 'zh-CN':
- '上传文件之前的钩子,参数为上传的文件,若返回 false 或者返回 Promise 且被 reject,则停止上传。
',
- 'en-US': 'display different button'
- },
- demoId: 'custom-prefix'
- },
- {
- name: 'buttons',
- type: 'Boolean',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置组件基本按钮禁用或启用。
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'data',
- type: 'Object',
- defaultValue: '',
- desc: {
- 'zh-CN': '上传时附带的额外参数
',
- 'en-US': 'display different button'
- },
- demoId: 'data'
- },
- {
- name: 'disabled',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否禁用,该属性默认为false
',
- 'en-US': 'display different button'
- },
- demoId: 'dynamic-disable'
- },
- {
- name: 'display',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '显示删除文件功能,该属性默认为true
',
- 'en-US': 'display different button'
- },
- demoId: 'manual-upload'
- },
- {
- name: 'ext-icons',
- type: 'Object',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置自定义文件类型图标,根据扩展名定义,默认由组件内部提供。
',
- 'en-US': 'display different button'
- },
- demoId: 'placeholder'
- },
- {
- name: 'file-icon-list',
- type: 'Array',
- defaultValue: '',
- desc: {
- 'zh-CN': '配置文件上传显示的图标路径,未配置会默认显示组件内部配置图标
',
- 'en-US': 'display different button'
- },
- demoId: 'file-icon-list'
- },
- {
- name: 'file-list',
- type: 'Array',
- defaultValue: '',
- desc: {
- 'zh-CN': '上传的文件列表, 例如: [{name: "food.jpg", url: "https://xxx.cdn.com/xxx.jpg"}]
',
- 'en-US': 'display different button'
- },
- demoId: 'upload-file-list'
- },
- {
- name: 'file-title',
- type: 'String',
- defaultValue: '附件',
- desc: {
- 'zh-CN': '头部标题,该属性默认为‘附件’
',
- 'en-US': 'display different button'
- },
- demoId: 'file-title'
- },
- {
- name: 'header-show',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '是否显示头部,该属性默认为true
',
- 'en-US': 'display different button'
- },
- demoId: 'header-show'
- },
- {
- name: 'headers',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置上传的请求头部
',
- 'en-US': 'display different button'
- },
- demoId: 'upload-request'
- },
- {
- name: 'http-request',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '覆盖默认的上传行为,可以自定义上传的实现
',
- 'en-US': 'display different button'
- },
- demoId: 'upload-http-request'
- },
- {
- name: 'limit',
- type: 'Number',
- defaultValue: '',
- desc: {
- 'zh-CN': '最大允许上传个数
',
- 'en-US': 'display different button'
- },
- demoId: 'upload-limit'
- },
- {
- name: 'list-type',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '文件列表的类型
',
- 'en-US': 'display different button'
- },
- demoId: 'file-picture-card'
- },
- {
- name: 'max_file_count',
- type: 'Number',
- defaultValue: 'Infinity',
- desc: {
- 'zh-CN': '设置文件上传数量的最大值,默认无限制,要大于0的正整数。
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'mini-mode',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '设置 mini 模式。
',
- 'en-US': 'display different button'
- },
- demoId: 'mini-mode'
- },
- {
- name: 'multiple',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否支持多选文件
',
- 'en-US': 'display different button'
- },
- demoId: 'multiple-file'
- },
- {
- name: 'name',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '上传的文件字段名
',
- 'en-US': 'display different button'
- },
- demoId: 'data'
- },
- {
- name: 'show-file-list',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '是否显示已上传文件列表,该属性默认为true
',
- 'en-US': 'display different button'
- },
- demoId: 'upload-user-head'
- },
- {
- name: 'size',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '为单个按钮且按钮为TinyVue的Button组件时生效,值可设置为:medium,small,mini
',
- 'en-US': 'display different button'
- },
- demoId: 'size'
- },
- {
- name: 'success-statistics',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '文件上传成功数量展示,该属性默认为true
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'type',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '文本,该属性默认为select
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'upload-icon',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '是否显示头部文件上传按钮,该属性默认为true
',
- 'en-US': 'display different button'
- },
- demoId: 'data'
- },
- {
- name: 'with-credentials',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '文件列表支持发送 cookie 凭证信息类型,该属性默认为false
',
- 'en-US': 'display different button'
- },
- demoId: 'with-credentials'
- }
- ],
- methods: [
- {
- name: 'abort',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '取消上传请求
',
- 'en-US': 'Click'
- },
- demoId: 'event'
- },
- {
- name: 'clearFiles',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '清空已上传的文件列表(该方法不支持在 before-upload 中调用)
',
- 'en-US': 'Click'
- },
- demoId: 'clear-files'
- },
- {
- name: 'submit',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '',
- 'en-US': 'Click'
- },
- demoId: 'manual-upload'
- }
- ],
- events: [
- {
- name: 'change',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '
文件状态改变时触发的事件,添加文件、上传成功和上传失败时都会被触发
',
- 'en-US': 'Click'
- },
- demoId: 'upload-events'
- },
- {
- name: 'error',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '文件上传失败时触发的事件。
',
- 'en-US': 'Click'
- },
- demoId: 'upload-events'
- },
- {
- name: 'exceed',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '文件超出个数限制时触发的事件
',
- 'en-US': 'Click'
- },
- demoId: 'upload-events'
- },
- {
- name: 'preview',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '点击文件列表中已上传的文件时触发的事件
',
- 'en-US': 'Click'
- },
- demoId: 'upload-events'
- },
- {
- name: 'progress',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '文件上传时触发的事件
',
- 'en-US': 'Click'
- },
- demoId: 'upload-events'
- },
- {
- name: 'remove',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '从文件列表移除文件时触发的事件
',
- 'en-US': 'Click'
- },
- demoId: 'upload-events'
- },
- {
- name: 'success',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '文件上传成功时触发的事件
',
- 'en-US': 'Click'
- },
- demoId: 'upload-events'
- }
- ],
- slot: [
- {
- name: 'tip',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '提示说明文字
',
- 'en-US': 'Click'
- },
- demoId: 'custom-upload-tip'
- },
- {
- name: 'trigger',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '触发文件选择框的内容
',
- 'en-US': 'Click'
- },
- demoId: 'custom-upload-tip'
- }
- ]
- }
- ]
+ owner: ''
}
diff --git a/examples/sites/demos/mobile/app/form/webdoc/form.js b/examples/sites/demos/mobile/app/form/webdoc/form.js
index ae549db96..2a530d58b 100644
--- a/examples/sites/demos/mobile/app/form/webdoc/form.js
+++ b/examples/sites/demos/mobile/app/form/webdoc/form.js
@@ -134,223 +134,5 @@ export default {
},
codeFiles: ['validate.vue']
}
- ],
- apis: [
- {
- name: 'Form', // 组件名称展示使用
- type: 'component', // API 类型
- FormProperties: [
- {
- name: 'model',
- type: 'Object',
- defaultValue: '',
- desc: {
- 'zh-CN': '表单数据对象。
',
- 'en-US': ''
- },
- demoId: ''
- },
- {
- name: 'rules',
- type: 'Object',
- defaultValue: '',
- desc: {
- 'zh-CN': '表单验证规则。
',
- 'en-US': 'width'
- },
- demoId: 'validate'
- },
- {
- name: 'label-width',
- type: 'String',
- defaultValue: '80px',
- desc: {
- 'zh-CN': '表单中标签占位宽度,默认为 80px 。
',
- 'en-US': 'set main-title'
- },
- demoId: 'label-width'
- },
- {
- name: 'label-position',
- type: 'String',
- defaultValue: '"right" | "left" | "top"',
- desc: {
- 'zh-CN': '表单中标签的布局位置,提供可选项有:right/left/top,默认为 right 。
',
- 'en-US': 'Is show left text'
- },
- demoId: 'label-width'
- },
- {
- name: 'label-suffix',
- type: 'string',
- defaultValue: '',
- desc: {
- 'zh-CN': '表单中标签后缀 。
',
- 'en-US': 'set sub-title'
- },
- demoId: 'form-label-suffix'
- },
- {
- name: ' hide-required-asterisk',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否显示必填字段的标签旁边的红色星号
',
- 'en-US': 'Is show left arrow'
- },
- demoId: 'hide-required-asterisk'
- },
- {
- name: 'inline',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '行内布局模式,默认为 false 。
',
- 'en-US': 'Is show right arrow'
- },
- demoId: 'hide-required-asterisk'
- },
- {
- name: 'inline-message',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否以行内形式展示校验信息
',
- 'en-US': 'Is show right text'
- },
- demoId: 'validate'
- },
- {
- name: 'show-message',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否显示校验错误信息
',
- 'en-US': 'width'
- },
- demoId: ''
- },
- {
- name: 'validate-on-rule-change',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否以行内形式展示校验信息
',
- 'en-US': 'width'
- },
- demoId: ''
- }
- ],
- FormMethods: [
- {
- name: 'clearValidate',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN':
- '移除表单项的校验结果。传入待移除的表单项的 prop 属性或者 prop 组成的数组,如不传则移除整个表单的校验结果
',
- 'en-US': 'width'
- },
- demoId: 'validate'
- },
- {
- name: 'resetFields',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '对整个表单进行重置,将所有字段值重置为初始值并移除校验结果
',
- 'en-US': 'width'
- },
- demoId: 'validate'
- },
- {
- name: 'validate',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN':
- '对整个表单进行校验的方法,参数为一个回调函数。该回调函数会在校验结束后被调用,并传入两个参数:是否校验成功和未通过校验的字段。若不传入回调函数,则会返回一个 promise
',
- 'en-US': 'width'
- },
- demoId: 'validate'
- },
- {
- name: 'validateField',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '对部分表单字段进行校验的方法
',
- 'en-US': 'width'
- },
- demoId: ''
- }
- ],
- FormEvents: [
- {
- name: 'validate',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '任一表单项被校验后触发。
',
- 'en-US': 'width'
- },
- demoId: ''
- }
- ],
- FormSlots: [
- {
- name: 'default',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '默认插槽
',
- 'en-US': 'Click'
- },
- demoId: ''
- }
- ],
- FormItemProperties: [
- {
- name: 'ellipsis',
- type: 'boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '默认自动换行,不换行,显示省略号
',
- 'en-US': 'Is fixed top'
- },
- demoId: 'auto-wordwrap'
- },
- {
- name: 'label',
- type: 'string',
- defaultValue: '',
- desc: {
- 'zh-CN': '标签文本
',
- 'en-US': 'Is fixed top'
- },
- demoId: 'auto-wordwrap'
- },
- {
- name: 'prop',
- type: 'string',
- defaultValue: '',
- desc: {
- 'zh-CN': '表单域 model 字段
',
- 'en-US': 'Is fixed top'
- },
- demoId: 'auto-wordwrap'
- },
- {
- name: 'vertical',
- type: 'boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '垂直换行
',
- 'en-US': 'Is fixed top'
- },
- demoId: 'auto-wordwrap'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/imageviewer/events-change-close.vue b/examples/sites/demos/mobile/app/imageviewer/events-change-close.vue
index 794010530..3aa6e6c20 100644
--- a/examples/sites/demos/mobile/app/imageviewer/events-change-close.vue
+++ b/examples/sites/demos/mobile/app/imageviewer/events-change-close.vue
@@ -24,7 +24,11 @@ export default {
},
data() {
return {
- srcList: ['/static/images/dog1.png', '/static/images/dog2.png', '/static/images/dog3.png'],
+ srcList: [
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog1.png`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog2.png`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog3.png`
+ ],
shows: false
}
},
diff --git a/examples/sites/demos/mobile/app/imageviewer/image-full-current.vue b/examples/sites/demos/mobile/app/imageviewer/image-full-current.vue
index fe955d6c9..f78813f23 100644
--- a/examples/sites/demos/mobile/app/imageviewer/image-full-current.vue
+++ b/examples/sites/demos/mobile/app/imageviewer/image-full-current.vue
@@ -22,7 +22,11 @@ export default {
},
data() {
return {
- srcList: ['/static/images/dog1.png', '/static/images/dog2.png', '/static/images/dog3.png'],
+ srcList: [
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog1.png`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog2.png`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog3.png`
+ ],
shows: false
}
},
diff --git a/examples/sites/demos/mobile/app/imageviewer/slot-index.vue b/examples/sites/demos/mobile/app/imageviewer/slot-index.vue
index af824e67a..33df071f4 100644
--- a/examples/sites/demos/mobile/app/imageviewer/slot-index.vue
+++ b/examples/sites/demos/mobile/app/imageviewer/slot-index.vue
@@ -28,7 +28,11 @@ export default {
data() {
return {
zIndex: 200,
- srcList: ['/static/images/dog1.png', '/static/images/dog2.png', '/static/images/dog3.png'],
+ srcList: [
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog1.png`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog2.png`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog3.png`
+ ],
shows: false
}
},
diff --git a/examples/sites/demos/mobile/app/imageviewer/start-position.vue b/examples/sites/demos/mobile/app/imageviewer/start-position.vue
index 45b84dc45..fa86ecb3d 100644
--- a/examples/sites/demos/mobile/app/imageviewer/start-position.vue
+++ b/examples/sites/demos/mobile/app/imageviewer/start-position.vue
@@ -23,7 +23,11 @@ export default {
},
data() {
return {
- srcList: ['/static/images/dog1.png', '/static/images/dog2.png', '/static/images/dog3.png'],
+ srcList: [
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog1.png`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog2.png`,
+ `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog3.png`
+ ],
shows: false
}
},
diff --git a/examples/sites/demos/mobile/app/imageviewer/webdoc/imageviewer.js b/examples/sites/demos/mobile/app/imageviewer/webdoc/imageviewer.js
index 717b48adf..295eb29f2 100644
--- a/examples/sites/demos/mobile/app/imageviewer/webdoc/imageviewer.js
+++ b/examples/sites/demos/mobile/app/imageviewer/webdoc/imageviewer.js
@@ -49,147 +49,5 @@ export default {
},
codeFiles: ['start-position.vue']
}
- ],
- apis: [
- {
- name: 'ImageViewer', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'arrow-show',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否显示图片切换按钮,该属性默认为false
',
- 'en-US': 'display different button'
- },
- demoId: 'image-full-current'
- },
- {
- name: 'async-close',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否开启异步关闭,该属性默认为false
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'close-show',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否显示关闭按钮,该属性默认为false
',
- 'en-US': 'display different button'
- },
- demoId: 'image-full-current'
- },
- {
- name: 'image-full-current',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否全屏显示,该属性默认为false
',
- 'en-US': 'display different button'
- },
- demoId: 'image-full-current'
- },
- {
- name: 'preview-visible',
- type: 'Boolean',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置图片预览显示隐藏
',
- 'en-US': 'display different button'
- },
- demoId: 'image-full-current'
- },
- {
- name: 'show-index',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否显示当前图片下标,该属性默认为false
',
- 'en-US': 'display different button'
- },
- demoId: 'slot-index'
- },
- {
- name: 'start-position',
- type: 'Number',
- defaultValue: '0',
- desc: {
- 'zh-CN': '图片预览起始位置索引,该属性默认为0
',
- 'en-US': 'display different button'
- },
- demoId: 'start-position'
- },
- {
- name: 'tool-show',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否显示工具栏钮,该属性默认为false
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'url-list',
- type: 'Array',
- defaultValue: '',
- desc: {
- 'zh-CN': '配置图片路径
',
- 'en-US': 'display different button'
- },
- demoId: 'image-full-current'
- },
- {
- name: 'z-index',
- type: 'Number',
- defaultValue: '2000',
- desc: {
- 'zh-CN': '设置图片预览的 z-index,该属性默认为2000
',
- 'en-US': 'display different button'
- },
- demoId: 'slot-index'
- }
- ],
- events: [
- {
- name: 'change',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '切换当前图片时触发,{ index:切换时图片索引, url: 切换时图片链接 }
',
- 'en-US': 'Click'
- },
- demoId: 'events-change-close'
- },
- {
- name: 'close',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': 'close,{ index: 关闭时图片索引, url: 关闭时图片链接 }
',
- 'en-US': 'Click'
- },
- demoId: 'events-change-close'
- }
- ],
- slots: [
- {
- name: 'index',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '自定义页码内容
',
- 'en-US': 'Click'
- },
- demoId: 'slot-index'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/index-bar/webdoc/index-bar.js b/examples/sites/demos/mobile/app/index-bar/webdoc/index-bar.js
index 331aa84ff..1d2c418ec 100644
--- a/examples/sites/demos/mobile/app/index-bar/webdoc/index-bar.js
+++ b/examples/sites/demos/mobile/app/index-bar/webdoc/index-bar.js
@@ -26,69 +26,5 @@ export default {
},
codeFiles: ['event.vue']
}
- ],
- apis: [
- {
- name: 'IndexBar', // 组件名称展示使用
- type: 'component', // API 类型
- IndexBarProperties: [
- {
- name: 'indexList',
- type: '[]',
- defaultValue: '',
- desc: {
- 'zh-CN': '索引文字列表
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- }
- ],
- IndexBarEvents: [
- {
- name: 'select',
- type: 'Function(arg1)',
- defaultValue: '',
- desc: {
- 'zh-CN': '选中新的索引触发
',
- 'en-US': 'display different button'
- },
- demoId: 'event'
- },
- {
- name: 'change',
- type: 'Function(arg1)',
- defaultValue: '',
- desc: {
- 'zh-CN': ' 当前索引改变触发
',
- 'en-US': 'display different button'
- },
- demoId: 'event'
- }
- ],
- IndexBarEvents: [
- {
- name: 'default',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': ' 自定义内容
',
- 'en-US': 'display different button'
- },
- demoId: 'event'
- }
- ],
- IndexBarAnchorProperties: [
- {
- name: 'index',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '索引文字
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/input/webdoc/input.js b/examples/sites/demos/mobile/app/input/webdoc/input.js
index cafda5ed8..cfbc6a6f4 100644
--- a/examples/sites/demos/mobile/app/input/webdoc/input.js
+++ b/examples/sites/demos/mobile/app/input/webdoc/input.js
@@ -17,14 +17,17 @@ export default {
codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'clearable',
- 'name': { 'zh-CN': '一键清空', 'en-US': 'Clearable' },
- 'desc': {
+ demoId: 'clearable',
+ name: {
+ 'zh-CN': '一键清空',
+ 'en-US': 'Clearable'
+ },
+ desc: {
'zh-CN': '可通过 clearable
属性设置输入框显示清空图标按钮。
',
'en-US':
'You can set the clearable
attribute to display the clear icon button in the input.
'
},
- 'codeFiles': ['clearable.vue']
+ codeFiles: ['clearable.vue']
},
{
demoId: 'type',
@@ -60,9 +63,10 @@ export default {
'en-US': 'Scalable Textarea'
},
desc: {
- 'zh-CN': `可通过 resize
属性设置文本框的缩放。可选值:none | both | horizontal | vertical
。
可通过 autosize
属性设置文本框自适应内容高度。可传入对象,如 { minRows: 2, maxRows: 6 }
。`,
- 'en-US': `
You can use the resize
property to set the zoom of the text field. The value can be none | both | horizontal | vertical
. Note: This parameter is valid only when type="textarea"
is used.
- You can use the autosize
attribute to set the text field to adapt to the content height. You can transfer an object, for example, {minRows: 2, maxRows: 6}
. Note: This parameter is valid only for type="textarea"
.
`
+ 'zh-CN':
+ '可通过 resize
属性设置文本框的缩放。可选值:none | both | horizontal | vertical
。
可通过 autosize
属性设置文本框自适应内容高度。可传入对象,如 { minRows: 2, maxRows: 6 }
。',
+ 'en-US':
+ '
You can use the resize
property to set the zoom of the text field. The value can be none | both | horizontal | vertical
. Note: This parameter is valid only when type="textarea"
is used.
\n You can use the autosize
attribute to set the text field to adapt to the content height. You can transfer an object, for example, {minRows: 2, maxRows: 6}
. Note: This parameter is valid only for type="textarea"
.
'
},
codeFiles: ['textarea-scalable.vue']
},
@@ -108,7 +112,10 @@ export default {
},
{
demoId: 'prefix-suffix-icon',
- name: { 'zh-CN': '图标', 'en-US': 'Icon' },
+ name: {
+ 'zh-CN': '图标',
+ 'en-US': 'Icon'
+ },
desc: {
'zh-CN': '可通过 prefix-icon, suffix-icon
属性设置输入框头部、尾部图标
',
'en-US':
@@ -147,24 +154,10 @@ export default {
'en-US': 'Events'
},
desc: {
- 'zh-CN': `
- 输入框的事件,包括
- input
(输入值时触发),
- blur
(失去焦点时触发),
- focus
(获取焦点时触发),
- change
(值改变时触发),
- clear
(清除按钮时触发)
-
- `,
- 'en-US': `
- Event of the text box, including:
- input
(triggered when a value is entered)
- blur
(triggered when the focus is lost)
- focus
(triggered when the focus is obtained)
- change
(triggered when the value changes)
- clear
(triggered when the button is cleared)
-
- `
+ 'zh-CN':
+ '\n 输入框的事件,包括\n input
(输入值时触发), \n blur
(失去焦点时触发), \n focus
(获取焦点时触发), \n change
(值改变时触发), \n clear
(清除按钮时触发)\n
\n ',
+ 'en-US':
+ '\n Event of the text box, including:\n input
(triggered when a value is entered)\n blur
(triggered when the focus is lost)\n focus
(triggered when the focus is obtained)\n change
(triggered when the value changes)\n clear
(triggered when the button is cleared)\n
\n '
},
codeFiles: ['events.vue']
},
@@ -207,447 +200,5 @@ export default {
},
codeFiles: ['validate-event.vue']
}
- ],
- apis: [
- {
- name: 'Input', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'autocomplete',
- type: 'String',
- defaultValue: 'off',
- desc: {
- 'zh-CN': '原生属性,自动补全',
- 'en-US': 'Native autocomplete attribute'
- },
- demoId: 'native-attributes'
- },
- {
- name: 'autofocus',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '原生属性,自动获取焦点',
- 'en-US': 'Native attribute. The focus is automatically obtained during page loading.'
- },
- demoId: 'native-attributes'
- },
- {
- name: 'autosize',
- type: 'Boolean | Object',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '自适应内容高度,只对 type="textarea"有效。可传入对象,如,{ minRows: 2, maxRows: 6 }',
- 'en-US':
- 'Adaptive content height. This parameter is valid only for type="textarea"
. Objects can be transferred, for example, { minRows: 2, maxRows: 6 }'
- },
- demoId: 'textarea-scalable'
- },
- {
- name: 'clearable',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否显示清除按钮,该属性不适用于 type="textarea"
',
- 'en-US':
- 'Whether to display the clear button. This attribute is not applicable to type="textarea"
'
- },
- demoId: 'clearable'
- },
- {
- name: 'cols',
- type: 'Number',
- defaultValue: '',
- desc: {
- 'zh-CN': '原生属性,设置宽度,在 type ="textarea"时有效',
- 'en-US':
- 'Native attribute, which is used to set the width. This parameter is valid only when type is "textarea"'
- },
- demoId: 'textarea-rows-cols'
- },
- {
- name: 'counter',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否显示字数统计,只在 type = "text" 或 type = "textarea" 时有效',
- 'en-US':
- 'Whether to display the word count statistics. This parameter is valid only when type is "text" or type is "textarea"'
- },
- demoId: 'counter'
- },
- {
- name: 'disabled',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否禁用',
- 'en-US': 'Disabled'
- },
- demoId: 'disabled'
- },
- {
- name: 'is-select',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否可下拉选择',
- 'en-US': 'display different button'
- },
- demoId: 'type-select'
- },
- {
- name: 'label',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '等价于原生 aria-label 属性',
- 'en-US': 'equal to aria-label attribute'
- },
- demoId: ''
- },
- {
- name: 'max',
- type: 'number',
- defaultValue: '',
- desc: {
- 'zh-CN': '原生属性,设置最大值',
- 'en-US': 'Native attribute, set the maximum value'
- },
- demoId: 'native-attributes'
- },
- {
- name: 'maxlength',
- type: 'Number',
- defaultValue: '',
- desc: {
- 'zh-CN': '原生属性,最大输入长度',
- 'en-US': 'Native attribute, maximum input length'
- },
- demoId: 'counter'
- },
- {
- name: 'min',
- type: 'number',
- defaultValue: '',
- desc: {
- 'zh-CN': '原生属性,设置最小值',
- 'en-US': 'Native attribute, which sets the minimum value'
- },
- demoId: 'native-attributes'
- },
- {
- name: 'minlength',
- type: 'Number',
- defaultValue: '',
- desc: {
- 'zh-CN': '原生属性,最小输入长度',
- 'en-US': 'Native attribute, minimum input length'
- },
- demoId: 'counter'
- },
- {
- name: 'tips',
- type: 'String | Slot',
- defaultValue: '',
- desc: {
- 'zh-CN': '提示信息',
- 'en-US': 'tips under input'
- },
- demoId: 'slots'
- },
- {
- name: 'name',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '原生 name 属性',
- 'en-US': 'native name attribute'
- },
- demoId: 'native-attributes'
- },
- {
- name: 'placeholder',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '输入框占位文本',
- 'en-US': 'placeholder text'
- },
- demoId: 'basic-usage'
- },
- {
- name: 'prefix-icon',
- type: 'Component',
- defaultValue: '',
- desc: {
- 'zh-CN': '输入框头部图标',
- 'en-US': 'Icon at the head'
- },
- demoId: 'prefix-suffix-icon'
- },
- {
- name: 'readonly',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '原生属性,是否只读',
- 'en-US': 'Native attribute, read-only'
- },
- demoId: 'native-attributes'
- },
- {
- name: 'rows',
- type: 'Number',
- defaultValue: '2',
- desc: {
- 'zh-CN': '输入框行数,只对 type="textarea"有效',
- 'en-US': 'Number of lines in the input box. This parameter is valid only for type="textarea"'
- },
- demoId: 'textarea-rows-cols'
- },
- {
- name: 'select-menu',
- type: 'Array',
- defaultValue: '',
- desc: {
- 'zh-CN': '下拉选择的选项',
- 'en-US': 'options of select'
- },
- demoId: 'type-select'
- },
- {
- name: 'show-password',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否显示切换密码图标',
- 'en-US': 'Whether to display the switchover password icon'
- },
- demoId: 'show-password'
- },
- {
- name: 'show-word-limit',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否显示输入字数统计,只在 type = ‘text’ 或 type = ‘textarea’ 时有效,该属性默认为false',
- 'en-US':
- 'Whether to display the number of input words. This parameter is valid only when type is "text" or type is "textarea"'
- },
- demoId: 'counter'
- },
- {
- name: 'step',
- type: 'Number',
- defaultValue: '',
- desc: {
- 'zh-CN': '原生属性,设置输入字段的合法数字间隔',
- 'en-US': 'Native attribute, which is used to set the valid digit interval of the input field'
- },
- demoId: 'native-attributes'
- },
- {
- name: 'suffix-icon',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '输入框尾部图标',
- 'en-US': 'Icon at the right'
- },
- demoId: 'prefix-suffix-icon'
- },
- {
- name: 'title',
- type: 'String | Slot',
- defaultValue: '',
- desc: {
- 'zh-CN': '自定义标题',
- 'en-US': 'custom title'
- },
- demoId: ''
- },
- {
- name: 'type',
- type: 'String',
- defaultValue: 'text',
- desc: {
- 'zh-CN': '类型,同原生 input 标签的 type 属性',
- 'en-US': 'the type of input'
- },
- demoId: 'type'
- },
- {
- name: 'validate-event',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '输入时是否触发表单的校验',
- 'en-US': ' Whether form validation is triggered when entering data'
- },
- demoId: 'validate-event'
- },
- {
- name: 'v-model / modelValue',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '绑定值',
- 'en-US': 'input value'
- },
- demoId: 'basic-usage'
- },
- {
- name: 'width',
- type: 'Number | String',
- defaultValue: '',
- desc: {
- 'zh-CN': '宽度,取值为数字或元素 width 属性有效值,如果是数字则以 px 为单位',
- 'en-US':
- 'width, accepts a numerical value or a valid value for the width property, and if it is a number, it is measured in pixels.'
- },
- demoId: ''
- }
- ],
- methods: [
- {
- name: 'blur',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '使 input 失去焦点',
- 'en-US': 'Make the input lose focus.'
- },
- demoId: 'methods'
- },
- {
- name: 'focus',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '使 input 获取焦点',
- 'en-US': 'Focus the input'
- },
- demoId: 'methods'
- },
- {
- name: 'select',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '选中 input 中的文字',
- 'en-US': 'Select the text in the input'
- },
- demoId: 'methods'
- }
- ],
- events: [
- {
- name: 'change',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '在 Input 值改变时触发',
- 'en-US': 'callback when value has changed'
- },
- demoId: 'events'
- },
- {
- name: 'blur',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '在 Input 失去焦点时触发',
- 'en-US': 'callback when input lost focus'
- },
- demoId: 'events'
- },
- {
- name: 'focus',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '在 Input 获得焦点时触发',
- 'en-US': 'callback when input gains focus'
- },
- demoId: 'events'
- },
- {
- name: 'clear',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '在点击由 clearable 属性生成的清空按钮时触发',
- 'en-US': 'callback when click clear icon'
- },
- demoId: 'events'
- },
- {
- name: 'input',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '输入值时触发事件',
- 'en-US': 'callback when user input'
- },
- demoId: 'events'
- }
- ],
- slots: [
- {
- name: 'append',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '输入框后置内容,只对 type="text"有效',
- 'en-US': 'append content for input fields only works with type="text"'
- },
- demoId: 'slots'
- },
- {
- name: 'prepend',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '输入框前置内容,只对 type="text"有效',
- 'en-US': 'prepend content for input fields only works with type="text"'
- },
- demoId: 'slots'
- },
- {
- name: 'prefix',
- desc: {
- 'zh-CN': '输入框头部内容,只对 type="text"有效',
- 'en-US': 'prefix content for input fields only works with type="text"'
- },
- demoId: 'slots'
- },
- {
- name: 'suffix',
- desc: {
- 'zh-CN': '输入框尾部内容,只对 type="text"有效',
- 'en-US': 'suffix content for input fields only works with type="text"'
- },
- demoId: 'slots'
- },
- {
- name: 'title',
- desc: {
- 'zh-CN': '标题插槽',
- 'en-US': 'title slot'
- },
- demoId: 'slots'
- },
- {
- name: 'tips',
- desc: {
- 'zh-CN': '提示信息插槽',
- 'en-US': 'tips slot'
- },
- demoId: 'slots'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/label/webdoc/label.js b/examples/sites/demos/mobile/app/label/webdoc/label.js
index bb70dcfc4..1d568d42b 100644
--- a/examples/sites/demos/mobile/app/label/webdoc/label.js
+++ b/examples/sites/demos/mobile/app/label/webdoc/label.js
@@ -134,114 +134,5 @@ export default {
},
codeFiles: ['required.vue']
}
- ],
- apis: [
- {
- name: 'Label', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'label',
- type: 'string',
- defaultValue: '',
- desc: {
- 'zh-CN': '文本
',
- 'en-US': 'text'
- },
- demoId: 'base'
- },
- {
- name: 'type',
- type: 'string',
- defaultValue: 'base',
- desc: {
- 'zh-CN': '类型 \n base, number
',
- 'en-US': 'type'
- },
- demoId: 'type'
- },
- {
- name: ' color',
- type: 'string',
- defaultValue: 'primary',
- desc: {
- 'zh-CN': '文本颜色:primary,secondary,placeholder,disabled,inverse,brand,link
',
- 'en-US': 'text color'
- },
- demoId: 'color'
- },
- {
- name: 'size',
- type: 'string',
- defaultValue: 'normal',
- desc: {
- 'zh-CN': '文本大小:large,normal,small,mini
',
- 'en-US': 'text size'
- },
- demoId: 'size'
- },
- {
- name: 'wholeline',
- type: 'boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否整行显示
',
- 'en-US': 'whole line display'
- },
- demoId: 'wholeline'
- },
- {
- name: 'position',
- type: 'string',
- defaultValue: 'left',
- desc: {
- 'zh-CN': '整行显示时的位置:left,center,right
',
- 'en-US': 'position of whole line dispaly'
- },
- demoId: 'position'
- },
- {
- name: 'ellipsis',
- type: 'number',
- defaultValue: '',
- desc: {
- 'zh-CN': '支持超出省略号显示的行数
',
- 'en-US': 'ellipsis'
- },
- demoId: 'ellipsis'
- },
- {
- name: 'decimal',
- type: 'number',
- defaultValue: '2',
- desc: {
- 'zh-CN': '小数点的位数
',
- 'en-US': 'decimal'
- },
- demoId: 'decimal'
- },
- {
- name: 'limit',
- type: 'number',
- defaultValue: '',
- desc: {
- 'zh-CN': '限制文本的字数
',
- 'en-US': 'text limit'
- },
- demoId: 'limit'
- },
- {
- name: 'is-required',
- type: 'boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否添加*号
',
- 'en-US': 'is required'
- },
- demoId: 'required'
- }
- ],
- slots: []
- }
]
}
diff --git a/examples/sites/demos/mobile/app/list/double-list.vue b/examples/sites/demos/mobile/app/list/double-list.vue
index 2206f6f54..cd92876de 100644
--- a/examples/sites/demos/mobile/app/list/double-list.vue
+++ b/examples/sites/demos/mobile/app/list/double-list.vue
@@ -28,13 +28,13 @@ export default {
id: 1,
content: '主文本,文本较多换行时,列表高度相应增高,文本与列表上下间距不变',
contentdes: '此处是辅助说明文体,说明文本',
- img: '/static/images/dog2.png'
+ img: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog2.png`
},
{
id: 2,
content: '主文本',
contentdes: '此处是辅助说明文体,说明文本,文本较多换行时,列表高度相应增高,文本与列表上下间距不变',
- img: '/static/images/dog2.png'
+ img: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog2.png`
}
]
}
diff --git a/examples/sites/demos/mobile/app/list/imformation-list.vue b/examples/sites/demos/mobile/app/list/imformation-list.vue
index 0c9aeb484..9c82ca16d 100644
--- a/examples/sites/demos/mobile/app/list/imformation-list.vue
+++ b/examples/sites/demos/mobile/app/list/imformation-list.vue
@@ -98,7 +98,7 @@ export default {
content: 'AI系列培训-Introduction to AI & ML-分布式',
subtext: '',
contentdes: '',
- img: '/static/images/px.png'
+ img: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/px.png`
}
],
dataList1: [
@@ -108,7 +108,7 @@ export default {
'AI系列培训-Introduction to AI & ML-分布式与并行与交流,分布式与并行与交流,分布式与并行与交流,分布式与并行与交流,分布式与并行与交流,分布式与并行与交流',
subtext: '',
contentdes: '01-14 00:00',
- img: '/static/images/zh.png'
+ img: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/zh.png`
}
],
dataList2: [
@@ -118,7 +118,7 @@ export default {
'AI系列培训-Introduction to AI & ML-分布式与并行与交流,分布式与并行与交流,分布式与并行与交流,分布式与并行与交流,分布式与并行与交流,分布式与并行与交流',
subtext: '',
contentdes: '1235评论',
- img: '/static/images/dsj.png'
+ img: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dsj.png`
}
],
dataList3: [
@@ -128,14 +128,14 @@ export default {
'AI系列培训-Introduction to AI & ML-分布式与并行与交流,分布式与并行与交流,分布式与并行与交流,分布式与并行与交流,分布式与并行与交流,分布式与并行与交流',
subtext: '',
contentdes: '1235播放',
- img: '/static/images/ry.png'
+ img: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ry.png`
},
{
id: 2,
content: 'AI系列培训',
subtext: '',
contentdes: '1235播放',
- img: '/static/images/ld.png'
+ img: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/ld.png`
}
],
dataList4: [
@@ -145,14 +145,14 @@ export default {
'AI系列培训-Introduction to AI & ML-分布式与并行与交流,分布式与并行与交流,分布式与并行与交流,分布式与并行与交流,分布式与并行与交流,分布式与并行与交流',
subtext: '',
contentdes: '1235播放',
- img: '/static/images/jz.png'
+ img: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/jz.png`
},
{
id: 2,
content: 'AI系列培训',
subtext: '',
contentdes: '1235播放',
- img: '/static/images/dh.png'
+ img: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dh.png`
}
]
}
diff --git a/examples/sites/demos/mobile/app/list/single-line.vue b/examples/sites/demos/mobile/app/list/single-line.vue
index 3643571c7..39e2420f7 100644
--- a/examples/sites/demos/mobile/app/list/single-line.vue
+++ b/examples/sites/demos/mobile/app/list/single-line.vue
@@ -74,17 +74,17 @@ export default {
content: '主文本',
text: '次文本',
des: '辅助说明文字',
- imgsrc: '/static/images/icon.png',
+ imgsrc: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/icon.png`,
dataList: [
{
id: 1,
content: '相机胶卷(2023)',
- img: '/static/images/dog1.png'
+ img: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog1.png`
},
{
id: 2,
content: '相机胶卷(2023)',
- img: '/static/images/dog2.png'
+ img: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog2.png`
}
]
}
diff --git a/examples/sites/demos/mobile/app/list/slots.vue b/examples/sites/demos/mobile/app/list/slots.vue
index 8a8e4e772..14a16c5eb 100644
--- a/examples/sites/demos/mobile/app/list/slots.vue
+++ b/examples/sites/demos/mobile/app/list/slots.vue
@@ -32,21 +32,21 @@ export default {
content: '主文本1',
subtext: '次文本1',
contentdes: '这是描述文本1',
- img: '/static/images/dog1.png'
+ img: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog1.png`
},
{
id: 2,
content: '主文本2',
subtext: '次文本2',
contentdes: '这是描述文本2',
- img: '/static/images/dog2.png'
+ img: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog2.png`
},
{
id: 3,
content: '主文本3',
subtext: '次文本3',
contentdes: '这是描述文本3',
- img: '/static/images/dog3.png'
+ img: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog3.png`
}
]
}
diff --git a/examples/sites/demos/mobile/app/list/webdoc/list.js b/examples/sites/demos/mobile/app/list/webdoc/list.js
index 03895e059..5fb95a06d 100644
--- a/examples/sites/demos/mobile/app/list/webdoc/list.js
+++ b/examples/sites/demos/mobile/app/list/webdoc/list.js
@@ -62,85 +62,5 @@ export default {
},
codeFiles: ['slots.vue']
}
- ],
- apis: [
- {
- name: 'List', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'content',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置主文本
',
- 'en-US': 'Is fixed top'
- },
- demoId: 'double-line'
- },
- {
- name: ' content-des',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置描述文本
',
- 'en-US': 'Is show left arrow'
- },
- demoId: 'double-line'
- },
- {
- name: 'sub-text',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置次文本
',
- 'en-US': 'Is show right arrow'
- },
- demoId: 'single-line'
- }
- ],
- slots: [
- {
- name: 'default',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '自定义主文本内容
',
- 'en-US': 'Is show right arrow'
- },
- demoId: ''
- },
- {
- name: 'description',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '自定义描述内容
',
- 'en-US': 'Is show right arrow'
- },
- demoId: 'slots'
- },
- {
- name: 'prefix',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '自定义头部内容
',
- 'en-US': 'Is show right arrow'
- },
- demoId: 'slots'
- },
- {
- name: 'suffix',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '自定义尾部内容
',
- 'en-US': 'Is show right arrow'
- },
- demoId: 'slots'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/loading/webdoc/loading.js b/examples/sites/demos/mobile/app/loading/webdoc/loading.js
index d86dcdda3..f4487e8b7 100644
--- a/examples/sites/demos/mobile/app/loading/webdoc/loading.js
+++ b/examples/sites/demos/mobile/app/loading/webdoc/loading.js
@@ -26,55 +26,5 @@ export default {
},
codeFiles: ['type.vue']
}
- ],
- apis: [
- {
- name: 'Loading', // 组件名称展示使用
- type: 'loading', // API 类型
- properties: [
- {
- name: 'type',
- type: 'string',
- defaultValue: 'primary',
- desc: {
- 'zh-CN': '通过type设置不同的加载样式
',
- 'en-US': 'display different button'
- },
- demoId: 'type'
- },
- {
- name: 'target',
- type: 'DOM',
- defaultValue: 'DOM document.getElementById("id")',
- desc: {
- 'zh-CN': '通过document.getElementById绑定div的DOM节点
',
- 'en-US': 'display different button'
- },
- demoId: 'type'
- },
- {
- name: 'tiny_mode',
- type: 'string',
- defaultValue: 'pc',
- desc: {
- 'zh-CN': '通配置项pc,mobile表示不同设备
',
- 'en-US': 'display different button'
- },
- demoId: 'type'
- }
- ],
- method: [
- {
- name: 'closeLoading',
- type: 'Function',
- defaultValue: '',
- desc: {
- 'zh-CN': '关闭Loading
',
- 'en-US': 'display different button'
- },
- demoId: 'type'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/mask/webdoc/mask.js b/examples/sites/demos/mobile/app/mask/webdoc/mask.js
index 7f3c01692..a473efea9 100644
--- a/examples/sites/demos/mobile/app/mask/webdoc/mask.js
+++ b/examples/sites/demos/mobile/app/mask/webdoc/mask.js
@@ -52,63 +52,5 @@ export default {
},
codeFiles: ['slot-default.vue']
}
- ],
- apis: [
- {
- name: 'Mask',
- type: 'component',
- properties: [
- {
- name: 'cancelTouch',
- type: 'boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否禁用touch事件,设为 true
后点击遮罩层不会关闭',
- 'en-US': "whether to disable touch events, and mask wouldn't close when it was set true
"
- },
- demoId: 'cancel-touch'
- },
- {
- name: 'visible',
- type: 'boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否展示遮罩层',
- 'en-US': 'whether to show mask layer'
- },
- demoId: 'base'
- },
- {
- name: 'z-index',
- type: 'number',
- defaultValue: '99',
- desc: {
- 'zh-CN': '层叠数值',
- 'en-US': 'z-index property'
- },
- demoId: 'z-index'
- }
- ],
- events: [
- {
- name: 'click',
- desc: {
- 'zh-CN': '点击遮罩层触发',
- 'en-US': 'Click'
- },
- demoId: 'basic-usage'
- }
- ],
- slots: [
- {
- name: 'default',
- desc: {
- 'zh-CN': '默认插槽',
- 'en-US': 'Default slot'
- },
- demoId: 'slot-default'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/minipicker/webdoc/minipicker.js b/examples/sites/demos/mobile/app/minipicker/webdoc/minipicker.js
index 1d0a1058e..8cb424ad9 100644
--- a/examples/sites/demos/mobile/app/minipicker/webdoc/minipicker.js
+++ b/examples/sites/demos/mobile/app/minipicker/webdoc/minipicker.js
@@ -135,209 +135,5 @@ export default {
},
codeFiles: ['visibleitemcount.vue']
}
- ],
- apis: [
- {
- name: 'MiniPicker', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'cancel-button-text',
- type: 'String',
- defaultValue: '取消',
- desc: {
- 'zh-CN': '取消按钮内容设置,该属性默认为‘取消’
',
- 'en-US': 'display different button'
- },
- demoId: 'cancel-button-text'
- },
- {
- name: 'columns',
- type: 'Array',
- defaultValue: '',
- desc: {
- 'zh-CN': '配置每一列显示的数据
',
- 'en-US': 'display different button'
- },
- demoId: 'multicolumn'
- },
- {
- name: 'confirm-button-text',
- type: 'String',
- defaultValue: '确定',
- desc: {
- 'zh-CN': '确定按钮内容设置,该属性默认为‘确定’
',
- 'en-US': 'display different button'
- },
- demoId: 'confirm-button-text'
- },
- {
- name: 'default-index',
- type: 'Number',
- defaultValue: '0',
- desc: {
- 'zh-CN': '单列选择时,选择的初始值索引,该属性默认为0
',
- 'en-US': 'display different button'
- },
- demoId: 'defaultindex'
- },
- {
- name: 'item-height',
- type: 'Number',
- defaultValue: '34',
- desc: {
- 'zh-CN': '选项高度,该属性默认为34
',
- 'en-US': 'display different button'
- },
- demoId: 'itemheight'
- },
- {
- name: 'swipe-duration',
- type: 'Number',
- defaultValue: '1000',
- desc: {
- 'zh-CN': '快速滑动时惯性滚动的时长,单位 ms,该属性默认为1000
',
- 'en-US': 'display different button'
- },
- demoId: 'cancel-button-text'
- },
- {
- name: 'title',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '标题
',
- 'en-US': 'display different button'
- },
- demoId: 'cancel-button-text'
- },
- {
- name: 'value-key',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '选项对象中,选项文字对应的键名,该属性默认为"text"
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'visible',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '选择器组件显示或隐藏,该属性默认为false
',
- 'en-US': 'display different button'
- },
- demoId: 'cancel-button-text'
- },
- {
- name: 'visible-item-count',
- type: 'Number',
- defaultValue: '5',
- desc: {
- 'zh-CN': '可见的选项个数,该属性默认为5
',
- 'en-US': 'display different button'
- },
- demoId: 'visibleitemcount'
- }
- ],
- methods: [
- {
- name: 'getColumnIndex',
- type: '获取对应列选中项的索引,参数columnIndex,返回值optionIndex',
- defaultValue: '',
- desc: {
- 'zh-CN': '下拉时触发的事件
',
- 'en-US': 'Click'
- },
- demoId: 'methods'
- },
- {
- name: 'getColumnValue',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '获取对应列选中的值,参数columnIndex,返回值value
',
- 'en-US': 'Click'
- },
- demoId: 'methods'
- },
- {
- name: 'getColumnValues',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '获取对应列中所有选项,参数columnIndex,返回值values
',
- 'en-US': 'Click'
- },
- demoId: 'methods'
- },
- {
- name: 'getIndexes',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '获取所有列选中值对应的索引
',
- 'en-US': 'Click'
- },
- demoId: 'column'
- },
- {
- name: 'getValues',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '获取所有列选中的值
',
- 'en-US': 'Click'
- },
- demoId: 'column'
- }
- ],
- events: [
- {
- name: 'cancel',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '点击取消按钮时触发
',
- 'en-US': 'Click'
- },
- demoId: ''
- },
- {
- name: 'change',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '选项改变时触发。
',
- 'en-US': 'Click'
- },
- demoId: 'change'
- },
- {
- name: 'confirm',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '点击确定按钮时触发
',
- 'en-US': 'Click'
- },
- demoId: 'cancel'
- }
- ],
- slot: [
- {
- name: 'toolbar',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '自定义工具栏
',
- 'en-US': 'toolbar'
- },
- demoId: 'toolbar'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/modal/webdoc/modal.js b/examples/sites/demos/mobile/app/modal/webdoc/modal.js
index 3684ebbab..f1cd28fc7 100644
--- a/examples/sites/demos/mobile/app/modal/webdoc/modal.js
+++ b/examples/sites/demos/mobile/app/modal/webdoc/modal.js
@@ -350,331 +350,5 @@ export default {
},
codeFiles: ['zoom-event.vue']
}
- ],
- apis: [
- {
- name: 'Modal', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'modelValue / v-model',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '绑定值
',
- 'en-US': 'display different button'
- },
- demoId: 'cancel-event'
- },
- {
- name: 'id',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '只对 type=message 有效,如果不想窗口重复点击,可以设置唯一的 id 防止重复提示
',
- 'en-US': 'display different button'
- },
- demoId: 'id'
- },
- {
- name: 'is-form-reset',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '关闭弹窗,默认重置表单数据
',
- 'en-US': 'display different button'
- },
- demoId: 'is-form-reset'
- },
- {
- name: 'title',
- type: 'String',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '窗口的标题(支持开启国际化)
',
- 'en-US': 'display different button'
- },
- demoId: 'title'
- },
- {
- name: 'type',
- type: 'String',
- defaultValue: 'alert',
- desc: {
- 'zh-CN': '窗口类型;该属性的可选值为 alert, confirm, message
',
- 'en-US': 'display different button'
- },
- demoId: 'type'
- },
- {
- name: 'status',
- type: 'String',
- defaultValue: 'info',
- desc: {
- 'zh-CN':
- '只对 type=alert | confirm | message 有效,消息状态;该属性的可选值为 info, success, warning, error, loading
',
- 'en-US': 'display different button'
- },
- demoId: 'status'
- },
- {
- name: 'message',
- type: 'String | Function | VNode]',
- defaultValue: '',
- desc: {
- 'zh-CN': '窗口的内容,类型为:纯文本/VNode,或返回纯文本/VNode的函数
',
- 'en-US': 'display different button'
- },
- demoId: 'message'
- },
- {
- name: 'show-header',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '是否显示头部
',
- 'en-US': 'display different button'
- },
- demoId: 'showHeader'
- },
- {
- name: 'showFooter',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '是否显示底部
',
- 'en-US': 'display different button'
- },
- demoId: 'showFooter'
- },
- {
- name: 'lock-view',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '是否锁住页面,不允许窗口之外的任何操作
',
- 'en-US': 'display different button'
- },
- demoId: 'lock-view'
- },
- {
- name: 'lock-scroll',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '是否锁住滚动条,不允许页面滚动
',
- 'en-US': 'display different button'
- },
- demoId: 'lock-scroll'
- },
- {
- name: 'mask',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '是否显示遮罩层
',
- 'en-US': 'display different button'
- },
- demoId: 'mask-closable'
- },
- {
- name: 'mask-closable',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '是否允许点击遮罩层关闭窗口
',
- 'en-US': 'display different button'
- },
- demoId: 'mask-closable'
- },
- {
- name: 'esc-closable',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '是否允许按 Esc 键关闭窗口
',
- 'en-US': 'display different button'
- },
- demoId: 'mask-closable'
- },
- {
- name: 'resize',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否允许拖动调整窗口大小
',
- 'en-US': 'display different button'
- },
- demoId: 'resize'
- },
- {
- name: 'duration',
- type: 'Number | String',
- defaultValue: '3000',
- desc: {
- 'zh-CN': '只对 type=message 有效,自动关闭的延时
',
- 'en-US': 'display different button'
- },
- demoId: 'duration'
- },
- {
- name: 'width',
- type: 'Number | String',
- defaultValue: '3000',
- desc: {
- 'zh-CN': '窗口的宽度
',
- 'en-US': 'display different button'
- },
- demoId: 'grid'
- },
- {
- name: 'height',
- type: 'Number | String',
- defaultValue: '',
- desc: {
- 'zh-CN': '窗口的高度
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'min-width',
- type: 'Number | String',
- defaultValue: '',
- desc: {
- 'zh-CN': '窗口的最小宽度
',
- 'en-US': 'display different button'
- },
- demoId: 'min-width'
- },
- {
- name: 'min-height',
- type: 'Number | String',
- defaultValue: '',
- desc: {
- 'zh-CN': '窗口的最小高度
',
- 'en-US': 'display different button'
- },
- demoId: 'min-height'
- },
- {
- name: 'top',
- type: 'Number | String',
- defaultValue: '15',
- desc: {
- 'zh-CN': '只对 type=message 有效,消息距离顶部的位置
',
- 'en-US': 'display different button'
- },
- demoId: 'top'
- },
- {
- name: 'zIndex',
- type: 'Number',
- defaultValue: '3000',
- desc: {
- 'zh-CN': '自定义堆叠顺序(对于某些特殊场景,比如被遮挡时可能会用到)
',
- 'en-US': 'display different button'
- },
- demoId: 'zIndex'
- },
- {
- name: 'fullscreen',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '默认最大化显示
',
- 'en-US': 'display different button'
- },
- demoId: 'fullscreen'
- }
- ],
- events: [
- {
- name: 'show',
- type: 'Function(params)',
- defaultValue: '',
- desc: {
- 'zh-CN': '在窗口显示时会触发该事件;params: { type // 事件类型,$modal // 组件实例 }
',
- 'en-US': 'display different button'
- },
- demoId: 'show-event'
- },
- {
- name: 'hide',
- type: 'Function(params)',
- defaultValue: '',
- desc: {
- 'zh-CN': '在窗口关闭时会触发该事件;params: { type // 事件类型,$modal // 组件实例 }
',
- 'en-US': 'display different button'
- },
- demoId: 'hide-event'
- },
- {
- name: 'confirm',
- type: 'Function(params)',
- defaultValue: '',
- desc: {
- 'zh-CN':
- '点击确定按钮时会触发该事件;params: { type // 事件类型,$modal // 组件实例 },event: 原生事件
',
- 'en-US': 'display different button'
- },
- demoId: 'confirm-event'
- },
- {
- name: 'close',
- type: 'Function(params)',
- defaultValue: '',
- desc: {
- 'zh-CN':
- '点击关闭按钮时会触发该事件;params: { type // 事件类型,$modal // 组件实例 },event: 原生事件
',
- 'en-US': 'display different button'
- },
- demoId: 'close-event'
- },
- {
- name: 'cancel',
- type: 'Function(params)',
- defaultValue: '',
- desc: {
- 'zh-CN':
- '点击取消按钮时会触发该事件;params: { type // 事件类型,$modal // 组件实例 },event: 原生事件
',
- 'en-US': 'display different button'
- },
- demoId: 'cancel-event'
- },
- {
- name: 'zoom',
- type: 'Function(params)',
- defaultValue: '',
- desc: {
- 'zh-CN': '窗口缩放时会触发该事件;params: { type // 事件类型,$modal // 组件实例 },event: 原生事件
',
- 'en-US': 'display different button'
- },
- demoId: 'zoom-event'
- }
- ],
- slots: [
- {
- name: 'default',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '默认插槽
',
- 'en-US': 'display different button'
- },
- demoId: 'cancel-event'
- },
- {
- name: 'footer',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '窗口底部的模板
',
- 'en-US': 'display different button'
- },
- demoId: 'footer-slot'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/multi-select/basic-usage.vue b/examples/sites/demos/mobile/app/multi-select/basic-usage.vue
index d3e0af763..3d26583aa 100644
--- a/examples/sites/demos/mobile/app/multi-select/basic-usage.vue
+++ b/examples/sites/demos/mobile/app/multi-select/basic-usage.vue
@@ -1,23 +1,12 @@
-
-
- MultiSelect
- 下拉选择器
-
-
-
-
-
+
+
+
+ value: {{ value }}
-
diff --git a/examples/sites/demos/mobile/app/multi-select/disabled.vue b/examples/sites/demos/mobile/app/multi-select/disabled.vue
new file mode 100644
index 000000000..25191dc83
--- /dev/null
+++ b/examples/sites/demos/mobile/app/multi-select/disabled.vue
@@ -0,0 +1,507 @@
+
+
+ 1. 整体禁用:
+
+
+
+
+ 2. 单项菜单禁用:
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile/app/multi-select/event-click-item.vue b/examples/sites/demos/mobile/app/multi-select/event-click-item.vue
new file mode 100644
index 000000000..4b127555f
--- /dev/null
+++ b/examples/sites/demos/mobile/app/multi-select/event-click-item.vue
@@ -0,0 +1,263 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile/app/multi-select/filter.vue b/examples/sites/demos/mobile/app/multi-select/filter.vue
new file mode 100644
index 000000000..c5fce3336
--- /dev/null
+++ b/examples/sites/demos/mobile/app/multi-select/filter.vue
@@ -0,0 +1,275 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile/app/multi-select/type-wheel.vue b/examples/sites/demos/mobile/app/multi-select/type-wheel.vue
new file mode 100644
index 000000000..0eb60aa63
--- /dev/null
+++ b/examples/sites/demos/mobile/app/multi-select/type-wheel.vue
@@ -0,0 +1,229 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile/app/multi-select/webdoc/multi-select.js b/examples/sites/demos/mobile/app/multi-select/webdoc/multi-select.js
index d2a700b45..e4010873f 100644
--- a/examples/sites/demos/mobile/app/multi-select/webdoc/multi-select.js
+++ b/examples/sites/demos/mobile/app/multi-select/webdoc/multi-select.js
@@ -13,56 +13,54 @@ export default {
'en-US': 'button type
'
},
codeFiles: ['basic-usage.vue']
- }
- ],
- apis: [
+ },
{
- name: 'multiSelect', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'dataSource',
- type: '[]',
- defaultValue: '',
- desc: {
- 'zh-CN': '数据
',
- 'en-US': 'display different button'
- },
- demoId: 'basic-usage'
- },
- {
- name: 'defaultSelectedArray',
- type: '[]',
- defaultValue: '',
- desc: {
- 'zh-CN': '默认值
',
- 'en-US': 'display different button'
- },
- demoId: 'basic-usage'
- }
- ],
- events: [
- {
- name: 'confim',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '确认事件
',
- 'en-US': 'display different button'
- },
- demoId: 'basic-usage'
- },
- {
- name: 'reset',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '重置事件
',
- 'en-US': 'display different button'
- },
- demoId: 'basic-usage'
- }
- ]
+ demoId: 'disabled',
+ name: {
+ 'zh-CN': '禁用',
+ 'en-US': 'Disabled'
+ },
+ desc: {
+ 'zh-CN': '基础用法
',
+ 'en-US': 'button type
'
+ },
+ codeFiles: ['disabled.vue']
+ },
+ {
+ demoId: 'filter',
+ name: {
+ 'zh-CN': '选项过滤',
+ 'en-US': 'Filter'
+ },
+ desc: {
+ 'zh-CN': '',
+ 'en-US': 'button type
'
+ },
+ codeFiles: ['filter.vue']
+ },
+ {
+ demoId: 'type-wheel',
+ name: {
+ 'zh-CN': '滑轮模式',
+ 'en-US': 'Type Wheel'
+ },
+ desc: {
+ 'zh-CN': '',
+ 'en-US': 'button type
'
+ },
+ codeFiles: ['type-wheel.vue']
+ },
+ {
+ demoId: 'event-click-item',
+ name: {
+ 'zh-CN': '点击选项事件',
+ 'en-US': 'Type Wheel'
+ },
+ desc: {
+ 'zh-CN': '',
+ 'en-US': 'button type
'
+ },
+ codeFiles: ['event-click-item.vue']
}
]
}
diff --git a/examples/sites/demos/mobile/app/navbar/webdoc/navbar.js b/examples/sites/demos/mobile/app/navbar/webdoc/navbar.js
index 5fb232b4a..4396e2c44 100644
--- a/examples/sites/demos/mobile/app/navbar/webdoc/navbar.js
+++ b/examples/sites/demos/mobile/app/navbar/webdoc/navbar.js
@@ -50,125 +50,5 @@ export default {
},
codeFiles: ['z-index.vue']
}
- ],
- apis: [
- {
- name: 'navBar', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'fixed',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '是否固定在顶部,该属性默认为true
',
- 'en-US': 'Is fixed top'
- },
- demoId: 'left-right-arrow'
- },
- {
- name: 'left-arrow',
- type: 'Boolean',
- defaultValue: '',
- desc: {
- 'zh-CN': '是否显示左侧箭头,该属性默认为false
',
- 'en-US': 'Is show left arrow'
- },
- demoId: 'left-right-arrow'
- },
- {
- name: 'right-arrow',
- type: 'Boolean',
- defaultValue: '',
- desc: {
- 'zh-CN': '是否显示右侧箭头
',
- 'en-US': 'Is show right arrow'
- },
- demoId: 'left-right-arrow'
- },
- {
- name: 'right-text',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置右侧文本
',
- 'en-US': 'Is show right text'
- },
- demoId: 'left-right-text'
- },
- {
- name: 'left-text',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置左侧文本
',
- 'en-US': 'Is show left text'
- },
- demoId: 'left-right-text'
- },
- {
- name: 'sub-title',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置副标题
',
- 'en-US': 'set sub-title'
- },
- demoId: 'left-right-text'
- },
- {
- name: 'title',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置主标题
',
- 'en-US': 'set main-title'
- },
- demoId: 'z-index'
- },
- {
- name: 'z-index',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置z-index
',
- 'en-US': 'set z-index'
- },
- demoId: 'z-index'
- }
- ],
- slot: [
- {
- name: 'default',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '自定义标题
',
- 'en-US': 'Click'
- },
- demoId: 'left-right-arrow'
- },
- {
- name: 'left',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '自定义左侧内容
',
- 'en-US': 'Click'
- },
- demoId: 'left-right-text'
- },
- {
- name: 'right',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '自定义右侧内容
',
- 'en-US': 'Click'
- },
- demoId: 'left-right-text'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/numeric/webdoc/numeric.js b/examples/sites/demos/mobile/app/numeric/webdoc/numeric.js
index b1459304f..2f64f45b8 100644
--- a/examples/sites/demos/mobile/app/numeric/webdoc/numeric.js
+++ b/examples/sites/demos/mobile/app/numeric/webdoc/numeric.js
@@ -110,166 +110,5 @@ export default {
},
codeFiles: ['step.vue']
}
- ],
- apis: [
- {
- name: 'Numeric', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'circulate',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '向上到达最大值后从最小值开始,或反过来,该属性默认为false
',
- 'en-US': 'display different button'
- },
- demoId: 'circulate'
- },
- {
- name: 'controls',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '是否使用控制按钮,该属性默认为true
',
- 'en-US': 'display different button'
- },
- demoId: 'controls'
- },
- {
- name: 'controls-position',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '控制按钮位置
',
- 'en-US': 'display different button'
- },
- demoId: 'controls-position'
- },
- {
- name: 'disabled',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否禁用计数器。该属性默认为false。
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'label',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '输入框关联的label文字
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'max',
- type: 'Number',
- defaultValue: 'Infinity',
- desc: {
- 'zh-CN': '设置计数器允许的最大值,该属性默为 Infinity。
',
- 'en-US': 'display different button'
- },
- demoId: 'max'
- },
- {
- name: 'min',
- type: 'Number',
- defaultValue: '-Infinity',
- desc: {
- 'zh-CN': '设置计数器允许的最小值,该属性默为 -Infinity
',
- 'en-US': 'display different button'
- },
- demoId: 'max'
- },
- {
- name: 'placeholder',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '输入框占位文本
',
- 'en-US': 'display different button'
- },
- demoId: 'placeholder'
- },
- {
- name: 'precision',
- type: 'Number',
- defaultValue: '',
- desc: {
- 'zh-CN': '数值精度
',
- 'en-US': 'display different button'
- },
- demoId: 'precision'
- },
- {
- name: 'step',
- type: 'Number',
- defaultValue: '1',
- desc: {
- 'zh-CN': '设置按上下方向键或点击上下按钮增减的数值,该属性默认步长为 1。
',
- 'en-US': 'display different button'
- },
- demoId: 'step'
- },
- {
- name: 'step-strictly',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否只能输入 step 的倍数,该属性默认为false。
',
- 'en-US': 'display different button'
- },
- demoId: 'step'
- },
-
- {
- name: 'value',
- type: 'Number',
- defaultValue: '0',
- desc: {
- 'zh-CN': '设置输入组件的默认值,该属性默认为 0。
',
- 'en-US': 'display different button'
- },
- demoId: ''
- }
- ],
- events: [
- {
- name: 'change',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置组件的值变化时触发的回调函数。
',
- 'en-US': 'Click'
- },
- demoId: 'event'
- },
- {
- name: 'blur',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置组件失去焦点时触发的回调函数。
',
- 'en-US': 'Click'
- },
- demoId: 'event'
- },
- {
- name: 'focus',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置组件获得焦点时触发的回调函数。
',
- 'en-US': 'Click'
- },
- demoId: 'event'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/popover/base.vue b/examples/sites/demos/mobile/app/popover/base.vue
index 9603d1c62..a2d86b961 100644
--- a/examples/sites/demos/mobile/app/popover/base.vue
+++ b/examples/sites/demos/mobile/app/popover/base.vue
@@ -26,7 +26,9 @@
- 这是自定义插槽使用
+
+ 这是自定义插槽使用
+
@@ -42,40 +44,40 @@ export default {
{
id: '0',
label: '代金券',
- icon: '/static/images/icon.png'
+ icon: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/icon.png`
},
{
id: '1',
label: '拜访纪要',
- icon: '/static/images/icon.png'
+ icon: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/icon.png`
},
{
id: '2',
label: '拜访打卡',
- icon: '/static/images/icon.png'
+ icon: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/icon.png`
},
{
id: '3',
label: '联系人',
- icon: '/static/images/icon.png'
+ icon: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/icon.png`
},
{
id: '4',
label: '报备',
- icon: '/static/images/icon.png'
+ icon: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/icon.png`
}
],
data2: [
{
id: '0',
label: '取消收藏',
- icon: '/static/images/icon.png'
+ icon: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/icon.png`
},
{
id: '1',
label: '暂不关注该客户',
subLabel: '首页“关注”将不收到该客户动态',
- icon: '/static/images/icon.png'
+ icon: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/icon.png`
}
],
data3: []
@@ -86,7 +88,7 @@ export default {
this.data3.push({
id: index,
label: '内容' + index,
- icon: '/static/images/icon.png'
+ icon: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/icon.png`
})
}
},
diff --git a/examples/sites/demos/mobile/app/popover/direction.vue b/examples/sites/demos/mobile/app/popover/direction.vue
index 9f331d996..a2e7fcd8e 100644
--- a/examples/sites/demos/mobile/app/popover/direction.vue
+++ b/examples/sites/demos/mobile/app/popover/direction.vue
@@ -41,40 +41,40 @@ export default {
{
id: '0',
label: '代金券',
- icon: '/static/images/icon.png'
+ icon: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/icon.png`
},
{
id: '1',
label: '拜访纪要',
- icon: '/static/images/icon.png'
+ icon: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/icon.png`
},
{
id: '2',
label: '拜访打卡',
- icon: '/static/images/icon.png'
+ icon: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/icon.png`
},
{
id: '3',
label: '联系人',
- icon: '/static/images/icon.png'
+ icon: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/icon.png`
},
{
id: '4',
label: '报备',
- icon: '/static/images/icon.png'
+ icon: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/icon.png`
}
],
data2: [
{
id: '0',
label: '取消收藏',
- icon: '/static/images/icon.png'
+ icon: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/icon.png`
},
{
id: '1',
label: '暂不关注该客户',
subLabel: '首页“关注”将不收到该客户动态',
- icon: '/static/images/icon.png'
+ icon: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/icon.png`
}
],
data3: []
@@ -85,7 +85,7 @@ export default {
this.data3.push({
id: index,
label: '内容' + index,
- icon: '/static/images/icon.png'
+ icon: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/icon.png`
})
}
},
diff --git a/examples/sites/demos/mobile/app/popover/webdoc/popover.js b/examples/sites/demos/mobile/app/popover/webdoc/popover.js
index 8ccf9ec23..3359fbac9 100644
--- a/examples/sites/demos/mobile/app/popover/webdoc/popover.js
+++ b/examples/sites/demos/mobile/app/popover/webdoc/popover.js
@@ -26,268 +26,5 @@ export default {
},
codeFiles: ['direction.vue']
}
- ],
- apis: [
- {
- name: 'Popover', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'trigger',
- type: 'string',
- defaultValue: 'click',
- desc: {
- 'zh-CN': '触发方式;该属性的可选值为 click / focus / hover / manual
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'title',
- type: 'string',
- defaultValue: '',
- desc: {
- 'zh-CN': '标题
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- },
- {
- name: 'content',
- type: 'string',
- defaultValue: '',
- desc: {
- 'zh-CN': '显示的内容,也可以通过 slot 传入 DOM
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'width',
- type: 'string| number',
- defaultValue: 'auto',
- desc: {
- 'zh-CN': '宽度,该属性的默认值为auto,最小宽度 150px
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- },
- {
- name: 'placement',
- type: 'String',
- defaultValue: 'bottom',
- desc: {
- 'zh-CN':
- '出现位置;该属性的可选值为 top/top-start/top-end/bottom/bottom-start/bottom-end/left/left-start/left-end/right/right-start/right-end
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- },
- {
- name: 'disabled',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': 'Popover 是否可用
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'modelValue / v-model',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '状态是否可见
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'offset',
- type: 'Number',
- defaultValue: '0',
- desc: {
- 'zh-CN': '出现位置的偏移量
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'arrow-offset',
- type: 'Number',
- defaultValue: '0',
- desc: {
- 'zh-CN': '箭头的位置偏移
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'transform-origin',
- type: 'Boolean | String',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '组件的旋转中心点
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'append-to-body',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '是否添加到body上
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'transition',
- type: 'String',
- defaultValue: 'fade-in-linear',
- desc: {
- 'zh-CN': '定义渐变动画
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'visible-arrow',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '是否显示 Tooltip 箭头
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'popper-options',
- type: 'Object',
- defaultValue: '{ boundariesElement: "body", gpuAcceleration: false }',
- desc: {
- 'zh-CN': 'popper.js 的参数;该属性的可选值为 参考popper.js文档
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'popper-class',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '为 popper 添加类名
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'open-delay',
- type: 'Number',
- defaultValue: '0',
- desc: {
- 'zh-CN': '触发方式为 hover 时的显示延迟,单位为毫秒
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'close-delay',
- type: 'Number',
- defaultValue: '200',
- desc: {
- 'zh-CN': '触发方式为 hover 时的隐藏延迟,单位为毫秒
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'maxHeight',
- type: 'Number | String',
- defaultValue: '',
- desc: {
- 'zh-CN': '最大高度
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- },
- {
- name: 'listData',
- type: 'Array | Object',
- defaultValue: '',
- desc: {
- 'zh-CN': '内容对象列表,对象字段包含:icon图片地址、label标题、subLabel子标题
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- }
- ],
- events: [
- {
- name: 'show',
- type: 'Function()',
- defaultValue: '',
- desc: {
- 'zh-CN': '显示时触发
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- },
- {
- name: 'hide',
- type: 'Function()',
- defaultValue: '',
- desc: {
- 'zh-CN': '隐藏时触发
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- },
- {
- name: 'after-enter',
- type: 'Function()',
- defaultValue: '',
- desc: {
- 'zh-CN': '显示动画播放完毕后触发
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- },
- {
- name: 'after-leave',
- type: 'Function()',
- defaultValue: '',
- desc: {
- 'zh-CN': '隐藏动画播放完毕后触发
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- }
- ],
- slots: [
- {
- name: 'default',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': 'Popover 内嵌 HTML 文本
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- },
- {
- name: 'reference',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '触发 Popover 显示的 HTML 元素
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/progress/webdoc/progress.js b/examples/sites/demos/mobile/app/progress/webdoc/progress.js
index b62b1a81d..30ef4f275 100644
--- a/examples/sites/demos/mobile/app/progress/webdoc/progress.js
+++ b/examples/sites/demos/mobile/app/progress/webdoc/progress.js
@@ -147,103 +147,5 @@ export default {
},
codeFiles: ['width.vue']
}
- ],
- apis: [
- {
- name: 'progress', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'color',
- type: 'String | Function | Array',
- defaultValue: '',
- desc: {
- 'zh-CN': '进度条背景色(会覆盖 status 状态颜色)
',
- 'en-US': 'Is fixed top'
- },
- demoId: 'custom-color'
- },
- {
- name: ' format',
- type: 'Function',
- defaultValue: '',
- desc: {
- 'zh-CN': '显示文字内置在进度条内时,用于自定义显示内容
',
- 'en-US': 'Is show left arrow'
- },
- demoId: 'format'
- },
- {
- name: 'percentage',
- type: 'Number',
- defaultValue: '0',
- desc: {
- 'zh-CN': '百分比(必填)
',
- 'en-US': 'Is show right arrow'
- },
- demoId: 'dynamic-progress'
- },
- {
- name: 'show-text',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否显示进度条文字内容
',
- 'en-US': 'Is show right text'
- },
- demoId: 'text-inside-or-no-text'
- },
- {
- name: 'status',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '进度条当前状态
',
- 'en-US': 'Is show left text'
- },
- demoId: 'progress-status'
- },
- {
- name: 'stroke-width',
- type: 'Number',
- defaultValue: '',
- desc: {
- 'zh-CN': '进度条的宽度,单位 px
',
- 'en-US': 'set sub-title'
- },
- demoId: 'progress-width'
- },
- {
- name: 'text-inside',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '进度条显示文字内置在进度条内(只在 type=line 时可用)
',
- 'en-US': 'set main-title'
- },
- demoId: 'format-text'
- },
- {
- name: 'type',
- type: 'String',
- defaultValue: 'line |circle |dashboard',
- desc: {
- 'zh-CN': '进度条类型
',
- 'en-US': 'progress-type'
- },
- demoId: 'progress-type'
- },
- {
- name: 'width',
- type: 'Number',
- defaultValue: '',
- desc: {
- 'zh-CN': '环形进度条画布宽度(只在 type 为 circle 或 dashboard 时可用)
',
- 'en-US': 'width'
- },
- demoId: 'width'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/pull-refresh/webdoc/pull-refresh.js b/examples/sites/demos/mobile/app/pull-refresh/webdoc/pull-refresh.js
index ca1fc0bff..24ca6c603 100644
--- a/examples/sites/demos/mobile/app/pull-refresh/webdoc/pull-refresh.js
+++ b/examples/sites/demos/mobile/app/pull-refresh/webdoc/pull-refresh.js
@@ -122,137 +122,5 @@ export default {
},
codeFiles: ['event.vue']
}
- ],
- apis: [
- {
- name: 'pull-refresh ', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'v-model',
- type: 'boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否刷新状态,可以手动设置false来关闭刷新
',
- 'en-US': 'is refreshing'
- },
- demoId: 'base'
- },
- {
- name: 'loosing-text',
- type: 'string',
- defaultValue: '释放即可刷新',
- desc: {
- 'zh-CN': '下拉高度大于等于head-height时的提示文字,默认为:释放即可刷新
',
- 'en-US': 'display different button'
- },
- demoId: 'loosing-text'
- },
- {
- name: 'has-more',
- type: 'boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '是否有更多数据
',
- 'en-US': 'has more'
- },
- demoId: 'has-more'
- },
- {
- name: 'disabled-pull-down',
- type: 'boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否禁用下拉刷新
',
- 'en-US': 'disablde pull down'
- },
- demoId: 'disabled-pull-down'
- },
- {
- name: 'disabled-pull-up',
- type: 'boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否禁用上拉
',
- 'en-US': 'disablded pull up'
- },
- demoId: 'disabled-pull-up'
- },
- {
- name: 'pull-up-distance',
- type: 'number',
- defaultValue: '18',
- desc: {
- 'zh-CN': '触发上拉刷新的距离
',
- 'en-US': 'pull up distance'
- },
- demoId: 'pull-up-distance'
- },
- {
- name: 'pull-up-loading-text',
- type: 'string',
- defaultValue: '',
- desc: {
- 'zh-CN': '上拉加载文字
',
- 'en-US': 'pull up loading text'
- },
- demoId: 'pulling-text'
- },
- {
- name: 'pull-down-loading-text',
- type: 'string',
- defaultValue: '',
- desc: {
- 'zh-CN': '下拉加载文字
',
- 'en-US': 'pull down loading text'
- },
- demoId: 'pulling-text'
- }
- ],
- events: [
- {
- name: 'pull-down',
- type: '(event: PullEvent) => void',
- defaultValue: '',
- desc: {
- 'zh-CN': '下拉时触发的事件
',
- 'en-US': 'Click'
- },
- demoId: 'event'
- },
- {
- name: 'pull-up',
- type: '(event: PullEvent) => void',
- defaultValue: '',
- desc: {
- 'zh-CN': '上拉时触发的事件
',
- 'en-US': 'Click'
- },
- demoId: 'event'
- }
- ],
- slot: [
- {
- name: 'header',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '下拉刷新插槽
',
- 'en-US': 'pull down slot'
- },
- demoId: ''
- },
- {
- name: 'footer',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '上拉加载更多插槽
',
- 'en-US': 'pull up slot'
- },
- demoId: 'pull-refresh-slot'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/radio/webdoc/radio.js b/examples/sites/demos/mobile/app/radio/webdoc/radio.js
index d9df40b24..2999bfe97 100644
--- a/examples/sites/demos/mobile/app/radio/webdoc/radio.js
+++ b/examples/sites/demos/mobile/app/radio/webdoc/radio.js
@@ -50,87 +50,5 @@ export default {
},
codeFiles: ['event.vue']
}
- ],
- apis: [
- {
- name: 'Radio', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'disabled',
- type: 'boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否禁用
',
- 'en-US': 'display different button'
- },
- demoId: 'disabled'
- },
- {
- name: 'label',
- type: 'object | string',
- defaultValue: '',
- desc: {
- 'zh-CN': 'Radio 的 value,该属性默认为{}
',
- 'en-US': 'display different button'
- },
- demoId: 'label'
- },
- {
- name: 'name',
- type: 'string',
- defaultValue: '',
- desc: {
- 'zh-CN': '原生 name 属性
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- },
- {
- name: 'text',
- type: 'string',
- defaultValue: '',
- desc: {
- 'zh-CN': '文本
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- },
- {
- name: 'value',
- type: 'object | string',
- defaultValue: '{}',
- desc: {
- 'zh-CN': '绑定值,该属性默认为{}
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- }
- ],
- events: [
- {
- name: 'change',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '绑定值变化时触发的事件,可获取changeValue
',
- 'en-US': 'Click'
- },
- demoId: 'event'
- }
- ],
- slots: [
- {
- name: 'default',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': 'Radio的内容
',
- 'en-US': 'Click'
- },
- demoId: ''
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/search/webdoc/search.js b/examples/sites/demos/mobile/app/search/webdoc/search.js
index 7859ce6e9..e2e8102d5 100644
--- a/examples/sites/demos/mobile/app/search/webdoc/search.js
+++ b/examples/sites/demos/mobile/app/search/webdoc/search.js
@@ -62,119 +62,5 @@ export default {
},
codeFiles: ['events.vue']
}
- ],
- apis: [
- {
- name: 'Search', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'button-text',
- type: 'String',
- defaultValue: '搜索',
- desc: {
- 'zh-CN': '自定义搜索框按钮的文本内容,默认是‘搜索’
',
- 'en-US': 'display different button'
- },
- demoId: 'button-text'
- },
- {
- name: 'themeType',
- type: 'String',
- defaultValue: 'primary',
- desc: {
- 'zh-CN': '配置主题色,primary:蓝 gray:灰
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- },
- {
- name: 'placeholder',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置搜索输入框内的提示占位文本
',
- 'en-US': 'display different button'
- },
- demoId: 'button-text'
- },
- {
- name: 'v-model/value',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置搜索输入框内的默认搜索值
',
- 'en-US': 'display different button'
- },
- demoId: 'default-value'
- },
- {
- name: 'search-types',
- type: 'Array',
- defaultValue: '',
- desc: {
- 'zh-CN': '',
- 'en-US': 'display different button'
- },
- demoId: 'default-value'
- }
- ],
- events: [
- {
- name: 'change',
- type: 'Function(arg1,arg2)',
- defaultValue: '',
- desc: {
- 'zh-CN':
- '
在 input 框中输入完成时触发的回调函数;arg1:{Object 搜索类型},arg2:{String 当前input框中值}
',
- 'en-US': 'Click'
- },
- demoId: 'events'
- },
- {
- name: 'clear',
- type: 'Function(arg1,arg2)',
- defaultValue: '',
- desc: {
- 'zh-CN': '在点击清除按钮时触发的回调函数
',
- 'en-US': 'Click'
- },
- demoId: 'clear'
- },
- {
- name: 'select',
- type: 'Function(arg1)',
- defaultValue: '',
- desc: {
- 'zh-CN': '在search组件切换类型时触发的回调函数;arg1:{Object 搜索类型}
',
- 'en-US': 'Click'
- },
- demoId: 'clear'
- },
- {
- name: 'search',
- type: 'Function(arg1)',
- defaultValue: '',
- desc: {
- 'zh-CN':
- '在展开状态点击搜索按钮时触发的回调函数;arg1:{Object 搜索类型},arg2:{String 当前input框中值}
',
- 'en-US': 'Click'
- },
- demoId: 'events'
- }
- ],
- slots: [
- {
- name: 'default',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '自定义搜索框右侧内容
',
- 'en-US': 'Click'
- },
- demoId: ''
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/slider/webdoc/slider.js b/examples/sites/demos/mobile/app/slider/webdoc/slider.js
index 1788d55b4..9516dfb4f 100644
--- a/examples/sites/demos/mobile/app/slider/webdoc/slider.js
+++ b/examples/sites/demos/mobile/app/slider/webdoc/slider.js
@@ -160,167 +160,5 @@ export default {
},
codeFiles: ['vertical-mode.vue']
}
- ],
- apis: [
- {
- name: 'Slider', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'disabled',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否禁用
',
- 'en-US': 'display different button'
- },
- demoId: 'dynamic-disable'
- },
- {
- name: 'format-tooltip',
- type: 'Function(value)',
- defaultValue: '',
- desc: {
- 'zh-CN': '格式化 tooltip message
',
- 'en-US': 'display different button'
- },
- demoId: 'format-tooltip'
- },
- {
- name: 'max',
- type: 'Number',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置最大值。必需是整数,可以负数。必需大于所设置的最小值。
',
- 'en-US': 'display different button'
- },
- demoId: 'max-min'
- },
- {
- name: 'min',
- type: 'Number',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置最小值。
',
- 'en-US': 'display different button'
- },
- demoId: 'max-min'
- },
- {
- name: 'num-pages',
- type: 'Number',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置总步数,即按快捷键 PageDown/PageUp 时,每次移动的距离是(最大值-最小值)/分页数
',
- 'en-US': 'display different button'
- },
- demoId: 'shortcut-operation'
- },
- {
- name: 'range',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否为范围选择
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'show-input',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否显示输入框,仅在非范围选择时有效
',
- 'en-US': 'display different button'
- },
- demoId: 'show-input'
- },
- {
- name: 'show-tip',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '是否显示 tooltip
',
- 'en-US': 'display different button'
- },
- demoId: 'show-tip'
- },
- {
- name: 'step',
- type: 'Number',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置滑块移动时,每步位移距离,必需是大于0的正整数。
',
- 'en-US': 'display different button'
- },
- demoId: 'about-step'
- },
- {
- name: 'value',
- type: 'Number | Array',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置单滑块的当前值,必需是整数或数组。
',
- 'en-US': 'display different button'
- },
- demoId: ''
- },
- {
- name: 'vertical',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否竖向模式
',
- 'en-US': 'display different button'
- },
- demoId: 'vertical-mode'
- }
- ],
- events: [
- {
- name: 'change',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '值改变时触发(使用鼠标拖曳时,只在松开鼠标后触发)
',
- 'en-US': 'Click'
- },
- demoId: 'slider-event-change'
- },
- {
- name: 'start',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置滑块滑动开始时,触发该事件
',
- 'en-US': 'Click'
- },
- demoId: 'slider-event-start'
- },
- {
- name: 'stop',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置滑块滑动结束时,触发该事件
',
- 'en-US': 'Click'
- },
- demoId: 'slider-event-stop'
- }
- ],
- slots: [
- {
- name: 'default',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '组件默认插槽
',
- 'en-US': 'Click'
- },
- demoId: ''
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/switch/webdoc/switch.js b/examples/sites/demos/mobile/app/switch/webdoc/switch.js
index e9693b149..8b92dd12d 100644
--- a/examples/sites/demos/mobile/app/switch/webdoc/switch.js
+++ b/examples/sites/demos/mobile/app/switch/webdoc/switch.js
@@ -62,75 +62,5 @@ export default {
},
codeFiles: ['event.vue']
}
- ],
- apis: [
- {
- name: 'Switch', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'disabled',
- type: 'boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否禁用,该属性默认为false
',
- 'en-US': 'display different button'
- },
- demoId: 'disabled'
- },
- {
- name: 'false-value',
- type: 'string',
- defaultValue: 'false',
- desc: {
- 'zh-CN': 'switch 关闭时的值,该属性默认为false
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- },
- {
- name: 'true-value',
- type: 'string',
- defaultValue: 'true',
- desc: {
- 'zh-CN': 'switch 打开时的值,该属性默认为true
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- },
- {
- name: 'v-model',
- type: 'string',
- defaultValue: '',
- desc: {
- 'zh-CN': '绑定值
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- },
- {
- name: 'mini',
- type: 'boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '小尺寸
',
- 'en-US': 'mini'
- },
- demoId: 'mini'
- }
- ],
- events: [
- {
- name: 'change',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': 'switch 状态发生变化时的回调函数,可获取新状态的值
',
- 'en-US': 'Click'
- },
- demoId: 'event'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/tabbar/slot-icon.vue b/examples/sites/demos/mobile/app/tabbar/slot-icon.vue
index 0998d2d26..f41d76cc4 100644
--- a/examples/sites/demos/mobile/app/tabbar/slot-icon.vue
+++ b/examples/sites/demos/mobile/app/tabbar/slot-icon.vue
@@ -29,8 +29,8 @@ export default {
IconGroup: iconGroup(),
IconSetting: iconSetting(),
icon: {
- active: '/static/images/dog1.png',
- inactive: '/static/images/dog2.png'
+ active: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog1.png`,
+ inactive: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/dog2.png`
}
}
}
diff --git a/examples/sites/demos/mobile/app/tabbar/webdoc/tabbar.js b/examples/sites/demos/mobile/app/tabbar/webdoc/tabbar.js
index 12fab3f28..b295ca87c 100644
--- a/examples/sites/demos/mobile/app/tabbar/webdoc/tabbar.js
+++ b/examples/sites/demos/mobile/app/tabbar/webdoc/tabbar.js
@@ -86,97 +86,5 @@ export default {
},
codeFiles: ['slot-icon.vue']
}
- ],
- apis: [
- {
- name: 'Tabbar', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'active-color',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '选中标签的颜色
',
- 'en-US': 'display different button'
- },
- demoId: 'active-inactive-color'
- },
- {
- name: 'border',
- type: 'Boolean',
- defaultValue: '',
- desc: {
- 'zh-CN': '是否显示外边框,该属性默认为true
',
- 'en-US': 'display different button'
- },
- demoId: 'border'
- },
- {
- name: 'fixed',
- type: 'Boolen',
- defaultValue: '',
- desc: {
- 'zh-CN': '是否固定在底部,该属性默认为true
',
- 'en-US': 'display different button'
- },
- demoId: 'border'
- },
- {
- name: 'inactive-color',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '未选中标签的颜色
',
- 'en-US': 'display different button'
- },
- demoId: 'active-inactive-color'
- },
- {
- name: 'route',
- type: 'Boolean',
- defaultValue: '',
- desc: {
- 'zh-CN': '是否开启路由模式,该属性默认为false
',
- 'en-US': 'display different button'
- },
- demoId: 'route'
- },
- {
- name: 'z-index',
- type: 'Number | String',
- defaultValue: '',
- desc: {
- 'zh-CN': '元素 z-index
',
- 'en-US': 'display different button'
- },
- demoId: 'border'
- }
- ],
- events: [
- {
- name: 'change',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '切换标签时触发,value: 当前选中标签的名称或索引值
',
- 'en-US': 'Click'
- },
- demoId: 'event-change'
- }
- ],
- slot: [
- {
- name: 'icon',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '自定义图标
',
- 'en-US': 'Click'
- },
- demoId: 'slot-icon'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/table/webdoc/table.js b/examples/sites/demos/mobile/app/table/webdoc/table.js
index 66c6dc19c..9e6018740 100644
--- a/examples/sites/demos/mobile/app/table/webdoc/table.js
+++ b/examples/sites/demos/mobile/app/table/webdoc/table.js
@@ -14,63 +14,5 @@ export default {
},
codeFiles: ['base.vue']
}
- ],
- apis: [
- {
- name: 'Table', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'columns',
- type: '[]',
- defaultValue: '',
- desc: {
- 'zh-CN': '列数据
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- },
- {
- name: 'data',
- type: '[]',
- defaultValue: '',
- desc: {
- 'zh-CN': '表格数据
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- },
- {
- name: 'width',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '表格宽度
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- },
- {
- name: 'defaultChecked',
- type: '[]',
- defaultValue: '',
- desc: {
- 'zh-CN': '默认选中项
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- },
- {
- name: 'keys',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '数据标识
',
- 'en-US': 'display different button'
- },
- demoId: 'base'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/tabs/active-color.vue b/examples/sites/demos/mobile/app/tabs/active-color.vue
index 81f5bd430..f3e59afcb 100644
--- a/examples/sites/demos/mobile/app/tabs/active-color.vue
+++ b/examples/sites/demos/mobile/app/tabs/active-color.vue
@@ -1,5 +1,5 @@
-
+
内容1
内容2
内容3
@@ -10,7 +10,7 @@
-
+
+
diff --git a/examples/sites/demos/mobile/app/tabs/basic-usage.vue b/examples/sites/demos/mobile/app/tabs/basic-usage.vue
new file mode 100644
index 000000000..d6080b028
--- /dev/null
+++ b/examples/sites/demos/mobile/app/tabs/basic-usage.vue
@@ -0,0 +1,32 @@
+
+
+
+ 内容1
+ 内容2
+ 内容3
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile/app/tabs/before-leave.vue b/examples/sites/demos/mobile/app/tabs/before-leave.vue
index 5c2d7de03..917c7339c 100644
--- a/examples/sites/demos/mobile/app/tabs/before-leave.vue
+++ b/examples/sites/demos/mobile/app/tabs/before-leave.vue
@@ -1,5 +1,5 @@
-
+
表单组件,具有与用户交互,并可完成数据采集功能的控件。
数据组件,提供了非常强大数据表格功能,在Grid可以展示数据列表,可以对数据列表进行选择、编辑等。
@@ -9,8 +9,8 @@
-
+
+
diff --git a/examples/sites/demos/mobile/app/tabs/size.vue b/examples/sites/demos/mobile/app/tabs/size.vue
new file mode 100644
index 000000000..1fc3fd488
--- /dev/null
+++ b/examples/sites/demos/mobile/app/tabs/size.vue
@@ -0,0 +1,34 @@
+
+
+
+ 内容1
+ 内容2
+ 内容3
+ 内容4
+ 内容5
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/mobile/app/tabs/stretch.vue b/examples/sites/demos/mobile/app/tabs/stretch.vue
new file mode 100644
index 000000000..bbc5d2a78
--- /dev/null
+++ b/examples/sites/demos/mobile/app/tabs/stretch.vue
@@ -0,0 +1,22 @@
+
+
+ 导航组件,帮助网站访问者浏览站点的组件。
+ 业务组件,与业务紧密相关实现某种业务功能的组件集。
+
+
+
+
diff --git a/examples/sites/demos/mobile/app/tabs/swipe.vue b/examples/sites/demos/mobile/app/tabs/swipe.vue
index 913b38a3f..f6d68605a 100644
--- a/examples/sites/demos/mobile/app/tabs/swipe.vue
+++ b/examples/sites/demos/mobile/app/tabs/swipe.vue
@@ -1,5 +1,5 @@
-
+
内容1
内容2
内容3
@@ -10,7 +10,7 @@
-
-
-
diff --git a/examples/sites/demos/mobile/app/tabs/webdoc/tabs.cn.md b/examples/sites/demos/mobile/app/tabs/webdoc/tabs.cn.md
index 51d64cdd9..9d88efa5e 100644
--- a/examples/sites/demos/mobile/app/tabs/webdoc/tabs.cn.md
+++ b/examples/sites/demos/mobile/app/tabs/webdoc/tabs.cn.md
@@ -4,8 +4,8 @@ title: Tabs 选项卡
# Tabs 选项卡
-
+
-Tabs分隔内容上有关联但属于不同类别的数据集合。
+Tabs 分隔内容上有关联但属于不同类别的数据集合。
diff --git a/examples/sites/demos/mobile/app/tabs/webdoc/tabs.js b/examples/sites/demos/mobile/app/tabs/webdoc/tabs.js
index 4268b833d..0b4ffabb9 100644
--- a/examples/sites/demos/mobile/app/tabs/webdoc/tabs.js
+++ b/examples/sites/demos/mobile/app/tabs/webdoc/tabs.js
@@ -3,230 +3,121 @@ export default {
owner: '',
demos: [
{
- demoId: 'active-color',
+ demoId: 'basic-usage',
name: {
- 'zh-CN': '自定义当前标签颜色',
- 'en-US': 'button type'
+ 'zh-CN': '基本使用',
+ 'en-US': 'Basic Usage'
},
desc: {
- 'zh-CN': '自定义当前标签颜色
',
- 'en-US': 'button type
'
+ 'zh-CN':
+ 'Tabs
:通过 v-model 设置选中的页签项,对应 TabItem 页签项中 name 属性的值;
\n TabItem
:通过 title 设置页签项标题, name 设置页签项的值,disabled 设置页签项禁用,默认插槽自定义对应的内容。',
+ 'en-US':
+ ' Tabs
:Set the selected tag item through the v-model , corresponding to the value of the name attribute in the TabItem tag item;
\n TabItem
:Set the label item title through title .nameSet the value of tab items.disabledSet tab items to be disabled.Customize the corresponding content for the default slot.
'
+ },
+ codeFiles: ['basic-usage.vue']
+ },
+ {
+ demoId: 'active-color',
+ name: {
+ 'zh-CN': '当前页签颜色',
+ 'en-US': 'Active Label Color'
+ },
+ desc: {
+ 'zh-CN': '通过 active-color
设置当前页签的字体色。',
+ 'en-US': 'Specify the font color of the current label using the active-color
property.'
},
codeFiles: ['active-color.vue']
},
{
- demoId: 'before-leave',
+ demoId: 'size',
name: {
- 'zh-CN': '切换标签页前的钩子',
- 'en-US': 'button round'
+ 'zh-CN': '页签尺寸',
+ 'en-US': 'Tab Size'
},
desc: {
- 'zh-CN': '切换标签页前的钩子
',
- 'en-US': 'button round
'
+ 'zh-CN': '通过 size
设置当前页签的字体色。',
+ 'en-US': 'Set the font color of the current tag using the size
attribute.'
+ },
+ codeFiles: ['size.vue']
+ },
+ {
+ demoId: 'before-leave',
+ name: {
+ 'zh-CN': '切换页签钩子函数',
+ 'en-US': 'Change Tab Hook'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 before-leave
钩子函数处理切换页签项前的逻辑,若返回是 false
或 Promise.reject
,则阻止切换,返回 true 则可以切换。',
+ 'en-US':
+ 'Use the before-leave
hook function to handle the logic before switching label items. If false
or Promise.reject
is returned, the switch is blocked, and if true is returned, the switch can be made.'
},
codeFiles: ['before-leave.vue']
},
{
demoId: 'swipe',
name: {
- 'zh-CN': '滑动内容切换标签页',
- 'en-US': 'events'
+ 'zh-CN': '滑动内容切换页签',
+ 'en-US': 'Slide Content to Switch Tabs'
},
desc: {
- 'zh-CN': '滑动内容切换标签页
',
- 'en-US': '
bbutton click
'
+ 'zh-CN': '通过 swipeable
属性设置滑动内容是否切换页签。',
+ 'en-US': 'Set whether swiping changes the selected tab through the swipeable
attribute.'
},
codeFiles: ['swipe.vue']
},
{
- demoId: 'tabs-events',
+ demoId: 'stretch',
name: {
- 'zh-CN': '事件',
- 'en-US': 'events'
+ 'zh-CN': '自动撑宽',
+ 'en-US': 'Automatic widening'
},
desc: {
- 'zh-CN': '事件
',
- 'en-US': '
bbutton click
'
+ 'zh-CN': '通过 stretch
设置页签项的宽度是否自撑开,默认为 false 。',
+ 'en-US':
+ 'Set whether the width of the label item is self expanding by stretch
, and the default is false.'
},
- codeFiles: ['tabs-events.vue']
+ codeFiles: ['stretch.vue']
},
{
- demoId: 'three-level',
+ demoId: 'add-delete-tab',
name: {
- 'zh-CN': '嵌套标签页',
- 'en-US': 'events'
+ 'zh-CN': '动态增减页签',
+ 'en-US': 'Dynamic Addition of Tabs'
},
desc: {
- 'zh-CN': '嵌套标签页
',
- 'en-US': '
bbutton click
'
+ 'zh-CN':
+ '通过 with-add
打开添加按钮,并监听 add
事件自定义实现添加页签项的逻辑;
\n with-close
显示删除按钮,并监听 close
事件自定义实现添加页签项的逻辑。',
+ 'en-US':
+ 'Open the add button through with-add
and listen for the add
event to customize the logic for adding tag items.
Show the delete button through with-close
and listen for the close
event to customize the logic for closing tag items.
'
},
- codeFiles: ['three-level.vue']
- },
- {
- demoId: 'with-add',
- name: {
- 'zh-CN': '新增标签页',
- 'en-US': 'events'
- },
- desc: {
- 'zh-CN': '新增标签页
',
- 'en-US': '
bbutton click
'
- },
- codeFiles: ['with-add.vue']
+ codeFiles: ['add-delete-tab.vue']
},
{
demoId: 'expand',
name: {
- 'zh-CN': '可展开标签页',
- 'en-US': 'events'
+ 'zh-CN': '页签可展开',
+ 'en-US': 'Expandable Tab '
},
desc: {
- 'zh-CN': '可展开标签页
',
- 'en-US': '
bbutton click
'
+ 'zh-CN':
+ '当页签数量比较多无法全部展示时,可通过设置 :show-expand-tabs="true"
显示展开按钮,点击后展开全部页签功能。',
+ 'en-US':
+ 'When there are too many tabs to display at once, you can use the :show-expand-tabs="true"
attribute to show an expand button. Clicking on this button will expand and display all tabs.'
},
codeFiles: ['expand.vue']
- }
- ],
- apis: [
+ },
{
- name: 'Tabs', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'active-color',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置当前标签页激活状态的颜色
',
- 'en-US': 'display different button'
- },
- demoId: 'active-color'
- },
- {
- name: ' active-name',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '激活当前页
',
- 'en-US': 'display different button'
- },
- demoId: 'active-color'
- },
- {
- name: 'before-leave',
- type: 'Function(activeName, oldActiveName)',
- defaultValue: '',
- desc: {
- 'zh-CN': '切换标签之前的钩子,若返回 false 或者返回 Promise 且被 reject,则阻止切换
',
- 'en-US': 'display different button'
- },
- demoId: 'before-leave'
- },
- {
- name: 'swipeable',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '滑动标签内容切换标签页
',
- 'en-US': 'display different button'
- },
- demoId: 'swipe'
- },
- {
- name: 'value / v-model',
- type: 'String',
- defaultValue: '',
- desc: {
- 'zh-CN': '绑定值,选中选项卡的 name
',
- 'en-US': 'display different button'
- },
- demoId: 'active-color'
- },
- {
- name: 'with-add',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '标签是否可增加
',
- 'en-US': 'display different button'
- },
- demoId: 'with-add'
- },
- {
- name: 'show-expand-tabs',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': ' 属性启用标签可可展开功能
',
- 'en-US': 'display different button'
- },
- demoId: 'expend'
- },
- {
- name: 'expand-tabs-title',
- type: 'string',
- defaultValue: '请选择',
- desc: {
- 'zh-CN': '属性实现自定义展开内容的title,默认“请选择”
',
- 'en-US': 'display different button'
- },
- demoId: 'expend'
- },
- {
- name: 'expand-tabs-mode',
- type: 'string',
- defaultValue: 'columns',
- desc: {
- 'zh-CN': '属性实现展开内容的排列方式,column:为单列,columns:为多列,默认“多列”
',
- 'en-US': 'display different button'
- },
- demoId: 'expend'
- }
- ],
- events: [
- {
- name: 'add',
- type: 'Function()',
- defaultValue: '',
- desc: {
- 'zh-CN': '增加tabitem时触发事件
',
- 'en-US': 'Click'
- },
- demoId: 'tabs-events'
- },
- {
- name: 'click',
- type: 'Function(arg1,arg2) ',
- defaultValue: '',
- desc: {
- 'zh-CN': '点击tabitem时触发事件
',
- 'en-US': 'Click'
- },
- demoId: 'tabs-events'
- },
- {
- name: 'close',
- type: 'Function(arg)',
- defaultValue: '',
- desc: {
- 'zh-CN': '删除tabitem时触发事件
',
- 'en-US': 'Click'
- },
- demoId: 'tabs-events'
- }
- ],
- slot: [
- {
- name: 'default',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '组件默认插槽
',
- 'en-US': 'Click'
- },
- demoId: 'active-color'
- }
- ]
+ demoId: 'tabs-events',
+ name: {
+ 'zh-CN': '点击事件',
+ 'en-US': ' Click Event'
+ },
+ desc: {
+ 'zh-CN': '通过 click
监听点击页签事件。',
+ 'en-US': 'Listen for click events on tab buttons using the click
event.'
+ },
+ codeFiles: ['tabs-events.vue']
}
]
}
diff --git a/examples/sites/demos/mobile/app/tabs/with-add.vue b/examples/sites/demos/mobile/app/tabs/with-add.vue
deleted file mode 100644
index 1d9a7b92d..000000000
--- a/examples/sites/demos/mobile/app/tabs/with-add.vue
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
- 基本用法
-
-
-
- {{ item.content }}
-
-
-
-
-
-
-
-
diff --git a/examples/sites/demos/mobile/app/tag/webdoc/tag.js b/examples/sites/demos/mobile/app/tag/webdoc/tag.js
index ca75de3d4..248b692a8 100644
--- a/examples/sites/demos/mobile/app/tag/webdoc/tag.js
+++ b/examples/sites/demos/mobile/app/tag/webdoc/tag.js
@@ -3,94 +3,52 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
'zh-CN': '基本用法',
'en-US': 'Basic Usage'
},
- 'codeFiles': ['basic-usage.vue']
+ desc: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'different-color',
- 'name': { 'zh-CN': '不同颜色', 'en-US': 'Different Color' },
- 'desc': {
+ demoId: 'different-color',
+ name: {
'zh-CN': '不同颜色',
'en-US': 'Different Color'
},
- 'codeFiles': ['different-color.vue']
+ desc: {
+ 'zh-CN': '不同颜色',
+ 'en-US': 'Different Color'
+ },
+ codeFiles: ['different-color.vue']
},
{
- 'demoId': 'max-width',
- 'name': { 'zh-CN': '最大宽度', 'en-US': 'Max Width' },
- 'desc': {
+ demoId: 'max-width',
+ name: {
'zh-CN': '最大宽度',
'en-US': 'Max Width'
},
- 'codeFiles': ['max-width.vue']
+ desc: {
+ 'zh-CN': '最大宽度',
+ 'en-US': 'Max Width'
+ },
+ codeFiles: ['max-width.vue']
},
{
- 'demoId': 'mini',
- 'name': { 'zh-CN': '小尺寸', 'en-US': 'Mini' },
- 'desc': {
+ demoId: 'mini',
+ name: {
'zh-CN': '小尺寸',
'en-US': 'Mini'
},
- 'codeFiles': ['mini.vue']
- }
- ],
- apis: [
- {
- 'name': 'tag',
- 'type': 'component',
- 'props': [
- {
- 'name': 'color',
- 'type': 'string',
- 'defaultValue': 'default',
- 'desc': {
- 'zh-CN': '文字颜色:default、red、blue、yellow、green',
- 'en-US': 'text color: default、red、blue、yellow、green'
- },
- 'demoId': 'different-color'
- },
- {
- 'name': 'max-width',
- 'type': 'string | number',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '最大宽度', 'en-US': 'max width' },
- 'demoId': 'max-width'
- },
- {
- 'name': 'mini',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '小尺寸',
- 'en-US': 'mini'
- },
- 'demoId': 'mini'
- },
- {
- 'name': 'text',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '文字',
- 'en-US': 'Text'
- },
- 'demoId': 'basic-usage'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '标签内容', 'en-US': 'Label Content' },
- 'demoId': 'slot-default'
- }
- ]
+ desc: {
+ 'zh-CN': '小尺寸',
+ 'en-US': 'Mini'
+ },
+ codeFiles: ['mini.vue']
}
]
}
diff --git a/examples/sites/demos/mobile/app/timeline/webdoc/timeline.js b/examples/sites/demos/mobile/app/timeline/webdoc/timeline.js
index 1f7add132..dbde4016a 100644
--- a/examples/sites/demos/mobile/app/timeline/webdoc/timeline.js
+++ b/examples/sites/demos/mobile/app/timeline/webdoc/timeline.js
@@ -50,197 +50,5 @@ export default {
},
codeFiles: ['steps.vue']
}
- ],
- apis: [
- {
- name: 'TimeLine', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'data',
- type: 'Array',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置时间线步骤条数据',
- 'en-US': 'data'
- },
- demoId: 'different-data'
- },
- {
- name: 'show-number',
- type: 'Boolean',
- defaultValue: 'true',
- desc: {
- 'zh-CN': '
设置未完成的状态是否显示序号',
- 'en-US': 'data'
- },
- demoId: 'different-data'
- },
- {
- name: 'name-field',
- type: 'String',
- defaultValue: 'name',
- desc: {
- 'zh-CN': '
设置节点信息中名称对应的字段名
',
- 'en-US': 'Is show left arrow'
- },
- demoId: 'different-data'
- },
- {
- name: 'start',
- type: 'start',
- defaultValue: '1',
- desc: {
- 'zh-CN': '设置步骤条序号起始值
',
- 'en-US': 'Is show left arrow'
- },
- demoId: ''
- },
- {
- name: 'space',
- type: 'Number',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置步骤条的宽度
',
- 'en-US': 'Is show right arrow'
- },
- demoId: 'space'
- },
- {
- name: 'time-field',
- type: 'String',
- defaultValue: 'time',
- desc: {
- 'zh-CN': '设置节点时间信息对应的字段名
',
- 'en-US': 'Is show right text'
- },
- demoId: 'different-data'
- },
- {
- name: 'active',
- type: 'Number',
- defaultValue: '1',
- desc: {
- 'zh-CN': '设置步骤条的选中步骤
',
- 'en-US': 'Is show right text'
- },
- demoId: 'different-data'
- },
- {
- name: 'reverse',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '设置竖向步骤条的方向
',
- 'en-US': 'Is show right text'
- },
- demoId: 'mobileTimeLine'
- },
- {
- name: 'vertical',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '竖式步骤条
',
- 'en-US': 'Is show right text'
- },
- demoId: 'steps'
- },
- {
- name: 'horizontal',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否为横向步骤条
',
- 'en-US': 'Is show right text'
- },
- demoId: ''
- },
- {
- name: 'showStatus',
- type: 'Boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否展示状态文字
',
- 'en-US': 'Is show right text'
- },
- demoId: ''
- }
- ],
- events: [
- {
- name: 'click',
- type: 'Function(arg1,arg2)',
- defaultValue: '',
- desc: {
- 'zh-CN': '节点的点击事件;arguments: arg1:点击节点的下标, arg2:{ name: 节点名称, time: 时间 }
',
- 'en-US': 'Click'
- },
- demoId: 'mobileTimeLine'
- }
- ],
- slot: [
- {
- name: 'left',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '定义步骤条左侧内容
',
- 'en-US': 'Click'
- },
- demoId: 'slot'
- },
- {
- name: 'right',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '定义步骤条右侧内容
',
- 'en-US': 'Click'
- },
- demoId: 'slot'
- },
- {
- name: 'top',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '定义横向步骤条顶部
',
- 'en-US': 'Click'
- },
- demoId: ''
- },
- {
- name: 'bottom',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '定义横向步骤条底部
',
- 'en-US': 'Click'
- },
- demoId: ''
- },
- {
- name: 'header',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '定义竖向步骤条头部内容
',
- 'en-US': 'Click'
- },
- demoId: ''
- },
- {
- name: 'conternt',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '定义竖向步骤条内容
',
- 'en-US': 'Click'
- },
- demoId: ''
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/toast/webdoc/toast.js b/examples/sites/demos/mobile/app/toast/webdoc/toast.js
index 92fdf500b..14fcbef18 100644
--- a/examples/sites/demos/mobile/app/toast/webdoc/toast.js
+++ b/examples/sites/demos/mobile/app/toast/webdoc/toast.js
@@ -38,65 +38,5 @@ export default {
},
codeFiles: ['failed.vue']
}
- ],
- apis: [
- {
- name: 'Toast', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'zIndex',
- type: 'Number',
- defaultValue: '100',
- desc: {
- 'zh-CN': '弹框层级
',
- 'en-US': ''
- },
- demoId: 'base'
- },
- {
- name: 'type',
- type: 'string',
- defaultValue: 'text',
- desc: {
- 'zh-CN': '类型, text:纯文本 correct:成功 error:失败
',
- 'en-US': 'type'
- },
- demoId: 'base'
- },
- {
- name: 'text',
- type: 'string',
- defaultValue: '',
- desc: {
- 'zh-CN': '展示的文本
',
- 'en-US': 'display text'
- },
- demoId: 'base'
- },
- {
- name: 'time',
- type: 'Number',
- defaultValue: '2000',
- desc: {
- 'zh-CN': '展示持续时间,单位:ms
',
- 'en-US': 'display times'
- },
- demoId: 'base'
- }
- ],
- method: [
- {
- name: 'timeout',
- type: 'Function',
- defaultValue: '',
- desc: {
- 'zh-CN': '消失前的回调
',
- 'en-US': ''
- },
- demoId: 'base'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/mobile/app/user-head/basic-usage.vue b/examples/sites/demos/mobile/app/user-head/basic-usage.vue
index 93ebe0393..cbf0c2291 100644
--- a/examples/sites/demos/mobile/app/user-head/basic-usage.vue
+++ b/examples/sites/demos/mobile/app/user-head/basic-usage.vue
@@ -12,7 +12,11 @@
-
+
自定义
diff --git a/examples/sites/demos/mobile/app/user-head/image-user-head.vue b/examples/sites/demos/mobile/app/user-head/image-user-head.vue
index 79767254b..60c4a96cd 100644
--- a/examples/sites/demos/mobile/app/user-head/image-user-head.vue
+++ b/examples/sites/demos/mobile/app/user-head/image-user-head.vue
@@ -11,7 +11,7 @@ export default {
},
data() {
return {
- imgUrl: '/static/images/fruit.jpg'
+ imgUrl: `${import.meta.env.VITE_APP_BUILD_BASE_URL}static/images/fruit.jpg`
}
}
}
diff --git a/examples/sites/demos/mobile/app/user-head/webdoc/user-head.js b/examples/sites/demos/mobile/app/user-head/webdoc/user-head.js
index 25b362b36..075bdec6e 100644
--- a/examples/sites/demos/mobile/app/user-head/webdoc/user-head.js
+++ b/examples/sites/demos/mobile/app/user-head/webdoc/user-head.js
@@ -159,125 +159,5 @@ export default {
},
codeFiles: ['round-user-head.vue']
}
- ],
- apis: [
- {
- name: 'UserHead', // 组件名称展示使用
- type: 'component', // API 类型
- properties: [
- {
- name: 'type',
- type: 'string',
- defaultValue: 'label',
- desc: {
- 'zh-CN': '头像类型,该属性的可选值为 icon / image / label
',
- 'en-US': 'display different button'
- },
- demoId: 'basic-usage'
- },
- {
- name: 'value',
- type: 'string',
- defaultValue: '',
- desc: {
- 'zh-CN': '设type=icon 时为图标类名,type=label时为字体串,type=image时为资源路径
',
- 'en-US': 'display different button'
- },
- demoId: 'basic-usage'
- },
- {
- name: 'size',
- type: 'number',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置头像尺寸
',
- 'en-US': 'display different button'
- },
- demoId: 'basic-usage'
- },
- {
- name: 'backgroundColor',
- type: 'string',
- defaultValue: '',
- desc: {
- 'zh-CN': '设置背景色
',
- 'en-US': 'display different button'
- },
- demoId: 'custom-background-color'
- },
- {
- name: 'color',
- type: 'string',
- defaultValue: '#ffffff',
- desc: {
- 'zh-CN': '头像为icon或文字类型时的颜色
',
- 'en-US': 'display different button'
- },
- demoId: 'color'
- },
- {
- name: 'messageTotal',
- type: 'number',
- defaultValue: '',
- desc: {
- 'zh-CN': '右上角消息计数
',
- 'en-US': 'display different button'
- },
- demoId: 'message-count-limit'
- },
- {
- name: 'messageUpperLimit',
- type: 'number',
- defaultValue: '0',
- desc: {
- 'zh-CN': '右上角消息显示上限
',
- 'en-US': 'display different button'
- },
- demoId: 'message-count-limit'
- },
- {
- name: 'messageType',
- type: 'string',
- defaultValue: 'details',
- desc: {
- 'zh-CN': '右上角消息提醒类型,basic显示小圆点不显示消息数量
',
- 'en-US': 'display different button'
- },
- demoId: 'message-count-type'
- },
- {
- name: 'min',
- type: 'boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '小尺寸模式
',
- 'en-US': 'display different button'
- },
- demoId: 'min-user-head'
- },
- {
- name: 'round',
- type: 'boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '圆形模式
',
- 'en-US': 'display different button'
- },
- demoId: 'round-user-head'
- }
- ],
- slots: [
- {
- name: 'default',
- type: '',
- defaultValue: '',
- desc: {
- 'zh-CN': '自定义图像内容
',
- 'en-US': 'display different button'
- },
- demoId: 'round-user-head'
- }
- ]
- }
]
}
diff --git a/examples/sites/demos/pc/app/action-menu/webdoc/action-menu.js b/examples/sites/demos/pc/app/action-menu/webdoc/action-menu.js
index a5d80303c..a6930b72e 100644
--- a/examples/sites/demos/pc/app/action-menu/webdoc/action-menu.js
+++ b/examples/sites/demos/pc/app/action-menu/webdoc/action-menu.js
@@ -3,280 +3,134 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '使用 options
属性配置菜单内容,label
定义节点的显示文本。',
'en-US':
'Use options
attributes to configure menu content, and label
to define the display text for nodes.'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'disabled',
- 'name': { 'zh-CN': '禁用', 'en-US': 'Disabled' },
- 'desc': {
+ demoId: 'disabled',
+ name: {
+ 'zh-CN': '禁用',
+ 'en-US': 'Disabled'
+ },
+ desc: {
'zh-CN': '通过 disabled
字段设置当前下拉选项是否为禁用状态。
',
'en-US': 'Set whether the current drop-down option is disabled through the disabled
field.
'
},
- 'codeFiles': ['disabled.vue']
+ codeFiles: ['disabled.vue']
},
{
- 'demoId': 'icon',
- 'name': { 'zh-CN': '图标', 'en-US': 'Icon' },
- 'desc': {
+ demoId: 'icon',
+ name: {
+ 'zh-CN': '图标',
+ 'en-US': 'Icon'
+ },
+ desc: {
'zh-CN':
'通过 icon
属性设置菜单项的图标,suffix-icon
设置下拉触发源图标,show-icon
设置是否显示下拉触发源图标。',
'en-US':
'Set the icon of the attribute setting menu item through icon
, set the drop-down trigger source icon through suffix-icon
, and set whether to display the drop-down trigger source icon through show-icon
.'
},
- 'codeFiles': ['icon.vue']
+ codeFiles: ['icon.vue']
},
{
- 'demoId': 'text-field',
- 'name': { 'zh-CN': '映射字段', 'en-US': 'Display Text' },
- 'desc': {
+ demoId: 'text-field',
+ name: {
+ 'zh-CN': '映射字段',
+ 'en-US': 'Display Text'
+ },
+ desc: {
'zh-CN': '通过 text-field
属性设置菜单项文本的键值,默认为 label。
',
'en-US':
'Set the key value of the menu item text through the text-field
attribute, which defaults to label.
'
},
- 'codeFiles': ['text-field.vue']
+ codeFiles: ['text-field.vue']
},
{
- 'demoId': 'more-text',
- 'name': { 'zh-CN': '下拉按钮文本', 'en-US': 'Dropdown button text' },
- 'desc': {
+ demoId: 'more-text',
+ name: {
+ 'zh-CN': '下拉按钮文本',
+ 'en-US': 'Dropdown button text'
+ },
+ desc: {
'zh-CN': '通过 more-text
属性设置下拉按钮文本,默认为 更多
。
',
'en-US':
'Set the dropdown button text through the more-text
attribute, default to More
'
},
- 'codeFiles': ['more-text.vue']
+ codeFiles: ['more-text.vue']
},
{
- 'demoId': 'spacing',
- 'name': { 'zh-CN': '间距', 'en-US': 'Spacing' },
- 'desc': {
+ demoId: 'spacing',
+ name: {
+ 'zh-CN': '间距',
+ 'en-US': 'Spacing'
+ },
+ desc: {
'zh-CN': '通过 spacing
属性设置菜单按钮之间的间距,默认为 5px
。
',
'en-US':
'Set the spacing between menu buttons through the spacing
attribute, which defaults to 5px
.
'
},
- 'codeFiles': ['spacing.vue']
+ codeFiles: ['spacing.vue']
},
{
- 'demoId': 'popper-class',
- 'name': { 'zh-CN': '弹框样式', 'en-US': 'Bullet Box Style' },
- 'desc': {
+ demoId: 'popper-class',
+ name: {
+ 'zh-CN': '弹框样式',
+ 'en-US': 'Bullet Box Style'
+ },
+ desc: {
'zh-CN': '通过 popper-class
属性设置下拉面板的类名,自定义样式。
',
'en-US':
'Set the class name of the drop-down panel and customize the style through the popper-class
attribute.
'
},
- 'codeFiles': ['popper-class.vue']
+ codeFiles: ['popper-class.vue']
},
{
- 'demoId': 'max-show-num',
- 'name': { 'zh-CN': '个数限制', 'en-US': 'Number limit' },
- 'desc': {
+ demoId: 'max-show-num',
+ name: {
+ 'zh-CN': '个数限制',
+ 'en-US': 'Number limit'
+ },
+ desc: {
'zh-CN': '通过 max-show-num
属性设置最多显示菜单按钮的个数,默认为 2。
',
'en-US':
'By setting the max-show-num
attribute, the maximum number of displayed menu buttons is set to 2 by default.
'
},
- 'codeFiles': ['max-show-num.vue']
+ codeFiles: ['max-show-num.vue']
},
{
- 'demoId': 'slot-item',
- 'name': { 'zh-CN': '菜单项插槽', 'en-US': 'Menu Slot' },
- 'desc': {
+ demoId: 'slot-item',
+ name: {
+ 'zh-CN': '菜单项插槽',
+ 'en-US': 'Menu Slot'
+ },
+ desc: {
'zh-CN': '通过 item
插槽自定义下拉选项的 HTML 模板。
',
'en-US': 'Customize the HTML template for dropdown options through the item
slot.
'
},
- 'codeFiles': ['slot-item.vue']
+ codeFiles: ['slot-item.vue']
},
{
- 'demoId': 'events',
- 'name': { 'zh-CN': '事件', 'en-US': 'Menu Item Click Event' },
- 'desc': {
- 'zh-CN':
- '' +
- '事件说明
\n' +
- 'item-click:监听菜单项的点击事件。
\n' +
- 'more-click:监听下拉按钮的点击事件。trigger 为 click 时生效。
\n' +
- 'visible-change:监听下拉弹框的显示或隐藏状态变化。
\n' +
- '\n',
-
- 'en-US':
- '' +
- 'Event description
\n' +
- 'item-click:Listen for click events on menu items.
\n' +
- 'more-click:Listen for the click event of the drop-down button. Effective when trigger is click.
\n' +
- 'visible-change:Monitor the display or hidden status changes of the dropdown pop-up.
\n' +
- '\n'
+ demoId: 'events',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': 'Menu Item Click Event'
},
- 'codeFiles': ['events.vue']
- }
- ],
- apis: [
- {
- 'name': 'action-menu',
- 'type': 'component',
- 'props': [
- {
- 'name': 'max-show-num',
- 'type': 'number',
- 'defaultValue': '2',
- 'desc': {
- 'zh-CN': '最多显示菜单按钮的个数,其他菜单在下拉弹框显示',
- 'en-US':
- 'The maximum number of displayed menu buttons, and other menus are displayed in the drop-down pop-up box'
- },
- 'demoId': 'max-show-num'
- },
- {
- 'name': 'more-text',
- 'type': 'string',
- 'defaultValue': "'更多'",
- 'desc': {
- 'zh-CN': '下拉按钮文本',
- 'en-US': 'Dropdown button text'
- },
- 'demoId': 'more-text'
- },
- {
- 'name': 'options',
- 'type': 'IItemData[]',
- 'typeAnchorName': 'IItemData',
- 'defaultValue': '[]',
- 'desc': {
- 'zh-CN': '菜单项列表的数据',
- 'en-US': 'Data for menu item list'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'popper-class',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '下拉弹框的类名,用于自定义样式',
- 'en-US': 'The class name of the dropdown pop-up box, used for customizing styles'
- },
- 'demoId': 'popper-class'
- },
- {
- 'name': 'spacing',
- 'type': 'string | number',
- 'defaultValue': "'5px'",
- 'desc': {
- 'zh-CN': '菜单按钮之间的间距',
- 'en-US': 'Spacing between menu buttons'
- },
- 'demoId': 'spacing'
- },
- {
- 'name': 'suffix-icon',
- 'type': 'Component',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '下拉触发源图标',
- 'en-US': 'Dropdown trigger source icon'
- },
- 'demoId': 'icon'
- },
- {
- 'name': 'show-icon',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否显示下拉触发源图标',
- 'en-US': 'Is the dropdown trigger source icon displayed'
- },
- 'demoId': 'icon'
- },
- {
- 'name': 'text-field',
- 'type': 'string',
- 'defaultValue': "'label'",
- 'desc': {
- 'zh-CN': '菜单按钮文本的键值',
- 'en-US': 'Key values for menu button text'
- },
- 'demoId': 'text-field'
- }
- ],
- 'events': [
- {
- 'name': 'item-click',
- 'type': '(data:IItemClickParams) => void',
- 'typeAnchorName': 'IItemClickParams',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '监听菜单项的点击事件',
- 'en-US': 'Listen for click events on menu items'
- },
- 'demoId': 'events'
- },
- {
- 'name': 'more-click',
- 'type': '() => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '监听下拉按钮的点击事件。trigger 为 click 时生效',
- 'en-US': 'Listen for the click event of the drop-down button. Effective when trigger is click'
- },
- 'demoId': 'events'
- },
- {
- 'name': 'visible-change',
- 'type': '(status: boolean) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '监听下拉弹框的显示或隐藏状态变化',
- 'en-US': 'Monitor the display or hidden state changes of the dropdown pop-up box'
- },
- 'demoId': 'events'
- }
- ],
- 'slots': [
- {
- 'name': 'item',
- 'type': '插槽',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '菜单选项插槽',
- 'en-US': 'Menu option slot'
- },
- 'demoId': 'slot-item'
- }
- ]
- }
- ],
- types: [
- {
- name: 'IItemData',
- type: 'interface',
- code: `
-interface IItemData {
- label: string // 菜单项文本
- disabled: boolean // 是否禁用
- divided: boolean // 是否显示分割线
- children: IItemData[] // 菜单项子集
- icon: Component // 菜单项图标
-}
-`
- },
- {
- name: 'IItemClickParams',
- type: 'interface',
- code: `
-interface IItemClickParams {
- itemData: IItemData // 菜单项配置
- vm: { // 菜单项实例
- selected: boolean
- textField: string
- tipPosition: string
- $el: HTMLElement
- }
-}
-`
+ desc: {
+ 'zh-CN':
+ '事件说明
\nitem-click:监听菜单项的点击事件。
\nmore-click:监听下拉按钮的点击事件。trigger 为 click 时生效。
\nvisible-change:监听下拉弹框的显示或隐藏状态变化。
\n\n',
+ 'en-US':
+ 'Event description
\nitem-click:Listen for click events on menu items.
\nmore-click:Listen for the click event of the drop-down button. Effective when trigger is click.
\nvisible-change:Monitor the display or hidden status changes of the dropdown pop-up.
\n\n'
+ },
+ codeFiles: ['events.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/alert/custom-class-composition-api.vue b/examples/sites/demos/pc/app/alert/custom-class-composition-api.vue
new file mode 100644
index 000000000..555f7e354
--- /dev/null
+++ b/examples/sites/demos/pc/app/alert/custom-class-composition-api.vue
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/alert/custom-class.spec.ts b/examples/sites/demos/pc/app/alert/custom-class.spec.ts
new file mode 100644
index 000000000..c2086663e
--- /dev/null
+++ b/examples/sites/demos/pc/app/alert/custom-class.spec.ts
@@ -0,0 +1,12 @@
+import { test, expect } from '@playwright/test'
+
+test('基本用法', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('alert#custom-class')
+
+ const demo = page.locator('#custom-class')
+ const alertBox = demo.locator('.customClass')
+
+ // 颜色边框正确
+ await expect(alertBox).toHaveCSS('background-color', 'rgb(255, 192, 203)')
+})
diff --git a/examples/sites/demos/pc/app/alert/custom-class.vue b/examples/sites/demos/pc/app/alert/custom-class.vue
new file mode 100644
index 000000000..18d408e2f
--- /dev/null
+++ b/examples/sites/demos/pc/app/alert/custom-class.vue
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/alert/webdoc/alert.js b/examples/sites/demos/pc/app/alert/webdoc/alert.js
index ea6bcd3c8..7bb400b0c 100644
--- a/examples/sites/demos/pc/app/alert/webdoc/alert.js
+++ b/examples/sites/demos/pc/app/alert/webdoc/alert.js
@@ -3,250 +3,122 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN':
'通过 description
属性或者 description
插槽来设置提示内容,通过 type
设置不同的类型。
',
'en-US':
'Set the prompt content through the description
attribute or description
slot, and set different types through type
.
'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'size',
- 'name': { 'zh-CN': '尺寸', 'en-US': 'Size' },
- 'desc': {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '尺寸',
+ 'en-US': 'Size'
+ },
+ desc: {
'zh-CN': '通过 size
设置不同的尺寸,可选值: normal
、large
。
',
'en-US':
'Set different sizes through size
, with optional values: normal, large
.
'
},
- 'codeFiles': ['size.vue']
+ codeFiles: ['size.vue']
},
{
- 'demoId': 'title',
- 'name': { 'zh-CN': '自定义标题', 'en-US': 'Custom Title' },
- 'desc': {
+ demoId: 'title',
+ name: {
+ 'zh-CN': '自定义标题',
+ 'en-US': 'Custom Title'
+ },
+ desc: {
'zh-CN':
'当 size
为 large
时,通过 title
属性 或 title
插槽自定义标题。如不设置,默认标题根据对应的 type
显示。
',
'en-US':
'When size
is set to large, the title is displayed. You can set title
or slot
to customize the title. The default title is displayed according to the set type
.
'
},
- 'codeFiles': ['title.vue']
+ codeFiles: ['title.vue']
},
{
- 'demoId': 'center',
- 'name': { 'zh-CN': '文字居中', 'en-US': 'Center text' },
- 'desc': {
+ demoId: 'center',
+ name: {
+ 'zh-CN': '文字居中',
+ 'en-US': 'Center text'
+ },
+ desc: {
'zh-CN': '通过 center
设置文字显示居中。
',
'en-US': 'You can use the center
property to center the text.
'
},
- 'codeFiles': ['center.vue']
+ codeFiles: ['center.vue']
},
{
- 'demoId': 'icon',
- 'name': { 'zh-CN': '自定义警告图标', 'en-US': 'Customized warning icon' },
- 'desc': {
+ demoId: 'icon',
+ name: {
+ 'zh-CN': '自定义警告图标',
+ 'en-US': 'Customized warning icon'
+ },
+ desc: {
'zh-CN':
'通过 icon
设置自定义图标,默认会根据不同的 type
的值自动使用对应图标。
',
'en-US':
'By setting custom icons through icon
, the corresponding icons will be automatically used by default based on different type
values.
'
},
- 'codeFiles': ['icon.vue']
+ codeFiles: ['icon.vue']
},
{
- 'demoId': 'slot-default',
- 'name': { 'zh-CN': '自定义交互操作', 'en-US': 'Customized Interaction' },
- 'desc': {
+ demoId: 'slot-default',
+ name: {
+ 'zh-CN': '自定义交互操作',
+ 'en-US': 'Customized Interaction'
+ },
+ desc: {
'zh-CN': '当 size
为 large
时,通过默认插槽自定义交互操作。
',
'en-US':
'When size
is large
, set the default slot custom interaction operation.
'
},
- 'codeFiles': ['slot-default.vue']
+ codeFiles: ['slot-default.vue']
},
{
- 'demoId': 'show-icon',
- 'name': { 'zh-CN': '是否显示图标', 'en-US': 'Display icon' },
- 'desc': {
+ demoId: 'show-icon',
+ name: {
+ 'zh-CN': '是否显示图标',
+ 'en-US': 'Display icon'
+ },
+ desc: {
'zh-CN': '通过 show-icon
设置左侧图标是否显示。
',
'en-US': 'Set whether the left icon is displayed by show icon
.
'
},
- 'codeFiles': ['show-icon.vue']
+ codeFiles: ['show-icon.vue']
},
{
- 'demoId': 'custom-close',
- 'name': { 'zh-CN': '关闭按钮', 'en-US': 'custom close button' },
- 'desc': {
+ demoId: 'custom-close',
+ name: {
+ 'zh-CN': '关闭按钮',
+ 'en-US': 'custom close button'
+ },
+ desc: {
'zh-CN':
'通过 close-text
设置关闭按钮文本,关闭告警后会触发 close
事件。
通过 closable
设置是否显示关闭按钮,没有关闭按钮,警告框将不可关闭。
通过 close
插槽自定义关闭按钮,仅当 closable
为 false
时插槽有效,可自定义逻辑控制组件的显示、隐藏。
',
'en-US':
'Set the close button text through close text
< Br/>Set whether to display the close button through close
. If there is no close button, the warning box will not be able to be closed< By customizing the close button through the close
slot, the slot is only valid when the close
is false
, and the display and hiding of logic control components can be customized.'
},
- 'codeFiles': ['custom-close.vue']
- }
- ],
- apis: [
+ codeFiles: ['custom-close.vue']
+ },
{
- 'name': 'alert',
- 'type': 'component',
- 'props': [
- {
- 'name': 'center',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '文字是否居中',
- 'en-US': 'Whether the text is centered'
- },
- 'demoId': 'center'
- },
- {
- 'name': 'closable',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '警告是否可以关闭',
- 'en-US': 'Set whether alarms can be disabled.'
- },
- 'demoId': 'custom-close'
- },
- {
- 'name': 'close-text',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '关闭按钮自定义文本',
- 'en-US': 'Customized text of the close button'
- },
- 'demoId': 'custom-close'
- },
- {
- 'name': 'description',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '警告的提示内容',
- 'en-US': 'Set the warning prompt content'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'icon',
- 'type': 'Component',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '传入图标组件自定义警告的图标,默认会根据 type 值自动使用对应图标',
- 'en-US':
- 'The icon for the custom warning of the incoming icon component will be automatically used based on the type value by default'
- },
- 'demoId': 'icon'
- },
- {
- 'name': 'show-icon',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否显示图标',
- 'en-US': 'Display icon'
- },
- 'demoId': 'show-icon'
- },
- {
- 'name': 'size',
- 'type': "'normal' | 'large'",
- 'defaultValue': "'normal'",
- 'desc': {
- 'zh-CN': '警告的尺寸大小',
- 'en-US': 'Set the size of the warning'
- },
- 'demoId': 'size'
- },
- {
- 'name': 'title',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '警告的标题,在 size 为 large 时有效,默认会根据 type 自动设置',
- 'en-US':
- 'Set the warning title. This parameter is valid only when size is set to large. By default, the alarm title is automatically set based on type.'
- },
- 'demoId': 'title'
- },
- {
- 'name': 'type',
- 'type': 'IType',
- 'typeAnchorName': 'IType',
- 'defaultValue': "'info'",
- 'desc': {
- 'zh-CN': '警告的类型',
- 'en-US': 'Set the alarm type'
- },
- 'demoId': 'basic-usage'
- }
- ],
- 'events': [
- {
- 'name': 'close',
- 'type': '() => void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '关闭 alert 时触发的事件',
- 'en-US': 'Event triggered when the alert function is disabled'
- },
- 'demoId': 'custom-close'
- }
- ],
- 'slots': [
- {
- 'name': 'close',
- 'type': '',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '自定义关闭内容,当 closable 属性为 false 时有效',
- 'en-US': ''
- },
- 'demoId': 'custom-close'
- },
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '组件默认插槽,当 size 设置为 large 后有效',
- 'en-US': 'The default slot for the component is valid when size is set to large'
- },
- 'demoId': 'slot-default'
- },
- {
- 'name': 'description',
- 'type': '',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '提示内容',
- 'en-US': 'Prompt Content'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'title',
- 'type': '',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '标题的内容,当 size 设置为 large 后有效',
- 'en-US': 'The content of the title is valid when size is set to large'
- },
- 'demoId': 'title'
- }
- ]
- }
- ],
- types: [
- {
- name: 'IType',
- type: 'type',
- code: `
-type IType = 'success' | 'warning' | 'info' | 'error' | 'simple'
-`
+ demoId: 'custom-class',
+ name: {
+ 'zh-CN': '自定义类名',
+ 'en-US': 'custom close button'
+ },
+ desc: {
+ 'zh-CN': '通过 custom-class
设置自定义类名。
',
+ 'en-US': 'Set the user-defined class name through custom-class
.'
+ },
+ codeFiles: ['custom-class.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/amount/webdoc/amount.js b/examples/sites/demos/pc/app/amount/webdoc/amount.js
index 2abf5e54e..40826f5b8 100644
--- a/examples/sites/demos/pc/app/amount/webdoc/amount.js
+++ b/examples/sites/demos/pc/app/amount/webdoc/amount.js
@@ -3,236 +3,96 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example ' },
- 'codeFiles': ['basic-usage.vue']
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example '
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'set-date',
- 'name': { 'zh-CN': '设置日期', 'en-US': 'Set Date' },
- 'desc': {
+ demoId: 'set-date',
+ name: {
+ 'zh-CN': '设置日期',
+ 'en-US': 'Set Date'
+ },
+ desc: {
'zh-CN':
'通过 date
属性设置日期后,将会在金额组件中显示日期框。值可设置为 string 或者 Date() 类型。\n通过 change
获取改变后的值。
\n',
'en-US':
'After the date is set through the date
attribute, the date box is displayed in the amount component. The value can be of the string or Date() type. \n Obtain the changed value through change
.
\n'
},
- 'codeFiles': ['set-date.vue']
+ codeFiles: ['set-date.vue']
},
{
- 'demoId': 'size',
- 'name': { 'zh-CN': '编辑框大小', 'en-US': 'editing box size' },
- 'desc': {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '编辑框大小',
+ 'en-US': 'editing box size'
+ },
+ desc: {
'zh-CN': '可选择的类型:medium
,small
,mini
\n',
'en-US': 'The options are as follows:medium
,small
, mini
\n'
},
- 'codeFiles': ['size.vue']
+ codeFiles: ['size.vue']
},
{
- 'demoId': 'custom-currency',
- 'name': { 'zh-CN': '指定币种', 'en-US': 'Specified Currency' },
- 'desc': {
+ demoId: 'custom-currency',
+ name: {
+ 'zh-CN': '指定币种',
+ 'en-US': 'Specified Currency'
+ },
+ desc: {
'zh-CN':
'默认显示币种为 CNY,可通过 currency
指定需要的币种,若指定的币种在返回的服务数据中不存在,则币种下拉框将不显示该币种。
\n',
'en-US':
'The default currency is CNY. You can use currency
to specify the currency. If the specified currency does not exist in the returned service data, the currency is not displayed in the Currency drop-down list box.
\n'
},
- 'codeFiles': ['custom-currency.vue']
+ codeFiles: ['custom-currency.vue']
},
{
- 'demoId': 'digits-maxlen',
- 'name': { 'zh-CN': '金额设置', 'en-US': 'Amount Setting' },
- 'desc': {
+ demoId: 'digits-maxlen',
+ name: {
+ 'zh-CN': '金额设置',
+ 'en-US': 'Amount Setting'
+ },
+ desc: {
'zh-CN':
'设置 digits
属性可指定金额小数位数,默认为 2 位。设置 max-len
属性指定整数位最大可输入长度,默认为 15 位。
\n',
'en-US':
'Set the digits
attribute to specify the number of decimal places of the amount. The default value is 2. Set the max-len
attribute to specify the maximum length of an integer. The default value is 15.
\n'
},
- 'codeFiles': ['digits-maxlen.vue']
+ codeFiles: ['digits-maxlen.vue']
},
{
- 'demoId': 'custom-service',
- 'name': { 'zh-CN': '自定义服务', 'en-US': 'Custom Service ' },
- 'desc': {
+ demoId: 'custom-service',
+ name: {
+ 'zh-CN': '自定义服务',
+ 'en-US': 'Custom Service '
+ },
+ desc: {
'zh-CN':
'fetchCurrency
指定自定义服务,fields
可指定显示字段和值设置在服务数据中的字段映射。
\n',
'en-US':
'fetchCurrency
specifies the custom service. fields
can specify the field mapping of the display field and value settings in the service data.
\n'
},
- 'codeFiles': ['custom-service.vue']
+ codeFiles: ['custom-service.vue']
},
{
- 'demoId': 'amount-disable',
- 'name': { 'zh-CN': '禁用', 'en-US': 'Disable' },
- 'desc': {
+ demoId: 'amount-disable',
+ name: {
+ 'zh-CN': '禁用',
+ 'en-US': 'Disable'
+ },
+ desc: {
'zh-CN': '通过 disabled
配置 Amount 组件禁用。
\n',
'en-US': 'You can disable the Amount component by using disabled
.
\n'
},
- 'codeFiles': ['amount-disable.vue']
- }
- ],
- apis: [
- {
- 'name': 'amount',
- 'type': 'component',
- 'props': [
- {
- 'name': 'placeholder',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '当数据为空时的占位符', 'en-US': 'Placeholder when data is empty' },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'size',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置组件大小', 'en-US': 'Set the component size' },
- 'demoId': 'size'
- },
- {
- 'name': 'format',
- 'type': 'object',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- "数字格式化置项,可配置如下字段:;{\n fraction: 4, // 保留小数位数\n rounding: 0, // 舍入点,0-9之间的数字,如配置为7时则为6舍7入,默认为5(四舍五入);配置为0或>9将会进行截取\n prefix: '$', // 前置标识\n groupSize: 3, // 整数部分分组间隔,即第一个分组位数\n secondaryGroupSize: 2, // 整数部分第二级分组间隔,不设置或为0时 自动取groupSize\n groupSeparator: ',', // 整数部分分组分隔符\n decimalSeparator: '.', // 小数点符号\n fractionGroupSize: 0, // 小数部分分组间隔\n fractionGroupSeparator: ' ', // 小数分组分隔符\n suffix: '@' // 后置标识\n }",
- 'en-US':
- "Number formatting configuration item. The following fields can be configured:; {\n fraction: 4, //Retain the number of decimal places. \n rounding: 0, //Round the number between 0 and 9. For example, if the value is set to 7, the value is rounded off to 6. The default value is 5 (rounded off). If this parameter is set to 0 or greater than 9, truncation is performed. \n prefix: '$', //Front identifier. \n groupSize: 3, //Integer part grouping interval, that is, the number of bits of the first grouping. \n secondaryGroupSize: 2, //Integer part second-level grouping interval. If this parameter is not set or is set to 0, the value of groupSize is automatically used. \n groupSeparator: ',', //Integer part grouping separator. \n decimalSeparator:' ', / / Decimal point symbol \n fractionGroupSize: 0, // Decimal part grouping interval \n fractionGroupSeparator: '', / / Decimal grouping separator \n suffix: '@' / / Post identifier \n}"
- },
- 'demoId': ''
- },
- {
- 'name': 'currency',
- 'type': 'string',
- 'defaultValue': '该属性的默认值为 CNY',
- 'desc': { 'zh-CN': '', 'en-US': '' },
- 'demoId': 'custom-currency'
- },
- {
- 'name': 'digits',
- 'type': 'number',
- 'defaultValue': '该属性的默认值为 2',
- 'desc': {
- 'zh-CN': '设置小数点位数,默认为 2 位。',
- 'en-US': 'Set the number of decimal places. The default value is two.'
- },
- 'demoId': 'digits-maxlen'
- },
- {
- 'name': 'date',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置弹出框内显示日期框。值可设置为 string 或者 Date() 类型。',
- 'en-US':
- 'Set the date box to be displayed in the pop-up box. The value can be of the string or Date() type.'
- },
- 'demoId': 'set-date'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 false',
- 'desc': {
- 'zh-CN': '设置是否禁用,默认为 false。',
- 'en-US': 'Whether to disable the function. The default value is false.'
- },
- 'demoId': 'amount-disable'
- },
- {
- 'name': 'max-len',
- 'type': 'number',
- 'defaultValue': '该属性的默认值为 15',
- 'desc': {
- 'zh-CN': '整数位最大长度,默认为 15 位。',
- 'en-US': 'Maximum integer length. The default value is 15 characters.'
- },
- 'demoId': 'digits-maxlen'
- },
- {
- 'name': 'negative',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '是否可为负数,默认为 true ,可设为负数。',
- 'en-US':
- 'Indicates whether the value can be a negative number. The default value is true. The value can be a negative number.'
- },
- 'demoId': ''
- },
- {
- 'name': 'popper-class',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '为 popper 添加类名(可参考 popover 组件)',
- 'en-US': 'Add a class name for the popper. For details, see the popover component.'
- },
- 'demoId': ''
- },
- {
- 'name': 'popper-append-to-body',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 true',
- 'desc': {
- 'zh-CN':
- '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)',
- 'en-US':
- 'Indicates whether to insert the pop-up box to the body element. When a fault occurs in the dialog box that is displayed, you can set this attribute to false (for details, see the select component).'
- },
- 'demoId': ''
- },
- {
- 'name': 'value',
- 'type': 'string , number',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置金额组件的值。', 'en-US': 'Set the value of the amount component.' },
- 'demoId': 'digits-maxlen'
- },
- {
- 'name': 'rounding',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '控制输入金额四舍五入。', 'en-US': 'Controls the rounding of the input amount.' },
- 'demoId': 'digits-maxlen'
- },
- {
- 'name': 'fetchCurrency',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义金额组件的请求服务接口,fetchCurrency返回一个Promise对象 ',
- 'en-US':
- 'Request service interface of the customized amount component. fetchCurrency returns a Promise object.'
- },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'fields',
- 'type': 'object',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义金额组件数据映射,在没有使用框架服务时必填',
- 'en-US':
- 'Customized amount component data mapping. This parameter is mandatory when the framework service is not used.'
- },
- 'demoId': 'custom-service'
- }
- ],
- 'events': [
- {
- 'name': 'change',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当组件的值发生变化时会触发该事件。',
- 'en-US': 'This event is triggered when the value of a component changes.'
- },
- 'demoId': 'set-date'
- }
- ],
- 'slots': []
+ codeFiles: ['amount-disable.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/anchor/webdoc/anchor.js b/examples/sites/demos/pc/app/anchor/webdoc/anchor.js
index 7cbb56fb3..8bc400115 100644
--- a/examples/sites/demos/pc/app/anchor/webdoc/anchor.js
+++ b/examples/sites/demos/pc/app/anchor/webdoc/anchor.js
@@ -3,147 +3,54 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '通过 links
设置导航数据, type
设置类型。',
'en-US': 'Set navigation data through links
, and type
to set the type.'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'is-affix',
- 'name': { 'zh-CN': '固定模式', 'en-US': 'Fixed mode' },
- 'desc': {
+ demoId: 'is-affix',
+ name: {
+ 'zh-CN': '固定模式',
+ 'en-US': 'Fixed mode'
+ },
+ desc: {
'zh-CN': '通过 is-affix
设置固定定位,不随页面滚动。',
'en-US': 'Set fixed positioning through is-affix
, without scrolling with the page.'
},
- 'codeFiles': ['is-affix.vue']
+ codeFiles: ['is-affix.vue']
},
{
- 'demoId': 'set-container',
- 'name': { 'zh-CN': '滚动容器', 'en-US': 'Rolling Container' },
- 'desc': {
- 'zh-CN': `通过 container-id
设置滚动容器, link-click
监听锚点点击事件,阻止浏览器默认行为,实现单页面 hash
路由模式的页内跳转,在指定容器内滚动。
- mark-class
设置自定义类名,高亮显示导航的目标元素。`,
- 'en-US': `By setting the scrolling container through container-id
, link-click
listens for anchor click events, prevents browser default behavior, and implements single page hash
routing mode for page hopping, scrolling within the specified container
- mark-class
Set a custom class name to highlight the target element for navigation.`
+ demoId: 'set-container',
+ name: {
+ 'zh-CN': '滚动容器',
+ 'en-US': 'Rolling Container'
},
- 'codeFiles': ['set-container.vue']
+ desc: {
+ 'zh-CN':
+ '通过 container-id
设置滚动容器, link-click
监听锚点点击事件,阻止浏览器默认行为,实现单页面 hash
路由模式的页内跳转,在指定容器内滚动。
\n mark-class
设置自定义类名,高亮显示导航的目标元素。',
+ 'en-US':
+ 'By setting the scrolling container through container-id
, link-click
listens for anchor click events, prevents browser default behavior, and implements single page hash
routing mode for page hopping, scrolling within the specified container
\n mark-class
Set a custom class name to highlight the target element for navigation.'
+ },
+ codeFiles: ['set-container.vue']
},
{
- 'demoId': 'change',
- 'name': { 'zh-CN': 'change事件', 'en-US': 'change event' },
- 'desc': {
+ demoId: 'change',
+ name: {
+ 'zh-CN': 'change事件',
+ 'en-US': 'change event'
+ },
+ desc: {
'zh-CN': '通过 change
监听锚点改变的事件。',
'en-US': ' change
event. Callback is triggered when the anchor link changes.'
},
- 'codeFiles': ['change.vue']
- }
- ],
- apis: [
- {
- 'name': 'anchor',
- 'type': 'component',
- 'props': [
- {
- 'name': 'container-id',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '用于单页面 hash 路由模式时指定滚动容器的 id 值,id 为空时则滚动容器默认为 HTML 文档的根节点 body 元素',
- 'en-US':
- 'When used in single page hash routing mode, specify the id value of the scrolling container. If the id is empty, the scrolling container defaults to the body element of the root node of the HTML document'
- },
- 'demoId': 'set-container'
- },
- {
- 'name': 'is-affix',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '固定模式', 'en-US': 'Fixed mode' },
- 'demoId': 'is-affix'
- },
- {
- 'name': 'links',
- 'type': 'ILink[]',
- 'typeAnchorName': 'ILink',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '导航数据配置项,可通过 children 嵌套',
- 'en-US': 'Navigation data configuration items can be nested through children'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'mark-class',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义滚动的目标元素类名',
- 'en-US': 'Class name of the customized scrolling target element'
- },
- 'demoId': 'set-container'
- },
- {
- 'name': 'type',
- 'type': `'line' | 'dot'`,
- 'defaultValue': `'line'`,
- 'desc': {
- 'zh-CN': '锚点类型',
- 'en-US': 'Anchor type'
- },
- 'demoId': 'basic-usage'
- }
- ],
- 'events': [
- {
- 'name': 'change',
- 'type': '(hash: string) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '锚点链接改变事件',
- 'en-US': 'Anchor link change event'
- },
- 'demoId': 'change'
- },
- {
- 'name': 'on-change',
- 'type': '(hash: string) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '使用 change 代替;[deprecated v3.12.0 废弃,v3.17.0 移除;移除原因:命名规范]',
- 'en-US':
- 'use change instead [deprecated v3.12.0 abandoned, v3.17.0 removed; reason for removal: naming convention]'
- },
- 'demoId': 'change'
- },
- {
- 'name': 'link-click',
- 'type': '(event: Event, currentLink: {link: string, title: string}) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '锚点点击事件',
- 'en-US': 'Anchor click event'
- },
- 'demoId': 'set-container'
- }
- ],
- 'slots': []
- }
- ],
- types: [
- {
- name: 'ILink',
- type: 'interface',
- code: `
-interface ILink {
- key: string // 锚点的key值
- link: string // 导航的hash值
- title: string // 锚点标题
- children: ILink[] // 子锚点
-}`
+ codeFiles: ['change.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/area/area-events-composition-api.vue b/examples/sites/demos/pc/app/area/area-events-composition-api.vue
index 55149c3c8..e0f331b10 100644
--- a/examples/sites/demos/pc/app/area/area-events-composition-api.vue
+++ b/examples/sites/demos/pc/app/area/area-events-composition-api.vue
@@ -8,7 +8,7 @@
>
-
+
+
diff --git a/examples/sites/demos/pc/app/autocomplete/display-only.vue b/examples/sites/demos/pc/app/autocomplete/display-only.vue
new file mode 100644
index 000000000..4d59badd3
--- /dev/null
+++ b/examples/sites/demos/pc/app/autocomplete/display-only.vue
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/autocomplete/hide-loading.spec.ts b/examples/sites/demos/pc/app/autocomplete/hide-loading.spec.ts
index 30259f202..fffb9c154 100644
--- a/examples/sites/demos/pc/app/autocomplete/hide-loading.spec.ts
+++ b/examples/sites/demos/pc/app/autocomplete/hide-loading.spec.ts
@@ -4,7 +4,9 @@ test('hide-loading', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('autocomplete#hide-loading')
await page.getByPlaceholder('请输入内容', { exact: true }).nth(1).click()
- await expect(page.getByRole('listitem').getByRole('img')).toBeVisible()
+ await expect(page.getByRole('listitem').locator('.tiny-svg')).toBeVisible()
+ await page.getByPlaceholder('请输入内容', { exact: true }).nth(1).blur()
+
await page.getByPlaceholder('请输入内容', { exact: true }).nth(2).click()
- await expect(page.getByRole('listitem').getByRole('img')).not.toBeVisible()
+ await expect(page.getByRole('listitem').locator('.tiny-svg')).not.toBeVisible()
})
diff --git a/examples/sites/demos/pc/app/autocomplete/webdoc/autocomplete.js b/examples/sites/demos/pc/app/autocomplete/webdoc/autocomplete.js
index 615e6cb75..bdfc9a5b9 100644
--- a/examples/sites/demos/pc/app/autocomplete/webdoc/autocomplete.js
+++ b/examples/sites/demos/pc/app/autocomplete/webdoc/autocomplete.js
@@ -3,406 +3,212 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基础用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基础用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '通过设置 fetch-suggestions
方法设置输入建议。
',
'en-US': ' Set input suggestions by setting the fetch-suggestions
method.'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'disabled',
- 'name': { 'zh-CN': '禁用', 'en-US': 'Disabled' },
- 'desc': {
+ demoId: 'disabled',
+ name: {
+ 'zh-CN': '禁用',
+ 'en-US': 'Disabled'
+ },
+ desc: {
'zh-CN': '
通过 disabled
属性可以设置为禁用状态。
\n',
'en-US': 'The disabled
attribute can be set to the disabled state.
\n'
},
- 'codeFiles': ['disabled.vue']
+ codeFiles: ['disabled.vue']
},
{
- 'demoId': 'size',
- 'name': { 'zh-CN': '输入框大小', 'en-US': 'Text box size' },
- 'desc': {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '输入框大小',
+ 'en-US': 'Text box size'
+ },
+ desc: {
'zh-CN': '可选择值为medium
,small
,mini
。
',
'en-US': 'The value can be medium
, small
, or mini
.
'
},
- 'codeFiles': ['size.vue']
+ codeFiles: ['size.vue']
},
{
- 'demoId': 'clearable',
- 'name': { 'zh-CN': '可清除', 'en-US': 'Can be cleared' },
- 'desc': {
+ demoId: 'clearable',
+ name: {
+ 'zh-CN': '可清除',
+ 'en-US': 'Can be cleared'
+ },
+ desc: {
'zh-CN': '配置 clearable
属性后,输入内容后会显示清除图标,单击可以清除输入框内容。
\n',
'en-US':
'After the clearable
attribute is configured, the clear icon is displayed after you enter content. You can click to clear the content in the text box.
\n'
},
- 'codeFiles': ['clearable.vue']
+ codeFiles: ['clearable.vue']
},
{
- 'demoId': 'slot',
- 'name': { 'zh-CN': '插槽', 'en-US': 'slot' },
- 'desc': {
+ demoId: 'slot',
+ name: {
+ 'zh-CN': '插槽',
+ 'en-US': 'slot'
+ },
+ desc: {
'zh-CN':
'分别配置 prepend
、append
、prefix
、suffix
、default
插槽。
',
'en-US':
'Configure prepend
, append
, prefix
, default
, and suffix
slots.
'
},
- 'codeFiles': ['slot.vue']
+ codeFiles: ['slot.vue']
},
{
- 'demoId': 'custom-icon',
- 'name': { 'zh-CN': '图标', 'en-US': 'Icon' },
- 'desc': {
+ demoId: 'custom-icon',
+ name: {
+ 'zh-CN': '图标',
+ 'en-US': 'Icon'
+ },
+ desc: {
'zh-CN':
'配置 prefix-icon
和 suffix-icon
属性可分别自定义输入框前后置图标。
\n',
'en-US':
'Configure the prefix-icon
and suffix-icon
attributes to customize the icons before and after the text box.
\n'
},
- 'codeFiles': ['custom-icon.vue']
+ codeFiles: ['custom-icon.vue']
},
{
- 'demoId': 'debounce',
- 'name': { 'zh-CN': '去抖延时', 'en-US': 'Debounce Delay' },
- 'desc': {
+ demoId: 'debounce',
+ name: {
+ 'zh-CN': '去抖延时',
+ 'en-US': 'Debounce Delay'
+ },
+ desc: {
'zh-CN': '通过 debounce
属性可以设置获取输入建议的去抖延时,默认值为 300 毫秒。
\n',
'en-US':
'You can set the dejitter delay for obtaining input suggestions through the debounce
attribute. The default value is 300 ms.
\n'
},
- 'codeFiles': ['debounce.vue']
+ codeFiles: ['debounce.vue']
},
{
- 'demoId': 'hide-loading',
- 'name': { 'zh-CN': '加载图标', 'en-US': 'Loading Icon' },
- 'desc': {
+ demoId: 'hide-loading',
+ name: {
+ 'zh-CN': '加载图标',
+ 'en-US': 'Loading Icon'
+ },
+ desc: {
'zh-CN': '设置 hide-loading
属性为 true ,可以隐藏加载图标。
\n',
'en-US': 'Set hide-loading
to true to hide the loading icon.
\n'
},
- 'codeFiles': ['hide-loading.vue']
+ codeFiles: ['hide-loading.vue']
},
{
- 'demoId': 'remote-search',
- 'name': { 'zh-CN': '远程搜索', 'en-US': 'Remote Search' },
- 'desc': {
+ demoId: 'display-only',
+ name: {
+ 'zh-CN': '只读',
+ 'en-US': 'Display Only'
+ },
+ desc: {
+ 'zh-CN': '通过 display-only
属性添加只读状态
',
+ 'en-US': ' Add read-only status via the display-only attribute
'
+ },
+ codeFiles: ['display-only.vue']
+ },
+ {
+ demoId: 'remote-search',
+ name: {
+ 'zh-CN': '远程搜索',
+ 'en-US': 'Remote Search'
+ },
+ desc: {
'zh-CN': '通过 fetch-suggestions
属性设置远程搜索。
\n',
'en-US': 'Set the remote search through the fetch-suggestions
attribute.
\n'
},
- 'codeFiles': ['remote-search.vue']
+ codeFiles: ['remote-search.vue']
},
{
- 'demoId': 'value-key',
- 'name': { 'zh-CN': '显示的键名', 'en-US': 'Key Name to be displayed.' },
- 'desc': {
+ demoId: 'value-key',
+ name: {
+ 'zh-CN': '显示的键名',
+ 'en-US': 'Key Name to be displayed.'
+ },
+ desc: {
'zh-CN':
'输入内容后,建议列表中默认显示输入建议对象中 value 键名对应的值,若对象中没有 value 键名,就可以通过 value-key
属性指定显示的键名。
\n',
'en-US':
'After you enter content, the value corresponding to the value key name of the input object is displayed in the suggestion list by default. If the object does not have a value key name, you can specify the key name by using the value-key
attribute.
\n'
},
- 'codeFiles': ['value-key.vue']
+ codeFiles: ['value-key.vue']
},
{
- 'demoId': 'popper-class',
- 'name': { 'zh-CN': '列表样式', 'en-US': 'List Style' },
- 'desc': {
+ demoId: 'popper-class',
+ name: {
+ 'zh-CN': '列表样式',
+ 'en-US': 'List Style'
+ },
+ desc: {
'zh-CN':
'popper-class
属性可指定一个样式类名,可自定义建议列表的样式。\npopper-append-to-body
属性可设置是否将下拉列表插入至 body 元素。在下拉列表的定位出现问题时,可将该属性设置为 false。
\n',
'en-US':
'popper-class
property specifies a style class name to customize the style of the suggestion list. The \npopper-append-to-body
property sets whether the drop-down list is inserted into the body element. You can set this property to false when a problem occurs in locating the drop-down list.
\n'
},
- 'codeFiles': ['popper-class.vue']
+ codeFiles: ['popper-class.vue']
},
{
- 'demoId': 'placement',
- 'name': { 'zh-CN': '菜单弹出位置', 'en-US': 'Menu Pop-up Position' },
- 'desc': {
+ demoId: 'placement',
+ name: {
+ 'zh-CN': '菜单弹出位置',
+ 'en-US': 'Menu Pop-up Position'
+ },
+ desc: {
'zh-CN': 'placement
属性可以设置菜单弹出位置,默认为 bottom-start
。
\n',
'en-US':
'placement
property can be used to set the menu pop-up position. The default value is bottom-start
.
\n'
},
- 'codeFiles': ['placement.vue']
+ codeFiles: ['placement.vue']
},
{
- 'demoId': 'highlight-first-item',
- 'name': { 'zh-CN': '第一项高亮', 'en-US': 'Highlight the first item' },
- 'desc': {
+ demoId: 'highlight-first-item',
+ name: {
+ 'zh-CN': '第一项高亮',
+ 'en-US': 'Highlight the first item'
+ },
+ desc: {
'zh-CN': '设置 highlight-first-item
属性为 true ,可以突出显示远程搜索建议中的第一项。
\n',
'en-US':
'Set the highlight-first-item
attribute to true to highlight the first item in the remote search suggestion.
\n'
},
- 'codeFiles': ['highlight-first-item.vue']
+ codeFiles: ['highlight-first-item.vue']
},
{
- 'demoId': 'no-trigger-on-focus',
- 'name': { 'zh-CN': '触发', 'en-US': 'Trigger' },
- 'desc': {
+ demoId: 'no-trigger-on-focus',
+ name: {
+ 'zh-CN': '触发',
+ 'en-US': 'Trigger'
+ },
+ desc: {
'zh-CN':
'默认输入框聚焦就会显示全部的建议列表,但设置 trigger-on-focus
属性为 false 后只有在匹配到输入建议后才会显示匹配到的建议列表。
\n',
'en-US':
' By default, all suggestions are displayed when the input box is focused. However, if trigger-on-focus
is set to false, the list of matched suggestions is displayed only after the input suggestions are matched.
\n'
},
- 'codeFiles': ['no-trigger-on-focus.vue']
+ codeFiles: ['no-trigger-on-focus.vue']
},
{
- 'demoId': 'select-event',
- 'name': { 'zh-CN': '事件', 'en-US': 'Event' },
- 'desc': {
+ demoId: 'select-event',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': 'Event'
+ },
+ desc: {
'zh-CN':
'Autocomplete 组件提供 select
事件,点击选中建议项时触发,回调参数为选中建议项。\n通过 select-when-unmatched
设置在输入联想没有匹配值时,按 Enter 键时是否触发 select 事件,默认值为 false。
\n',
'en-US':
'Autocomplete provides the select
event, which is triggered when a suggestion item is selected. The callback parameter is the suggestion item selected. \n Use select-when-unmatched
to set whether to trigger the select event when you press Enter when no matching value is entered. The default value is false.
\n'
},
- 'codeFiles': ['select-event.vue']
- }
- ],
- apis: [
- {
- 'name': 'autocomplete',
- 'type': 'component',
- 'props': [
- {
- 'name': 'clearable',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否可清空', 'en-US': 'Whether to clear data' },
- 'demoId': 'clearable'
- },
- {
- 'name': 'placeholder',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '输入框占位文本', 'en-US': 'Placeholder text in the text box' },
- 'demoId': 'hide-loading'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '是否禁用', 'en-US': 'Whether to disabled' },
- 'demoId': 'disabled'
- },
- {
- 'name': 'value-key',
- 'type': 'string',
- 'defaultValue': `'value'`,
- 'desc': {
- 'zh-CN': '在输入建议对象中,用于显示和匹配输入的键名',
- 'en-US': 'In the Input Suggestion object, key names for displaying and matching inputs'
- },
- 'demoId': 'value-key'
- },
- {
- 'name': 'v-model',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '必填值,输入绑定值', 'en-US': 'This parameter is mandatory. Enter a bound value.' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'debounce',
- 'type': 'number',
- 'defaultValue': '300',
- 'desc': { 'zh-CN': '获取输入建议的去抖延时', 'en-US': 'Obtain the recommended input dejitter delay.' },
- 'demoId': 'debounce'
- },
- {
- 'name': 'placement',
- 'typeAnchorName': 'IAutocompletePlacement',
- 'type': 'IAutocompletePlacement',
- 'defaultValue': `'bottom-start'`,
- 'desc': {
- 'zh-CN': '菜单弹出位置',
- 'en-US': 'Menu pop-up position'
- },
- 'demoId': 'placement'
- },
- {
- 'name': 'popper-class',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '下拉列表的类名',
- 'en-US': 'Class name of the Autocomplete drop-down list box'
- },
- 'demoId': 'popper-class'
- },
- {
- 'name': 'size',
- 'type': `'medium' | 'small' | 'mini'`,
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置组件大小',
- 'en-US': 'Set the component size.'
- },
- 'demoId': 'size'
- },
- {
- 'name': 'trigger-on-focus',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否在输入框 focus 时显示建议列表',
- 'en-US': 'Whether to display the suggestion list when the text box is focused'
- },
- 'demoId': 'no-trigger-on-focus'
- },
- {
- 'name': 'name',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': 'input 元素的原生属性', 'en-US': 'Native attributes of the input element' }
- },
- {
- 'name': 'select-when-unmatched',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '在输入没有任何匹配建议的情况下,按下回车是否触发 select 事件',
- 'en-US':
- 'Indicates whether to trigger the select event when pressing Enter when the input does not have any matching suggestions.'
- },
- 'demoId': 'select-event'
- },
- {
- 'name': 'label',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '等价于原生 input aria-label 属性', 'en-US': 'Equiphorus input aria-label attribute' },
- 'demoId': ''
- },
- {
- 'name': 'prefix-icon',
- 'type': 'Component',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '输入框头部图标', 'en-US': 'Icon on the header of the text box' },
- 'demoId': 'custom-icon'
- },
- {
- 'name': 'suffix-icon',
- 'type': 'Component',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '输入框尾部图标', 'en-US': 'Icon at the end of the text box' },
- 'demoId': 'custom-icon'
- },
- {
- 'name': 'hide-loading',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否隐藏远程加载时的加载图标',
- 'en-US': 'Whether to hide the loading icon during remote loading'
- },
- 'demoId': 'hide-loading'
- },
- {
- 'name': 'popper-append-to-body',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否将下拉列表插入至 body 元素。在下拉列表的定位出现问题时,可将该属性设置为 false',
- 'en-US':
- 'Indicates whether to insert the drop-down list into the body element. When a fault occurs in locating the drop-down list, you can set this attribute to false'
- },
- 'demoId': 'popper-class'
- },
- {
- 'name': 'fetch-suggestions',
- 'typeAnchorName': 'IAutocompleteFetchSuggestions',
- 'type': 'IAutocompleteFetchSuggestions',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '返回输入建议的方法,仅当你的输入建议数据 resolve 时,通过调用 callback 来返回它',
- 'en-US':
- 'This method is used to return input suggestions. It is returned by calling callback only when your input suggestions are resolved.'
- },
- 'demoId': 'remote-search'
- },
- {
- 'name': 'highlight-first-item',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否默认突出显示远程搜索建议中的第一项',
- 'en-US': 'Whether to highlight the first item in remote search suggestions by default'
- },
- 'demoId': 'highlight-first-item'
- }
- ],
- 'events': [
- {
- 'name': 'select',
- 'type': '(selection: IAutocompleteSuggestionItem) => void',
- 'typeAnchorName': 'IAutocompleteSuggestionItem',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点击选中建议项时触发,回调参数为 fetch-suggestions 中传入的项',
- 'en-US':
- 'Triggered when you click to select a suggestion item. The callback parameter is the item passed in fetch-suggestions'
- },
- 'demoId': 'select-event'
- }
- ],
- 'slots': [
- {
- 'name': 'prefix',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '输入框头部内容', 'en-US': 'Content in the text box header' },
- 'demoId': 'slot'
- },
- {
- 'name': 'suffix',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '输入框尾部内容', 'en-US': 'Content at the end of the text box' },
- 'demoId': 'slot'
- },
- {
- 'name': 'prepend',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '输入框前置内容', 'en-US': 'Pre-content in the text box' },
- 'demoId': 'slot'
- },
- {
- 'name': 'append',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '输入框后置内容', 'en-US': 'Content after the text box' },
- 'demoId': 'slot'
- },
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '下拉列表项插槽,插槽参数: arg: { slotScope: IAutocompleteSuggestionItem }, 其中 slotScope 是 fetch-suggestions 中传入的项',
- 'en-US':
- 'Drop-down list item slot, slot parameter: arg: { slotScope: IAutocompleteSuggestionItem }, where slotScope is the item passed in fetch-suggestions'
- },
- 'demoId': 'slot'
- }
- ]
- }
- ],
- types: [
- {
- name: 'IAutocompleteSuggestionItem',
- type: 'type',
- code: `interface IAutocompleteSuggestionItem {
- [key: string]: string | undefined
- value?: string
-}`
- },
- {
- name: 'IAutocompletePlacement',
- type: 'type',
- code: `type IAutocompletePlacement = "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end"`
- },
- {
- name: 'IAutocompleteFetchSuggestions',
- type: 'type',
- code: 'type IAutocompleteFetchSuggestions = (queryString: string, callback: (suggestions: IAutocompleteSuggestionItem[]) => void) => void'
+ codeFiles: ['select-event.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/badge/offset-composition-api.vue b/examples/sites/demos/pc/app/badge/offset-composition-api.vue
index 3385b2e95..a695a54dd 100644
--- a/examples/sites/demos/pc/app/badge/offset-composition-api.vue
+++ b/examples/sites/demos/pc/app/badge/offset-composition-api.vue
@@ -1,8 +1,10 @@
- 使用字符串:
- 我的待办
- 使用数字:
- 我的待办
+
+ 使用字符串:
+ 我的待办
+ 使用数字:
+ 我的待办
+
diff --git a/examples/sites/demos/pc/app/breadcrumb/size.spec.ts b/examples/sites/demos/pc/app/breadcrumb/size.spec.ts
new file mode 100644
index 000000000..aa20d12e5
--- /dev/null
+++ b/examples/sites/demos/pc/app/breadcrumb/size.spec.ts
@@ -0,0 +1,30 @@
+import { test, expect } from '@playwright/test'
+
+test('Breadcrumb 尺寸设置', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('breadcrumb#size')
+
+ const breadcrumb = page.getByRole('navigation', { name: 'Breadcrumb' })
+ const breadcrumbItem = page.locator('.tiny-breadcrumb__item')
+ const breadcrumbItemMedium = page.locator('.tiny-breadcrumb__item--medium').nth(0)
+ const currentItem = breadcrumbItem.last()
+ const separator = page.locator('.tiny-breadcrumb__separator')
+
+ // 面包屑导航、导航项出现,当前页导航加粗
+ await expect(breadcrumb).toBeVisible()
+ await expect(breadcrumbItem).toHaveCount(3)
+ await expect(currentItem.last().locator('.is-link')).toHaveCSS('font-weight', '700')
+
+ // 尺寸
+ await expect(breadcrumbItemMedium).toBeVisible()
+
+ // 分隔符
+ await expect(separator).toHaveCount(3)
+ await expect(separator.first()).toHaveText(/>/)
+ await expect(separator.last()).toBeHidden()
+
+ // 点击导航项
+ await breadcrumbItem.first().click()
+ await expect(page.locator('.tiny-notify').last()).toBeVisible()
+ await expect(page.locator('.tiny-notify').last()).toHaveText(/"to":{"path":"/)
+})
diff --git a/examples/sites/demos/pc/app/breadcrumb/size.vue b/examples/sites/demos/pc/app/breadcrumb/size.vue
new file mode 100644
index 000000000..002416303
--- /dev/null
+++ b/examples/sites/demos/pc/app/breadcrumb/size.vue
@@ -0,0 +1,40 @@
+
+
+
+
+ 产品
+
+ 软件
+
+
+
+
diff --git a/examples/sites/demos/pc/app/breadcrumb/webdoc/breadcrumb.js b/examples/sites/demos/pc/app/breadcrumb/webdoc/breadcrumb.js
index 4543224af..59cfc97f2 100644
--- a/examples/sites/demos/pc/app/breadcrumb/webdoc/breadcrumb.js
+++ b/examples/sites/demos/pc/app/breadcrumb/webdoc/breadcrumb.js
@@ -3,192 +3,72 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'base',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
- 'zh-CN': `Breadcrumb
:通过 select
监听面包屑选中事件。
- BreadcrumbItem
:通过 to
设置选项路由跳转对象,label
设置选项名称,select
监听选项选中事件。`,
- 'en-US': `Breadcrumb
: Listen for breadcrumb selection events throughselect
;
- BreadcrumbItem
: Route the jump object through the to
setting option,
setting option name,select
listening for option selection events.`
+ demoId: 'base',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
},
- 'codeFiles': ['base.vue']
+ desc: {
+ 'zh-CN':
+ 'Breadcrumb
:通过 select
监听面包屑选中事件。
\n BreadcrumbItem
:通过 to
设置选项路由跳转对象,label
设置选项名称,select
监听选项选中事件。',
+ 'en-US':
+ 'Breadcrumb
: Listen for breadcrumb selection events throughselect
;
\n BreadcrumbItem
: Route the jump object through the to
setting option,
setting option name,select
listening for option selection events.'
+ },
+ codeFiles: ['base.vue']
},
{
- 'demoId': 'slot-default',
- 'name': { 'zh-CN': '定义节点', 'en-US': 'Custom Node' },
- 'desc': {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '尺寸设置',
+ 'en-US': 'size'
+ },
+ desc: {
+ 'zh-CN': '通过 size
自定义尺寸,仅支持 medium
尺寸。',
+ 'en-US':
+ 'Set the size
attribute and customize the size. Only the medium
size is supported..'
+ },
+ codeFiles: ['size.vue']
+ },
+ {
+ demoId: 'slot-default',
+ name: {
+ 'zh-CN': '定义节点',
+ 'en-US': 'Custom Node'
+ },
+ desc: {
'zh-CN':
'BreadcrumbItem
:通过默认插槽自定义节点内容;replace
设置不向浏览器历史添加新记录。',
'en-US':
'BreadcrumbItem
: Customize node content through default slots< Code>replaceSet not to add new records to browser history.'
},
- 'codeFiles': ['slot-default.vue']
+ codeFiles: ['slot-default.vue']
},
{
- 'demoId': 'separator',
- 'name': { 'zh-CN': '定义分隔符', 'en-US': 'Custom separator' },
- 'desc': {
+ demoId: 'separator',
+ name: {
+ 'zh-CN': '定义分隔符',
+ 'en-US': 'Custom separator'
+ },
+ desc: {
'zh-CN': 'Breadcrumb
:通过 separator
或 separator-icon
自定义分隔符。',
'en-US':
'Breadcrumb
: Customize the separator throughseparator
orseparator icon
.'
},
- 'codeFiles': ['separator.vue']
+ codeFiles: ['separator.vue']
},
{
- 'demoId': 'options',
- 'name': { 'zh-CN': '配置式', 'en-US': 'Configuration' },
- 'desc': {
+ demoId: 'options',
+ name: {
+ 'zh-CN': '配置式',
+ 'en-US': 'Configuration'
+ },
+ desc: {
'zh-CN':
'通过 options
配置每个 BreadcrumbItem
;text-field
指定显示键值,默认显示键值为 label
。',
'en-US':
'Configure eachBreadcrumbItem
throughoptions
< Code>text fieldspecifies the display key value, and the default display key value islabel
.'
},
- 'codeFiles': ['options.vue']
- }
- ],
- apis: [
- {
- 'name': 'breadcrumb',
- 'type': 'component',
- 'props': [
- {
- 'name': 'options',
- 'type': 'IOptionsItem[]',
- 'typeAnchorName': 'IOptionsItem',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '单独使用 Breadcrumb,通过 option 配置生成面包屑',
- 'en-US': 'Use Breadcrumb alone to generate bread crumbs through option configuration'
- },
- 'demoId': 'options'
- },
- {
- 'name': 'separator',
- 'type': 'string',
- 'defaultValue': '>',
- 'desc': { 'zh-CN': '分隔符', 'en-US': 'Separator' },
- 'demoId': 'separator'
- },
- {
- 'name': 'separator-icon',
- 'type': 'vueComponent',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '图标分隔符', 'en-US': 'Icon separator' },
- 'demoId': 'separator'
- },
- {
- 'name': 'text-field',
- 'type': 'string',
- 'defaultValue': 'label',
- 'desc': {
- 'zh-CN': '指定面包屑的显示键值,结合 options 使用',
- 'en-US': 'Specify the display key value for bread crumbs, used in conjunction with options'
- },
- 'demoId': 'options'
- }
- ],
- 'events': [
- {
- 'name': 'select',
- 'type': '(value: ISelectValue) => void',
- 'typeAnchorName': 'ISelectValue',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点击 BreadcrumbItem 时触发',
- 'en-US': 'This event is triggered when BreadcrumbItem is clicked.'
- },
- 'demoId': 'options'
- }
- ]
- },
- {
- 'name': 'breadcrumb-item',
- 'type': 'component',
- 'props': [
- {
- 'name': 'label',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '定义面包屑的显示文本', 'en-US': 'Define the breadcrumb display text' },
- 'demoId': 'base'
- },
- {
- 'name': 'replace',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '在使用 to 进行路由跳转时,启用 replace 将不会向 浏览器历史记录 history 里添加新记录',
- 'en-US': 'When using to for routing jump, enabling replace will not add new records to the browser history'
- },
- 'demoId': 'slot-default'
- },
- {
- 'name': 'to',
- 'type': 'string | IOptionsItemTo',
- 'typeAnchorName': 'IOptionsItemTo',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '路由跳转对象,同 vue-router 的 to',
- 'en-US': 'Route redirection object, which is the same as to of vue-router'
- },
- 'demoId': 'slot-default'
- }
- ],
- 'events': [
- {
- 'name': 'select',
- 'type': '(value: ISelectValue) => void',
- 'typeAnchorName': 'ISelectValue',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点击 BreadcrumbItem 时触发',
- 'en-US': 'This event is triggered when BreadcrumbItem is clicked.'
- },
- 'demoId': 'base'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '默认插槽', 'en-US': 'Default slot' },
- 'demoId': 'slot-default'
- }
- ]
- }
- ],
- types: [
- {
- name: 'IOptionsItemTo',
- type: 'interface',
- code: `
-interface IOptionsItemTo {
- path: string
-}`
- },
- {
- name: 'IOptionsItem',
- type: 'interface',
- code: `
-interface IOptionsItem {
- label?: string
- to?: IOptionsItemTo
- replace?: boolean
- [customProp: string]: string
-}`
- },
- {
- name: 'ISelectValue',
- type: 'interface',
- code: `
-interface ISelectValue {
- event: Event
- link: HTMLElement
- option: IOptionsItem
- replace: boolean
- to?: IOptionsItemTo
-}`
+ codeFiles: ['options.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/bulletin-board/webdoc/bulletin-board.js b/examples/sites/demos/pc/app/bulletin-board/webdoc/bulletin-board.js
index 92115fe09..cd4475d93 100644
--- a/examples/sites/demos/pc/app/bulletin-board/webdoc/bulletin-board.js
+++ b/examples/sites/demos/pc/app/bulletin-board/webdoc/bulletin-board.js
@@ -3,158 +3,107 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'base',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'base',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN':
'通过 data
设置公告牌公告信息数据,tab-title
属性设置每个公告牌标题。
\n',
'en-US':
'The data
attribute must be set to set the bulletin information data, and the tab-title
attribute must be set to set the title of each bulletin board.
\n'
},
- 'codeFiles': ['base.vue']
+ codeFiles: ['base.vue']
},
{
- 'demoId': 'title',
- 'name': { 'zh-CN': '公告牌标题', 'en-US': 'Billboard Title' },
- 'desc': {
+ demoId: 'title',
+ name: {
+ 'zh-CN': '公告牌标题',
+ 'en-US': 'Billboard Title'
+ },
+ desc: {
'zh-CN': '通过 title
设置公告牌标题。
\n',
'en-US': 'You can use title
to set the bulletin board title.
\n'
},
- 'codeFiles': ['title.vue']
+ codeFiles: ['title.vue']
},
{
- 'demoId': 'active-name',
- 'name': { 'zh-CN': '默认激活的选项卡', 'en-US': 'Default Activated Tab' },
- 'desc': {
+ demoId: 'active-name',
+ name: {
+ 'zh-CN': '默认激活的选项卡',
+ 'en-US': 'Default Activated Tab'
+ },
+ desc: {
'zh-CN': '通过 active-name
设置默认激活的选项卡,从 1
开始计算。
\n',
'en-US':
'You can set the default active tab by active-name
, starting from 1
.
\n'
},
- 'codeFiles': ['active-name.vue']
+ codeFiles: ['active-name.vue']
},
{
- 'demoId': 'tab-title',
- 'name': { 'zh-CN': '选项卡标题', 'en-US': 'Tab Title' },
- 'desc': {
+ demoId: 'tab-title',
+ name: {
+ 'zh-CN': '选项卡标题',
+ 'en-US': 'Tab Title'
+ },
+ desc: {
'zh-CN': '通过 tab-title
设置自定义选项卡标题。
\n',
'en-US': 'You can customize the tab title by using the tab-title
attribute.
\n'
},
- 'codeFiles': ['tab-title.vue']
+ codeFiles: ['tab-title.vue']
},
{
- 'demoId': 'url',
- 'name': { 'zh-CN': '基于Url的跳转', 'en-US': 'URL-based redirection' },
- 'desc': {
+ demoId: 'url',
+ name: {
+ 'zh-CN': '基于Url的跳转',
+ 'en-US': 'URL-based redirection'
+ },
+ desc: {
'zh-CN':
'基于 Url
的跳转是通过数据中的 url
和 target
字段进行设置的。
\n',
'en-US':
'The URL-based redirection is based on the url
and target
fields in the data.
\n'
},
- 'codeFiles': ['url.vue']
+ codeFiles: ['url.vue']
},
{
- 'demoId': 'route',
- 'name': { 'zh-CN': '基于Route的跳转', 'en-US': 'Route-based redirection' },
- 'desc': {
+ demoId: 'route',
+ name: {
+ 'zh-CN': '基于Route的跳转',
+ 'en-US': 'Route-based redirection'
+ },
+ desc: {
'zh-CN': '基于 Route
的跳转是通过数据中的 route
字段进行设置的的。
\n',
'en-US': 'Route-based redirection is performed based on the route
field in the data.
\n'
},
- 'codeFiles': ['route.vue']
+ codeFiles: ['route.vue']
},
{
- 'demoId': 'more-link',
- 'name': { 'zh-CN': '显示 “更多” 链接', 'en-US': 'Show More links' },
- 'desc': {
+ demoId: 'more-link',
+ name: {
+ 'zh-CN': '显示 “更多” 链接',
+ 'en-US': 'Show More links'
+ },
+ desc: {
'zh-CN':
'通过 more-link
显示并设置更多链接。 show-more
设置是否显示更多按钮,默认为 true。
\n',
'en-US':
'You can use more-link
to display and set more links. show-more
Sets whether to display the More button. The default value is true.
\n'
},
- 'codeFiles': ['more-link.vue']
+ codeFiles: ['more-link.vue']
},
{
- 'demoId': 'icon',
- 'name': { 'zh-CN': '自定义新公告前缀', 'en-US': 'User-defined bulletin prefix' },
- 'desc': {
+ demoId: 'icon',
+ name: {
+ 'zh-CN': '自定义新公告前缀',
+ 'en-US': 'User-defined bulletin prefix'
+ },
+ desc: {
'zh-CN': '通过 icon
自定义新公告前缀图标。
\n',
'en-US': 'You can use icon
to customize the new bulletin prefix icon.
\n'
},
- 'codeFiles': ['icon.vue']
- }
- ],
- apis: [
- {
- 'name': 'bulletin-board',
- 'type': 'component',
- 'props': [
- {
- 'name': 'active-name',
- 'type': 'string',
- 'defaultValue': '1',
- 'desc': {
- 'zh-CN': "默认显示第1栏,可选'1' '2' '3'等",
- 'en-US': 'By default, column 1 is displayed. You can select 1, 2, or 3.'
- },
- 'demoId': 'active-name'
- },
- {
- 'name': 'data',
- 'type': 'Array',
- 'defaultValue': '',
- 'desc': { 'zh-CN': 'tab-item 数据;tab-item 数据', 'en-US': 'tab-item data; tab-item data' },
- 'demoId': 'base'
- },
- {
- 'name': 'icon',
- 'type': 'object , string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': 'tab-item中第一条信息的字体图标;tab-item中第一条信息的字体图标',
- 'en-US':
- 'Font icon of the first information in tab-item; Font icon of the first piece of information in tab-item'
- },
- 'demoId': 'icon'
- },
- {
- 'name': 'show-more',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否显示更多按钮,默认显示,需要与 more-link 同时使用',
- 'en-US':
- 'Indicates whether to display the More button. The More button is displayed by default and must be used together with more-link.'
- },
- 'demoId': 'more-link'
- },
- {
- 'name': 'more-link',
- 'type': 'object',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- "更多按钮跳转地址,show-more 为true 的时候生效;moreLink: { url: 'localhost:3000/', // 跳转地址,url 和 route 属性二选一,url优先级高 route: 'Alert', // 跳转路由,url 和 route 属性二选一,url优先级高 target: '_blank', // 跳转方式 text: '更多' // 链接文本 }",
- 'en-US':
- "More button redirection URL. This parameter is valid only when show-more is set to true. moreLink: {url:'localhost:3000/', //Redirection address. Either the URL or route attribute must be selected. The URL has a higher priority. route:'Alert', //Redirection route. Either the URL or route attribute must be selected. URL has a high priority target: '_blank', //Redirection mode text: 'More' //Link text}"
- },
- 'demoId': 'more-link'
- },
- {
- 'name': 'tab-title',
- 'type': 'Array',
- 'defaultValue': '',
- 'desc': { 'zh-CN': 'tab栏数据', 'en-US': 'Data in the tab column' },
- 'demoId': 'tab-title'
- },
- {
- 'name': 'title',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '公告牌的标题', 'en-US': 'Billboard title' },
- 'demoId': 'title'
- }
- ],
- 'events': [],
- 'slots': []
+ codeFiles: ['icon.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/button-group/disabled-composition-api.vue b/examples/sites/demos/pc/app/button-group/disabled-composition-api.vue
index 62d64dcd2..51cb313ad 100644
--- a/examples/sites/demos/pc/app/button-group/disabled-composition-api.vue
+++ b/examples/sites/demos/pc/app/button-group/disabled-composition-api.vue
@@ -1,12 +1,14 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/button-group/disabled.vue b/examples/sites/demos/pc/app/button-group/disabled.vue
index 443231aee..873b42f9e 100644
--- a/examples/sites/demos/pc/app/button-group/disabled.vue
+++ b/examples/sites/demos/pc/app/button-group/disabled.vue
@@ -1,12 +1,14 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/button-group/webdoc/button-group.js b/examples/sites/demos/pc/app/button-group/webdoc/button-group.js
index 6cec2f4d6..5f5c63d1e 100644
--- a/examples/sites/demos/pc/app/button-group/webdoc/button-group.js
+++ b/examples/sites/demos/pc/app/button-group/webdoc/button-group.js
@@ -3,299 +3,174 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '通过 data
设置按钮组数据,v-model
设置绑定值。
',
'en-US':
'Set the button group data through data
, and set the binding value through v model
.
'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'size',
- 'name': { 'zh-CN': '组件尺寸大小', 'en-US': 'Set Component Size' },
- 'desc': {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '组件尺寸大小',
+ 'en-US': 'Set Component Size'
+ },
+ desc: {
'zh-CN':
'通过 size
设置尺寸大小,可选值有 medium
、small
、mini
。
',
'en-US':
'Set the size through size
. The optional values are: medium
, small
, mini
.
'
},
- 'codeFiles': ['size.vue']
+ codeFiles: ['size.vue']
},
{
- 'demoId': 'disabled',
- 'name': { 'zh-CN': '禁用状态', 'en-US': 'Disabled' },
- 'desc': {
+ demoId: 'disabled',
+ name: {
+ 'zh-CN': '禁用状态',
+ 'en-US': 'Disabled'
+ },
+ desc: {
'zh-CN':
'通过 disabled
设置按钮组是否禁用,数据项设置 disabled
属性可以禁用单个按钮。
',
'en-US':
'By setting whether the button group is disabled through disabled
, and setting the disabled
property of the data item, individual buttons can be disabled.
'
},
- 'codeFiles': ['disabled.vue']
+ codeFiles: ['disabled.vue']
},
{
- 'demoId': 'plain',
- 'name': { 'zh-CN': '朴素按钮', 'en-US': 'Simple button' },
- 'desc': {
+ demoId: 'plain',
+ name: {
+ 'zh-CN': '朴素按钮',
+ 'en-US': 'Simple button'
+ },
+ desc: {
'zh-CN': '通过 plain
设置是否为朴素按钮。
',
'en-US': 'Set whether it is a plain button through plain
.
'
},
- 'codeFiles': ['plain.vue']
+ codeFiles: ['plain.vue']
},
{
- 'demoId': 'text-value-field',
- 'name': { 'zh-CN': '数据字段映射', 'en-US': 'Data Field Mapping' },
- 'desc': {
+ demoId: 'text-value-field',
+ name: {
+ 'zh-CN': '数据字段映射',
+ 'en-US': 'Data Field Mapping'
+ },
+ desc: {
'zh-CN':
'若按钮组数据对象中的字段不是默认的 text
和 value
,则可通过 text-field
、value-field
属性进行映射。
',
'en-US':
'If the fields in the button group data object are not the default text and value, the text-field
and value-field
attributes can be used for mapping.
'
},
- 'codeFiles': ['text-value-field.vue']
+ codeFiles: ['text-value-field.vue']
},
{
- 'demoId': 'show-more',
- 'name': { 'zh-CN': '显示更多按钮', 'en-US': 'Display More Buttons' },
- 'desc': {
+ demoId: 'show-more',
+ name: {
+ 'zh-CN': '显示更多按钮',
+ 'en-US': 'Display More Buttons'
+ },
+ desc: {
'zh-CN': '通过 show-more
设置显示更多按钮,当按钮数量大于设置值时,将显示更多按钮。
',
'en-US':
'By setting show more
to display more buttons, when the number of buttons exceeds the set value, more buttons will be displayed.
'
},
- 'codeFiles': ['show-more.vue']
+ codeFiles: ['show-more.vue']
},
{
- 'demoId': 'show-edit',
- 'name': { 'zh-CN': '编辑按钮', 'en-US': 'Display Edit Button' },
- 'desc': {
+ demoId: 'show-edit',
+ name: {
+ 'zh-CN': '编辑按钮',
+ 'en-US': 'Display Edit Button'
+ },
+ desc: {
'zh-CN':
'设置了显示更多按钮后,可以通过 show-edit
设置是否显示编辑按钮。点击编辑按钮后触发 edit
事件。
',
'en-US':
'After setting up to display more buttons, You can set whether to display the edit button through show edit
. After clicking the edit button, the edit
event is triggered.
'
},
- 'codeFiles': ['show-edit.vue']
+ codeFiles: ['show-edit.vue']
},
{
- 'demoId': 'slot-default',
- 'name': { 'zh-CN': '默认插槽', 'en-US': 'Default slot' },
- 'desc': {
+ demoId: 'slot-default',
+ name: {
+ 'zh-CN': '默认插槽',
+ 'en-US': 'Default slot'
+ },
+ desc: {
'zh-CN':
'使用默认插槽自定义按钮组,使用默认插槽后, button-group
的 data
、text-field
、value-field
、value / v-model
、size
属性对插槽中的按钮将不再生效。
',
'en-US':
'When the default slot mode is used, the data, text-field, value-field, v-model, and size
attributes of the ButtonGroup do not take effect for buttons in the slot.
'
},
- 'codeFiles': ['slot-default.vue']
+ codeFiles: ['slot-default.vue']
},
{
- 'demoId': 'slot-empty',
- 'name': { 'zh-CN': '空数据插槽', 'en-US': 'Empty slot' },
- 'desc': {
+ demoId: 'slot-empty',
+ name: {
+ 'zh-CN': '空数据插槽',
+ 'en-US': 'Empty slot'
+ },
+ desc: {
'zh-CN': '当数据为空时,默认会显示暂无数据,通过默认插槽自定义内容。
',
'en-US': 'When the data is empty, customize the content via the empty
slot.
'
},
- 'codeFiles': ['slot-empty.vue']
+ codeFiles: ['slot-empty.vue']
},
{
- 'demoId': 'button-group-multiple',
- 'name': { 'zh-CN': '多行按钮组', 'en-US': 'Button Group Multiple' },
- 'desc': {
+ demoId: 'button-group-multiple',
+ name: {
+ 'zh-CN': '多行按钮组',
+ 'en-US': 'Button Group Multiple'
+ },
+ desc: {
'zh-CN': '多行按钮组,当超出最大宽度后,换行显示。
',
'en-US':
'Multi-line button group, after exceeding the maximum width, it will be displayed in a new line.
'
},
- 'codeFiles': ['button-group-multiple.vue']
+ codeFiles: ['button-group-multiple.vue']
},
{
- 'demoId': 'border',
- 'name': { 'zh-CN': '边框', 'en-US': 'Border' },
- 'desc': {
+ demoId: 'border',
+ name: {
+ 'zh-CN': '边框',
+ 'en-US': 'Border'
+ },
+ desc: {
'zh-CN': '通过 border
设置有无边框。
',
'en-US': 'Set whether there is a border through border
.
'
},
- 'codeFiles': ['border.vue']
+ codeFiles: ['border.vue']
},
{
- 'demoId': 'sup',
- 'name': { 'zh-CN': '选块角标', 'en-US': '' },
- 'desc': {
+ demoId: 'sup',
+ name: {
+ 'zh-CN': '选块角标',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN':
'通过 data
的 sup
属性配置选块角标,详见 IButtonGroupData 。
',
'en-US': ''
},
- 'codeFiles': ['sup.vue']
+ codeFiles: ['sup.vue']
},
{
- 'demoId': 'change-event',
- 'name': { 'zh-CN': '事件', 'en-US': 'Change Event' },
- 'desc': {
+ demoId: 'change-event',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': 'Change Event'
+ },
+ desc: {
'zh-CN': '当选中按钮发生改变时触发 change
事件。
',
'en-US': 'The change
event is triggered when the selected button is changed.
'
},
- 'codeFiles': ['change-event.vue']
- }
- ],
- apis: [
- {
- 'name': 'button-group',
- 'type': 'component',
- 'props': [
- {
- 'name': 'border',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否显示边框线',
- 'en-US': 'Remove button border.'
- },
- 'demoId': 'border'
- },
- {
- 'name': 'data',
- 'type': 'IButtonGroupData[]',
- 'typeAnchorName': 'IButtonGroupData',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '按钮组数据',
- 'en-US': 'button group data'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否被禁用按钮组',
- 'en-US': 'Sets whether the button group is disabled'
- },
- 'demoId': 'disabled'
- },
- {
- 'name': 'modelValue / v-model',
- 'type': 'number | string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '默认选中按钮的值',
- 'en-US': 'Default value of the selected button'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'plain',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否朴素按钮',
- 'en-US': 'Indicates whether the button is a simple button'
- },
- 'demoId': 'plain'
- },
- {
- 'name': 'show-edit',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否显示编辑按钮,只有在显示更多的情况下生效',
- 'en-US':
- 'Whether to display the edit button. This parameter takes effect only when more buttons are displayed'
- },
- 'demoId': 'show-edit'
- },
- {
- 'name': 'show-more',
- 'type': 'number',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '当超过给定的按钮数量时显示更多按钮',
- 'en-US': 'Show more buttons when the given number of buttons is exceeded'
- },
- 'demoId': 'show-more'
- },
- {
- 'name': 'size',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '按钮组尺寸大小',
- 'en-US': 'Set the component size'
- },
- 'demoId': 'size'
- },
- {
- 'name': 'text-field',
- 'type': 'string',
- 'defaultValue': "'text'",
- 'desc': {
- 'zh-CN': '按钮显示文字的字段值',
- 'en-US': 'Field value of the button displayed text'
- },
- 'demoId': 'text-value-field'
- },
- {
- 'name': 'value-field',
- 'type': 'string',
- 'defaultValue': "'value'",
- 'desc': {
- 'zh-CN': '按钮选中值的字段值',
- 'en-US': 'Field value of the button value'
- },
- 'demoId': 'text-value-field'
- }
- ],
- 'events': [
- {
- 'name': 'change',
- 'type': '(value: string | number) => void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '当选中按钮发生改变时触发',
- 'en-US': 'Set the callback function triggered when the selected button is changed'
- },
- 'demoId': 'change-event'
- },
- {
- 'name': 'edit',
- 'type': '() => void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '当编辑按钮被点击时触发',
- 'en-US': 'Set the callback function triggered when the edit button is clicked'
- },
- 'demoId': 'show-edit'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '默认插槽,自定义按钮组内容',
- 'en-US': 'button group content'
- },
- 'demoId': 'slot-default'
- }
- ]
- }
- ],
- types: [
- {
- name: 'IButtonGroupData',
- type: 'interface',
- code: `
-interface IButtonGroupData {
- text: string // 显示文本
- value: number | number // 选中的值
- disabled?: boolean // 是否禁用
- // 配置选块角标
- sup?: {
- text: string // 角标文本
- class?: string // 角标的自定义class
- slot?: string // 自定义插槽名称,提供后可在button-group内使用对应的插槽自定义角标内容
- icon?: Component // 传入图标组件
- }
-}
-`
+ codeFiles: ['change-event.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/button/ghost.spec.ts b/examples/sites/demos/pc/app/button/ghost.spec.ts
index 0ab14987f..0a8c31829 100644
--- a/examples/sites/demos/pc/app/button/ghost.spec.ts
+++ b/examples/sites/demos/pc/app/button/ghost.spec.ts
@@ -11,8 +11,8 @@ test('幽灵按钮', async ({ page }) => {
await expect(getGhostBtn(0)).toHaveCSS('color', 'rgb(37, 43, 58)')
await expect(getGhostBtn(0)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
await expect(getGhostBtn(0)).toHaveCSS('border-bottom-color', 'rgb(173, 176, 184)')
- await page.waitForTimeout(200)
await getGhostBtn(0).hover()
+ await page.waitForTimeout(200)
await expect(getGhostBtn(0)).toHaveCSS('color', 'rgb(94, 124, 224)')
await expect(getGhostBtn(0)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
await expect(getGhostBtn(0)).toHaveCSS('border-bottom-color', 'rgb(94, 124, 224)')
@@ -21,8 +21,8 @@ test('幽灵按钮', async ({ page }) => {
await expect(getGhostBtn(1)).toHaveCSS('color', 'rgb(94, 124, 224)')
await expect(getGhostBtn(1)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
await expect(getGhostBtn(1)).toHaveCSS('border-bottom-color', 'rgb(94, 124, 224)')
- await page.waitForTimeout(200)
await getGhostBtn(1).hover()
+ await page.waitForTimeout(200)
await expect(getGhostBtn(1)).toHaveCSS('color', 'rgb(118, 147, 245)')
await expect(getGhostBtn(1)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
await expect(getGhostBtn(1)).toHaveCSS('border-bottom-color', 'rgb(118, 147, 245)')
@@ -31,8 +31,8 @@ test('幽灵按钮', async ({ page }) => {
await expect(getGhostBtn(2)).toHaveCSS('color', 'rgb(80, 212, 171)')
await expect(getGhostBtn(2)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
await expect(getGhostBtn(2)).toHaveCSS('border-bottom-color', 'rgb(80, 212, 171)')
- await page.waitForTimeout(200)
await getGhostBtn(2).hover()
+ await page.waitForTimeout(200)
await expect(getGhostBtn(2)).toHaveCSS('color', 'rgb(172, 242, 220)')
await expect(getGhostBtn(2)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
await expect(getGhostBtn(2)).toHaveCSS('border-bottom-color', 'rgb(172, 242, 220)')
@@ -41,8 +41,8 @@ test('幽灵按钮', async ({ page }) => {
await expect(getGhostBtn(3)).toHaveCSS('color', 'rgb(37, 43, 58)')
await expect(getGhostBtn(3)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
await expect(getGhostBtn(3)).toHaveCSS('border-bottom-color', 'rgb(37, 43, 58)')
- await page.waitForTimeout(200)
await getGhostBtn(3).hover()
+ await page.waitForTimeout(200)
await expect(getGhostBtn(3)).toHaveCSS('color', 'rgb(92, 97, 115)')
await expect(getGhostBtn(3)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
await expect(getGhostBtn(3)).toHaveCSS('border-bottom-color', 'rgb(92, 97, 115)')
@@ -51,8 +51,8 @@ test('幽灵按钮', async ({ page }) => {
await expect(getGhostBtn(4)).toHaveCSS('color', 'rgb(250, 152, 65)')
await expect(getGhostBtn(4)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
await expect(getGhostBtn(4)).toHaveCSS('border-bottom-color', 'rgb(250, 152, 65)')
- await page.waitForTimeout(200)
await getGhostBtn(4).hover()
+ await page.waitForTimeout(200)
await expect(getGhostBtn(4)).toHaveCSS('color', 'rgb(250, 194, 10)')
await expect(getGhostBtn(4)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
await expect(getGhostBtn(4)).toHaveCSS('border-bottom-color', 'rgb(250, 194, 10)')
@@ -61,8 +61,8 @@ test('幽灵按钮', async ({ page }) => {
await expect(getGhostBtn(5)).toHaveCSS('color', 'rgb(199, 0, 11)')
await expect(getGhostBtn(5)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
await expect(getGhostBtn(5)).toHaveCSS('border-bottom-color', 'rgb(199, 0, 11)')
- await page.waitForTimeout(200)
await getGhostBtn(5).hover()
+ await page.waitForTimeout(200)
await expect(getGhostBtn(5)).toHaveCSS('color', 'rgb(214, 74, 82)')
await expect(getGhostBtn(5)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)')
await expect(getGhostBtn(5)).toHaveCSS('border-bottom-color', 'rgb(214, 74, 82)')
diff --git a/examples/sites/demos/pc/app/button/webdoc/button.js b/examples/sites/demos/pc/app/button/webdoc/button.js
index 568b4d074..82f12a489 100644
--- a/examples/sites/demos/pc/app/button/webdoc/button.js
+++ b/examples/sites/demos/pc/app/button/webdoc/button.js
@@ -3,284 +3,147 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN':
'通过 type
设置按钮类型, plain
设置是否为朴素按钮, round
设置是否为圆角按钮, circle
设置是否为圆形按钮。
',
'en-US':
'Set the button type through type
, whether it is a plain button, whether it is a rounded button, and whether it is a circular button.
'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'ghost',
- 'name': { 'zh-CN': '幽灵按钮', 'en-US': 'Ghost button' },
- 'desc': {
+ demoId: 'ghost',
+ name: {
+ 'zh-CN': '幽灵按钮',
+ 'en-US': 'Ghost button'
+ },
+ desc: {
'zh-CN': '通过 ghost
设置幽灵按钮。
',
'en-US': 'Set up ghost buttons via ghost
.
'
},
- 'codeFiles': ['ghost.vue']
+ codeFiles: ['ghost.vue']
},
{
- 'demoId': 'dynamic-disabled',
- 'name': { 'zh-CN': '动态禁用按钮', 'en-US': 'Dynamic Disable Button' },
- 'desc': {
+ demoId: 'dynamic-disabled',
+ name: {
+ 'zh-CN': '动态禁用按钮',
+ 'en-US': 'Dynamic Disable Button'
+ },
+ desc: {
'zh-CN': '通过 disabled
设置是否禁用按钮。
',
'en-US': 'Set whether to disable the button through disabled
.
'
},
- 'codeFiles': ['dynamic-disabled.vue']
+ codeFiles: ['dynamic-disabled.vue']
},
{
- 'demoId': 'icon',
- 'name': { 'zh-CN': '图标按钮', 'en-US': 'Icon Button' },
- 'desc': {
+ demoId: 'icon',
+ name: {
+ 'zh-CN': '图标按钮',
+ 'en-US': 'Icon Button'
+ },
+ desc: {
'zh-CN':
'通过 icon
设置按钮展示图标, 接收一个图标组件。
Icon 图标用法
先从 @opentiny/vue-icon
中导入需要的 Icon,执行Icon函数得到Icon组件。然后在模板中通过 icon
属性进行引用。
',
'en-US':
'Display icons and receive an icon component through the icon
settings button p>
Icon icon usage
First, import the required Icon from @ opentiny/vue icon
, and execute the Icon function to obtain the Icon component. Then refer to it in the template through the icon
attribute.
'
},
- 'codeFiles': ['icon.vue']
+ codeFiles: ['icon.vue']
},
{
- 'demoId': 'text',
- 'name': { 'zh-CN': '文字按钮', 'en-US': 'Text button' },
- 'desc': {
+ demoId: 'text',
+ name: {
+ 'zh-CN': '文字按钮',
+ 'en-US': 'Text button'
+ },
+ desc: {
'zh-CN':
'将 type
属性设置为 text
后展示形式为文字按钮,可通过 text
设置按钮文本。
',
'en-US':
'Set the type
attribute to text
and display it as a text button. The button text can be set through text
.
'
},
- 'codeFiles': ['text.vue']
+ codeFiles: ['text.vue']
},
{
- 'demoId': 'image',
- 'name': { 'zh-CN': '图片按钮', 'en-US': 'Picture button' },
- 'desc': {
+ demoId: 'image',
+ name: {
+ 'zh-CN': '图片按钮',
+ 'en-US': 'Picture button'
+ },
+ desc: {
'zh-CN': '通过默认插槽自定义按钮内容,例如引入图片。
',
'en-US': 'Customize button content through default slots, such as introducing images.
'
},
- 'codeFiles': ['image.vue']
+ codeFiles: ['image.vue']
},
{
- 'demoId': 'loading',
- 'name': { 'zh-CN': '显示加载中', 'en-US': 'Display Loading' },
- 'desc': {
+ demoId: 'loading',
+ name: {
+ 'zh-CN': '显示加载中',
+ 'en-US': 'Display Loading'
+ },
+ desc: {
'zh-CN': '通过 loading
设置按钮是否为加载中的样式。
',
'en-US': 'Set whether the button is in the loading style by loading
.
'
},
- 'codeFiles': ['loading.vue']
+ codeFiles: ['loading.vue']
},
{
- 'demoId': 'size',
- 'name': { 'zh-CN': '尺寸', 'en-US': 'Dimension' },
- 'desc': {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '尺寸',
+ 'en-US': 'Dimension'
+ },
+ desc: {
'zh-CN':
'通过 size
设置按钮尺寸,可选值为 large
、medium
、small
、mini
。不设置时为默认尺寸。
',
'en-US':
'Set the button size through size
, with optional values of large
, medium
, small
, mini
. Default size when not set.
'
},
- 'codeFiles': ['size.vue']
+ codeFiles: ['size.vue']
},
{
- 'demoId': 'reset-time',
- 'name': { 'zh-CN': '防止重复点击', 'en-US': 'Prevent duplicate clicks' },
- 'desc': {
+ demoId: 'reset-time',
+ name: {
+ 'zh-CN': '防止重复点击',
+ 'en-US': 'Prevent duplicate clicks'
+ },
+ desc: {
'zh-CN':
'通过 reset-time
设置单击后按钮禁用的时长,默认禁用时长为 1000 毫秒,可用于防止按钮连续点击出现表单重复提交的问题。
',
'en-US':
'You can use the reset-time
to set the duration for which the button is disabled. The default duration is 1000 ms. This parameter can be used to prevent repeated submission of the form when you click the button continuously.
'
},
- 'codeFiles': ['reset-time.vue']
+ codeFiles: ['reset-time.vue']
},
{
- 'demoId': 'autofocus',
- 'name': { 'zh-CN': '默认聚焦', 'en-US': 'Default Focus' },
- 'desc': {
+ demoId: 'autofocus',
+ name: {
+ 'zh-CN': '默认聚焦',
+ 'en-US': 'Default Focus'
+ },
+ desc: {
'zh-CN': '通过 autofocus
设置按钮原生属性,是否默认为聚焦状态。
',
'en-US':
'Set the button native properties to default to the focused state through autofocus
.
'
},
- 'codeFiles': ['autofocus.vue']
+ codeFiles: ['autofocus.vue']
},
{
- 'demoId': 'click',
- 'name': { 'zh-CN': '点击事件', 'en-US': 'Event' },
- 'desc': {
+ demoId: 'click',
+ name: {
+ 'zh-CN': '点击事件',
+ 'en-US': 'Event'
+ },
+ desc: {
'zh-CN': '当点击按钮后会触发 click
事件。
',
'en-US': 'When the button is clicked, the click
event will be triggered.
'
},
- 'codeFiles': ['click.vue']
- }
- ],
- apis: [
- {
- 'name': 'button',
- 'type': 'component',
- 'props': [
- {
- 'name': 'autofocus',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否默认聚焦',
- 'en-US': 'Whether to focus by default'
- },
- 'demoId': 'autofocus'
- },
- {
- 'name': 'circle',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否圆形按钮',
- 'en-US': 'Round button'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否被禁用按钮',
- 'en-US': 'Sets whether the button is disabled'
- },
- 'demoId': 'dynamic-disabled'
- },
- {
- 'name': 'ghost',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否幽灵按钮',
- 'en-US': 'Is ghost button'
- },
- 'demoId': 'ghost'
- },
- {
- 'name': 'icon',
- 'type': 'Component',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '按钮左侧展示的图标,接收为Icon组件',
- 'en-US': 'The icon displayed by the button is received as an Icon component'
- },
- 'demoId': 'icon'
- },
- {
- 'name': 'loading',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否加载中状态',
- 'en-US': 'Loading status'
- },
- 'demoId': 'loading'
- },
- {
- 'name': 'native-type',
- 'type': "'button' | 'submit' | 'reset'",
- 'defaultValue': "'button'",
- 'desc': {
- 'zh-CN': '对应按钮原生 type 属性',
- 'en-US': 'Set the button native type attribute'
- },
- 'demoId': ''
- },
- {
- 'name': 'plain',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否朴素按钮',
- 'en-US': 'Simple button'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'reset-time',
- 'type': 'number',
- 'defaultValue': '1000',
- 'desc': {
- 'zh-CN': '设置按钮禁用时间,防止重复提交,单位毫秒',
- 'en-US': 'Set the button disable time, in milliseconds, to prevent repeated submission'
- },
- 'demoId': 'reset-time'
- },
- {
- 'name': 'round',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否圆角按钮',
- 'en-US': 'Whether to round the corner button'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'size',
- 'type': "'large' | 'medium' | 'small' | 'mini'",
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '定义按钮尺寸',
- 'en-US': 'Define the button size'
- },
- 'demoId': 'size'
- },
- {
- 'name': 'text',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '按钮显示的文本',
- 'en-US': 'Set the text displayed by the button'
- },
- 'demoId': 'text'
- },
- {
- 'name': 'type',
- 'type': 'IButtonType',
- 'typeAnchorName': 'IButtonType',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '展示按钮不同的状态,设置为text则展示为文本按钮',
- 'en-US': 'Display different states of buttons, set to text to display as text buttons'
- },
- 'demoId': 'basic-usage'
- }
- ],
- 'events': [
- {
- 'name': 'click',
- 'type': '(event: PointEvent) => void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '当按钮被点击时触发的回调函数',
- 'en-US': 'Sets the callback function triggered when a button is clicked'
- },
- 'demoId': 'click'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '默认插槽,自定义按钮展示内容',
- 'en-US': 'Default slot'
- },
- 'demoId': 'image'
- }
- ]
- }
- ],
- types: [
- {
- name: 'IButtonType',
- type: 'interface',
- code: `type IButtonType = 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'`
+ codeFiles: ['click.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/calendar-view/calendar-event-composition-api.vue b/examples/sites/demos/pc/app/calendar-view/calendar-event-composition-api.vue
index c79d6a727..b31c92ebb 100644
--- a/examples/sites/demos/pc/app/calendar-view/calendar-event-composition-api.vue
+++ b/examples/sites/demos/pc/app/calendar-view/calendar-event-composition-api.vue
@@ -12,29 +12,29 @@
-
diff --git a/examples/sites/demos/pc/app/calendar-view/calendar-event.vue b/examples/sites/demos/pc/app/calendar-view/calendar-event.vue
index 24b0ce284..c8a72f54d 100644
--- a/examples/sites/demos/pc/app/calendar-view/calendar-event.vue
+++ b/examples/sites/demos/pc/app/calendar-view/calendar-event.vue
@@ -26,19 +26,19 @@ export default {
},
methods: {
prevWeekClick(date) {
- console.log(date)
+ Modal.message({ message: `上一周按钮点击事件: ${date[0].value}`, status: 'info' })
},
nextWeekClick(date) {
- console.log(date)
+ Modal.message({ message: `下一周按钮点击事件: ${date[0].value}`, status: 'info' })
},
- weekChange(oldVal, newVal) {
- console.log(oldVal, newVal)
+ weekChange(weekDate) {
+ Modal.message({ message: `周改变事件: ${weekDate[0].value}`, status: 'info' })
},
- yearChange(oldVal, newVal) {
- console.log(oldVal, newVal)
+ yearChange(newVal, oldVal) {
+ Modal.message({ message: `年改变事件: ${newVal}年, ${oldVal}年`, status: 'info' })
},
- monthChange(oldVal, newVal) {
- console.log(oldVal, newVal)
+ monthChange(newVal, oldVal) {
+ Modal.message({ message: `月改变事件: ${newVal}月, ${oldVal}月`, status: 'info' })
}
}
}
diff --git a/examples/sites/demos/pc/app/calendar-view/calendar-mode.spec.ts b/examples/sites/demos/pc/app/calendar-view/calendar-mode.spec.ts
index 7a00da596..5d4e8e35a 100644
--- a/examples/sites/demos/pc/app/calendar-view/calendar-mode.spec.ts
+++ b/examples/sites/demos/pc/app/calendar-view/calendar-mode.spec.ts
@@ -3,9 +3,9 @@ import { test, expect } from '@playwright/test'
test('显示模式', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('calendar-view#calendar-mode')
- const monthBtn = page.locator('label').nth(2)
- const timelineBtn = page.locator('label').nth(3)
- const scheduleBtn = page.locator('label').nth(4)
+ const monthBtn = page.locator('label').nth(1)
+ const timelineBtn = page.locator('label').nth(2)
+ const scheduleBtn = page.locator('label').nth(3)
const dmonthDom = page.locator('.tiny-calendar-view-month__main')
const timelineDom = page.locator('.tiny-calendar-view-week__timeline')
const scheduleDom = page.locator('.tiny-calendar-view-week__schedule')
diff --git a/examples/sites/demos/pc/app/calendar-view/webdoc/calendar-view.js b/examples/sites/demos/pc/app/calendar-view/webdoc/calendar-view.js
index f43994f2c..a0ab9010c 100644
--- a/examples/sites/demos/pc/app/calendar-view/webdoc/calendar-view.js
+++ b/examples/sites/demos/pc/app/calendar-view/webdoc/calendar-view.js
@@ -3,344 +3,165 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '默认以月的形式展示当月的每一天。
\n',
'en-US': 'By default, each day of the current month is displayed in the form of month.
\n'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'calendar-mode',
- 'name': { 'zh-CN': '显示模式', 'en-US': 'Display mode' },
- 'desc': {
+ demoId: 'calendar-mode',
+ name: {
+ 'zh-CN': '显示模式',
+ 'en-US': 'Display mode'
+ },
+ desc: {
'zh-CN':
'通过 mode
属性指定以年的形式显示,将展示当年的每个月份。可选值有 month
/ timeline
/ schedule
。
\n',
'en-US':
'The mode
attribute specifies that each month of the current year is displayed. The options are month
/ timeline
/ schedule
.
\n'
},
- 'codeFiles': ['calendar-mode.vue']
+ codeFiles: ['calendar-mode.vue']
},
{
- 'demoId': 'calendar-disabled-day',
- 'name': { 'zh-CN': '日期禁用', 'en-US': '' },
- 'desc': {
+ demoId: 'calendar-disabled-day',
+ name: {
+ 'zh-CN': '日期禁用',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN': '通过 disabled
回调函数来禁用某些日期。
\n',
'en-US': '\n'
},
- 'codeFiles': ['calendar-disabled-day.vue']
+ codeFiles: ['calendar-disabled-day.vue']
},
{
- 'demoId': 'calendar-schedule-slot',
- 'name': { 'zh-CN': '日程模式插槽', 'en-US': '' },
- 'desc': {
+ demoId: 'calendar-schedule-slot',
+ name: {
+ 'zh-CN': '日程模式插槽',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN': '日程模式下内容区提供 weekday1-weekday7 这 7 个插槽,方便用户自定义日程展示。
\n',
'en-US': '\n'
},
- 'codeFiles': ['calendar-schedule-slot.vue']
+ codeFiles: ['calendar-schedule-slot.vue']
},
{
- 'demoId': 'calendar-timeline-slot',
- 'name': { 'zh-CN': '时间线插槽', 'en-US': '' },
- 'desc': {
+ demoId: 'calendar-timeline-slot',
+ name: {
+ 'zh-CN': '时间线插槽',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN': '时间下模式下提供 timeline1-timeline7 这 7 个插槽,方便用户自定义日程展示。
\n',
'en-US': '\n'
},
- 'codeFiles': ['calendar-timeline-slot.vue']
+ codeFiles: ['calendar-timeline-slot.vue']
},
{
- 'demoId': 'calendar-timeline-range',
- 'name': { 'zh-CN': '时间线范围配置', 'en-US': '' },
- 'desc': {
+ demoId: 'calendar-timeline-range',
+ name: {
+ 'zh-CN': '时间线范围配置',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN': '通过dayTimes属性配置时间线模式下所展示的时间范围,默认为[8,18],可配范围[0,23]。
\n',
'en-US': '\n'
},
- 'codeFiles': ['calendar-timeline-range.vue']
+ codeFiles: ['calendar-timeline-range.vue']
},
{
- 'demoId': 'multi-select',
- 'name': { 'zh-CN': '日期多选', 'en-US': '' },
- 'desc': {
+ demoId: 'multi-select',
+ name: {
+ 'zh-CN': '日期多选',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN': '设置 mult-select = true 属性后,可开启日期多选。
\n',
'en-US': '\n'
},
- 'codeFiles': ['multi-select.vue']
+ codeFiles: ['multi-select.vue']
},
{
- 'demoId': 'calendar-day-mark',
- 'name': { 'zh-CN': '日期标记', 'en-US': '' },
- 'desc': {
+ demoId: 'calendar-day-mark',
+ name: {
+ 'zh-CN': '日期标记',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN':
'通过showMark回调函数来标记某些日期,markColor属性设置标记的颜色,此功能只在时间线模式和日程模式生效。markColor可选颜色同 theme
\n',
'en-US': '\n'
},
- 'codeFiles': ['calendar-day-mark.vue']
+ codeFiles: ['calendar-day-mark.vue']
},
{
- 'demoId': 'custom-header',
- 'name': { 'zh-CN': '自定义头部显示', 'en-US': 'Display Selected Date' },
- 'desc': {
+ demoId: 'custom-header',
+ name: {
+ 'zh-CN': '自定义头部显示',
+ 'en-US': 'Display Selected Date'
+ },
+ desc: {
'zh-CN': '通过作用域插槽 header 自定义需要显示的头部区域。
\n',
'en-US': '\n'
},
- 'codeFiles': ['custom-header.vue']
+ codeFiles: ['custom-header.vue']
},
{
- 'demoId': 'custom-calendar-toolbar',
- 'name': { 'zh-CN': '自定义工具栏', 'en-US': 'Custom Toolbar' },
- 'desc': {
+ demoId: 'custom-calendar-toolbar',
+ name: {
+ 'zh-CN': '自定义工具栏',
+ 'en-US': 'Custom Toolbar'
+ },
+ desc: {
'zh-CN': '通过作用域插槽 tool 自定义需要的工具栏。
\n',
'en-US': 'Customize the required toolbar through the scope slot tool.
\n'
},
- 'codeFiles': ['custom-calendar-toolbar.vue']
+ codeFiles: ['custom-calendar-toolbar.vue']
},
{
- 'demoId': 'custom-day-bg-color',
- 'name': { 'zh-CN': '自定义单元格背景色', 'en-US': 'Add Schedule Event' },
- 'desc': {
+ demoId: 'custom-day-bg-color',
+ name: {
+ 'zh-CN': '自定义单元格背景色',
+ 'en-US': 'Add Schedule Event'
+ },
+ desc: {
'zh-CN':
'自定义日期单元格背景色。
\n目前只支持预置的颜色,可选颜色blue、green、red、yellow、purple、cyan、grey
\n',
'en-US': '\n'
},
- 'codeFiles': ['custom-day-bg-color.vue']
+ codeFiles: ['custom-day-bg-color.vue']
},
{
- 'demoId': 'set-working-day',
- 'name': { 'zh-CN': '设置工作日或节假日', 'en-US': '' },
- 'desc': {
+ demoId: 'set-working-day',
+ name: {
+ 'zh-CN': '设置工作日或节假日',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN': '可以结合日期多选,自定义背景色,工具栏插槽等功能实现设置工作日或节假日的功能
\n',
'en-US': '\n'
},
- 'codeFiles': ['set-working-day.vue']
+ codeFiles: ['set-working-day.vue']
},
{
- 'demoId': 'calendar-event',
- 'name': { 'zh-CN': '事件', 'en-US': '' },
- 'desc': {
+ demoId: 'calendar-event',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN':
'日历抛出的事件有以下这些:
\nnew-schedule:新增日程按钮点击事件
\nselected-date-change:选中日期改变事件
\nprev-week-click:上一周按钮点击事件
\nnext-week-click:下一周按钮点击事件
\nweek-change:周改变事件
\nyear-change:年改变事件
\nmonth-change:月改变事件
\n',
'en-US': '\n'
},
- 'codeFiles': ['calendar-event.vue']
- }
- ],
- apis: [
- {
- 'name': 'calendar-view',
- 'type': 'component',
- 'props': [
- {
- 'name': 'day-times',
- 'type': 'Array',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '配置时间线模式下所展示的时间范围,默认为[8,18],可配范围[0,23]。',
- 'en-US': ''
- },
- 'demoId': 'calendar-timeline-range'
- },
- {
- 'name': 'disabled',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '日期禁用',
- 'en-US': ''
- },
- 'demoId': 'calendar-disabled-day'
- },
- {
- 'name': 'events',
- 'type': 'Array',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '日程事件',
- 'en-US': ''
- },
- 'demoId': 'calendar-event'
- },
- {
- 'name': 'height',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '日历高度',
- 'en-US': ''
- },
- 'demoId': ''
- },
- {
- 'name': 'mark-color',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点标记的颜色',
- 'en-US': ''
- },
- 'demoId': 'calendar-day-mark'
- },
- {
- 'name': 'mode',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '显示模式,可选值有 timeline-时间线模式、schedule-日程模式、month-月模式,默认为月模式。',
- 'en-US': ''
- },
- 'demoId': 'calendar-mode'
- },
- {
- 'name': 'modes',
- 'type': 'Array',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '模式组,显示模式任意组合',
- 'en-US': ''
- },
- 'demoId': 'calendar-mode'
- },
- {
- 'name': 'month',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '日历当前显示月份',
- 'en-US': ''
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'multi-select',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '日期多选',
- 'en-US': ''
- },
- 'demoId': 'multi-select'
- },
- {
- 'name': 'set-day-bg-color',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置日期背景色',
- 'en-US': ''
- },
- 'demoId': 'custom-day-bg-color'
- },
- {
- 'name': 'show-mark',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '显示点标记',
- 'en-US': ''
- },
- 'demoId': 'calendar-day-mark'
- },
- {
- 'name': 'show-new-schedule',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '显示新增日程按钮',
- 'en-US': ''
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'year',
- 'type': 'number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '日历当前显示年份',
- 'en-US': ''
- },
- 'demoId': 'basic-usage'
- }
- ],
- 'events': [
- {
- 'name': 'month-change',
- 'desc': {
- 'zh-CN': '月改变事件',
- 'en-US': ''
- },
- 'demoId': 'calendar-event'
- },
- {
- 'name': 'new-schedule',
- 'desc': {
- 'zh-CN': '新增日程按钮点击事件',
- 'en-US': ''
- },
- 'demoId': 'calendar-schedule-slot'
- },
- {
- 'name': 'next-week-click',
- 'desc': {
- 'zh-CN': '下一周按钮点击事件',
- 'en-US': ''
- },
- 'demoId': 'calendar-event'
- },
- {
- 'name': 'prev-week-click',
- 'desc': {
- 'zh-CN': '上一周按钮点击事件',
- 'en-US': ''
- },
- 'demoId': 'calendar-event'
- },
- {
- 'name': 'selected-date-change',
- 'desc': {
- 'zh-CN': '选中日期改变事件',
- 'en-US': ''
- },
- 'demoId': 'multi-select'
- },
- {
- 'name': 'week-change',
- 'desc': {
- 'zh-CN': '周改变事件',
- 'en-US': ''
- },
- 'demoId': 'calendar-event'
- },
- {
- 'name': 'year-change',
- 'desc': {
- 'zh-CN': '年改变事件',
- 'en-US': ''
- },
- 'demoId': 'calendar-event'
- }
- ],
- 'slots': [
- {
- 'name': 'header',
- 'desc': { 'zh-CN': '头部插槽', 'en-US': '' },
- 'demoId': 'calendar-schedule-slot'
- },
- {
- 'name': 'timeline',
- 'desc': { 'zh-CN': '时间线插槽,有timeline1-timeline7 7个插槽', 'en-US': '' },
- 'demoId': 'calendar-schedule-slot'
- },
- {
- 'name': 'tool',
- 'desc': { 'zh-CN': '工具栏插槽', 'en-US': '' },
- 'demoId': 'calendar-schedule-slot'
- },
- {
- 'name': 'weekday',
- 'desc': { 'zh-CN': '日程插槽,有weekday1-weekday7 7个插槽', 'en-US': '' },
- 'demoId': 'calendar-schedule-slot'
- }
- ]
+ codeFiles: ['calendar-event.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/calendar/webdoc/calendar.js b/examples/sites/demos/pc/app/calendar/webdoc/calendar.js
index 11ad2e8d6..2bc260466 100644
--- a/examples/sites/demos/pc/app/calendar/webdoc/calendar.js
+++ b/examples/sites/demos/pc/app/calendar/webdoc/calendar.js
@@ -3,143 +3,81 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '默认以月的形式展示当月的每一天。
\n',
'en-US': 'By default, each day of the current month is displayed in the form of month.
\n'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'calendar-mode',
- 'name': { 'zh-CN': '显示模式', 'en-US': 'Display mode' },
- 'desc': {
+ demoId: 'calendar-mode',
+ name: {
+ 'zh-CN': '显示模式',
+ 'en-US': 'Display mode'
+ },
+ desc: {
'zh-CN': '通过 mode
属性指定以年的形式显示,将展示当年的每个月份。可选值有 year、month。
\n',
'en-US':
'The mode
attribute specifies that each month of the current year is displayed. The options are year and month.
\n'
},
- 'codeFiles': ['calendar-mode.vue']
+ codeFiles: ['calendar-mode.vue']
},
{
- 'demoId': 'show-selected-date',
- 'name': { 'zh-CN': '显示选中日期', 'en-US': 'Display Selected Date' },
- 'desc': {
+ demoId: 'show-selected-date',
+ name: {
+ 'zh-CN': '显示选中日期',
+ 'en-US': 'Display Selected Date'
+ },
+ desc: {
'zh-CN':
'以月的形式展示时,指定 show-selected 属性后,单击日期单元格,将会在日历框上方展示当前选中的日期。
\n',
'en-US':
'When the date is displayed in the format of month, the selected date is displayed above the calendar box after the show-selected attribute is specified and the date cell is clicked.
\n'
},
- 'codeFiles': ['show-selected-date.vue']
+ codeFiles: ['show-selected-date.vue']
},
{
- 'demoId': 'custom-day-cell',
- 'name': { 'zh-CN': '自定义日期单元格', 'en-US': 'Custom Date Cell' },
- 'desc': {
+ demoId: 'custom-day-cell',
+ name: {
+ 'zh-CN': '自定义日期单元格',
+ 'en-US': 'Custom Date Cell'
+ },
+ desc: {
'zh-CN': '通过作用域插槽 day 自定义日期单元格。
\n',
'en-US': 'Customize the date cell through the scope slot day.
\n'
},
- 'codeFiles': ['custom-day-cell.vue']
+ codeFiles: ['custom-day-cell.vue']
},
{
- 'demoId': 'custom-calendar-toolbar',
- 'name': { 'zh-CN': '自定义工具栏', 'en-US': 'Custom Toolbar' },
- 'desc': {
+ demoId: 'custom-calendar-toolbar',
+ name: {
+ 'zh-CN': '自定义工具栏',
+ 'en-US': 'Custom Toolbar'
+ },
+ desc: {
'zh-CN': '通过作用域插槽 tool 自定义需要的工具栏。
\n',
'en-US': 'Customize the required toolbar through the scope slot tool.
\n'
},
- 'codeFiles': ['custom-calendar-toolbar.vue']
+ codeFiles: ['custom-calendar-toolbar.vue']
},
{
- 'demoId': 'dynamic-add-schedule',
- 'name': { 'zh-CN': '添加日程事件', 'en-US': 'Add Schedule Event' },
- 'desc': {
+ demoId: 'dynamic-add-schedule',
+ name: {
+ 'zh-CN': '添加日程事件',
+ 'en-US': 'Add Schedule Event'
+ },
+ desc: {
'zh-CN':
'通过 events 属性可以指定事件列表,它是一个对象数组,对象中包含如下字段:
\nevents 说明
\ntime:指定需要展示事件的日期\ntitle:指定事件标题\ncontent:指定事件的具体内容 type:指定当鼠标悬停在事件标题上时,弹出的展示事件具体内容的提示框的主题,包括 warning、error、info、success
\n\n',
'en-US':
'You can use the events attribute to specify the event list. It is an object array that contains the following fields:
\nevents Description
\ntime: specifies the date of the event to be displayed.\ntitle: Specifies the event title. \ncontent: specifies the event content. type: specifies the theme of the dialog box that displays the event content when you hover the cursor over the event title. The options are warning, error, info, and success
\n\n'
},
- 'codeFiles': ['dynamic-add-schedule.vue']
- }
- ],
- apis: [
- {
- 'name': 'calendar',
- 'type': 'component',
- 'props': [
- {
- 'name': 'events',
- 'type': 'eventLists[]',
- 'typeAnchorName': 'eventLists',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '事件列表', 'en-US': 'Event List' },
- 'demoId': 'dynamic-add-schedule'
- },
- {
- 'name': 'mode',
- 'type': "'month' | 'year'",
- 'defaultValue': "'month'",
- 'desc': {
- 'zh-CN': '日历显示模式',
- 'en-US': 'Display mode. The value can be month or year. The default value is month.'
- },
- 'demoId': 'calendar-mode'
- },
- {
- 'name': 'month',
- 'type': 'number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '指定月份,默认当前月份',
- 'en-US': 'Specified month. The default value is the current month.'
- },
- 'demoId': 'custom-day-cell'
- },
- {
- 'name': 'show-selected',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否显示选中的日期', 'en-US': 'Display the selected date.' },
- 'demoId': 'show-selected-date'
- },
- {
- 'name': 'year',
- 'type': 'number',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '指定年份,默认当前年份', 'en-US': 'Specified year. The default year is this year.' },
- 'demoId': 'custom-day-cell'
- }
- ],
- 'events': [],
- 'slots': [
- {
- 'name': 'day',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '日期单元格插槽', 'en-US': 'Date Cell Slot' },
- 'demoId': 'custom-day-cell'
- },
- {
- 'name': 'tool',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '日历工具栏插槽', 'en-US': 'Calendar Toolbar Slot' },
- 'demoId': 'custom-calendar-toolbar'
- }
- ]
- }
- ],
- types: [
- {
- name: 'eventLists',
- type: 'interface',
- code: `
- interface eventLists [{
- time: 1534297845236, // 指定需要展示事件的日期
- title: '消息', // 指定事件标题
- content: '这是一条消息', // 指定事件的具体内容
- type: 'info' // 事件主题类型,包括 warning、error、info、success。
- }]`
+ codeFiles: ['dynamic-add-schedule.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/carousel/webdoc/carousel.js b/examples/sites/demos/pc/app/carousel/webdoc/carousel.js
index 3e198d51c..e75886232 100644
--- a/examples/sites/demos/pc/app/carousel/webdoc/carousel.js
+++ b/examples/sites/demos/pc/app/carousel/webdoc/carousel.js
@@ -3,302 +3,174 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN':
'通过arrow
属性设置左右箭头切换效果,loop
属性是否循环显示,autoplay
属性自动切换。',
'en-US':
'Set the left and right arrow switching effect through thearrow
attribute, check whether theloop
attribute is displayed in a loop, and automatically switch theautoplay
attribute.'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'indicator-trigger',
- 'name': { 'zh-CN': '指示器和触发方式', 'en-US': 'Indicator and Trigger Mode' },
- 'desc': {
+ demoId: 'indicator-trigger',
+ name: {
+ 'zh-CN': '指示器和触发方式',
+ 'en-US': 'Indicator and Trigger Mode'
+ },
+ desc: {
'zh-CN':
'通过配置 indicator-position
为outside
后,走马灯指示器默认显示在幻灯片内容上,将显示在外部。\n配置 trigger
为click
,可以修改指示器触发方式为单击,默认鼠标悬停到指示器时,走马灯幻灯片就会对应切换。
\n',
'en-US':
'The walk indicator is displayed on the slide by default. After indicator-position
is set to outside, the indicator is displayed outside. \n Set trigger
to click. You can change the indicator triggering mode to click. By default, when you hover the cursor over an indicator, the slideshow is switched accordingly.
\n'
},
- 'codeFiles': ['indicator-trigger.vue']
+ codeFiles: ['indicator-trigger.vue']
},
{
- 'demoId': 'manual-play',
- 'name': { 'zh-CN': '手动轮播', 'en-US': 'Manual Carousel' },
- 'desc': {
+ demoId: 'manual-play',
+ name: {
+ 'zh-CN': '手动轮播',
+ 'en-US': 'Manual Carousel'
+ },
+ desc: {
'zh-CN':
'通过调用 setActiveItem()
、next()
、prev()
方法可根据需要进行轮播。initial-index
属性可以指定初始激活的幻灯片索引。
\n',
'en-US':
'Invoke the setActiveItem()
, next()
, and prev()
methods to perform NVOD as required. The initial-index
property specifies the slide index that is initially activated.
\n'
},
- 'codeFiles': ['manual-play.vue']
+ codeFiles: ['manual-play.vue']
},
{
- 'demoId': 'close-loop',
- 'name': { 'zh-CN': '关闭循环轮播', 'en-US': 'Disable cyclic NVOD' },
- 'desc': {
+ demoId: 'close-loop',
+ name: {
+ 'zh-CN': '关闭循环轮播',
+ 'en-US': 'Disable cyclic NVOD'
+ },
+ desc: {
'zh-CN':
'通过配置 loop
属性为false
后,若走马灯幻灯片已切换到最后一项,则将不能再从第一项开始循环切换。即切换到最后一项时,右侧切换箭头不再显示,切换到第一项时,左侧切换箭头不再显示。
\n',
'en-US':
'After the loop
attribute is set to false
, if the slide is switched to the last item, the slide cannot be switched cyclically from the first item. That is, when switching to the last item, the right toggle arrow is no longer displayed, and when switching to the first item, the left toggle arrow is no longer displayed.
\n'
},
- 'codeFiles': ['close-loop.vue']
+ codeFiles: ['close-loop.vue']
},
{
- 'demoId': 'autoplay',
- 'name': { 'zh-CN': '自动切换', 'en-US': 'Automatic switchover' },
- 'desc': {
+ demoId: 'autoplay',
+ name: {
+ 'zh-CN': '自动切换',
+ 'en-US': 'Automatic switchover'
+ },
+ desc: {
'zh-CN':
'通过配置 autoplay
属性为true
后,走马灯的幻灯片内容将自动轮播切换。
\n',
'en-US':
'After autoplay
is set to true
, the slide content of the walk-through is automatically switched in rotation.
\n'
},
- 'codeFiles': ['autoplay.vue']
+ codeFiles: ['autoplay.vue']
},
{
- 'demoId': 'play-interval',
- 'name': { 'zh-CN': '轮播间隔时间', 'en-US': 'NVOD Interval' },
- 'desc': {
+ demoId: 'play-interval',
+ name: {
+ 'zh-CN': '轮播间隔时间',
+ 'en-US': 'NVOD Interval'
+ },
+ desc: {
'zh-CN': '通过 interval
属性可以自定义,走马灯幻灯片轮播间隔时间默认为 3000 毫秒。
\n',
'en-US':
'The interval is 3000 ms by default, which can be customized through the interval
attribute.
\n'
},
- 'codeFiles': ['play-interval.vue']
+ codeFiles: ['play-interval.vue']
},
{
- 'demoId': 'up-down-carousel',
- 'name': { 'zh-CN': '纵向轮播', 'en-US': 'vertical carousel' },
- 'desc': {
+ demoId: 'up-down-carousel',
+ name: {
+ 'zh-CN': '纵向轮播',
+ 'en-US': 'vertical carousel'
+ },
+ desc: {
'zh-CN': '通过配置 type
属性为vertical
即可实现纵向轮播。
\n',
'en-US': 'Set type
to vertical to implement vertical
rotation.
\n'
},
- 'codeFiles': ['up-down-carousel.vue']
+ codeFiles: ['up-down-carousel.vue']
},
{
- 'demoId': 'show-title',
- 'name': { 'zh-CN': '显示标题', 'en-US': 'Display Title' },
- 'desc': {
+ demoId: 'show-title',
+ name: {
+ 'zh-CN': '显示标题',
+ 'en-US': 'Display Title'
+ },
+ desc: {
'zh-CN': '通过 title
配置显示标题,需要与 show-title
结合使用。
\n',
'en-US':
'Use title
to configure the display title. This parameter must be used together with show-title
.
\n'
},
- 'codeFiles': ['show-title.vue']
+ codeFiles: ['show-title.vue']
},
{
- 'demoId': 'carousel-arrow-always',
- 'name': { 'zh-CN': '总是显示切换箭头', 'en-US': 'Always show the switch arrow' },
- 'desc': {
+ demoId: 'carousel-arrow-always',
+ name: {
+ 'zh-CN': '总是显示切换箭头',
+ 'en-US': 'Always show the switch arrow'
+ },
+ desc: {
'zh-CN': '通过arrow
设置属性为always
。',
'en-US': 'Set the attribute toalways
througharrow
.'
},
- 'codeFiles': ['carousel-arrow-always.vue']
+ codeFiles: ['carousel-arrow-always.vue']
},
{
- 'demoId': 'carousel-arrow-hover',
- 'name': { 'zh-CN': 'hover 时显示切换箭头', 'en-US': 'The switch arrow is displayed during Hover' },
- 'desc': {
+ demoId: 'carousel-arrow-hover',
+ name: {
+ 'zh-CN': 'hover 时显示切换箭头',
+ 'en-US': 'The switch arrow is displayed during Hover'
+ },
+ desc: {
'zh-CN': '通过arrow
设置属性为hover
。',
'en-US': 'Set the attribute tohover
througharrow
.'
},
- 'codeFiles': ['carousel-arrow-hover.vue']
+ codeFiles: ['carousel-arrow-hover.vue']
},
{
- 'demoId': 'carousel-arrow-never',
- 'name': { 'zh-CN': '隐藏切换箭头', 'en-US': 'Hide the switch arrow' },
- 'desc': {
+ demoId: 'carousel-arrow-never',
+ name: {
+ 'zh-CN': '隐藏切换箭头',
+ 'en-US': 'Hide the switch arrow'
+ },
+ desc: {
'zh-CN': '通过arrow
设置属性为never
。',
'en-US': 'Set the attribute tonever
througharrow
.'
},
- 'codeFiles': ['carousel-arrow-never.vue']
+ codeFiles: ['carousel-arrow-never.vue']
},
{
- 'demoId': 'card-mode',
- 'name': { 'zh-CN': '卡片模式', 'en-US': 'Card Mode' },
- 'desc': {
+ demoId: 'card-mode',
+ name: {
+ 'zh-CN': '卡片模式',
+ 'en-US': 'Card Mode'
+ },
+ desc: {
'zh-CN': '通过配置 type
属性为card
后,走马灯将以卡片形式进行展示。
\n',
'en-US':
'After the type
attribute is set to card
, the lantern is displayed as a card.
\n'
},
- 'codeFiles': ['card-mode.vue']
+ codeFiles: ['card-mode.vue']
},
{
- 'demoId': 'carousel-events',
- 'name': { 'zh-CN': '走马灯事件', 'en-US': 'The Ma Deng incident' },
- 'desc': {
+ demoId: 'carousel-events',
+ name: {
+ 'zh-CN': '走马灯事件',
+ 'en-US': 'The Ma Deng incident'
+ },
+ desc: {
'zh-CN':
'主要包含change
事件。
\n当幻灯片切换时会触发该事件,回调函数可接收两个参数:当前幻灯片索引
和上一张幻灯片索引
。
\n',
'en-US': ''
},
- 'codeFiles': ['carousel-events.vue']
- }
- ],
- apis: [
- {
- 'name': 'carousel',
- 'type': 'component',
- 'props': [
- {
- 'name': 'arrow',
- 'type': 'string',
- 'defaultValue': `该属性的默认值为 'hover'`,
- 'desc': {
- 'zh-CN': '切换箭头的显示效果,该属性的可选值为 always / hover / never',
- 'en-US': 'Switch the display effect of arrows,The optional values for this attribute are always/hover/never'
- },
- 'demoId': 'up-down-carousel'
- },
- {
- 'name': 'autoplay',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 false',
- 'desc': { 'zh-CN': '是否自动切换', 'en-US': 'Whether to automatically switch' },
- 'demoId': 'autoplay'
- },
- {
- 'name': 'height',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '走马灯的高度', 'en-US': 'The height of the lantern' },
- 'demoId': 'indicator-trigger'
- },
- {
- 'name': 'indicator-position',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '指示器的位置。该属性的可选值为 outside / none',
- 'en-US': 'The position of the indicator. The optional values for this attribute are outside/none'
- },
- 'demoId': 'indicator-trigger'
- },
- {
- 'name': 'initial-index',
- 'type': 'number',
- 'defaultValue': '该属性的默认值为 0',
- 'desc': {
- 'zh-CN': '初始状态激活的幻灯片的索引,从 0 开始',
- 'en-US': 'Index of slides activated in initial state, starting from 0'
- },
- 'demoId': 'manual-play'
- },
- {
- 'name': 'interval',
- 'type': 'number',
- 'defaultValue': '该属性的默认值为 3000',
- 'desc': {
- 'zh-CN': '自动切换的时间间隔,单位为毫秒',
- 'en-US': 'The time interval for automatic switching, in milliseconds'
- },
- 'demoId': 'play-interval'
- },
- {
- 'name': 'show-title',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 false',
- 'desc': { 'zh-CN': '是否显示标题', 'en-US': 'Is the title displayed' },
- 'demoId': 'show-title'
- },
- {
- 'name': 'trigger',
- 'type': 'string',
- 'defaultValue': `该属性的默认值为 'hover'`,
- 'desc': {
- 'zh-CN': '指示器的触发方式,默认为 hover。该属性的可选值为 click',
- 'en-US':
- 'The triggering method of the indicator is hover by default. The optional value for this attribute is click'
- },
- 'demoId': 'indicator-trigger'
- },
- {
- 'name': 'type',
- 'type': 'string',
- 'defaultValue': `该属性的默认值为 'horizontal'`,
- 'desc': {
- 'zh-CN': '走马灯的类型,该属性的可选值为 horizontal / vertical / card',
- 'en-US': 'The type of horse lantern,The optional values for this attribute are horizontal/vertical/card'
- },
- 'demoId': 'card-mode'
- },
- {
- 'name': 'loop',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 true',
- 'desc': { 'zh-CN': '是否循环显示', 'en-US': 'Whether to display in a loop' },
- 'demoId': 'close-loop'
- }
- ],
- 'events': [
- {
- 'name': 'change',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '幻灯片切换时触发', 'en-US': 'Trigger during slide transition' },
- 'demoId': 'carousel-events'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '默认插槽', 'en-US': 'Default slot' },
- 'demoId': 'manual-play'
- }
- ],
- 'methods': [
- {
- 'name': 'next',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '切换至下一张幻灯片', 'en-US': 'Switch to the next slide' },
- 'demoId': 'manual-play'
- },
- {
- 'name': 'prev',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '切换至上一张幻灯片', 'en-US': 'Switch to the previous slide' },
- 'demoId': 'manual-play'
- },
- {
- 'name': 'setActiveItem',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '手动切换幻灯片', 'en-US': 'Manually switch slides' },
- 'demoId': 'manual-play'
- }
- ]
- },
- {
- 'name': 'carousel-item',
- 'type': 'component',
- 'props': [
- {
- 'name': 'title',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '幻灯片标题', 'en-US': 'Slide Title' },
- 'demoId': 'show-title'
- },
- {
- 'name': 'name',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '幻灯片名称', 'en-US': 'Slide Name' },
- 'demoId': 'manual-play'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '默认插槽', 'en-US': 'Default slot' },
- 'demoId': 'manual-play'
- }
- ]
+ codeFiles: ['carousel-events.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/cascader-panel/webdoc/cascader-panel.js b/examples/sites/demos/pc/app/cascader-panel/webdoc/cascader-panel.js
index 91cb29df1..ac6059068 100644
--- a/examples/sites/demos/pc/app/cascader-panel/webdoc/cascader-panel.js
+++ b/examples/sites/demos/pc/app/cascader-panel/webdoc/cascader-panel.js
@@ -3,364 +3,60 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN':
'通过 options
来指定选项,也可通过 props
来设置多选、动态加载等功能,具体详情见下方 API 表格。
\n',
'en-US':
'Use options
to specify options. You can also use props
to set functions such as multiple selection and dynamic loading. For details, see the API table below.
\n'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'custom-option-content',
- 'name': { 'zh-CN': '自定义节点内容', 'en-US': 'Custom Node Content' },
- 'desc': {
- 'zh-CN': `
-
可以通过 scoped slot
对级联面板的备选项的节点内容进行自定义。
- scoped slot
会传入两个字段 node
和 data
,分别表示当前节点的 Node 对象和数据。
- `,
- 'en-US': `
- The
can customize the node contents of the cascade panel's alternatives through the scoped slot
.
- scoped slot
passes in two fields, node
and data
, representing the Node object and data of the current node, respectively.
- `
+ demoId: 'custom-option-content',
+ name: {
+ 'zh-CN': '自定义节点内容',
+ 'en-US': 'Custom Node Content'
},
- 'codeFiles': ['custom-option-content.vue']
- },
- {
- 'demoId': 'cascader-panel-props',
- 'name': { 'zh-CN': 'Props 选项', 'en-US': 'Props Options' },
- 'desc': {
- 'zh-CN': `
-
通过 children
指定子级选项,默认值为 'children'。
- 通过 emitPath
是否返回由该节点所在的各级菜单的值所组成的数组。
- 通过 label
指定显示选项 label 值,默认为 'label'。
- 通过 value
指定值选项 value 值,默认为 'value'。
- `,
- 'en-US': `
-
specifies the child options through children
, which defaults to children.
- Whether to return an array of values from the menu levels where the node resides via emitPath
.
- specifies the display option label value by label
, which defaults to label.
- Specifies the value option value by value
, which defaults to value.
- `
+ desc: {
+ 'zh-CN':
+ '\n
可以通过 scoped slot
对级联面板的备选项的节点内容进行自定义。\n scoped slot
会传入两个字段 node
和 data
,分别表示当前节点的 Node 对象和数据。\n ',
+ 'en-US':
+ "\n The
can customize the node contents of the cascade panel's alternatives through the scoped slot
. \n scoped slot
passes in two fields, node
and data
, representing the Node object and data of the current node, respectively. \n "
},
- 'codeFiles': ['cascader-panel-props.vue']
+ codeFiles: ['custom-option-content.vue']
},
{
- 'demoId': 'change',
- 'name': { 'zh-CN': '事件与方法', 'en-US': 'Selected node changes' },
- 'desc': {
- 'zh-CN': `
-
通过 change
点击节点后触发的事件,回调参数为"选中节点的值"。
- 通过 clearCheckedNodes
清除选中的节点。
- 通过 getCheckedNodes
获取选中的节点。
- `,
- 'en-US': `
-
The event triggered by clicking the node through change
, with the callback parameter "Select the value of the node".
- Clear the selected nodes with clearCheckedNodes
.
- Get the selected nodes from getCheckedNodes
.
- `
+ demoId: 'cascader-panel-props',
+ name: {
+ 'zh-CN': 'Props 选项',
+ 'en-US': 'Props Options'
},
- 'codeFiles': ['change.vue']
- }
- ],
- apis: [
- {
- 'name': 'cascader-panel',
- 'type': 'component',
- 'props': [
- {
- 'name': 'modelValue / v-model',
- 'type': 'ICascaderPanelNodePropValue',
- 'typeAnchorName': 'ICascaderPanelNodePropValue',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': `选中项绑定值, 其类型由 props.multiple、props.emitPath 共同决定`,
- 'en-US': `Select an item binding value whose type is determined by both props.multiple and props.emitPath`
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'options',
- 'type': 'ICascaderPanelData[]',
- 'typeAnchorName': 'ICascaderPanelData',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '可选项数据源,键名可通过 Props 属性配置',
- 'en-US': 'Optional data source. The key name can be configured through the Props attribute.'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'props',
- 'type': 'ICascaderPanelConfig',
- 'typeAnchorName': 'ICascaderPanelConfig',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '配置选项,具体见 ICascaderPanelConfig 表 ',
- 'en-US': 'Configuration options. For details, see the ICascaderPanelConfig table.'
- },
- 'demoId': 'cascader-panel-props'
- }
- ],
- 'events': [
- {
- 'name': 'change',
- 'type': '(value: ICascaderPanelNodePropValue) => void',
- 'typeAnchorName': 'ICascaderPanelNodePropValue',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当选中节点变化时触发; 回调参数为 选中节点的值',
- 'en-US':
- 'This event is triggered when the selected node changes. arg: The callback parameter is the value of the selected node (array type).'
- },
- 'demoId': 'change'
- },
- {
- 'name': 'expand-change',
- 'type': '(value: ICascaderPanelNodeValue[]) => void',
- 'typeAnchorName': 'ICascaderPanelNodeValue',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当展开节点发生变化时触发; 回调参数为 各父级选项值组成的数组 (Array 类型)',
- 'en-US':
- 'This event is triggered when the expanded node changes. arg: The callback parameter is an array (Array type) consisting of parent option values.'
- },
- 'demoId': 'change'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '自定义备选项的节点内容,参数为 { node: ICascaderPanelNode, data: ICascaderPanelData },分别为当前节点的 Node 对象和数据',
- 'en-US':
- 'User-defined candidate node content. The parameter is {node, data}, which indicates the node object and data of the current node.'
- },
- 'demoId': 'custom-option-content'
- }
- ],
- 'methods': [
- {
- 'name': 'getCheckedNodes',
- 'type': '(leafOnly: boolean = false) => ICascaderPanelNode[]',
- 'typeAnchorName': 'ICascaderPanelNode',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '获取选中的节点;参数为 (leafOnly) 是否只是获取子节点,默认值为 false',
- 'en-US':
- 'Obtain the selected node. The parameter (leafOnly) indicates whether to obtain only subnodes. The default value is false'
- },
- 'demoId': 'change'
- },
- {
- 'name': 'clearCheckedNodes',
- 'type': '() => void',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '清空选中的节点', 'en-US': 'Clear selected nodes.' },
- 'demoId': 'change'
- }
- ]
+ desc: {
+ 'zh-CN':
+ "\n
通过 children
指定子级选项,默认值为 'children'。\n 通过 emitPath
是否返回由该节点所在的各级菜单的值所组成的数组。\n 通过 label
指定显示选项 label 值,默认为 'label'。\n 通过 value
指定值选项 value 值,默认为 'value'。\n ",
+ 'en-US':
+ '\n
specifies the child options through children
, which defaults to children. \n Whether to return an array of values from the menu levels where the node resides via emitPath
. \n specifies the display option label value by label
, which defaults to label. \n Specifies the value option value by value
, which defaults to value. \n '
+ },
+ codeFiles: ['cascader-panel-props.vue']
},
{
- 'name': 'ICascaderPanelConfig ',
- 'type': 'interface',
- 'props': [
- {
- 'name': 'expandTrigger',
- 'type': `'click' | 'hover'`,
- 'defaultValue': `'click'`,
- 'desc': {
- 'zh-CN': '次级菜单的展开方式',
- 'en-US': 'The expansion mode of the secondary menu'
- }
- },
- {
- 'name': 'multiple',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否多选', 'en-US': 'Whether to select multiple options' }
- },
- {
- 'name': 'checkStrictly',
- 'type': 'boolean',
- 'defaultValue': ' false',
- 'desc': {
- 'zh-CN': '是否严格的遵守父子节点不互相关联',
- 'en-US':
- 'Whether to strictly comply with the principle that parent and child nodes are not associated with each other'
- }
- },
- {
- 'name': 'emitPath',
- 'type': 'boolean',
- 'defaultValue': ' true',
- 'desc': {
- 'zh-CN':
- '在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值',
- 'en-US':
- 'Indicates whether to return an array consisting of the values of menus at different levels of the selected node when the selected node is changed. If this parameter is set to false, only the value of the selected node is returned.'
- }
- },
- {
- 'name': 'lazy',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否动态加载子节点,需与 lazyLoad 方法结合使用',
- 'en-US':
- 'Whether to dynamically load subnodes. This parameter must be used together with the lazyLoad method.'
- }
- },
- {
- 'name': 'lazyLoad',
- 'type': 'ICascaderPanelLazyLoad',
- 'typeAnchorName': 'ICascaderPanelLazyLoad',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '加载动态数据的方法,仅在 lazy 为 true 时有效;参数说明: node 为当前点击的节点,resolve 为数据加载完成的回调(必须调用)',
- 'en-US':
- 'Method for loading dynamic data. This parameter is valid only when lazy is set to true. Parameter description: node indicates the currently clicked node. resolve indicates the callback after data loading is complete (mandatory).'
- }
- },
- {
- 'name': 'value',
- 'type': 'string',
- 'defaultValue': "'value'",
- 'desc': {
- 'zh-CN': '指定选项的值为选项对象的某个属性值',
- 'en-US': 'The value of an option is the value of an attribute of the option object.'
- },
- 'demoId': 'cascader-panel-props'
- },
- {
- 'name': 'label',
- 'type': 'string',
- 'defaultValue': "'label'",
- 'desc': {
- 'zh-CN': '指定选项标签为选项对象的某个属性值',
- 'en-US': 'Specify that the option label is an attribute value of the option object.'
- },
- 'demoId': 'cascader-panel-props'
- },
- {
- 'name': 'children',
- 'type': 'string',
- 'defaultValue': "'children'",
- 'desc': {
- 'zh-CN': '指定选项的子选项为选项对象的某个属性值',
- 'en-US': 'Specifies that the sub-option of an option is an attribute value of the option object.'
- },
- 'demoId': 'cascader-panel-props'
- },
- {
- 'name': 'disabled',
- 'type': 'string',
- 'defaultValue': "'disabled'",
- 'desc': {
- 'zh-CN': '指定选项的禁用为选项对象的某个属性值',
- 'en-US': 'Specify that an option is disabled as an attribute value of the option object.'
- },
- 'demoId': 'cascader-panel-props'
- },
- {
- 'name': 'leaf',
- 'type': 'string',
- 'defaultValue': "'leaf'",
- 'desc': {
- 'zh-CN': '指定选项的叶子节点的标志位为选项对象的某个属性值',
- 'en-US': 'The flag bit of the leaf node of the specified option is an attribute value of the option object.'
- },
- 'demoId': 'cascader-panel-props'
- }
- ]
- }
- ],
- types: [
- {
- name: 'ICascaderPanelNodeValue',
- type: 'type',
- code: `type ICascaderPanelNodeValue = string | number`
- },
- {
- name: 'ICascaderPanelNodePropValue',
- type: 'type',
- code: `
-type ICascaderPanelNodePropValue =
- | ICascaderPanelNodeValue
- | ICascaderPanelNodeValue[]
- | ICascaderPanelNodeValue[][]`
- },
- {
- name: 'ICascaderPanelData',
- type: 'type',
- code: `
-type ICascaderPanelData = {
- value?: ICascaderPanelNodeValue
- label?: string
- children?: ICascaderPanelData[]
- disabled?: boolean
- leaf?: boolean
- [key: string]: ICascaderPanelNodeValue | ICascaderPanelData[] | string | boolean | undefined
-}`
- },
- {
- name: 'ICascaderPanelConfig',
- type: 'interface',
- code: `
-interface ICascaderPanelConfig {
- emitPath: boolean
- expandTrigger: 'click' | 'hover'
- hoverThreshold: number
- checkStrictly?: boolean
- multiple?: boolean
- lazy: boolean
- lazyLoad: (
- node: ICascaderPanelNode,
- resolve: (dataList: ICascaderPanelData[]) => void
- ) => void
- value: string
- label: string
- children: string
- disabled: string
- leaf: string
-}`
- },
- {
- name: 'ICascaderPanelNode',
- type: 'type',
- code: `
-type ICascaderPanelNode = {
- parent: ICascaderPanelNode | null
- level: number
- data: ICascaderPanelData
- config: ICascaderPanelConfig
- uid: number
- value: ICascaderPanelNodeValue
- label: string
- pathNodes: Node[]
- path: ICascaderPanelNodeValue[]
- pathLabels: string[]
- loaded: boolean
- loading: boolean
- hasChildren: boolean
- children: Node[]
- checked?: boolean
- indeterminate?: boolean
- root?: boolean
-}`
- },
- {
- name: 'ICascaderPanelLazyLoad',
- type: 'type',
- code: `
-type ICascaderPanelLazyLoad = (node: ICascaderPanelNode, resolve: (dataList: ICascaderPanelData[]) => void) => void
- `
+ demoId: 'change',
+ name: {
+ 'zh-CN': '事件与方法',
+ 'en-US': 'Selected node changes'
+ },
+ desc: {
+ 'zh-CN':
+ '\n
通过 change
点击节点后触发的事件,回调参数为"选中节点的值"。\n 通过 clearCheckedNodes
清除选中的节点。\n 通过 getCheckedNodes
获取选中的节点。\n ',
+ 'en-US':
+ '\n
The event triggered by clicking the node through change
, with the callback parameter "Select the value of the node". \n Clear the selected nodes with clearCheckedNodes
. \n Get the selected nodes from getCheckedNodes
. \n '
+ },
+ codeFiles: ['change.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/cascader/auto-size-composition-api.vue b/examples/sites/demos/pc/app/cascader/auto-size-composition-api.vue
new file mode 100644
index 000000000..2e7bee22d
--- /dev/null
+++ b/examples/sites/demos/pc/app/cascader/auto-size-composition-api.vue
@@ -0,0 +1,158 @@
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/cascader/auto-size.vue b/examples/sites/demos/pc/app/cascader/auto-size.vue
new file mode 100644
index 000000000..8c6c6cfae
--- /dev/null
+++ b/examples/sites/demos/pc/app/cascader/auto-size.vue
@@ -0,0 +1,166 @@
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/cascader/check-strictly-multiple.spec.ts b/examples/sites/demos/pc/app/cascader/check-strictly-multiple.spec.ts
index b4de85523..c581a9122 100644
--- a/examples/sites/demos/pc/app/cascader/check-strictly-multiple.spec.ts
+++ b/examples/sites/demos/pc/app/cascader/check-strictly-multiple.spec.ts
@@ -3,7 +3,7 @@ import { test, expect } from '@playwright/test'
test('多选选择任意一级选项', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('cascader#check-strictly-multiple')
- await page.getByText('指南/安装指南/开发/引入组件').click()
+ await page.getByText('指南 /安装指南 /开发 /引入组件').click()
await page.getByRole('menuitem', { name: '开发' }).locator('span').nth(1).click()
await page.getByRole('menuitem', { name: '安装' }).click()
const kaifa = page.getByRole('menuitem', { name: '开发' }).locator('span').nth(1)
diff --git a/examples/sites/demos/pc/app/cascader/default-multiple.spec.ts b/examples/sites/demos/pc/app/cascader/default-multiple.spec.ts
index eb04354a6..388f90064 100644
--- a/examples/sites/demos/pc/app/cascader/default-multiple.spec.ts
+++ b/examples/sites/demos/pc/app/cascader/default-multiple.spec.ts
@@ -4,7 +4,7 @@ test('多选', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('cascader#default-multiple')
const multiple = page.locator('.tiny-cascader-multiple')
- const multipleText = page.getByText('指南/安装/项目登记指南/安装/安装 CLI指南/开发/引入组件')
+ const multipleText = page.getByText('指南 /安装 /项目登记指南 /安装 /安装 CLI指南 /开发 /引入组件')
await expect(multiple).toBeVisible()
await expect(multipleText).toBeVisible()
})
diff --git a/examples/sites/demos/pc/app/cascader/filter-method.spec.ts b/examples/sites/demos/pc/app/cascader/filter-method.spec.ts
index 035b2ee23..76740a4c1 100644
--- a/examples/sites/demos/pc/app/cascader/filter-method.spec.ts
+++ b/examples/sites/demos/pc/app/cascader/filter-method.spec.ts
@@ -7,8 +7,8 @@ test('自定义搜索逻辑', async ({ page }) => {
await page.getByRole('textbox', { name: '试试搜索:安装' }).fill('安装')
await page
.getByRole('listitem')
- .filter({ hasText: /^指南\/安装$/ })
+ .filter({ hasText: /^指南 \/安装$/ })
.click()
const text = await page.getByRole('textbox', { name: '试试搜索:安装' }).inputValue()
- await expect(text).toEqual('指南/安装')
+ await expect(text).toEqual('指南 /安装')
})
diff --git a/examples/sites/demos/pc/app/cascader/filter-mode-composition-api.vue b/examples/sites/demos/pc/app/cascader/filter-mode-composition-api.vue
new file mode 100644
index 000000000..e4f3cb2b7
--- /dev/null
+++ b/examples/sites/demos/pc/app/cascader/filter-mode-composition-api.vue
@@ -0,0 +1,172 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/cascader/filter-mode.vue b/examples/sites/demos/pc/app/cascader/filter-mode.vue
new file mode 100644
index 000000000..c8c9de8ae
--- /dev/null
+++ b/examples/sites/demos/pc/app/cascader/filter-mode.vue
@@ -0,0 +1,179 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/cascader/filterable-multiple.spec.ts b/examples/sites/demos/pc/app/cascader/filterable-multiple.spec.ts
index 5b2004082..88bbf8bbb 100644
--- a/examples/sites/demos/pc/app/cascader/filterable-multiple.spec.ts
+++ b/examples/sites/demos/pc/app/cascader/filterable-multiple.spec.ts
@@ -8,13 +8,13 @@ test('多选可搜索', async ({ page }) => {
await page.waitForTimeout(1000)
const text = await page.locator('.tiny-cascader__suggestion-item')
await expect(text).toHaveText([
- '指南/安装/项目登记',
- '指南/安装/环境准备',
- '指南/安装/安装 CLI',
- '指南/安装/创建项目'
+ '指南 /安装 /项目登记',
+ '指南 /安装 /环境准备',
+ '指南 /安装 /安装 CLI',
+ '指南 /安装 /创建项目'
])
- await page.getByRole('listitem').filter({ hasText: '指南/安装/项目登记' }).click()
- await page.getByRole('listitem').filter({ hasText: '指南/安装/环境准备' }).click()
- await expect(page.locator('span').filter({ hasText: '指南/安装/项目登记' }).first()).toBeVisible()
- await expect(page.locator('span').filter({ hasText: '指南/安装/环境准备' }).first()).toBeVisible()
+ await page.getByRole('listitem').filter({ hasText: '指南 /安装 /项目登记' }).click()
+ await page.getByRole('listitem').filter({ hasText: '指南 /安装 /环境准备' }).click()
+ await expect(page.locator('span').filter({ hasText: '指南 /安装 /项目登记' }).first()).toBeVisible()
+ await expect(page.locator('span').filter({ hasText: '指南 /安装 /环境准备' }).first()).toBeVisible()
})
diff --git a/examples/sites/demos/pc/app/cascader/filterable.spec.ts b/examples/sites/demos/pc/app/cascader/filterable.spec.ts
index cb42dad2c..0ba4ddb16 100644
--- a/examples/sites/demos/pc/app/cascader/filterable.spec.ts
+++ b/examples/sites/demos/pc/app/cascader/filterable.spec.ts
@@ -8,9 +8,9 @@ test('可搜索', async ({ page }) => {
await page.waitForTimeout(1000)
const text = await page.locator('.tiny-cascader__suggestion-item')
await expect(text).toHaveText([
- '指南/安装/项目登记',
- '指南/安装/环境准备',
- '指南/安装/安装 CLI',
- '指南/安装/创建项目'
+ '指南 /安装 /项目登记',
+ '指南 /安装 /环境准备',
+ '指南 /安装 /安装 CLI',
+ '指南 /安装 /创建项目'
])
})
diff --git a/examples/sites/demos/pc/app/cascader/props-children.spec.ts b/examples/sites/demos/pc/app/cascader/props-children.spec.ts
index f07a18a01..946bbf807 100644
--- a/examples/sites/demos/pc/app/cascader/props-children.spec.ts
+++ b/examples/sites/demos/pc/app/cascader/props-children.spec.ts
@@ -4,5 +4,5 @@ test('指定选项', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('cascader#props-children')
const text = await page.getByRole('textbox', { name: '请选择' }).inputValue()
- await expect(text).toEqual('指南/安装/安装 CLI')
+ await expect(text).toEqual('指南 /安装 /安装 CLI')
})
diff --git a/examples/sites/demos/pc/app/cascader/webdoc/cascader.js b/examples/sites/demos/pc/app/cascader/webdoc/cascader.js
index d34c4e504..7a52d2c6b 100644
--- a/examples/sites/demos/pc/app/cascader/webdoc/cascader.js
+++ b/examples/sites/demos/pc/app/cascader/webdoc/cascader.js
@@ -3,694 +3,271 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '通过 options
属性指定选项数组即可渲染出一个级联选择器。
\n',
'en-US':
'Renders a cascade selector by specifying an array of options with the options
attribute.
\n'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'expand-trigger',
- 'name': { 'zh-CN': 'hover 触发子菜单', 'en-US': 'Hover Triggering Submenu' },
- 'desc': {
+ demoId: 'expand-trigger',
+ name: {
+ 'zh-CN': 'hover 触发子菜单',
+ 'en-US': 'Hover Triggering Submenu'
+ },
+ desc: {
'zh-CN':
'通过 props.expandTrigger
可以指定展开子级菜单的触发方式为 hover
,默认为 click
。
\n',
'en-US':
'You can use props.expandTrigger
to specify the triggering mode of expanding a submenu as hover
. The default triggering mode is click
.
\n'
},
- 'codeFiles': ['expand-trigger.vue']
+ codeFiles: ['expand-trigger.vue']
},
{
- 'demoId': 'disabled-items',
- 'name': { 'zh-CN': '禁用选项', 'en-US': 'Disable Options' },
- 'desc': {
- 'zh-CN': `
-
通过在数据源option
中设置 disabled
字段来声明该选项是禁用的,在默认情况下,Cascader 会检查数据中每一项的 disabled
字段是否为 true
。
- 也可以通过直接设置 disabled
可以禁用组件。
- `,
- 'en-US': `
-
Declare that the option is disabled by setting the disabled
field in the data source; by default, Cascader checks to see if the disabled
field is true
for each item in the data.
- Components can also be disabled by setting disabled
directly.
- `
+ demoId: 'disabled-items',
+ name: {
+ 'zh-CN': '禁用选项',
+ 'en-US': 'Disable Options'
},
- 'codeFiles': ['disabled-items.vue']
+ desc: {
+ 'zh-CN':
+ '\n
通过在数据源option
中设置 disabled
字段来声明该选项是禁用的,在默认情况下,Cascader 会检查数据中每一项的 disabled
字段是否为 true
。\n 也可以通过直接设置 disabled
可以禁用组件。\n ',
+ 'en-US':
+ '\n
Declare that the option is disabled by setting the disabled
field in the data source; by default, Cascader checks to see if the disabled
field is true
for each item in the data. \n Components can also be disabled by setting disabled
directly.\n '
+ },
+ codeFiles: ['disabled-items.vue']
},
{
- 'demoId': 'clearable',
- 'name': { 'zh-CN': '可清空', 'en-US': 'Can be cleared' },
- 'desc': {
+ demoId: 'clearable',
+ name: {
+ 'zh-CN': '可清空',
+ 'en-US': 'Can be cleared'
+ },
+ desc: {
'zh-CN': '通过 clearable
属性设置输入框可清空。
\n',
'en-US': 'You can clear the text box by setting the clearable
attribute.
\n'
},
- 'codeFiles': ['clearable.vue']
+ codeFiles: ['clearable.vue']
},
{
- 'demoId': 'clearable1',
- 'name': { 'zh-CN': '分隔符', 'en-US': 'Separator' },
- 'desc': {
+ demoId: 'clearable1',
+ name: {
+ 'zh-CN': '分隔符',
+ 'en-US': 'Separator'
+ },
+ desc: {
'zh-CN': '通过 separator
属性设置分隔符。
\n',
'en-US': 'Set the separator through the separator
attribute.
\n'
},
- 'codeFiles': ['clearable.vue']
+ codeFiles: ['clearable.vue']
},
{
- 'demoId': 'size',
- 'name': { 'zh-CN': '尺寸', 'en-US': 'Dimension' },
- 'desc': {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '尺寸',
+ 'en-US': 'Dimension'
+ },
+ desc: {
'zh-CN': '通过 size
属性设置尺寸。
\n',
'en-US': 'Sets the size through the size
attribute.
\n'
},
- 'codeFiles': ['size.vue']
+ codeFiles: ['size.vue']
},
{
- 'demoId': 'default-multiple',
- 'name': { 'zh-CN': '多选', 'en-US': 'Multiple Choices' },
- 'desc': {
+ demoId: 'default-multiple',
+ name: {
+ 'zh-CN': '多选',
+ 'en-US': 'Multiple Choices'
+ },
+ desc: {
'zh-CN': '通过 props.multiple = true
来开启多选模式。
\n',
'en-US': 'Use props.multiple = true
to enable the multi-selection mode.
\n'
},
- 'codeFiles': ['default-multiple.vue']
+ codeFiles: ['default-multiple.vue']
},
{
- 'demoId': 'collapse-tags',
- 'name': { 'zh-CN': '折叠展示 Tag', 'en-US': 'Fold Tag' },
- 'desc': {
+ demoId: 'filter-mode',
+ name: {
+ 'zh-CN': '过滤器模式',
+ 'en-US': 'Filter Mode'
+ },
+ desc: {
+ 'zh-CN':
+ "\n
通过 shape='filter' 属性切换至过滤器模式。
\n 过滤器模式下可传入 label 显示标题,tip 显示提示信息,clearable 是否显示清除按钮,placeholder 显示占位符,blank 背景为透明。
\n ",
+ 'en-US':
+ "\n
Use the shape='filter' attribute to switch to filter mode.
\n In filter mode, label can be passed to show the title, tip can show the prompt message, clearable can show the clear button, placeholder can show the placeholder, blank background can be transparent.
\n "
+ },
+ codeFiles: ['filter-mode.vue']
+ },
+ {
+ demoId: 'auto-size',
+ name: {
+ 'zh-CN': '自适应高度',
+ 'en-US': 'Adaptive height'
+ },
+ desc: {
+ 'zh-CN': '通过 auto-size 属性指定下拉弹框是否根据内容自适应高度。
',
+ 'en-US':
+ 'Use the auto-size property to specify whether the drop-down box ADAPTS to the height based on the content.
'
+ },
+ codeFiles: ['auto-size.vue']
+ },
+ {
+ demoId: 'collapse-tags',
+ name: {
+ 'zh-CN': '折叠展示 Tag',
+ 'en-US': 'Fold Tag'
+ },
+ desc: {
'zh-CN':
'在开启多选模式后,默认情况下会展示所有已选中的选项的 Tag,可以使用 collapse-tags
来折叠 Tag 。
',
'en-US':
'After the multi-selection mode is enabled, tags of all selected options are displayed by default. You can use collapse-tags
to collapse tags.
'
},
- 'codeFiles': ['collapse-tags.vue']
+ codeFiles: ['collapse-tags.vue']
},
{
- 'demoId': 'check-strictly',
- 'name': { 'zh-CN': '父子级不相关联', 'en-US': 'The parent and child levels are not associated.' },
- 'desc': {
+ demoId: 'check-strictly',
+ name: {
+ 'zh-CN': '父子级不相关联',
+ 'en-US': 'The parent and child levels are not associated.'
+ },
+ desc: {
'zh-CN':
'通过 props.checkStrictly = true
来设置父子节点取消选中关联,从而达到选择任意一级选项的目的。默认单选模式下,只能选择叶子节点。
\n',
'en-US':
'The props.checkStrictly = true
is used to set the association between the parent and child nodes. In this way, any level of options can be selected. In the default single-choice mode, only leaf nodes can be selected.
\n'
},
- 'codeFiles': ['check-strictly.vue']
+ codeFiles: ['check-strictly.vue']
},
{
- 'demoId': 'check-strictly-multiple',
- 'name': { 'zh-CN': '多选选择任意一级选项', 'en-US': 'Select any level of options from multiple options.' },
- 'desc': {
+ demoId: 'check-strictly-multiple',
+ name: {
+ 'zh-CN': '多选选择任意一级选项',
+ 'en-US': 'Select any level of options from multiple options.'
+ },
+ desc: {
'zh-CN': '在多选模式下同时取消父子节点关联,选择任意一级选项。
\n',
'en-US':
'In multi-selection mode, cancel the association between parent and child nodes and select any level of options.
\n'
},
- 'codeFiles': ['check-strictly-multiple.vue']
+ codeFiles: ['check-strictly-multiple.vue']
},
{
- 'demoId': 'auto-load',
- 'name': { 'zh-CN': '动态加载', 'en-US': 'Dynamic loading' },
- 'desc': {
- 'zh-CN': `
-
-
当选中某一级时,动态加载该级下的选项。
- 通过 props
属性中的 lazy
开启动态加载,并通过 lazyload
来设置加载数据源的方法。
- lazyload
方法有两个参数,第一个参数 node 为当前点击的节点,第二个 resolve 为数据加载完成的回调(必须调用)。
-
-
为了更准确的显示节点的状态,默认地(默认指没有设置props.leaf
)可以使用leaf
字段。
- 表明此节点是否为叶子节点,否则会简单地以有无子节点来判断是否为叶子节点。
-
-
- `,
- 'en-US': `
-
-
When a level is selected, dynamically loads the options under that level.
- enables dynamic loading with lazy
in the props
property, and sets the method of loading the data source with lazyload
.
- Thelazyload
method takes two arguments, node for the current clicked node, and resolve for the callback (which must be called) when the data is loaded.
-
-
In order to more accurately display the state of the node, the leaf
field can be used by default (the default means that props.leaf
is not set).
- indicates whether this node is a leaf, otherwise it is simply determined by the presence or absence of child nodes.
-
-
- `
+ demoId: 'auto-load',
+ name: {
+ 'zh-CN': '动态加载',
+ 'en-US': 'Dynamic loading'
},
- 'codeFiles': ['auto-load.vue']
+ desc: {
+ 'zh-CN':
+ '\n \n
当选中某一级时,动态加载该级下的选项。\n 通过 props
属性中的 lazy
开启动态加载,并通过 lazyload
来设置加载数据源的方法。\n lazyload
方法有两个参数,第一个参数 node 为当前点击的节点,第二个 resolve 为数据加载完成的回调(必须调用)。\n \n
为了更准确的显示节点的状态,默认地(默认指没有设置props.leaf
)可以使用leaf
字段。\n 表明此节点是否为叶子节点,否则会简单地以有无子节点来判断是否为叶子节点。\n \n \n ',
+ 'en-US':
+ '\n \n
When a level is selected, dynamically loads the options under that level. \n enables dynamic loading with lazy
in the props
property, and sets the method of loading the data source with lazyload
. \n Thelazyload
method takes two arguments, node for the current clicked node, and resolve for the callback (which must be called) when the data is loaded. \n \n
In order to more accurately display the state of the node, the leaf
field can be used by default (the default means that props.leaf
is not set). \n indicates whether this node is a leaf, otherwise it is simply determined by the presence or absence of child nodes. \n \n \n '
+ },
+ codeFiles: ['auto-load.vue']
},
{
- 'demoId': 'auto-load-checkStrictly',
- 'name': { 'zh-CN': '动态加载且父子级不相关联', 'en-US': 'Dynamic loading with no parent-child association' },
- 'desc': {
+ demoId: 'auto-load-checkStrictly',
+ name: {
+ 'zh-CN': '动态加载且父子级不相关联',
+ 'en-US': 'Dynamic loading with no parent-child association'
+ },
+ desc: {
'zh-CN':
'当选中某一级时,动态加载该级下的选项。通过 props
属性中的 lazy
开启动态加载,并通过 lazyload
来设置加载数据源的方法。通过 props
属性中的 checkStrictly
开启父子级不相关联。
\n',
'en-US':
'When a level is selected, the options under the level are dynamically loaded. Use lazy
in the props
attribute to enable dynamic loading, and use lazyload
to set the method for loading data sources. Use checkStrictly
in the props
attribute to enable parent-child disassociation.
\n'
},
- 'codeFiles': ['auto-load-checkStrictly.vue']
+ codeFiles: ['auto-load-checkStrictly.vue']
},
{
- 'demoId': 'props-children',
- 'name': { 'zh-CN': '指定选项', 'en-US': 'Specify Options' },
- 'desc': {
- 'zh-CN': `
-
通过 props.children
指定选项的子选项,默认为 'children' 。
- 通过 props.value
指定指定选项的 value 值,默认为 'value' 。
- 通过 props.label
指定选项标签,默认为 'label' 。
- `,
- 'en-US': `
-
specifies the suboptions of the option via props.children
, which defaults to 'children'.
- Specifies the value of the given option via props.value
, which defaults to 'value'.
- Specifies the option label via props.label
, which defaults to 'label'.
- `
+ demoId: 'props-children',
+ name: {
+ 'zh-CN': '指定选项',
+ 'en-US': 'Specify Options'
},
- 'codeFiles': ['props-children.vue']
- },
- {
- 'demoId': 'filterable',
- 'name': { 'zh-CN': '可搜索', 'en-US': 'Searchable' },
- 'desc': {
- 'zh-CN': `
- 将 filterable
赋值为 true
即可打开搜索功能,默认会匹配节点的 label
或所有父节点的 label
(由 show-all-levels
决定)中包含输入值的选项。
- 使用empty
插槽设置无匹配选项时显示的内容,使用debounce
设置搜索延迟。
-
`,
- 'en-US': `
- Set filterable
to true
to turn on the search function, By default, the label
of the node or the label
of all parent nodes (as determined by show-all-levels
) will match the option containing the input value.
- Use the empty
slot to set what will be displayed if there is no matching option, and use debounce
to set the search delay.
-
`
+ desc: {
+ 'zh-CN':
+ "\n
通过 props.children
指定选项的子选项,默认为 'children' 。\n 通过 props.value
指定指定选项的 value 值,默认为 'value' 。\n 通过 props.label
指定选项标签,默认为 'label' 。\n ",
+ 'en-US':
+ "\n
specifies the suboptions of the option via props.children
, which defaults to 'children'. \n Specifies the value of the given option via props.value
, which defaults to 'value'. \n Specifies the option label via props.label
, which defaults to 'label'. \n "
},
- 'codeFiles': ['filterable.vue']
+ codeFiles: ['props-children.vue']
},
{
- 'demoId': 'filterable-multiple',
- 'name': { 'zh-CN': '多选可搜索', 'en-US': 'Multiple choices can be searched' },
- 'desc': {
+ demoId: 'filterable',
+ name: {
+ 'zh-CN': '可搜索',
+ 'en-US': 'Searchable'
+ },
+ desc: {
+ 'zh-CN':
+ '\n 将 filterable
赋值为 true
即可打开搜索功能,默认会匹配节点的 label
或所有父节点的 label
(由 show-all-levels
决定)中包含输入值的选项。\n 使用empty
插槽设置无匹配选项时显示的内容,使用debounce
设置搜索延迟。\n
',
+ 'en-US':
+ '\n Set filterable
to true
to turn on the search function, By default, the label
of the node or the label
of all parent nodes (as determined by show-all-levels
) will match the option containing the input value. \n Use the empty
slot to set what will be displayed if there is no matching option, and use debounce
to set the search delay.\n
'
+ },
+ codeFiles: ['filterable.vue']
+ },
+ {
+ demoId: 'filterable-multiple',
+ name: {
+ 'zh-CN': '多选可搜索',
+ 'en-US': 'Multiple choices can be searched'
+ },
+ desc: {
'zh-CN': '多选模式下开启搜索功能。
\n',
'en-US': 'Enable the search function in multi-choice mode.
\n'
},
- 'codeFiles': ['filterable-multiple.vue']
+ codeFiles: ['filterable-multiple.vue']
},
{
- 'demoId': 'filter-method',
- 'name': { 'zh-CN': '自定义搜索逻辑', 'en-US': 'Customized search logic' },
- 'desc': {
+ demoId: 'filter-method',
+ name: {
+ 'zh-CN': '自定义搜索逻辑',
+ 'en-US': 'Customized search logic'
+ },
+ desc: {
'zh-CN':
'filter-method
自定义搜索逻辑,第一个参数是节点 node,第二个参数是搜索关键词 keyword,通过返回布尔值表示是否命中,如果需要搜索到父级,通过 props.checkStrictly = true 来设置父子节点取消选中关联,从而达到选择任意一级选项的目的。默认单选模式下,只能选择叶子节点。
\n',
'en-US':
'filter-method
customizes the search logic. The first parameter is node, and the second parameter is keyword. A boolean value is returned to indicate whether the search is hit. To select a parent, set props.checkStrictly = true to deselect the parent and child nodes. In this way, the purpose of selecting any level of option is achieved. In the default single-choice mode, only leaf nodes can be selected.
\n'
},
- 'codeFiles': ['filter-method.vue']
+ codeFiles: ['filter-method.vue']
},
{
- 'demoId': 'show-all-levels',
- 'name': { 'zh-CN': '仅显示最后一级', 'en-US': 'Only the last level is displayed.' },
- 'desc': {
+ demoId: 'show-all-levels',
+ name: {
+ 'zh-CN': '仅显示最后一级',
+ 'en-US': 'Only the last level is displayed.'
+ },
+ desc: {
'zh-CN':
'属性 show-all-levels
定义了是否显示完整的路径,将其赋值为 false
则仅显示最后一级,默认为 true
,显示选中项所在的完整路径。
\n',
'en-US':
'The show-all-levels
attribute defines whether to display the complete path. If it is set to false
, only the last level is displayed. The default value is true
, indicating that the full path of the selected item is displayed.
\n'
},
- 'codeFiles': ['show-all-levels.vue']
+ codeFiles: ['show-all-levels.vue']
},
{
- 'demoId': 'events',
- 'name': { 'zh-CN': '事件', 'en-US': 'Event' },
- 'desc': {
- 'zh-CN': `
- Cascader 级联选择器的事件有:change
、expand-change
、blur
、focus
、visible-change
。
-
使用 props.emitPath
能设置节点的返回类型。
- `,
- 'en-US': `
- Cascader cascade selector events include: change
, expand-change
, blur
, focus
, < code>visible-change.
- Use props.emitPath
to set the return type of the node.
-
`
+ demoId: 'events',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': 'Event'
},
- 'codeFiles': ['events.vue']
- }
- ],
- apis: [
- {
- 'name': 'cascader',
- 'type': 'component',
- 'props': [
- {
- 'name': 'modelValue / v-model',
- 'type': 'ICascaderPanelNodePropValue',
- 'typeAnchorName': 'ICascaderPanelNodeValue',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '选中项绑定值, 其类型由 props.multiple、props.emitPath 共同决定',
- 'en-US':
- 'Binding value of the selected item, its type is determined by props.multiple, props.emitPath together.'
- },
- 'demoId': 'clearable'
- },
- {
- 'name': 'options',
- 'type': 'ICascaderPanelData[]',
- 'typeAnchorName': 'ICascaderPanelData',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '可选项数据源,键名可通过 Props 属性配置',
- 'en-US': 'Optional data source. The key name can be configured through the Props attribute.'
- },
- 'demoId': 'disabled-items'
- },
- {
- 'name': 'props',
- 'type': 'ICascaderPanelConfig',
- 'typeAnchorName': 'ICascaderPanelConfig',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '配置选项,具体见 ICascaderPanelConfig 表',
- 'en-US': 'Configuration options. For details, see the ICascaderPanelConfig table.'
- },
- 'demoId': 'props-children'
- },
- {
- 'name': 'popper-class',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '为 popper 添加类名(可参考 popover 组件)',
- 'en-US': 'Add a class name for the popper. For details, see the popover component.'
- },
- 'demoId': ''
- },
- {
- 'name': 'popper-append-to-body',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN':
- '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)',
- 'en-US':
- 'Indicates whether to insert a pop-up box to the body element. If an error occurs in locating a fault in the dialog box that is displayed, set this attribute to false (for details, see the select component).'
- },
- 'demoId': ''
- },
- {
- 'name': 'size',
- 'type': `'medium' | 'small' | 'mini'`,
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '尺寸',
- 'en-US': 'Dimension;'
- },
- 'demoId': 'size'
- },
- {
- 'name': 'placeholder',
- 'type': 'string',
- 'defaultValue': `'请选择'`,
- 'desc': { 'zh-CN': '输入框占位文本', 'en-US': 'Placeholder text in the text box' },
- 'demoId': 'filterable'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否禁用', 'en-US': 'Disable' },
- 'demoId': 'disabled-items'
- },
- {
- 'name': 'clearable',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否支持清空选项', 'en-US': 'Whether to support the clear option' },
- 'demoId': 'clearable'
- },
- {
- 'name': 'show-all-levels',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '输入框中是否显示选中值的完整路径',
- 'en-US': 'Whether to display the full path of the selected value in the text box'
- },
- 'demoId': 'show-all-levels'
- },
- {
- 'name': 'collapse-tags',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '多选模式下是否折叠 Tag', 'en-US': 'Whether to collapse tags in multi-choice mode' },
- 'demoId': 'collapse-tags'
- },
- {
- 'name': 'separator',
- 'type': 'string',
- 'defaultValue': `'/'`,
- 'desc': { 'zh-CN': '选项分隔符', 'en-US': 'Option separator' },
- 'demoId': 'clearable1'
- },
- {
- 'name': 'filterable',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '是否可搜索选项', 'en-US': 'Whether to search for options' },
- 'demoId': 'filterable'
- },
- {
- 'name': 'filter-method',
- 'type': '(node: ICascaderPanelNode, keyword: string) => boolean',
- 'typeAnchorName': 'ICascaderPanelNode',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '自定义搜索逻辑,第一个参数是节点 node,第二个参数是搜索关键词 keyword,通过返回布尔值表示是否命中',
- 'en-US':
- 'Customize the search logic. The first parameter is node, and the second parameter is keyword. A boolean value is returned to indicate whether the search is hit.'
- },
- 'demoId': 'filter-method'
- },
- {
- 'name': 'debounce',
- 'type': 'number',
- 'defaultValue': '300',
- 'desc': {
- 'zh-CN': '搜索关键词输入的去抖延迟,单位毫秒',
- 'en-US': 'Dejitter delay of the search keyword, in milliseconds.'
- },
- 'demoId': 'filterable'
- },
- {
- 'name': 'before-filter',
- 'type': '(value: string) => boolean | Promise',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '筛选之前的钩子,参数为输入的值,若返回 false 或者返回 Promise 且被 reject,则停止筛选',
- 'en-US':
- 'Hook before filtering. The parameter is the input value. If false is returned or Promise is returned and rejected, the filtering stops.'
- },
- 'demoId': 'filter-method'
- },
- {
- 'name': 'popper-class',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '自定义浮层类名', 'en-US': 'Customized floating layer class name' },
- 'demoId': ''
- }
- ],
- 'events': [
- {
- 'name': 'change',
- 'type': '(value: ICascaderPanelNodePropValue) => void',
- 'typeAnchorName': 'ICascaderPanelNodePropValue',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当选中节点变化时触发',
- 'en-US': 'This event is triggered when the selected node changes.'
- },
- 'demoId': 'events'
- },
- {
- 'name': 'expand-change',
- 'type': '(value: ICascaderPanelNodeValue[]) => void',
- 'typeAnchorName': 'ICascaderPanelNodeValue',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当展开节点发生变化时触发',
- 'en-US':
- 'This event is triggered when the expanded node changes. arg: The callback parameter is an array (Array type) consisting of parent option values.'
- },
- 'demoId': 'events'
- },
- {
- 'name': 'blur',
- 'type': '(event: FocusEvent) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当失去焦点时触发',
- 'en-US': 'This event is triggered when the focus is lost.'
- },
- 'demoId': 'events'
- },
- {
- 'name': 'focus',
- 'type': '(event: FocusEvent) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当获得焦点时触发',
- 'en-US': 'This event is triggered when the focus is obtained.'
- },
- 'demoId': 'events'
- },
- {
- 'name': 'visible-change',
- 'type': '(visible: boolean) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '下拉框出现/隐藏时触发',
- 'en-US': 'This event is triggered when the drop-down list box is displayed or hidden.'
- },
- 'demoId': 'events'
- },
- {
- 'name': 'remove-tag',
- 'type': '(removeValue: ICascaderPanelNodeValue[]) => void',
- 'typeAnchorName': 'ICascaderPanelNodeValue',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '在多选模式下,移除Tag时触发',
- 'en-US': 'In multi-choice mode, this event is triggered when a tag is removed.'
- },
- 'demoId': 'default-multiple'
- }
- ],
- 'slots': [
- {
- 'name': 'empty',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '无匹配选项时的内容', 'en-US': 'Content when no matching option is found' },
- 'demoId': 'filterable'
- },
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '自定义备选项的节点内容,参数为 { node: ICascaderPanelNode, data: ICascaderPanelData },分别为当前节点的 Node 对象和数据',
- 'en-US':
- 'User-defined candidate node content. The parameter is {node, data}, which indicates the node object and data of the current node.'
- }
- }
- ],
- 'methods': [
- {
- 'name': 'getCheckedNodes',
- 'type': '(leafOnly: boolean = false) => ICascaderPanelNode[]',
- 'typeAnchorName': 'ICascaderPanelNode',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '获取选中的节点',
- 'en-US': 'Obtain the selected node'
- },
- 'demoId': 'events'
- }
- ]
- },
- {
- 'name': 'ICascaderPanelConfig ',
- 'type': 'interface',
- 'props': [
- {
- 'name': 'expandTrigger',
- 'type': `'click' | 'hover'`,
- 'defaultValue': `'click'`,
- 'desc': {
- 'zh-CN': '次级菜单的展开方式',
- 'en-US': 'The expansion mode of the secondary menu'
- },
- 'demoId': 'expand-trigger'
- },
- {
- 'name': 'multiple',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否多选', 'en-US': 'Whether to select multiple options' },
- 'demoId': 'default-multiple'
- },
- {
- 'name': 'checkStrictly',
- 'type': 'boolean',
- 'defaultValue': ' false',
- 'desc': {
- 'zh-CN': '是否严格的遵守父子节点不互相关联',
- 'en-US':
- 'Whether to strictly comply with the principle that parent and child nodes are not associated with each other'
- },
- 'demoId': 'check-strictly'
- },
- {
- 'name': 'emitPath',
- 'type': 'boolean',
- 'defaultValue': ' true',
- 'desc': {
- 'zh-CN':
- '在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值',
- 'en-US':
- 'Indicates whether to return an array consisting of the values of menus at different levels of the selected node when the selected node is changed. If this parameter is set to false, only the value of the selected node is returned.'
- },
- 'demoId': 'events'
- },
- {
- 'name': 'lazy',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否动态加载子节点,需与 lazyLoad 方法结合使用',
- 'en-US':
- 'Whether to dynamically load subnodes. This parameter must be used together with the lazyLoad method.'
- },
- 'demoId': 'auto-load'
- },
- {
- 'name': 'lazyLoad',
- 'typeAnchorName': 'ICascaderPanelLazyLoad',
- 'type': 'ICascaderPanelLazyLoad',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '加载动态数据的方法,仅在 lazy 为 true 时有效;参数说明: node 为当前点击的节点,resolve 为数据加载完成的回调(必须调用)',
- 'en-US':
- 'Method for loading dynamic data. This parameter is valid only when lazy is set to true. Parameter description: node indicates the currently clicked node. resolve indicates the callback after data loading is complete (mandatory).'
- },
- 'demoId': 'auto-load'
- },
- {
- 'name': 'value',
- 'type': 'string',
- 'defaultValue': "'value'",
- 'desc': {
- 'zh-CN': '指定选项的值为选项对象的某个属性值',
- 'en-US': 'The value of an option is the value of an attribute of the option object.'
- },
- 'demoId': 'props-children'
- },
- {
- 'name': 'label',
- 'type': 'string',
- 'defaultValue': "'label'",
- 'desc': {
- 'zh-CN': '指定选项标签为选项对象的某个属性值',
- 'en-US': 'Specify that the option label is an attribute value of the option object.'
- },
- 'demoId': 'props-children'
- },
- {
- 'name': 'children',
- 'type': 'string',
- 'defaultValue': "'children'",
- 'desc': {
- 'zh-CN': '指定选项的子选项为选项对象的某个属性值',
- 'en-US': 'Specifies that the sub-option of an option is an attribute value of the option object.'
- },
- 'demoId': 'props-children'
- },
- {
- 'name': 'disabled',
- 'type': 'string',
- 'defaultValue': "'disabled'",
- 'desc': {
- 'zh-CN': '指定选项的禁用为选项对象的某个属性值',
- 'en-US': 'Specify that an option is disabled as an attribute value of the option object.'
- },
- 'demoId': 'disabled-items'
- },
- {
- 'name': 'leaf',
- 'type': 'string',
- 'defaultValue': "'leaf'",
- 'desc': {
- 'zh-CN': '指定选项的叶子节点的标志位为选项对象的某个属性值',
- 'en-US': 'The flag bit of the leaf node of the specified option is an attribute value of the option object.'
- },
- 'demoId': 'props-children'
- }
- ]
- }
- ],
- types: [
- {
- name: 'ICascaderPanelNodeValue',
- type: 'type',
- code: `type ICascaderPanelNodeValue = string | number`
- },
- {
- name: 'ICascaderPanelNodePropValue',
- type: 'type',
- code: `
-type ICascaderPanelNodePropValue =
- | ICascaderPanelNodeValue
- | ICascaderPanelNodeValue[]
- | ICascaderPanelNodeValue[][]`
- },
- {
- name: 'ICascaderPanelData',
- type: 'type',
- code: `
-type ICascaderPanelData = {
- value?: ICascaderPanelNodeValue
- label?: string
- children?: ICascaderPanelData[]
- disabled?: boolean
- leaf?: boolean
- [key: string]: ICascaderPanelNodeValue | ICascaderPanelData[] | string | boolean | undefined
-}`
- },
- {
- name: 'ICascaderPanelConfig',
- type: 'interface',
- code: `
-interface ICascaderPanelConfig {
- emitPath: boolean
- expandTrigger: 'click' | 'hover'
- hoverThreshold: number
- checkStrictly?: boolean
- multiple?: boolean
- lazy: boolean
- lazyLoad: (
- node: ICascaderPanelNode,
- resolve: (dataList: ICascaderPanelData[]) => void
- ) => void
- value: string
- label: string
- children: string
- disabled: string
- leaf: string
-}`
- },
- {
- name: 'ICascaderPanelNode',
- type: 'type',
- code: `
-type ICascaderPanelNode = {
- parent: ICascaderPanelNode | null
- level: number
- data: ICascaderPanelData
- config: ICascaderPanelConfig
- uid: number
- value: ICascaderPanelNodeValue
- label: string
- pathNodes: Node[]
- path: ICascaderPanelNodeValue[]
- pathLabels: string[]
- loaded: boolean
- loading: boolean
- hasChildren: boolean
- children: Node[]
- checked?: boolean
- indeterminate?: boolean
- root?: boolean
-}`
- },
- {
- name: 'ICascaderPanelLazyLoad',
- type: 'type',
- code: `
-type ICascaderPanelLazyLoad = (node: ICascaderPanelNode, resolve: (dataList: ICascaderPanelData[]) => void) => void
- `
+ desc: {
+ 'zh-CN':
+ '\n Cascader 级联选择器的事件有:change
、expand-change
、blur
、focus
、visible-change
。\n
使用 props.emitPath
能设置节点的返回类型。\n ',
+ 'en-US':
+ '\n Cascader cascade selector events include: change
, expand-change
, blur
, focus
, < code>visible-change. \n Use props.emitPath
to set the return type of the node.\n
'
+ },
+ codeFiles: ['events.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/chart/base-composition-api.vue b/examples/sites/demos/pc/app/chart/base-composition-api.vue
index 4b0453fd8..076370bb9 100644
--- a/examples/sites/demos/pc/app/chart/base-composition-api.vue
+++ b/examples/sites/demos/pc/app/chart/base-composition-api.vue
@@ -1,7 +1,7 @@
折线图
-
+ 切换主题
@@ -12,16 +12,25 @@
饼图
+ color-mode切换
-
+
diff --git a/examples/sites/demos/pc/app/chart/base.vue b/examples/sites/demos/pc/app/chart/base.vue
index b6aa8b47b..6f5a3f272 100644
--- a/examples/sites/demos/pc/app/chart/base.vue
+++ b/examples/sites/demos/pc/app/chart/base.vue
@@ -1,7 +1,7 @@
折线图
-
+ 切换主题
@@ -12,18 +12,26 @@
饼图
+ color-mode切换
-
+
diff --git a/examples/sites/demos/pc/app/chart/gauge/demo6-composition-api.vue b/examples/sites/demos/pc/app/chart/gauge/demo6-composition-api.vue
new file mode 100644
index 000000000..67078be3e
--- /dev/null
+++ b/examples/sites/demos/pc/app/chart/gauge/demo6-composition-api.vue
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/chart/gauge/demo6.vue b/examples/sites/demos/pc/app/chart/gauge/demo6.vue
new file mode 100644
index 000000000..7581ad473
--- /dev/null
+++ b/examples/sites/demos/pc/app/chart/gauge/demo6.vue
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/chart/graph/demo2-composition-api.vue b/examples/sites/demos/pc/app/chart/graph/demo2-composition-api.vue
index 607b173fa..e50f481c0 100644
--- a/examples/sites/demos/pc/app/chart/graph/demo2-composition-api.vue
+++ b/examples/sites/demos/pc/app/chart/graph/demo2-composition-api.vue
@@ -2,7 +2,7 @@
-
-
-
diff --git a/examples/sites/demos/pc/app/chart/props/demo10.vue b/examples/sites/demos/pc/app/chart/props/demo10.vue
index 33448eae2..f3df4ce57 100644
--- a/examples/sites/demos/pc/app/chart/props/demo10.vue
+++ b/examples/sites/demos/pc/app/chart/props/demo10.vue
@@ -1,27 +1,34 @@
-
+ 点击添加dataZoom自定义图片
-
-
-
diff --git a/examples/sites/demos/pc/app/chart/question/demo5-composition-api.vue b/examples/sites/demos/pc/app/chart/question/demo5-composition-api.vue
index 3dbe321b9..8e4fbcb9f 100644
--- a/examples/sites/demos/pc/app/chart/question/demo5-composition-api.vue
+++ b/examples/sites/demos/pc/app/chart/question/demo5-composition-api.vue
@@ -1,26 +1,20 @@
-
-
+ 点击改变父元素宽度
+ 点击执行resize()
当前父元素宽度: {{ parentElementWidth }},chart 组件{{ isAction ? '已' : '未' }}执行 resize()。
-
-
+
+
-
diff --git a/examples/sites/demos/pc/app/chart/radar/base.vue b/examples/sites/demos/pc/app/chart/radar/base.vue
index bcd64b852..9d2c6770d 100644
--- a/examples/sites/demos/pc/app/chart/radar/base.vue
+++ b/examples/sites/demos/pc/app/chart/radar/base.vue
@@ -4,7 +4,7 @@
-
diff --git a/examples/sites/demos/pc/app/chart/sunburst/demo3.vue b/examples/sites/demos/pc/app/chart/sunburst/demo3.vue
new file mode 100644
index 000000000..b14ab7331
--- /dev/null
+++ b/examples/sites/demos/pc/app/chart/sunburst/demo3.vue
@@ -0,0 +1,139 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-attributes-demo.js b/examples/sites/demos/pc/app/chart/webdoc/chart-attributes-demo.js
index 63a95380f..d86951e57 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-attributes-demo.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-attributes-demo.js
@@ -4,78 +4,78 @@ export default {
demos: [
{
'demoId': 'props-demo10',
- 'name': { 'zh-CN': '属性配置示例', 'en-US': 'Attribute Configuration Example' },
+ 'name': { 'zh-CN': '1 设置区域缩放组件', 'en-US': '1 Setting the Region Zoom Component' },
'desc': {
'zh-CN':
- '如果某属性加上去之后没有生效,很可能是没有引入相应的模块。例如:
\n在使用 dataZoom 组件时,需要引入 dataZoom 模块资源 import \'echarts/lib/component/dataZoom\'
。
\n\n1 设置区域缩放组件
\n可通过 init-options
配置组件初始化附加参数,具体可参考文档
\n',
+ '详细用法参考如下如果某属性加上去之后没有生效,很可能是没有引入相应的模块。例如:
\n在使用 dataZoom 组件时,需要引入 dataZoom 模块资源 import \'echarts/lib/component/dataZoom\'
。
\n\n1 设置区域缩放组件
\n可通过 init-options
配置组件初始化附加参数,具体可参考文档
示例。',
'en-US':
- ' If an attribute does not take effect after being added or removed, it is likely that the corresponding module is not introduced. For example,
\nWhen using the dataZoom component, you need to import the dataZoom module resource import\'echarts/lib/component/dataZoom\'
.
\n\n1 Setting the Region Scaling Component
\nYou can run the init-options
command to configure the additional initialization parameters of the component. For details, see the document
\n'
+ ' If an attribute does not take effect after being added or removed, it is likely that the corresponding module is not introduced. For example,
\nWhen using the dataZoom component, you need to import the dataZoom module resource import\'echarts/lib/component/dataZoom\'
.
\n\n1 Setting the Region Scaling Component
\nYou can run the init-options
command to configure the additional initialization parameters of the component. For details, see the document
.'
},
'codeFiles': ['props/demo10.vue']
},
{
'demoId': 'props-base',
- 'name': { 'zh-CN': '1 设置区域缩放组件', 'en-US': '1 Setting the Region Zoom Component' },
+ 'name': { 'zh-CN': '2 设置extend配置项', 'en-US': '2 Set the extend configuration item' },
'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
'codeFiles': ['props/base.vue']
},
{
'demoId': 'props-demo12',
- 'name': { 'zh-CN': '2 设置extend配置项', 'en-US': '2 Set the extend configuration item' },
+ 'name': { 'zh-CN': '3 修改颜色列表', 'en-US': '3 Modify the color list' },
'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
'codeFiles': ['props/demo12.vue']
},
{
'demoId': 'props-demo4',
- 'name': { 'zh-CN': '3 修改颜色列表', 'en-US': '3 Modify the color list' },
+ 'name': { 'zh-CN': '4 设置暂无数据状态', 'en-US': '4 Set the status of no data.' },
'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
'codeFiles': ['props/demo4.vue']
},
{
'demoId': 'props-demo5',
- 'name': { 'zh-CN': '4 设置暂无数据状态', 'en-US': '4 Set the status of no data.' },
+ 'name': { 'zh-CN': '5 增加自定义内容', 'en-US': '5 Add Custom Content' },
'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
'codeFiles': ['props/demo5.vue']
},
{
'demoId': 'props-demo6',
- 'name': { 'zh-CN': '5 增加自定义内容', 'en-US': '5 Add Custom Content' },
+ 'name': { 'zh-CN': '6 隐藏提示框与图例', 'en-US': '6 Hide dialog box and legend' },
'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
'codeFiles': ['props/demo6.vue']
},
{
'demoId': 'props-demo7',
- 'name': { 'zh-CN': '6 隐藏提示框与图例', 'en-US': '6 Hide dialog box and legend' },
+ 'name': { 'zh-CN': '7 设置图表容器样式', 'en-US': '7 Set chart container style' },
'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
'codeFiles': ['props/demo7.vue']
},
{
'demoId': 'props-demo8',
- 'name': { 'zh-CN': '7 设置图表容器样式', 'en-US': '7 Set chart container style' },
+ 'name': { 'zh-CN': '8 设置图表标线与标点', 'en-US': '8 Set the chart line and punctuation point' },
'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
'codeFiles': ['props/demo8.vue']
},
{
'demoId': 'props-demo9',
- 'name': { 'zh-CN': '8 设置图表标线与标点', 'en-US': '8 Set the chart line and punctuation point' },
+ 'name': { 'zh-CN': '9 设置视觉映射组件', 'en-US': '9 Setting the Visual Mapping Component' },
'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
'codeFiles': ['props/demo9.vue']
},
{
'demoId': 'props-demo2',
- 'name': { 'zh-CN': '9 设置视觉映射组件', 'en-US': '9 Setting the Visual Mapping Component' },
+ 'name': { 'zh-CN': '10 设置afterConfig函数', 'en-US': '10 Set the afterConfig function' },
'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
'codeFiles': ['props/demo2.vue']
},
{
'demoId': 'props-demo11',
- 'name': { 'zh-CN': '10 设置afterConfig函数', 'en-US': '10 Set the afterConfig function' },
+ 'name': { 'zh-CN': '11 设置工具箱', 'en-US': '11 Setting Toolbox' },
'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
'codeFiles': ['props/demo11.vue']
},
{
'demoId': 'props-demo3',
- 'name': { 'zh-CN': '11 设置工具箱', 'en-US': '11 Setting Toolbox' },
+ 'name': { 'zh-CN': '12 设置加载状态', 'en-US': '12 Setting the loading status' },
'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
'codeFiles': ['props/demo3.vue']
}
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-autonavi-map.js b/examples/sites/demos/pc/app/chart/webdoc/chart-autonavi-map.js
index 66f212e76..63e82a14b 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-autonavi-map.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-autonavi-map.js
@@ -14,5 +14,19 @@ export default {
'codeFiles': ['amap/base.vue']
}
],
- apis: [{ 'name': 'chart-autonavi-map', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
+ apis: [{ 'name': 'chart-autonavi-map', 'type': 'component', 'props': [], 'events': [], 'slots': [] }],
+ types: [
+ {
+ name: 'IChartSettings',
+ type: 'interface',
+ code: `
+interface IChartSettings {
+ amap: object // 高德地图配置项,参考高德地图文档配置
+ key: string // 高德地图 access_key
+ useOuterMap: boolean // 使用全局的地图依赖
+ v: string // 高德地图版本,默认1.4.3
+}
+`
+ }
+ ]
}
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-baidu-map.js b/examples/sites/demos/pc/app/chart/webdoc/chart-baidu-map.js
index c318916a1..e4940434e 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-baidu-map.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-baidu-map.js
@@ -14,5 +14,19 @@ export default {
'codeFiles': ['bmap/base.vue']
}
],
- apis: [{ 'name': 'chart-baidu-map', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
+ apis: [{ 'name': 'chart-baidu-map', 'type': 'component', 'props': [], 'events': [], 'slots': [] }],
+ types: [
+ {
+ name: 'IChartSettings',
+ type: 'interface',
+ code: `
+interface IChartSettings {
+ bmap: object // 百度地图配置项
+ key: string // 百度地图 access_key
+ useOuterMap: boolean // 使用全局的地图依赖
+ v: string // 百度地图版本,默认2.0
+}
+`
+ }
+ ]
}
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-bar.js b/examples/sites/demos/pc/app/chart/webdoc/chart-bar.js
index a6759472c..0cd368c29 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-bar.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-bar.js
@@ -50,5 +50,42 @@ export default {
'codeFiles': ['bar/demo7.vue']
}
],
- apis: [{ 'name': 'chart-bar', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
+ apis: [{ 'name': 'chart-bar', 'type': 'component', 'props': [], 'events': [], 'slots': [] }],
+ types: [
+ {
+ name: 'IChartSettings',
+ type: 'interface',
+ code: `
+interface IChartSettings {
+ axisSite: object // 指标所在的轴,默认不在 top 轴的指标都在 bottom 轴
+ dataOrder: boolean | object // 设置数据排序方式,默认为 false
+ digit: number // 设置数据类型为 percent 时保留的位数,默认为2
+ dimension: array // 维度,默认 columns 第一项为维度
+ itemStyle: object // 图形样式,
+ label: object // 设置图形上的文本标签,
+ labelMap: object // 设置指标的别名,同时作用于提示框和图例
+ legendName: object // 设置图表上方图例的别名
+ max: array // 上下坐标轴最大值
+ metrics: array // 指标,默认 columns 第二项起为指标
+ min: array // 上下坐标轴最小值
+ opacity: number // 透明度
+ scale: array // 是否是脱离0值比例,默认为[ false , false ],表示上下两个轴都不会脱离0值比例。设置成 true 后坐标刻度不会强制包含零刻度
+ stack: object // 堆叠选项
+ xAxisName: array // 上下坐标轴标题
+ xAxisType: array // 上下坐标轴数据类型,可选值: KMB , normal , percent
+ yAxisType: string // 纵轴的类型,可选值' category ',' value ',默认为' category '
+}
+
+> 备注 1. axisSite 可以设置 top 和 bottom,例如示例所示 axisSite: { top: ['占比'] } 即将占比的数据置于上轴上。
+
+> 备注 2. stack 用于将两数据堆叠起来,例如实例中所示stack: { '销售额': ['销售额-1季度', '销售额-2季度'] } 即将'销售额-1 季度', '销售额-2 季度'相应的数据堆叠在一起。
+
+> 备注 3. dataOrder 用于设置数据的排序方式,用于更加清晰的展示数据的升降。例如: { label: '成本', order: 'asc } 表示数据按照成本指标升序展示,降序为desc。
+
+> 备注 4. min 和 max 的值可以直接设置为数字,例如:[100, 300];也可以设置为['dataMin', 'dataMin'], ['dataMax', 'dataMax'],此时表示使用该坐标轴上的最小值或最大值为最小或最大刻度。
+
+> 备注 5. 为了优化连续的数值型横轴显示多指标的时候样式,在此情况下默认设置 opacity 为 0.5。
+`
+ }
+ ]
}
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-boxplot.js b/examples/sites/demos/pc/app/chart/webdoc/chart-boxplot.js
index 660ac1f96..aca7f3fb3 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-boxplot.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-boxplot.js
@@ -34,5 +34,28 @@ export default {
'codeFiles': ['boxplot/vertical.vue']
}
],
- apis: [{ 'name': 'chart-boxplot', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
+ apis: [{ 'name': 'chart-boxplot', 'type': 'component', 'props': [], 'events': [], 'slots': [] }],
+ types: [
+ {
+ name: 'IChartSettings',
+ type: 'interface',
+ code: `
+interface IChartSettings {
+ axisSite: object // 指标所在的轴,默认不在 top 轴的指标都在 bottom 轴
+ digit: number // 设置数据类型为 percent 时保留的位数,默认为2
+ itemStyle: object // 图形样式
+ label: object // 设置图形上的文本标签
+ labelMap: object // 设置指标的别名,同时作用于提示框和图例
+ legendName: object // 设置图表上方图例的别名
+ max: array // 上下坐标轴最大值
+ metrics: array // 指标,默认 columns 为指标
+ min: array // 上下坐标轴最小值
+ scale: array // 是否是脱离0值比例,默认为[ false , false ],表示上下两个轴都不会脱离0值比例。设置成 true 后坐标刻度不会强制包含零刻度
+ xAxisName: array // 上下坐标轴标题
+ xAxisType: array // 上下坐标轴数据类型,可选值: category , value
+ yAxisType: string // 纵轴的类型,可选值' category ',' value ',默认为' category '
+}
+`
+ }
+ ]
}
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-candle.js b/examples/sites/demos/pc/app/chart/webdoc/chart-candle.js
index 4c05cd372..4ab5dc8b8 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-candle.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-candle.js
@@ -50,5 +50,30 @@ export default {
'codeFiles': ['candle/demo7.vue']
}
],
- apis: [{ 'name': 'chart-candle', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
+ apis: [{ 'name': 'chart-candle', 'type': 'component', 'props': [], 'events': [], 'slots': [] }],
+ types: [
+ {
+ name: 'IChartSettings',
+ type: 'interface',
+ code: `
+interface IChartSettings {
+ MA: array // 移动平均线指标周期,默认[5,10,20,30]
+ dataType: string // 数据展示格式,可选值: KMB , normal , percent
+ digit: number // 设置数据类型为 percent 时保留的位数,默认为2
+ dimension: string // 维度,默认为 columns[0]
+ downColor: string // 下降颜色,默认为#ec0000
+ end: number // dataZoom 控件的结束位置,默认为100,即末尾位置
+ itemStyle: object // 图形样式
+ labelMap: object // 设置指标的别名
+ legendName: object // 设置图表上方图例的别名
+ metrics: array // 指标,默认为[columns[1] ~ columns[5]]
+ showDataZoom: boolean // 是否展示 dataZoom 控件,默认为 false
+ showMA: boolean // 是否展示移动平均线指标,默认为 false
+ showVol: boolean // 是否展示成交量,默认为 false
+ start: number // dataZoom 控件的起始位置,默认为50,即中间位置
+ upColor: string // 上升颜色,默认为 #00da3c
+}
+`
+ }
+ ]
}
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-funnel.js b/examples/sites/demos/pc/app/chart/webdoc/chart-funnel.js
index 9e5c88da4..a40f0d6b9 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-funnel.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-funnel.js
@@ -53,5 +53,26 @@ export default {
'codeFiles': ['funnel/demo7.vue']
}
],
- apis: [{ 'name': 'chart-funnel', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
+ apis: [{ 'name': 'chart-funnel', 'type': 'component', 'props': [], 'events': [], 'slots': [] }],
+ types: [
+ {
+ name: 'IChartSettings',
+ type: 'interface',
+ code: `
+interface IChartSettings {
+ ascending: boolean // 是否显示为金字塔,默认为 false
+ dataType: string // 数据类型,可选值: KMB , normal , percent
+ digit: number // 设置数据类型为 percent 时保留的位数,默认为2
+ dimension: string // 维度,默认 columns 第一项为维度
+ filterZero: boolean // 是否过滤指标为0的数据,默认为 false
+ itemStyle: object // 设置图形样式
+ label: object // 设置文本标签样式
+ labelLine: object // 设置标签的视觉引导线样式
+ metrics: string // 指标,默认 columns 第二项为指标
+ sequence: array // 数据显示顺序,默认按照数据大小顺序
+ useDefaultOrder: boolean // 是否自动按照数值大小排序,默认为 false
+}
+`
+ }
+ ]
}
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-gauge.js b/examples/sites/demos/pc/app/chart/webdoc/chart-gauge.js
index bbd531f38..1368232be 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-gauge.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-gauge.js
@@ -31,6 +31,12 @@ export default {
'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
'codeFiles': ['gauge/demo4.vue']
},
+ {
+ 'demoId': 'gauge-demo6',
+ 'name': { 'zh-CN': '综合示例', 'en-US': 'Comprehensive example' },
+ 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
+ 'codeFiles': ['gauge/demo6.vue']
+ },
{
'demoId': 'gauge-demo5',
'name': { 'zh-CN': '设置多表盘及修改样式', 'en-US': 'Set multiple watch faces and modify the style' },
@@ -38,5 +44,22 @@ export default {
'codeFiles': ['gauge/demo5.vue']
}
],
- apis: [{ 'name': 'chart-gauge', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
+ apis: [{ 'name': 'chart-gauge', 'type': 'component', 'props': [], 'events': [], 'slots': [] }],
+ types: [
+ {
+ name: 'IChartSettings',
+ type: 'interface',
+ code: `
+interface IChartSettings {
+ dataName: object // 表盘上显示的单位
+ dataType: object // 数据类型
+ digit: number // 设置数据类型为 percent 时保留的位数,默认为2
+ dimension: string // 维度,默认 columns[0]
+ labelMap: object // 设置指标的别名
+ metrics: string // 指标,默认 columns[1]
+ seriesMap: object // 附加到 series 中的设置
+}
+`
+ }
+ ]
}
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-heatmap.js b/examples/sites/demos/pc/app/chart/webdoc/chart-heatmap.js
index 43fe6e48d..aaebb73d6 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-heatmap.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-heatmap.js
@@ -41,5 +41,38 @@ export default {
'codeFiles': ['heatmap/demo5.vue']
}
],
- apis: [{ 'name': 'chart-heatmap', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
+ apis: [{ 'name': 'chart-heatmap', 'type': 'component', 'props': [], 'events': [], 'slots': [] }],
+ types: [
+ {
+ name: 'IChartSettings',
+ type: 'interface',
+ code: `
+interface IChartSettings {
+ beforeRegisterMap: () => void // 地图数据注册前执行的函数,参数为地图数据,需返回地图数据
+ beforeRegisterMapOnce: () => void // 地图数据注册前执行的函数(仅执行一次),参数为地图数据,需返回地图数据
+ blurSize: number // 模糊大小,默认为5
+ bmap: object // 百度地图配置项,
+ dataType: string // 数据类型,可选值: KMB , normal , percent
+ digit: number // 设置数据类型为 percent 时保留的位数,默认为2
+ dimension: array // 维度,默认为 [columns[0], columns[1]]
+ geo: object // 地图配置项,
+ heatColor: array // visualMap 中的最大值颜色区间
+ key: string // 百度地图 access _ key ,
+ mapURLProfix: string // 位置请求的 URL 前缀,默认为 https://unpkg.com/echarts@3.6.2/map/json/
+ max: number // visualMap 中的最大值,默认取指标中最大的数据
+ metrics: string // 指标,默认为 columns[2]
+ min: number // visualMap 中的最小值,默认取指标中最小的数据
+ pointSize: number // 点大小,默认为10
+ position: string // 地图类型,默认为' china '
+ positionJsonLink: string // 地图数据源
+ specialAreas: object // 地图中的位置配置,将地图中的部分区域缩放到合适的位置,可以使得整个地图的显示更加好看,
+ type: string // 热力图的类型,可选值: cartesian (默认值,直角坐标系), map (地图), bmap (百度地图)
+ xAxisList: array // x 轴数据,默认取数据中的数据中的第一维度的数据
+ xAxisName: string // x 轴名称
+ yAxisList: array // y 轴数据,默认取数据中的数据中的第二维度的数据
+ yAxisName: string // y 轴名称
+}
+`
+ }
+ ]
}
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-histogram.js b/examples/sites/demos/pc/app/chart/webdoc/chart-histogram.js
index a3bd2996f..9474b75cd 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-histogram.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-histogram.js
@@ -56,5 +56,45 @@ export default {
'codeFiles': ['histogram/demo8.vue']
}
],
- apis: [{ 'name': 'chart-histogram', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
+ apis: [{ 'name': 'chart-histogram', 'type': 'component', 'props': [], 'events': [], 'slots': [] }],
+ types: [
+ {
+ name: 'IChartSettings',
+ type: 'interface',
+ code: `
+interface IChartSettings {
+ axisSite: object // 指标所在的轴,默认不在 right 轴的指标都在 left 轴
+ dataOrder: boolean | object // 设置数据排序方式,默认为 false
+ digit: number // 设置数据类型为 percent 时保留的位数,默认为2
+ dimension: array // 维度,默认 columns 第一项为维度
+ itemStyle: object // 图形样式,
+ label: object // 设置图形上的文本标签,
+ labelMap: object // 设置指标的别名,同时作用于提示框和图例
+ legendName: object // 设置图表上方图例的别名
+ max: array // 左右坐标轴最大值
+ metrics: array // 指标,默认 columns 第二项起为指标
+ min: array // 左右坐标轴最小值
+ opacity: number // 透明度
+ scale: array // 是否是脱离0值比例,默认为[ false , false ],表示左右两个轴都不会脱离0值比例。设置成 true 后坐标刻度不会强制包含零刻度
+ showLine: array // 展示为折线图的指标
+ stack: object // 堆叠选项
+ xAxisType: string // 横轴的类型,可选值' category ',' value ',默认为' category '
+ yAxisName: array // 左右坐标轴标题
+ yAxisType: array // 左右坐标轴数据类型,可选值: KMB , normal , percent
+}
+
+> 备注 1. axisSite 可以设置 left 和 right,例如示例所示 axisSite: { right: ['占比'] } 即将占比的数据置于右轴上。
+
+> 备注 2. stack 用于将两数据堆叠起来,例如实例中所示stack: { '销售额': ['销售额-1季度', '销售额-2季度'] } 即将'销售额-1 季度', '销售额-2 季度'相应的数据堆叠在一起。
+
+> 备注 3. dataOrder 用于设置数据的排序方式,用于更加清晰的展示数据的升降。例如: { label: '余额', order: 'asc } 表示数据按照余额指标升序展示,降序为desc。
+
+> 备注 4. min 和 max 的值可以直接设置为数字,例如:[100, 300];也可以设置为['dataMin', 'dataMin'], ['dataMax', 'dataMax'],此时表示使用该坐标轴上的最小值或最大值为最小或最大刻度。
+
+> 备注 5. 有时我们需要将折线图与柱状图展示在同一个图上,利用 showLine 属性可以设置需要展示为折线图的指标,其他的指标则使用柱状图展示。
+
+> 备注 6. 为了优化连续的数值型横轴显示多指标的时候样式,在此情况下默认设置 opacity 为 0.5。
+`
+ }
+ ]
}
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-line.js b/examples/sites/demos/pc/app/chart/webdoc/chart-line.js
index 0a618bd74..7941f5cd6 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-line.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-line.js
@@ -62,5 +62,35 @@ export default {
'codeFiles': ['line/demo9.vue']
}
],
- apis: [{ 'name': 'chart-line', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
+ apis: [{ 'name': 'chart-line', 'type': 'component', 'props': [], 'events': [], 'slots': [] }],
+ types: [
+ {
+ name: 'IChartSettings',
+ type: 'interface',
+ code: `
+interface IChartSettings {
+ area: boolean // 是否展示为面积图,默认为 false
+ axisSite: object // 指标所在的轴,默认不在 right 轴的指标都在 left 轴
+ digit: number // 设置数据类型为 percent 时保留的位数,默认为2
+ dimension: array // 维度,默认 columns 第一项为维度
+ labelMap: object // 设置指标的别名,同时作用于提示框和图例
+ legendName: object // 设置图表上方图例的别名
+ max: array // 左右坐标轴最大值
+ metrics: array // 指标,默认 columns 第二项起为指标
+ min: array // 左右坐标轴最小值
+ scale: array // 是否是脱离0值比例,默认为[ false , false ],表示左右两个轴都不会脱离0值比例。设置成 true 后坐标刻度不会强制包含零刻度
+ stack: object // 堆叠选项
+ xAxisType: string // 横轴的数据类型,可选值: category , value , time , log
+ yAxisName: array // 左右坐标轴标题
+ yAxisType: array // 左右坐标轴数据类型,可选值: KMB , normal , percent
+}
+
+> 备注 1. axisSite 可以设置 left 和 right,例如示例所示 axisSite: { right: ['占比'] } 即将占比的数据置于右轴上。
+
+> 备注 2. stack 用于将两数据堆叠起来,例如实例中所示stack: { '销售额': ['成本', '利润'] } 即将'成本', '利润'相应的数据堆叠在一起。
+
+> 备注 3. min 和 max 的值可以直接设置为数字,例如:[100, 300];也可以设置为['dataMin', 'dataMin'], ['dataMax', 'dataMax'],此时表示使用该坐标轴上的最小值或最大值为最小或最大刻度。
+`
+ }
+ ]
}
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-liquidfill.js b/examples/sites/demos/pc/app/chart/webdoc/chart-liquidfill.js
index 81db00c8b..8b475f812 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-liquidfill.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-liquidfill.js
@@ -41,5 +41,106 @@ export default {
'codeFiles': ['liquidfill/demo5.vue']
}
],
- apis: [{ 'name': 'chart-liquidfill', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
+ apis: [{ 'name': 'chart-liquidfill', 'type': 'component', 'props': [], 'events': [], 'slots': [] }],
+ types: [
+ {
+ name: 'IChartSettings',
+ type: 'interface',
+ code: `
+interface IChartSettings {
+ dataType: string // 数据类型,默认为 percent ,也可设置为 normal
+ digit: number // 设置数据类型为 percent 时保留的位数,默认为2
+ dimension: string // 维度,默认 columns[0]
+ metrics: string // 指标,默认 columns[1]
+ seriesMap: ISeriesMap | array[ISeriesMap] // 附加到 series 中的设置,默认为{},可以设置单个水球图,也可以一次设置多个。数组形式配置见“多个水球图”示例,对象形式配置见其他示例。
+ wave: array[number] | array[array[number]] // 设置水球图分层,默认为[],数组中的值不大于 row 中对应的维度值,且需要由大到小排列。可设置为[0.3,0.2,0.1]的形式,表示每个水球图都显示4层,且最下面三层的值分别为0.1,0.2,0.3;也可设置为[[0.2,0.1],[0.1],[]]的形式,当有多个水球图时, wave 中的每一项对应一个水球图的分层设置,如果 wave.length < rows.length ,则剩余的水球图的分层设置以 wave 数组中最后一项为准。比如 rows =[{ val:0.1},{ val:0.2},{ val:0.3},{ val:0.4}],而 wave =[[0.2,0.1],[0.2]],此时 rows 中后三项的分层设置均为[0.2]
+}
+`
+ },
+ {
+ name: 'ISeriesMap',
+ type: 'interface',
+ code: `
+interface ISeriesMap {
+ amplitude: string // 水波的起伏程度,用百分数表示。数值越大,起伏程度越大,如’10%’
+ animationDuration: number // 水波初始动画所需要的时间,水波初始动画所需要的时间
+ animationDurationUpdate: number // 数据变动时水波动画变化所需要的时间,数据变动时水波动画变化所需要的时间
+ animationEasing: string // 水波初始的动画的速度曲线,水波初始的动画的速度曲线
+ animationEasingUpdate: string // 数据变动时水波动画的速度曲线,数据变动时水波动画的速度曲线
+ backgroundStyle: IBackgroundStyle // 水球图的背景颜色,水球图的背景颜色
+ center: array[string] // 水球图的位置,设置时以百分数表示,数组中第一项代表横坐标,相对于容器的 width 的百分比,第二项代表纵坐标,相对于容器 heigght 的百分比。如[’50%’,’50%’]表示居中
+ color: array[string] // 颜色, data 中第一个数据对应 color 中第一个颜色,以此类推。如果 color.length 小于 data.length , data 中数据项的颜色会循环展示。在这里, color 设置的是 row 中 metrics 和 wave 的值对应数据波浪的颜色。
+ direction: string // 水波的滚动方向,整体设置水波的滚动方向,可选’ left ’或’ right ’
+ emphasis: IEmphasis // 鼠标悬浮时波浪的样式,鼠标悬浮时波浪的样式
+ itemStyle: IItemStyle // 水球图波浪的样式,水球图波浪的样式
+ label: ILabel // 图形上的文本标签,图形上的文本标签
+ outline: IOutline // 水球图的外边框设置,水球图的外边框设置
+ period: number | function // 水波滚动的速度,表示滚动一个水波需要花费的时间,以毫秒为单位。可以直接设置数字,也可以设置为 function (value, index)的形式
+ radius: string // 水球图的半径,单个水球图的半径,相对于容器元素中较短边( width 和 height )的长度,以百分数表示,如’50%’
+ shape: string // 水球图的形状,水球图的形状,可选值有’ circle ’,‘ rect ’,‘ roundRect ’,‘ triangle ’,‘ diamond ’,‘ pin ’,‘ arrow ’,也可以通过 svg 自定义’ path ://\\*'
+ waveAnimation: boolean // 水波是否滚动,为 true 时水波滚动,反之不滚动。默认为 true
+ waveLength: string // 水波的长度,相对于水球的直径。当为’50%’时,水球图中一条数据上会出现两个水波;为33%时,会出现三个水波。以此类推。
+}
+`
+ },
+ {
+ name: 'IOutline',
+ type: 'interface',
+ code: `
+interface IOutline {
+ borderDistance: number // ,水球图外边框和水球图核心内容的距离,类似于元素的内边距
+ itemStyle: object // 水球图外边框的样式,主要配置项有 color : string (边框和核心内容之间的背景颜色,也就是 borderDistance 那部分的背景颜色), borderColor : string (外边框的颜色), borderWidth : number (外边框的宽度), shadowBlur : number (外边阴影的模糊距离), shadowColor: string (边框阴影的颜色)
+ show: boolean // 是否显示
+}
+`
+ },
+ {
+ name: 'IBackgroundStyle',
+ type: 'interface',
+ code: `
+interface IBackgroundStyle {
+ borderColor: string // 背景边框的颜色
+ borderWidth: number // 背景的边框
+ color: string // 水球图的背景颜色
+}
+`
+ },
+ {
+ name: 'IItemStyle',
+ type: 'interface',
+ code: `
+interface IItemStyle {
+ opacity: number // 波浪的透明度
+ shadowBlur: number // 波浪阴影的模糊距离
+ shadowColor: string // 波浪阴影的颜色
+}
+`
+ },
+ {
+ name: 'IEmphasis',
+ type: 'interface',
+ code: `
+interface IEmphasis {
+ itemStyle: object // 鼠标悬浮时波浪的样式, opacity: number (鼠标悬浮时波浪的透明度)
+}
+`
+ },
+ {
+ name: 'ILabel',
+ type: 'interface',
+ code: `
+interface ILabel {
+ align: string // 文本的位置,可选值有' left ',' center ',' right '
+ baseline: string // 文本垂直方向上对齐方向,可选值有' top ',' middle ',' bottom '
+ color: string // 文本的颜色
+ fontSize: number // 字号
+ fontWeight: string // 文本的字重
+ formatter: () => void // 自定义文字标签内容
+ insideColor: string // 被波浪覆盖部分的文本的颜色
+ show: boolean // 是否显示,默认显示
+ position: string | array[string] // 文本的位置,有 inside , left , right , top , bottom 可选,也可设置为[’10%’,’20%’]形式表示水平和垂直方向的位置
+}
+`
+ }
+ ]
}
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-map.js b/examples/sites/demos/pc/app/chart/webdoc/chart-map.js
index 62a306196..ea55f30e3 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-map.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-map.js
@@ -9,5 +9,39 @@ export default {
'codeFiles': ['map/base.vue']
}
],
- apis: [{ 'name': 'chart-map', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
+ apis: [{ 'name': 'chart-map', 'type': 'component', 'props': [], 'events': [], 'slots': [] }],
+ types: [
+ {
+ name: 'IChartSettings',
+ type: 'interface',
+ code: `
+interface IChartSettings {
+ aspectScale: number // 用于scale地图的长宽比,默认为0.75
+ beforeRegisterMap: () => void // 地图数据注册前执行的函数,参数为地图数据,需返回地图数据
+ beforeRegisterMapOnce: () => void // 地图数据注册前执行的函数(仅执行一次),参数为地图数据,需返回地图数据
+ boundingCoords: array // 左上角以及右下角分别所对应的经纬度,默认为 null
+ center: array // 当前视角的中心点
+ dataType: object // 指标数据类型,内容为指标-指标数据类型的键值对,支持' normal ',' KMB ',' percent '
+ digit: number // 设置数据类型为percent时保留的位数,默认为2
+ dimension: string // 维度,默认 columns 第一项为维度
+ itemStyle: boolean | object // 地图区域的多边形图形样式,默认为 true
+ label: boolean | object // 文本标签,默认为 true
+ mapGrid: object // 地图距离容器的边距,默认值为{ left : auto , right : auto , top : auto , bottom : auto }
+ mapOrigin: object // 地图geojson
+ mapURLProfix: string // 位置请求的URL前缀,默认为 https://unpkg.com/echarts@3.6.2/map/json/
+ metrics: array // 指标,默认 columns 第二项为指标
+ position: string // 位置,默认为' china '
+ positionJsonLink: string // 地图数据源
+ roam: boolean | string // 是否开启鼠标缩放和平移漫游,默认为 false ,可选值有 false , true ,' scale ',' move '
+ scaleLimit: object // 滚轮缩放的极限控制,默认{ min :1, max :1}
+ selectData: boolean // 是否高亮显示数据对应位置,默认为 false
+ selectedMode: boolean | string // 地图选中模式,默认为 false ,可选值有' single ',' multiple '
+ specialAreas: object // 地图中的位置配置,将地图中的部分区域缩放到合适的位置,可以使得整个地图的显示更加好看
+ zoom: number // 视角的缩放比例,默认为1
+}
+
+> 备注: 属性中的 position 默认为'china',可设置的类型有'china'、'china-cities'、'china-contour'、'world'、'province/beijing'、'province/shanghai'等,省份的 position 如例子中所示需要在前面加'province/'
+`
+ }
+ ]
}
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-pie.js b/examples/sites/demos/pc/app/chart/webdoc/chart-pie.js
index 288bab168..7232ac2e3 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-pie.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-pie.js
@@ -50,5 +50,32 @@ export default {
'codeFiles': ['pie/demo7.vue']
}
],
- apis: [{ 'name': 'chart-pie', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
+ apis: [{ 'name': 'chart-pie', 'type': 'component', 'props': [], 'events': [], 'slots': [] }],
+ types: [
+ {
+ name: 'IChartSettings',
+ type: 'interface',
+ code: `
+interface IChartSettings {
+ dataType: string // 数据类型,可选值: KMB , normal , percent
+ digit: number // 设置数据类型为 percent 时保留的位数,默认为2
+ dimension: string // 维度,默认 columns 第一项为维度
+ hoverAnimation: boolean // 是否开启 hover 在扇区上的放大动画效果,默认值为 true
+ itemStyle: object // 图形样式,
+ label: object // 饼图图形上的文本标签,
+ labelLine: object // 标签的视觉引导线样式,
+ legendLimit: number // legend 显示数量限制, legend 数量过多会导致饼图样式错误,限制 legend 最大值并且当超过此值时,隐藏 legend 可以解决这个问题
+ level: array // 多圆饼图时设置
+ limitShowNum: number // 设置超过此数字时使用‘其他’代替,此时数据会按照由大到小顺序显示
+ metrics: string // 指标,默认 columns 第二项为指标
+ offsetY: number/string // 纵向偏移量,支持数值和百分比
+ radius: number/string // 饼图半径,支持数值和百分比
+ roseType: string // 显示为南丁格尔玫瑰图,默认不展示为南丁格尔玫瑰图,可设置为' radius ',' area '
+ selectedMode: string // 选中模式,可选值: single , multiple ,默认为 false
+}
+
+> 备注 1. level 的值接受二维数组,例如: [['a', 'b'], ['c', 'd']] , 表示的含义是内层展示的是维度中的 'a', 'b' 的指标加在一起组成的饼图,外层为 'c', 'd' 的指标加在一起组成的环图。
+`
+ }
+ ]
}
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-question.js b/examples/sites/demos/pc/app/chart/webdoc/chart-question.js
index 971958077..e5d9dc965 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-question.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-question.js
@@ -4,19 +4,23 @@ export default {
demos: [
{
'demoId': 'question-base',
- 'name': { 'zh-CN': '常见问题', 'en-US': 'Frequently Asked Questions' },
+ 'name': { 'zh-CN': '父元素的初始宽度未知1', 'en-US': 'The initial width of the parent element is unknown2' },
'desc': {
'zh-CN':
- '父元素的初始宽度未知
\n在一个初始宽度未知的容器内绘制图表时,因为无法获取宽度,所以图表会绘制失败,解决的办法是在容器宽度已知后,\n调用 echarts 的 resize 方法。\n通过 cancel-resize-check
是用于resize之前,检测组件元素是否存在,元素是否有宽高,没有则不resize。
\n',
+ '在一个初始宽度未知的容器内绘制图表时,因为无法获取宽度,所以图表会绘制失败,解决的办法是在容器宽度已知后,\n调用 echarts 的 resize 方法。\n通过 cancel-resize-check
是用于resize之前,检测组件元素是否存在,元素是否有宽高,没有则不resize。
\n',
'en-US':
- 'The initial width of the parent element is unknown
\nWhen drawing a chart in a container whose initial width is unknown, the chart fails to be drawn because the width cannot be obtained. The solution is to obtain the width after the container width is known. \nInvoke the resize method of echarts. \n cancel-resize-check
is used to check whether a component element exists and whether the element has width and height before resize. If no, the component element does not have width and height.
\n'
+ 'When drawing a chart in a container whose initial width is unknown, the chart fails to be drawn because the width cannot be obtained. The solution is to obtain the width after the container width is known. \nInvoke the resize method of echarts. \n cancel-resize-check
is used to check whether a component element exists and whether the element has width and height before resize. If no, the component element does not have width and height.
\n'
},
'codeFiles': ['question/base.vue']
},
{
'demoId': 'question-demo5',
- 'name': { 'zh-CN': '父元素的初始宽度未知', 'en-US': 'The initial width of the parent element is unknown.' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
+ 'name': { 'zh-CN': '父元素的初始宽度未知2', 'en-US': 'The initial width of the parent element is unknown 2.' },
+ 'desc': {
+ 'zh-CN': '当父元素改变时,图表需要执行 resize 方法同步图表的宽高。',
+ 'en-US':
+ 'When the parent element changes, the chart needs to perform the resize method to synchronize the width and height of the chart.'
+ },
'codeFiles': ['question/demo5.vue']
},
{
@@ -32,7 +36,7 @@ export default {
},
{
'demoId': 'question-demo2',
- 'name': { 'zh-CN': '小数显示精度', 'en-US': 'Decimal display precision' },
+ 'name': { 'zh-CN': '小数显示精度1', 'en-US': 'Decimal display precision1' },
'desc': {
'zh-CN':
'处理数据类型时默认保留两位有效数字,但是当数字较小并设置为百分比类型时,这种方式会导致显示上的问题,例如:
\n',
@@ -40,6 +44,16 @@ export default {
'When processing data types, two valid digits are reserved by default. However, when the number is small and the percentage type is set, this method may cause display problems, for example,
\n'
},
'codeFiles': ['question/demo2.vue']
+ },
+ {
+ 'demoId': 'question-demo3',
+ 'name': { 'zh-CN': '小数显示精度2', 'en-US': 'Decimal display precision2' },
+ 'desc': {
+ 'zh-CN': '每个图表内都有 digit 配置项,设置此属性,保证设置类型后,数值较小也能够正常显示,如下所示:',
+ 'en-US':
+ 'Each chart contains the digit configuration item. Set this attribute to ensure that a small value can be properly displayed after the type is set, as shown in the following figure.'
+ },
+ 'codeFiles': ['question/demo3.vue']
}
],
apis: [{ 'name': 'chart-question', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-radar.js b/examples/sites/demos/pc/app/chart/webdoc/chart-radar.js
index 3a119c098..84580d3e6 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-radar.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-radar.js
@@ -26,5 +26,25 @@ export default {
'codeFiles': ['radar/demo3.vue']
}
],
- apis: [{ 'name': 'chart-radar', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
+ apis: [{ 'name': 'chart-radar', 'type': 'component', 'props': [], 'events': [], 'slots': [] }],
+ types: [
+ {
+ name: 'IChartSettings',
+ type: 'interface',
+ code: `
+interface IChartSettings {
+ areaStyle: object // 区域填充样式,
+ dataType: object // 数据类型,可选值: KMB , normal , percent
+ digit: number // 设置数据类型为 percent 时保留的位数,默认为2
+ dimension: string // 维度,默认 columns 第一项为维度
+ itemStyle: object // 折线拐点标志的样式,
+ label: object // 图形上的文本标签,
+ lineStyle: object // 线条样式,
+ metrics: array // 指标,默认 columns 第二项起为指标
+}
+
+> 备注:dataType 中直接设置对应维度的数据类型,例如示例的{ '占比': 'percent' },即将占比数据设置为百分比类型
+`
+ }
+ ]
}
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-ring.js b/examples/sites/demos/pc/app/chart/webdoc/chart-ring.js
index 53b67a443..66b8f721f 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-ring.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-ring.js
@@ -50,5 +50,29 @@ export default {
'codeFiles': ['ring/ring-title.vue']
}
],
- apis: [{ 'name': 'chart-ring', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
+ apis: [{ 'name': 'chart-ring', 'type': 'component', 'props': [], 'events': [], 'slots': [] }],
+ types: [
+ {
+ name: 'IChartSettings',
+ type: 'interface',
+ code: `
+interface IChartSettings {
+ dataType: string // 数据类型,可选值: KMB , normal , percent
+ digit: number // 设置数据类型为 percent 时保留的位数,默认为2
+ dimension: string // 维度,默认 columns 第一项为维度
+ hoverAnimation: boolean // 是否开启 hover 在扇区上的放大动画效果,默认值为 true
+ itemStyle: object // 图形样式,
+ label: object // 环图图形上的文本标签,
+ labelLine: object // 标签的视觉引导线样式,
+ legendLimit: number // legend 显示数量限制, legend 数量过多会导致环图样式错误,限制 legend 最大值并且当超过此值时,隐藏 legend 可以解决这个问题
+ limitShowNum: number // 设置超过此数字时使用‘其他’代替,此时数据会按照由大到小顺序显示
+ metrics: string // 指标,默认 columns 第二项为指标
+ offsetY: number/string // 纵向偏移量,支持数值和百分比
+ radius: array // 环图外半径与内半径,数组元素支持数值和百分比,如:[50,70]或['50%','70%']
+ roseType: string // 显示为南丁格尔玫瑰图,默认不展示为南丁格尔玫瑰图,可设置为' radius ',' area '
+ selectedMode: string // 选中模式,可选值: single , multiple ,默认为 false
+}
+`
+ }
+ ]
}
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-sankey.js b/examples/sites/demos/pc/app/chart/webdoc/chart-sankey.js
index a3c1f17af..0e3cc0aff 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-sankey.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-sankey.js
@@ -20,5 +20,23 @@ export default {
'codeFiles': ['sankey/demo2.vue']
}
],
- apis: [{ 'name': 'chart-sankey', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
+ apis: [{ 'name': 'chart-sankey', 'type': 'component', 'props': [], 'events': [], 'slots': [] }],
+ types: [
+ {
+ name: 'IChartSettings',
+ type: 'interface',
+ code: `
+interface IChartSettings {
+ dataType: array // 数据类型,数组的第一项为 item 的数据类型,第二项为 line 的数据类型,可选值: KMB , normal , percent
+ digit: number // 设置数据类型为percent时保留的位数,默认为2
+ dimension: string // 维度,默认 columns 第一项为维度
+ itemStyle: object // 节点矩形的样式,
+ label: object // 每个矩形节点中文本标签的样式,
+ lineStyle: object // 桑基图边的样式,
+ links: array // 节点间的关系数据,
+ metrics: string // 指标,默认 columns 第二项为指标
+}
+`
+ }
+ ]
}
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-scatter.js b/examples/sites/demos/pc/app/chart/webdoc/chart-scatter.js
index 17efc4fee..6c048d1b0 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-scatter.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-scatter.js
@@ -62,5 +62,35 @@ export default {
'codeFiles': ['scatter/demo8.vue']
}
],
- apis: [{ 'name': 'chart-scatter', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
+ apis: [{ 'name': 'chart-scatter', 'type': 'component', 'props': [], 'events': [], 'slots': [] }],
+ types: [
+ {
+ name: 'IChartSettings',
+ type: 'interface',
+ code: `
+interface IChartSettings {
+ axisVisible: boolean // 是否显示坐标轴
+ cursor: string // 鼠标悬浮时在图形元素上时鼠标的样式
+ dataType: object // 数据类型
+ digit: number // 设置数据类型为 percent 时保留的位数,默认为2
+ dimension: string // 维度,默认 columns[0]
+ labelMap: object // 设置指标的别名
+ legendName: object // 设置图表上方图例的别名
+ max: number // y 轴最大值
+ metrics: array // 指标,默认[columns[0], columns[1]]
+ min: number // y 轴最小值
+ scale: boolean // 是否是脱离0值比例
+ symbol: string // 标记的图形
+ symbolOffset: array // 标记相对于原本位置的偏移
+ symbolRotate: number // 标记的旋转角度
+ symbolSize: number | array | () => void // 标记的大小
+ symbolSizeMax: number // 气泡最大值,默认为50
+ tooltipTrigger: string // 提示框的触发方式,可选值: item , axis
+ xAxisName: string // x 轴标题
+ xAxisType: string // x 轴类型,可选值: category , value , time , log
+ yAxisName: string // y 轴标题
+}
+`
+ }
+ ]
}
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-sunburst.js b/examples/sites/demos/pc/app/chart/webdoc/chart-sunburst.js
index ed4381c01..3de3feaeb 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-sunburst.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-sunburst.js
@@ -18,6 +18,12 @@ export default {
'name': { 'zh-CN': '复杂示例', 'en-US': 'Complex Example' },
'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
'codeFiles': ['sunburst/demo2.vue']
+ },
+ {
+ 'demoId': 'sunburst-demo3',
+ 'name': { 'zh-CN': '配置 lable', 'en-US': 'Configuring Labels' },
+ 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
+ 'codeFiles': ['sunburst/demo3.vue']
}
],
apis: [{ 'name': 'chart-sunburst', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-tree.js b/examples/sites/demos/pc/app/chart/webdoc/chart-tree.js
index 8880eb07d..3d17ef59c 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-tree.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-tree.js
@@ -38,5 +38,18 @@ export default {
'codeFiles': ['tree/demo5.vue']
}
],
- apis: [{ 'name': 'chart-tree', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
+ apis: [{ 'name': 'chart-tree', 'type': 'component', 'props': [], 'events': [], 'slots': [] }],
+ types: [
+ {
+ name: 'IChartSettings',
+ type: 'interface',
+ code: `
+interface IChartSettings {
+ dimension: string // 维度,默认 columns 第一项为维度
+ metrics: string // 指标,默认 columns 第二项为指标
+ seriesMap: object // 附加到 series 中的设置
+}
+`
+ }
+ ]
}
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-waterfall.js b/examples/sites/demos/pc/app/chart/webdoc/chart-waterfall.js
index 6166a0c72..7d77b48c6 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-waterfall.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-waterfall.js
@@ -38,5 +38,22 @@ export default {
'codeFiles': ['waterfall/demo5.vue']
}
],
- apis: [{ 'name': 'chart-waterfall', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
+ apis: [{ 'name': 'chart-waterfall', 'type': 'component', 'props': [], 'events': [], 'slots': [] }],
+ types: [
+ {
+ name: 'IChartSettings',
+ type: 'interface',
+ code: `
+interface IChartSettings {
+ dataType: string // 数据类型,可选值: KMB , normal , percent
+ digit: number // 设置数据类型为 percent 时保留的位数,默认为2
+ dimension: string // 维度,默认 columns 第一项为维度
+ metrics: string // 指标,默认 columns 第二项为指标
+ remainName: string // 剩余的显示文案,默认显示其他
+ totalName: string // 总量的显示文案,默认显示总计
+ totalNum: number // 总量,默认瀑布图总量为所有数据的和
+}
+`
+ }
+ ]
}
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart-wordcloud.js b/examples/sites/demos/pc/app/chart/webdoc/chart-wordcloud.js
index 233f82f4f..81d3578ed 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart-wordcloud.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart-wordcloud.js
@@ -32,5 +32,20 @@ export default {
'codeFiles': ['wordcloud/demo4.vue']
}
],
- apis: [{ 'name': 'chart-wordcloud', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
+ apis: [{ 'name': 'chart-wordcloud', 'type': 'component', 'props': [], 'events': [], 'slots': [] }],
+ types: [
+ {
+ name: 'IChartSettings',
+ type: 'interface',
+ code: `
+interface IChartSettings {
+ color: array[string] | string | () => void // 词云图字体颜色,默认为 "rgb(Math.round(Math.random * 160), Math.round(Math.random * 160), Math.round(Math.random * 160))"
+ dimension: string // 维度,默认 columns[0]
+ metrics: string // 指标,默认 columns[1]
+ sizeMax: number // 最大字体大小,默认为60
+ sizeMin: number // 最小字体大小,默认为12
+}
+`
+ }
+ ]
}
diff --git a/examples/sites/demos/pc/app/chart/webdoc/chart.js b/examples/sites/demos/pc/app/chart/webdoc/chart.js
index 49025b84f..e3c07f92b 100644
--- a/examples/sites/demos/pc/app/chart/webdoc/chart.js
+++ b/examples/sites/demos/pc/app/chart/webdoc/chart.js
@@ -3,176 +3,18 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'base',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'base',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN':
'图表组件支持 双向数据绑定
,可以流畅的运行在 PC 和移动设备上,兼容当前绝大部分浏览器(IE 9/10/11,Chrome,Firefox,Safari 等)底层依赖轻量级的 Canvas 类库 ZRender,提供直观,生动,可交互,可高度个性化定制的数据可视化图表。\n可通过 theme
自定义主题\n百度地图和高德地图需要外网访问权限才能正常使用\n
\n',
'en-US':
'The chart component supports bidirectional data binding, which can run smoothly on PCs and mobile devices and is compatible with most browsers. (Internet Explorer 9/10/11, Chrome, Firefox, Safari, etc.) The bottom layer relies on the lightweight Canvas class library ZRender to provide intuitive, vivid, interactive, and highly personalized data visualization charts. \nYou can use theme
to customize themes. \nBaidu Maps and AutoNavi Maps require external network access. \n
\n'
},
- 'codeFiles': ['base.vue']
- }
- ],
- apis: [
- {
- 'name': 'chart',
- 'type': 'component',
- 'props': [
- {
- 'name': 'data ',
- 'type': 'object ',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '数据由指标和维度组成,“维度” 指的是数据的属性,“指标” 是量化衡量标准',
- 'en-US':
- 'Data consists of indicators and dimensions. Dimension refers to data attributes, and indicator refers to quantitative measurement standards.'
- },
- 'demoId': 'chart/attributes-demo#props-demo10'
- },
- {
- 'name': 'settings ',
- 'type': 'object ',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '配置项,各图表 Settings 属性配置请查阅各图表详情页面',
- 'en-US': 'Configuration item. For details about the attributes of each chart, see the chart details page.'
- },
- 'demoId': ''
- },
- {
- 'name': 'width',
- 'type': 'string',
- 'defaultValue': '该属性的默认值为 auto',
- 'desc': { 'zh-CN': '设置图表容器的宽度。', 'en-US': 'Set the width of the chart container.' },
- 'demoId': 'chart/attributes-demo#props-demo10'
- },
- {
- 'name': 'height',
- 'type': 'string',
- 'defaultValue': '该属性的默认值为 400px',
- 'desc': { 'zh-CN': '设置图表容器的高度。', 'en-US': 'Set the height of the chart container.' },
- 'demoId': 'chart/attributes-demo#props-demo10'
- },
- {
- 'name': 'events',
- 'type': 'object',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '事件绑定', 'en-US': 'Event binding' },
- 'demoId': 'chart/events#events-base'
- },
- {
- 'name': 'init-options',
- 'type': 'object',
- 'defaultValue': '',
- 'desc': { 'zh-CN': 'init 附加参数', 'en-US': 'Init Additional Parameters' },
- 'demoId': 'chart/attributes-demo#props-demo10'
- },
- {
- 'name': 'tooltip-visible',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 true',
- 'desc': { 'zh-CN': '是否显示提示框', 'en-US': 'Display dialog box' },
- 'demoId': 'chart/attributes-demo#props-demo10'
- },
- {
- 'name': 'legend-visible',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 true',
- 'desc': { 'zh-CN': '是否显示图例', 'en-US': 'Display legend' },
- 'demoId': 'chart/attributes-demo#props-demo10'
- },
- {
- 'name': 'theme',
- 'type': 'object',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义主题名称。;自定义主题对象。',
- 'en-US': 'User-defined theme name. ;User-defined theme object.'
- },
- 'demoId': 'chart#base'
- },
- {
- 'name': 'theme-name',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义主题名称,如果设置了theme-name,则theme无效',
- 'en-US': 'User-defined theme name. If theme-name is set, the theme is invalid.'
- },
- 'demoId': 'chart#base'
- },
- {
- 'name': 'judge-width',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 false',
- 'desc': {
- 'zh-CN': '是否处理生成图表时的宽度问题',
- 'en-US': 'Do you want to process the width issue when generating charts?'
- },
- 'demoId': 'chart/events#events-base'
- },
- {
- 'name': 'width-change-delay',
- 'type': 'number',
- 'defaultValue': '该属性的默认值为 300',
- 'desc': { 'zh-CN': '容器宽度变化的延迟', 'en-US': 'Container width change delay' },
- 'demoId': 'chart/question#question-base'
- },
- {
- 'name': 'resizeable',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 true',
- 'desc': { 'zh-CN': '是否处理窗口 resize 事件', 'en-US': 'Whether to process the window resize event' },
- 'demoId': 'chart/question#question-base'
- },
- {
- 'name': 'cancel-resize-check',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 false',
- 'desc': {
- 'zh-CN': '是否禁用 resize 时的容器检测',
- 'en-US': 'Whether to disable container detection during resize'
- },
- 'demoId': 'chart/question#question-base'
- },
- {
- 'name': 'resize-delay',
- 'type': 'number',
- 'defaultValue': '该属性的默认值为 200',
- 'desc': { 'zh-CN': '窗口 resize 事件回调的延迟', 'en-US': 'Delay of the window resize event callback' },
- 'demoId': 'chart/attributes-demo#props-demo10'
- },
- {
- 'name': 'change-delay',
- 'type': 'number',
- 'defaultValue': '该属性的默认值为 0',
- 'desc': {
- 'zh-CN': '属性修改触发图表重绘回调的延迟',
- 'en-US': 'Delay for triggering chart redrawing callback after attribute modification'
- },
- 'demoId': 'chart/question#question-base'
- },
- {
- 'name': 'set-option-opts',
- 'type': 'boolean , object',
- 'defaultValue': '该属性的默认值为 true',
- 'desc': { 'zh-CN': 'echarts setOption 的第二个参数', 'en-US': 'Echarts setOption second parameter' },
- 'demoId': ''
- },
- {
- 'name': 'not-set-unchange',
- 'type': 'Array',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '未发生变化时不参加 setOption 的属性',
- 'en-US': 'The setOption attribute does not change.'
- },
- 'demoId': ''
- }
- ],
- 'events': [],
- 'slots': []
+ codeFiles: ['base.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/checkbox/shape-composition-api.vue b/examples/sites/demos/pc/app/checkbox/shape-composition-api.vue
new file mode 100644
index 000000000..eee989f5d
--- /dev/null
+++ b/examples/sites/demos/pc/app/checkbox/shape-composition-api.vue
@@ -0,0 +1,23 @@
+
+
+ 复选框1
+
+
+ 复选框2复选框2复选框2复选框2复选框2复选框2
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/checkbox/shape.spec.ts b/examples/sites/demos/pc/app/checkbox/shape.spec.ts
new file mode 100644
index 000000000..477c8ba37
--- /dev/null
+++ b/examples/sites/demos/pc/app/checkbox/shape.spec.ts
@@ -0,0 +1,17 @@
+import { test, expect } from '@playwright/test'
+
+test('过滤器模式', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('checkbox#shape')
+
+ const demo = page.locator('#shape')
+ const checkboxGroup = demo.locator('.tiny-checkbox-group')
+ const tooltip = page.locator('.tiny-tooltip[aria-hidden="false"]')
+
+ await expect(demo.locator('.tiny-checkbox').first()).toHaveCSS('background-color', 'rgb(245, 246, 248)')
+ await expect(checkboxGroup.locator('.tiny-checkbox').first()).toHaveCSS('background-color', 'rgb(245, 246, 248)')
+ await expect(checkboxGroup.locator('.tiny-checkbox').nth(1)).toHaveCSS('background-color', 'rgb(245, 246, 248)')
+ await checkboxGroup.locator('.tiny-checkbox').nth(1).hover()
+ await page.waitForTimeout(50)
+ await expect(tooltip).toHaveText('复选框2复选框2复选框2复选框2复选框2复选框2')
+})
diff --git a/examples/sites/demos/pc/app/checkbox/shape.vue b/examples/sites/demos/pc/app/checkbox/shape.vue
new file mode 100644
index 000000000..49f0f86d2
--- /dev/null
+++ b/examples/sites/demos/pc/app/checkbox/shape.vue
@@ -0,0 +1,32 @@
+
+
+ 复选框1
+
+
+ 复选框2复选框2复选框2复选框2复选框2复选框2
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/checkbox/webdoc/checkbox.js b/examples/sites/demos/pc/app/checkbox/webdoc/checkbox.js
index 820cffcd8..a2a869099 100644
--- a/examples/sites/demos/pc/app/checkbox/webdoc/checkbox.js
+++ b/examples/sites/demos/pc/app/checkbox/webdoc/checkbox.js
@@ -3,582 +3,243 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '通过 v-model
设置绑定值,name
设置原生属性。
',
'en-US': 'For details, see the following example.
'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'checkbox-group',
- 'name': { 'zh-CN': '复选框组', 'en-US': 'Checkbox group' },
- 'desc': {
+ demoId: 'checkbox-group',
+ name: {
+ 'zh-CN': '复选框组',
+ 'en-US': 'Checkbox group'
+ },
+ desc: {
'zh-CN':
'checkbox-group
可以将多个 checkbox
元素管理为一组,在 checkbox-group
中使用 v-model
绑定选中值。checkbox
的 label
与 checkbox-group
的绑定值相对应,如果存在指定的值则为选中状态,否则为不选中。
',
'en-US':
'checkbox-group
can manage multiplecheckbox
elements into a group and usev model
to bind selected values incheckbox group
< Thelabel
of code>checkboxcorresponds to the binding value ofcheckbox group
. If a specified value exists, it is selected, otherwise it is not selected.
'
},
- 'codeFiles': ['checkbox-group.vue']
+ codeFiles: ['checkbox-group.vue']
},
{
- 'demoId': 'checkbox-button',
- 'name': { 'zh-CN': '复选框按钮', 'en-US': 'Checkbox button' },
- 'desc': {
+ demoId: 'checkbox-button',
+ name: {
+ 'zh-CN': '复选框按钮',
+ 'en-US': 'Checkbox button'
+ },
+ desc: {
'zh-CN': '通过 checkbox-button
以按钮的形式展示复选框,用法与 checkbox
相似。
',
'en-US':
' checkbox button
Display checkboxes in the form of buttons, similar in usage to checkbox
.
'
},
- 'codeFiles': ['checkbox-button.vue']
+ codeFiles: ['checkbox-button.vue']
},
{
- 'demoId': 'group-options',
- 'name': { 'zh-CN': '配置式复选框组', 'en-US': 'Profile Checkbox Group' },
- 'desc': {
+ demoId: 'group-options',
+ name: {
+ 'zh-CN': '配置式复选框组',
+ 'en-US': 'Profile Checkbox Group'
+ },
+ desc: {
'zh-CN':
'通过 options
配置显示多选框组。使用该属性后,可以不用再在标签中以插槽的形式插入 checkbox
或 checkbox-button
元素。 type
属性配合 options
属性一起使用,将 type
配置为 button
,复选框组将以按钮的形式展示。
',
'en-US':
'Configure the display of multiple selection box groups through options
. After using this attribute, you no longer need to insert checkbox
or checkbox button
elements in the label as slots. The type of options
is ICheckboxGroupOptions[] .The type
attribute is used in conjunction with the options
attribute to configure the type
as button
, and the checkbox group will be displayed in the form of a button.
'
},
- 'codeFiles': ['group-options.vue']
+ codeFiles: ['group-options.vue']
},
{
- 'demoId': 'description',
- 'name': { 'zh-CN': '描述文本', 'en-US': 'Description text' },
- 'desc': {
+ demoId: 'description',
+ name: {
+ 'zh-CN': '描述文本',
+ 'en-US': 'Description text'
+ },
+ desc: {
'zh-CN':
'复选框或复现框按钮的描述文本,有三种方式可以提供,优先级依次为 默认插槽
、text
、label
。
',
'en-US':
'There are three ways to provide the description text for the checkbox or checkbox button, with priority being default slot
, text
, and label
.
'
},
- 'codeFiles': ['description.vue']
+ codeFiles: ['description.vue']
},
{
- 'demoId': 'indeterminate',
- 'name': { 'zh-CN': '全选与半选', 'en-US': 'All and Half' },
- 'desc': {
+ demoId: 'indeterminate',
+ name: {
+ 'zh-CN': '全选与半选',
+ 'en-US': 'All and Half'
+ },
+ desc: {
'zh-CN':
'
在 checkbox
元素中配置 indeterminate
属性为 true 后,勾选框将展示为半选的样式。
',
'en-US':
'After the indeterminate
attribute is set to true in the checkbox
element, the check box is displayed as half-selected.
'
},
- 'codeFiles': ['indeterminate.vue']
+ codeFiles: ['indeterminate.vue']
},
{
- 'demoId': 'min-max',
- 'name': { 'zh-CN': '可选数量限制', 'en-US': 'Quantity Limit' },
- 'desc': {
+ demoId: 'min-max',
+ name: {
+ 'zh-CN': '可选数量限制',
+ 'en-US': 'Quantity Limit'
+ },
+ desc: {
'zh-CN':
'在 checkbox-group
上可通过 min
、 max
属性指定可勾选项目的最小、最大值。
',
'en-US':
'On the checkbox-group
, the min
and max
attributes can be used to specify the minimum and maximum values of the options that can be selected.
'
},
- 'codeFiles': ['min-max.vue']
+ codeFiles: ['min-max.vue']
},
{
- 'demoId': 'checked',
- 'name': { 'zh-CN': '是否默认勾选', 'en-US': 'Default selected' },
- 'desc': {
+ demoId: 'checked',
+ name: {
+ 'zh-CN': '是否默认勾选',
+ 'en-US': 'Default selected'
+ },
+ desc: {
'zh-CN':
' checkbox-group
上绑定的 v-model
可以配置默认选中, checked
同样可以配置默认选中。
',
'en-US':
'The v-model bound on check group
can be configured with default selection, and checked
can also be configured with default selection.
'
},
- 'codeFiles': ['checked.vue']
+ codeFiles: ['checked.vue']
},
{
- 'demoId': 'vertical-checkbox',
- 'name': { 'zh-CN': '垂直布局', 'en-US': 'vertical layout' },
- 'desc': {
+ demoId: 'vertical-checkbox',
+ name: {
+ 'zh-CN': '垂直布局',
+ 'en-US': 'vertical layout'
+ },
+ desc: {
'zh-CN':
'在 checkbox-group
元素上设置 vertical
为 true,则其管理的 checkbox-button
或 checkbox
将展示为垂直布局。
',
'en-US':
'Set vertical
to true on the checkbox-group
element, The checkbox-button
or checkbox
managed by it is displayed as a vertical layout.
'
},
- 'codeFiles': ['vertical-checkbox.vue']
+ codeFiles: ['vertical-checkbox.vue']
},
{
- 'demoId': 'border',
- 'name': { 'zh-CN': '带边框复选框', 'en-US': 'Checkbox border' },
- 'desc': {
+ demoId: 'border',
+ name: {
+ 'zh-CN': '带边框复选框',
+ 'en-US': 'Checkbox border'
+ },
+ desc: {
'zh-CN':
' checkbox
上配置 border
,可显示边框。若复选框后的描述文本超出时,可以通过 tooltip
组件增加提示信息,鼠标悬停时可提示所有内容。
',
'en-US':
'Configure border
on checkbox
to display borders. If the description text after the check box exceeds, a prompt message can be added through the Tooltip component, and all content can be prompted when the mouse hovers.
'
},
- 'codeFiles': ['border.vue']
+ codeFiles: ['border.vue']
},
{
- 'demoId': 'text',
- 'name': { 'zh-CN': '状态对应的值', 'en-US': 'Text' },
- 'desc': {
+ demoId: 'text',
+ name: {
+ 'zh-CN': '状态对应的值',
+ 'en-US': 'Text'
+ },
+ desc: {
'zh-CN': '通过 true-label
设置选中的值, false-label
设置未选中的值。
',
'en-US':
'Use true-label
to set the selected value, and false-label
to set the unselected value.
'
},
- 'codeFiles': ['text.vue']
+ codeFiles: ['text.vue']
},
{
- 'demoId': 'size',
- 'name': { 'zh-CN': '尺寸', 'en-US': 'Dimension' },
- 'desc': {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '尺寸',
+ 'en-US': 'Dimension'
+ },
+ desc: {
'zh-CN':
'当复选框为按钮形式时, size
属性可以设置尺寸,可选项有 medium
、small
、mini
,不设置则为默认样式。
',
'en-US':
'When the check box is a button, you can set the size of the button through the size
attribute. The options are medium, small, and mini. \n\n Setting the disabled
property on checkbox-button
will disable a check button. If the disabled
attribute is configured on the checkbox-group
tab, all check buttons are disabled.
'
},
- 'codeFiles': ['size.vue']
+ codeFiles: ['size.vue']
},
{
- 'demoId': 'custom-color',
- 'name': { 'zh-CN': '自定义颜色', 'en-US': 'Custom color' },
- 'desc': {
+ demoId: 'shape',
+ name: {
+ 'zh-CN': '过滤器模式',
+ 'en-US': 'Filter mode'
+ },
+ desc: {
+ 'zh-CN': '通过 shape
设置过滤器模式。
',
+ 'en-US': 'Set the filter mode via shape
.
'
+ },
+ codeFiles: ['shape.vue']
+ },
+ {
+ demoId: 'custom-color',
+ name: {
+ 'zh-CN': '自定义颜色',
+ 'en-US': 'Custom color'
+ },
+ desc: {
'zh-CN':
'通过 fill
自定义选中时背景和边框颜色,通过 text-color
自定义选中时的文本颜色。
',
'en-US':
'Customize the background and border color when selected throughfill
, and customize the text color when selected throughtext color
.
'
},
- 'codeFiles': ['custom-color.vue']
+ codeFiles: ['custom-color.vue']
},
{
- 'demoId': 'checkbox-slot',
- 'name': { 'zh-CN': '默认插槽', 'en-US': 'Slot' },
- 'desc': {
+ demoId: 'checkbox-slot',
+ name: {
+ 'zh-CN': '默认插槽',
+ 'en-US': 'Slot'
+ },
+ desc: {
'zh-CN': '通过 default slot
自定义文本内容。
',
'en-US': 'Customize text content through default slot
.
'
},
- 'codeFiles': ['checkbox-slot.vue']
+ codeFiles: ['checkbox-slot.vue']
},
{
- 'demoId': 'checkbox-button-multiple',
- 'name': { 'zh-CN': '多行按钮', 'en-US': 'Checkbox Button Multiple' },
- 'desc': {
+ demoId: 'checkbox-button-multiple',
+ name: {
+ 'zh-CN': '多行按钮',
+ 'en-US': 'Checkbox Button Multiple'
+ },
+ desc: {
'zh-CN': '多行按钮组,超出最大宽度后,换行显示。
',
'en-US': 'Multi line button group, displayed as a new line after exceeding the maximum width.
'
},
- 'codeFiles': ['checkbox-button-multiple.vue']
+ codeFiles: ['checkbox-button-multiple.vue']
},
{
- 'demoId': 'dynamic-create-checkbox',
- 'name': { 'zh-CN': '动态生成复选框组', 'en-US': 'Dynamic generate check box groups' },
- 'desc': {
+ demoId: 'dynamic-create-checkbox',
+ name: {
+ 'zh-CN': '动态生成复选框组',
+ 'en-US': 'Dynamic generate check box groups'
+ },
+ desc: {
'zh-CN': '复选框组所需数据可通过请求服务从后台取得,然后动态生成。
',
'en-US':
'The data required by the check box group can be obtained from the background through the request service and then dynamically generated.
'
},
- 'codeFiles': ['dynamic-create-checkbox.vue']
+ codeFiles: ['dynamic-create-checkbox.vue']
},
{
- 'demoId': 'checkbox-events',
- 'name': { 'zh-CN': '事件', 'en-US': 'Event' },
- 'desc': {
+ demoId: 'checkbox-events',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': 'Event'
+ },
+ desc: {
'zh-CN': '勾选值改变后将触发 change
事件。
',
'en-US': 'The change
event is triggered when the value of the check box is changed.
'
},
- 'codeFiles': ['checkbox-events.vue']
- }
- ],
- apis: [
- {
- 'name': 'checkbox',
- 'type': 'component',
- 'props': [
- {
- 'name': 'border',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否显示边框',
- 'en-US': 'Display border'
- },
- 'demoId': 'border'
- },
- {
- 'name': 'checked',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否默认勾选',
- 'en-US': 'Currently selected'
- },
- 'demoId': 'checked'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否禁用',
- 'en-US': 'Disable'
- },
- 'demoId': 'indeterminate'
- },
- {
- 'name': 'false-label',
- 'type': 'string | number',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '没有选中时的值',
- 'en-US': 'Value when no option is selected'
- },
- 'demoId': 'text'
- },
- {
- 'name': 'indeterminate',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '设置 indeterminate 状态,只负责样式控制',
- 'en-US': 'Sets the indeterminate state and controls only the style.'
- },
- 'demoId': 'indeterminate'
- },
- {
- 'name': 'label',
- 'type': 'string | number | boolean',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '选中状态的值(只有在 checkbox-group 中或者绑定对象类型为 array 时有效)',
- 'en-US':
- 'Selected value (This parameter is valid only when checkbox-group or the bound object type is array)'
- },
- 'demoId': 'checkbox-group'
- },
- {
- 'name': 'modelValue / v-model',
- 'type': 'string | number | boolean',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '绑定值',
- 'en-US': 'Bound Value'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'name',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '原生 name 属性',
- 'en-US': 'Native name attribute'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'size',
- 'type': "'medium' | 'small' | 'mini'",
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': 'checkbox 的尺寸,仅在 border 为真时有效',
- 'en-US': 'Checkbox size. This parameter is valid only when border is set to true'
- },
- 'demoId': 'size'
- },
- {
- 'name': 'text',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '复选框显示的文本',
- 'en-US': 'Text displayed in the check box'
- },
- 'demoId': 'description'
- },
- {
- 'name': 'true-label',
- 'type': 'string | number',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '选中时的值',
- 'en-US': 'Value when selected'
- },
- 'demoId': 'text'
- }
- ],
- 'events': [
- {
- 'name': 'change',
- 'type': '(value: string | number | boolean) => void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '当绑定值变化时触发的事件',
- 'en-US': 'This event is triggered when the binding value changes'
- },
- 'demoId': 'checkbox-events'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': 'checkbox的内容',
- 'en-US': 'Checkbox content'
- },
- 'demoId': 'checkbox-slot'
- }
- ]
- },
- {
- 'name': 'checkbox-group',
- 'type': 'component',
- 'props': [
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否禁用',
- 'en-US': 'Disable'
- },
- 'demoId': 'indeterminate'
- },
- {
- 'name': 'fill',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '按钮形式的 checkbox 激活时的填充色和边框色',
- 'en-US': 'Fill color and border color when the checkbox in button mode is activated'
- },
- 'demoId': 'custom-color'
- },
- {
- 'name': 'max',
- 'type': 'number',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '可被勾选的 checkbox 的最大数量',
- 'en-US': 'Maximum number of checkboxes that can be selected'
- },
- 'demoId': 'min-max'
- },
- {
- 'name': 'min',
- 'type': 'number',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '可被勾选的 checkbox 的最小数量',
- 'en-US': 'Minimum number of checkboxes that can be selected'
- },
- 'demoId': 'min-max'
- },
- {
- 'name': 'modelValue / v-model',
- 'type': 'string[] | number[]',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '绑定值',
- 'en-US': 'Bound Value'
- },
- 'demoId': 'checkbox-group'
- },
- {
- 'name': 'options',
- 'type': 'ICheckboxGroupOptions[]',
- 'typeAnchorName': 'ICheckboxGroupOptions',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': 'checkbox-group 子项配置列表',
- 'en-US': 'Checkbox component list'
- },
- 'demoId': 'group-options'
- },
- {
- 'name': 'size',
- 'type': "'medium' | 'small' | 'mini'",
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '多选框组尺寸,仅对按钮形式的 checkbox 或带有边框的 checkbox 有效',
- 'en-US':
- 'Size of the check box group. This parameter is valid only for the check box with buttons or borders'
- },
- 'demoId': 'size'
- },
- {
- 'name': 'text-color',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '按钮形式的 checkbox 激活时的文本颜色',
- 'en-US': 'Text color when the checkbox in button mode is activated'
- },
- 'demoId': 'custom-color'
- },
- {
- 'name': 'type',
- 'type': "'button' | 'checkbox'",
- 'defaultValue': "'checkbox'",
- 'desc': {
- 'zh-CN': ' 复选框组子项组件类型,需配合 options 属性使用',
- 'en-US': 'Checkbox component type'
- },
- 'demoId': 'group-options'
- },
- {
- 'name': 'vertical',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '设置组件排列方式,设置复选框是否垂直排列',
- 'en-US': 'Set the component arrangement mode. Sets whether the check boxes are arranged vertically'
- },
- 'demoId': 'vertical-checkbox'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': 'checkbox-group 选项组',
- 'en-US': 'Checkbox Option Group'
- },
- 'demoId': 'checkbox-group'
- }
- ],
- 'events': [
- {
- 'name': 'change',
- 'type': '(value: string[] |number[]) => void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '当绑定值变化时触发的事件',
- 'en-US': 'This event is triggered when the binding value changes.'
- },
- 'demoId': 'checkbox-events'
- }
- ]
- },
- {
- 'name': 'checkbox-button',
- 'type': 'component',
- 'props': [
- {
- 'name': 'checked',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否默认勾选',
- 'en-US': 'Currently selected'
- },
- 'demoId': 'checked'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否禁用',
- 'en-US': 'Is disabled'
- },
- 'demoId': 'indeterminate'
- },
- {
- 'name': 'events',
- 'type': 'ICheckboxGroupOptions.events',
- 'typeAnchorName': 'ICheckboxGroupOptions',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '原生事件',
- 'en-US': 'Native event'
- },
- 'demoId': 'group-options'
- },
- {
- 'name': 'false-label',
- 'type': 'string | number',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '没有选中时的值',
- 'en-US': 'Value when no option is selected'
- },
- 'demoId': 'text'
- },
- {
- 'name': 'label',
- 'type': 'string | number | boolean',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '选中状态的值(只有在 checkbox-group 中或者绑定对象类型为array时有效)',
- 'en-US':
- 'Value in the selected state (This parameter is valid only when checkbox-group or the bound object type is array.) The optional value of this attribute is medium-'
- },
- 'demoId': 'checkbox-group'
- },
- {
- 'name': 'modelValue / v-model',
- 'type': 'string | number | boolean',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '绑定值',
- 'en-US': 'Bound Value'
- },
- 'demoId': 'checkbox-button'
- },
- {
- 'name': 'name',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '原生 name 属性',
- 'en-US': 'Native name attribute'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'text',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '复选框文本',
- 'en-US': 'Text'
- },
- 'demoId': 'description'
- },
- {
- 'name': 'true-label',
- 'type': 'string | number',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '选中时的值',
- 'en-US': 'Value when selected'
- },
- 'demoId': 'text'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': 'checkbox-button 的内容',
- 'en-US': 'Checkbox-button content'
- },
- 'demoId': 'description'
- }
- ]
- }
- ],
- types: [
- {
- name: 'ICheckboxGroupOptions',
- type: 'interface',
- code: `
-interface ICheckboxGroupOptions {
- label: string // 选中时对应的值
- text?: number // 描述文本
- disabled?: boolean // 是否禁用
- checked?: boolean // 是否默认选中
- events?: {
- click?: (e: Event) => void // 点击事件
- change?: (e: Event) => void // change事件
- }
-}`
+ codeFiles: ['checkbox-events.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/collapse/webdoc/collapse.js b/examples/sites/demos/pc/app/collapse/webdoc/collapse.js
index 1de827a92..ebdadd34e 100644
--- a/examples/sites/demos/pc/app/collapse/webdoc/collapse.js
+++ b/examples/sites/demos/pc/app/collapse/webdoc/collapse.js
@@ -3,240 +3,111 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN':
'配置 name
属性作为每个 collapse-item
的唯一标志符,配置 v-model
设置当前激活的面板。默认情况下可以同时展开多个面板,这个例子默认展开了第一和第三个面板。
',
'en-US':
'For details, see the following example.
Configure the name
attribute as the unique identifier for each collapse-item.
'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'accordion',
- 'name': { 'zh-CN': '手风琴效果', 'en-US': 'Accordion Effect' },
- 'desc': {
+ demoId: 'accordion',
+ name: {
+ 'zh-CN': '手风琴效果',
+ 'en-US': 'Accordion Effect'
+ },
+ desc: {
'zh-CN':
'配置 accordion
属性为 true
后,折叠面板将展示手风琴效果,一次只允许展开一个面板。
',
'en-US':
'After accordion
is set to true, the collapsed panel displays the accordion effect.
Configure v-model
to set the currently active panel. (In accordion mode, the binding value type must be string. Otherwise, the binding value type is array.)
'
},
- 'codeFiles': ['accordion.vue']
+ codeFiles: ['accordion.vue']
},
{
- 'demoId': 'disable',
- 'name': { 'zh-CN': '禁用状态', 'en-US': 'Disabled' },
- 'desc': {
+ demoId: 'disable',
+ name: {
+ 'zh-CN': '禁用状态',
+ 'en-US': 'Disabled'
+ },
+ desc: {
'zh-CN':
'在 collapse-item
元素上配置 disabled
属性为 true 后,将禁用指定的折叠面板项。
',
'en-US':
'When the disabled
attribute is set to true on the collapse-item
element, the specified collapse panel item is disabled.
'
},
- 'codeFiles': ['disable.vue']
+ codeFiles: ['disable.vue']
},
{
- 'demoId': 'title',
- 'name': { 'zh-CN': '面板标题', 'en-US': 'Custom Panel Title' },
- 'desc': {
+ demoId: 'title',
+ name: {
+ 'zh-CN': '面板标题',
+ 'en-US': 'Custom Panel Title'
+ },
+ desc: {
'zh-CN':
'在 collapse-item
元素上配置 title
属性可以指定每个折叠面板项的标题。也可以通过 title
插槽的方式自定义面板标题,比如在标题后增加图标。
在 collapse-item
元素上配置 title-right
属性可以指定每个折叠面板项标题的右侧内容。也可以通过 title-right
插槽的方式自定义面板标题右侧内容,比如在标题右侧增加图标。
',
'en-US':
'Configure the title
attribute on the collapse-item
element to specify the title of each collapse panel item. However, you can also customize the panel title by using the title
slot, for example, adding an icon before the title.
Configure the title-right
attribute on the collapse-item
element to specify the right side of each collapse panel item title. However, you can also customize the content on the right of the panel title by using the title-right
slot, for example, adding an icon to the right of the title.
'
},
- 'codeFiles': ['title.vue']
+ codeFiles: ['title.vue']
},
{
- 'demoId': 'icon',
- 'name': { 'zh-CN': '展开/折叠图标', 'en-US': 'Customize the expansion and collapse icon' },
- 'desc': {
+ demoId: 'icon',
+ name: {
+ 'zh-CN': '展开/折叠图标',
+ 'en-US': 'Customize the expansion and collapse icon'
+ },
+ desc: {
'zh-CN':
'在 collapse-item
元素上可以通过 icon
插槽的方式自定义展开折叠 icon 图标。
',
'en-US':
'On the collapse-item
element, you can customize the folding icon icon by using the icon
slot.
'
},
- 'codeFiles': ['icon.vue']
+ codeFiles: ['icon.vue']
},
{
- 'demoId': 'before-close',
- 'name': { 'zh-CN': '阻止切换', 'en-US': 'Prevent the event of closing the folding panel' },
- 'desc': {
+ demoId: 'before-close',
+ name: {
+ 'zh-CN': '阻止切换',
+ 'en-US': 'Prevent the event of closing the folding panel'
+ },
+ desc: {
'zh-CN': '设置 before-close 属性,如果返回 false,将阻止面板的切换。
',
'en-US':
':before-close event before closing the folding panel. In the method, return true/false indicates whether the folding panel can be closed.
'
},
- 'codeFiles': ['before-close.vue']
+ codeFiles: ['before-close.vue']
},
{
- 'demoId': 'nested-content',
- 'name': { 'zh-CN': '嵌套内容', 'en-US': 'Nested Content' },
- 'desc': {
+ demoId: 'nested-content',
+ name: {
+ 'zh-CN': '嵌套内容',
+ 'en-US': 'Nested Content'
+ },
+ desc: {
'zh-CN': '通过 collapse-item
元素的默认插槽嵌入表单、表格等内容。
',
'en-US': 'Embed the form through the default slot of the collapse-item
element.
'
},
- 'codeFiles': ['nested-content.vue']
+ codeFiles: ['nested-content.vue']
},
{
- 'demoId': 'events',
- 'name': { 'zh-CN': '事件', 'en-US': 'Fold panel change event' },
- 'desc': {
+ demoId: 'events',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': 'Fold panel change event'
+ },
+ desc: {
'zh-CN': '激活面板的值改变时将触发 change
事件。
',
'en-US': 'When the value of the active panel changes, the change
event is triggered.
'
},
- 'codeFiles': ['events.vue']
- }
- ],
- apis: [
- {
- 'name': 'collapse',
- 'type': 'component',
- 'props': [
- {
- 'name': 'accordion',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否手风琴模式',
- 'en-US': 'In accordion mode'
- },
- 'demoId': 'accordion'
- },
- {
- 'name': 'before-close',
- 'type': '(item: Component, activeNames: string | number | Array) => boolean',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '阻止折叠面板切换',
- 'en-US': 'Do not close the folding panel.'
- },
- 'demoId': 'before-close'
- },
- {
- 'name': 'modelValue / v-model',
- 'type': 'string | number | Array',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '当前激活的面板。如果是手风琴模式,绑定值类型需要为 string | number,否则为 Array',
- 'en-US':
- 'Currently activated panel (In accordion mode, the binding value type must be string. Otherwise, the binding value type is array.)'
- },
- 'demoId': 'basic-usage'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '默认插槽',
- 'en-US': 'Default slot'
- },
- 'demoId': 'disable'
- }
- ],
- 'events': [
- {
- 'name': 'change',
- 'type': '(activeNames: string | number | Array) => void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '当前激活面板改变时触发。如果是手风琴模式,参数 activeNames 类型为 string | number,否则为 Array',
- 'en-US':
- 'Triggered when the current active panel changes. (In accordion mode, the type of activeNames is string. Otherwise, the type of activeNames is array.)'
- },
- 'demoId': 'events'
- }
- ]
- },
- {
- 'name': 'collapse-item',
- 'type': 'component',
- 'props': [
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否禁用',
- 'en-US': 'Disable'
- },
- 'demoId': 'disable'
- },
- {
- 'name': 'name',
- 'type': 'string | number',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '唯一标志符',
- 'en-US': 'Unique identifier'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'title',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '面板标题',
- 'en-US': 'Panel Title'
- },
- 'demoId': 'title'
- },
-
- {
- 'name': 'title-right',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '自定义面板标题右侧内容',
- 'en-US': ''
- },
- 'demoId': 'title'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '默认插槽',
- 'en-US': 'Default slot'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'icon',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '展开折叠 icon 图标',
- 'en-US': 'Expand and collapse the icon.'
- },
- 'demoId': 'icon'
- },
- {
- 'name': 'title',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '标题',
- 'en-US': 'Title'
- },
- 'demoId': 'title'
- },
- {
- 'name': 'title-right',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义面板标题右侧内容',
- 'en-US': ''
- },
- 'demoId': 'title'
- }
- ]
+ codeFiles: ['events.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/color-picker/history.vue b/examples/sites/demos/pc/app/color-picker/history.vue
index d5a1dad58..769bc0a38 100644
--- a/examples/sites/demos/pc/app/color-picker/history.vue
+++ b/examples/sites/demos/pc/app/color-picker/history.vue
@@ -1,37 +1,41 @@
-
-
+ Append history color
+ Pop history color
\ No newline at end of file
+
diff --git a/examples/sites/demos/pc/app/color-picker/predefine.vue b/examples/sites/demos/pc/app/color-picker/predefine.vue
index 8e3fbdf68..e136a65b6 100644
--- a/examples/sites/demos/pc/app/color-picker/predefine.vue
+++ b/examples/sites/demos/pc/app/color-picker/predefine.vue
@@ -1,37 +1,40 @@
-
-
+ Append predefine color
+ Pop predefine color
\ No newline at end of file
+
diff --git a/examples/sites/demos/pc/app/color-picker/webdoc/color-picker.js b/examples/sites/demos/pc/app/color-picker/webdoc/color-picker.js
index 6f3f01e71..e6e68ec65 100644
--- a/examples/sites/demos/pc/app/color-picker/webdoc/color-picker.js
+++ b/examples/sites/demos/pc/app/color-picker/webdoc/color-picker.js
@@ -3,166 +3,108 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '通过引用组件标签,v-model
绑定数据即可。',
'en-US': 'By referencing component tags,v model
bind data.'
},
- 'codeFiles': ['base.vue']
+ codeFiles: ['base.vue']
},
{
- 'demoId': 'size',
- 'name': { 'zh-CN': '尺寸设置', 'en-US': 'Size Setting' },
- 'desc': {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '尺寸设置',
+ 'en-US': 'Size Setting'
+ },
+ desc: {
'zh-CN':
'通过size
属性设置large
medium
small
mini
四种不同大小尺寸。不设置时为默认尺寸。',
'en-US':
'Set the size attribute to four different sizes: large
, medium
, small
, and mini
. Default size when not set'
},
- 'codeFiles': ['size.vue']
+ codeFiles: ['size.vue']
},
{
- 'demoId': 'event',
- 'name': { 'zh-CN': '事件触发', 'en-US': 'eventing' },
- 'desc': {
+ demoId: 'event',
+ name: {
+ 'zh-CN': '事件触发',
+ 'en-US': 'eventing'
+ },
+ desc: {
'zh-CN': '通过点击确认时触发confirm
事件, 取消时触发cancel
事件。',
'en-US':
'When click confirm will trigger confirm
event. When click outside or cancel will trigger cancel
event.'
},
- 'codeFiles': ['event.vue']
+ codeFiles: ['event.vue']
},
{
- 'demoId': 'enable-alpha',
- 'name': { 'zh-CN': 'Alpha', 'en-US': 'Alpha' },
- 'desc': { 'zh-CN': 'Alpha
选择。', 'en-US': 'Alpha
select.' },
- 'codeFiles': ['alpha.vue']
+ demoId: 'enable-alpha',
+ name: {
+ 'zh-CN': 'Alpha',
+ 'en-US': 'Alpha'
+ },
+ desc: {
+ 'zh-CN': 'Alpha
选择。',
+ 'en-US': 'Alpha
select.'
+ },
+ codeFiles: ['alpha.vue']
},
{
- 'demoId': 'history',
- 'name': { 'zh-CN': '历史记录', 'en-US': 'history' },
- 'desc': {
+ demoId: 'history',
+ name: {
+ 'zh-CN': '历史记录',
+ 'en-US': 'history'
+ },
+ desc: {
'zh-CN':
'当history
不为undefined
时, 将会启用历史记录功能。当用户点击确认时, 将会自动将颜色插入到history
. 用户行为会更改历史记录, 外部可以更改历史记录。',
'en-US':
'When history
is not undefined
, the history function will be enabled. When the user clicks confirm, the color will automatically be inserted into the history
User behavior can change history, and external users can also change history.'
},
- 'codeFiles': ['history.vue']
+ codeFiles: ['history.vue']
},
{
- 'demoId': 'predefine',
- 'name': {
+ demoId: 'predefine',
+ name: {
'zh-CN': '预定义颜色',
'en-US': 'Predefine color'
},
- 'desc': {
+ desc: {
'zh-CN': '通过predefine
预定义颜色值,用户行为不会更改预定义颜色, 但外部可以更改。',
'en-US':
'Bypredefine
predefined color values, user behavior does not change the predefined colors, but they can be changed externally.'
},
- 'codeFiles': ['predefine.vue']
+ codeFiles: ['predefine.vue']
},
{
- 'demoId': 'default-visible',
- 'name': { 'zh-CN': '默认显示', 'en-US': 'default-visible' },
- 'desc': {
+ demoId: 'default-visible',
+ name: {
+ 'zh-CN': '默认显示',
+ 'en-US': 'default-visible'
+ },
+ desc: {
'zh-CN':
'当visible
为true
时, 将会默认显示color-select
。 visible
是响应式的, 所以你可以强制控制color-select
的状态。当visible
切换的时候, 会触发cancel
事件。',
'en-US':
'If visible
is true the color-select
will show. The visible prop is reactive so you can force change color-select
show or not. When change visible
will trigger cancel
event.'
},
- 'codeFiles': ['default-visible.vue']
+ codeFiles: ['default-visible.vue']
},
{
- 'demoId': 'dynamic-color-change',
- 'name': { 'zh-CN': '颜色动态切换', 'en-US': 'dynamic-color-change' },
- 'desc': {
+ demoId: 'dynamic-color-change',
+ name: {
+ 'zh-CN': '颜色动态切换',
+ 'en-US': 'dynamic-color-change'
+ },
+ desc: {
'zh-CN': '通过动态切换color
属性, 以满足各种需求。',
'en-US': 'Can dynamically switch color
attributes to meet various needs.'
},
- 'codeFiles': ['dynamic-color-change.vue']
- }
- ],
- apis: [
- {
- 'name': 'color-picker',
- 'type': 'component',
- 'props': [
- {
- name: 'visible',
- type: 'boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否默认显示color-select',
- 'en-US': 'Is color select displayed by default'
- },
- demoId: 'default-visible'
- },
- {
- name: 'size',
- type: 'string',
- defaultValue: '',
- desc: {
- 'zh-CN': '定义color-picker尺寸;该属性的可选值为 large / medium / small / mini',
- 'en-US':
- 'Define color-picker dimensions; The optional values for this attribute are large/medium/small/mini'
- },
- demoId: 'size'
- },
- {
- name: 'alpha',
- type: 'boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否启用alpha选择',
- 'en-US': 'enable alpha select or not'
- },
- demoId: 'enable-alpha'
- },
- {
- name: 'history',
- type: 'string[] | undefined',
- defaultValue: 'undefined',
- desc: {
- 'zh-CN': '启用历史记录',
- 'en-US': 'enable history or not'
- },
- demoId: 'history'
- },
- {
- name: 'predefine',
- type: 'string[] | undefined',
- defaultValue: 'undefined',
- desc: {
- 'zh-CN': '启用预定义颜色',
- 'en-US': 'enable predefine or not'
- },
- demoId: 'predefine'
- }
- ],
- 'events': [
- {
- name: 'confirm',
- type: '(hex:string) => void',
- defaultValue: '',
- desc: {
- 'zh-CN': '按下确认时触发该事件',
- 'en-US': 'When click confirm will trigger confirm event'
- },
- demoId: 'event'
- },
- {
- name: 'cancel',
- type: '()=>void',
- defaultValue: '',
- desc: {
- 'zh-CN': '按下取消或点击外部的时触发该事件',
- 'en-US': 'When click cancel or click out-side will trigger cancel event'
- },
- demoId: 'event'
- }
- ],
- 'slots': []
+ codeFiles: ['dynamic-color-change.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/color-select-panel/alpha-composition-api.vue b/examples/sites/demos/pc/app/color-select-panel/alpha-composition-api.vue
index aab64e54a..79c891c97 100644
--- a/examples/sites/demos/pc/app/color-select-panel/alpha-composition-api.vue
+++ b/examples/sites/demos/pc/app/color-select-panel/alpha-composition-api.vue
@@ -8,10 +8,11 @@
\ No newline at end of file
+import { ref } from 'vue'
+import { ColorSelectPanel as TinyColorSelectPanel, Button } from '@opentiny/vue'
+
+const color = ref('#66ccff')
+const visible = ref(false)
+const changeVisible = () => (visible.value = !visible.value)
+const hidden = () => (visible.value = false)
+
diff --git a/examples/sites/demos/pc/app/color-select-panel/alpha.vue b/examples/sites/demos/pc/app/color-select-panel/alpha.vue
index aa7d5d1f8..5bd38908a 100644
--- a/examples/sites/demos/pc/app/color-select-panel/alpha.vue
+++ b/examples/sites/demos/pc/app/color-select-panel/alpha.vue
@@ -1,6 +1,6 @@
-
+ Show Color select panel
@@ -8,24 +8,26 @@
\ No newline at end of file
+
diff --git a/examples/sites/demos/pc/app/color-select-panel/base-composition-api.vue b/examples/sites/demos/pc/app/color-select-panel/base-composition-api.vue
index 082a476a0..92db2a9cc 100644
--- a/examples/sites/demos/pc/app/color-select-panel/base-composition-api.vue
+++ b/examples/sites/demos/pc/app/color-select-panel/base-composition-api.vue
@@ -8,10 +8,11 @@
\ No newline at end of file
+import { ref } from 'vue'
+import { ColorSelectPanel as TinyColorSelectPanel, Button } from '@opentiny/vue'
+
+const color = ref('#66ccff')
+const visible = ref(false)
+const changeVisible = () => (visible.value = !visible.value)
+const hidden = () => (visible.value = false)
+
diff --git a/examples/sites/demos/pc/app/color-select-panel/base.vue b/examples/sites/demos/pc/app/color-select-panel/base.vue
index 7487fcc00..321be6502 100644
--- a/examples/sites/demos/pc/app/color-select-panel/base.vue
+++ b/examples/sites/demos/pc/app/color-select-panel/base.vue
@@ -1,6 +1,6 @@
-
+ Show Color select panel
@@ -8,24 +8,26 @@
\ No newline at end of file
+
diff --git a/examples/sites/demos/pc/app/color-select-panel/event-composition-api.vue b/examples/sites/demos/pc/app/color-select-panel/event-composition-api.vue
index 1dad62881..78393d74d 100644
--- a/examples/sites/demos/pc/app/color-select-panel/event-composition-api.vue
+++ b/examples/sites/demos/pc/app/color-select-panel/event-composition-api.vue
@@ -8,27 +8,28 @@
\ No newline at end of file
+
diff --git a/examples/sites/demos/pc/app/color-select-panel/event.vue b/examples/sites/demos/pc/app/color-select-panel/event.vue
index e94d93a06..f23cb2546 100644
--- a/examples/sites/demos/pc/app/color-select-panel/event.vue
+++ b/examples/sites/demos/pc/app/color-select-panel/event.vue
@@ -1,6 +1,6 @@
-
+ Show Color select panel
@@ -8,43 +8,43 @@
\ No newline at end of file
+
diff --git a/examples/sites/demos/pc/app/color-select-panel/history-composition-api.vue b/examples/sites/demos/pc/app/color-select-panel/history-composition-api.vue
index d04d7bfa8..821a91f56 100644
--- a/examples/sites/demos/pc/app/color-select-panel/history-composition-api.vue
+++ b/examples/sites/demos/pc/app/color-select-panel/history-composition-api.vue
@@ -1,52 +1,49 @@
-
-
-
+ Show Color select panel
+ Append history color
+ Pop history color
-
+
\ No newline at end of file
+
diff --git a/examples/sites/demos/pc/app/color-select-panel/history.vue b/examples/sites/demos/pc/app/color-select-panel/history.vue
index 20fe166f8..ad6d3ffa5 100644
--- a/examples/sites/demos/pc/app/color-select-panel/history.vue
+++ b/examples/sites/demos/pc/app/color-select-panel/history.vue
@@ -1,8 +1,8 @@
-
-
-
+ Show Color select panel
+ Append history color
+ Pop history color
+ />
\ No newline at end of file
+
diff --git a/examples/sites/demos/pc/app/color-select-panel/predefine-composition-api.vue b/examples/sites/demos/pc/app/color-select-panel/predefine-composition-api.vue
index 08c5e2558..3639d0fe8 100644
--- a/examples/sites/demos/pc/app/color-select-panel/predefine-composition-api.vue
+++ b/examples/sites/demos/pc/app/color-select-panel/predefine-composition-api.vue
@@ -1,8 +1,8 @@
-
-
-
+ Show Color select panel
+ Append predefine color
+ Pop predefine color
+ />
\ No newline at end of file
+
diff --git a/examples/sites/demos/pc/app/color-select-panel/predefine.vue b/examples/sites/demos/pc/app/color-select-panel/predefine.vue
index 02699e6f3..45cc4d495 100644
--- a/examples/sites/demos/pc/app/color-select-panel/predefine.vue
+++ b/examples/sites/demos/pc/app/color-select-panel/predefine.vue
@@ -1,8 +1,8 @@
-
-
-
+ Show Color select panel
+ Append predefine color
+ Pop predefine color
+ />
\ No newline at end of file
+
diff --git a/examples/sites/demos/pc/app/color-select-panel/webdoc/color-select-panel.js b/examples/sites/demos/pc/app/color-select-panel/webdoc/color-select-panel.js
index 63b66d3a2..477ba1ed1 100644
--- a/examples/sites/demos/pc/app/color-select-panel/webdoc/color-select-panel.js
+++ b/examples/sites/demos/pc/app/color-select-panel/webdoc/color-select-panel.js
@@ -3,135 +3,68 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '通过visible
设置显示色彩选择面板。',
'en-US': 'Set the display color selection panel throughvisible
.'
},
- 'codeFiles': ['base.vue']
+ codeFiles: ['base.vue']
},
{
- 'demoId': 'alpha',
- 'name': { 'zh-CN': '透明度', 'en-US': 'Alpha' },
- 'desc': {
+ demoId: 'alpha',
+ name: {
+ 'zh-CN': '透明度',
+ 'en-US': 'Alpha'
+ },
+ desc: {
'zh-CN': '通过alpha
设置透明度选择。',
'en-US': 'Set transparency selection throughalpha
.'
},
- 'codeFiles': ['alpha.vue']
+ codeFiles: ['alpha.vue']
},
{
- 'demoId': 'event',
- 'name': { 'zh-CN': '事件触发', 'en-US': 'event' },
- 'desc': {
+ demoId: 'event',
+ name: {
+ 'zh-CN': '事件触发',
+ 'en-US': 'event'
+ },
+ desc: {
'zh-CN': '通过点击确认时触发confirm
事件, 取消时触发cancel
事件。',
'en-US':
'When click confirm will trigger confirm event. When click outside or cancel will trigger cancel event.'
},
- 'codeFiles': ['event.vue']
+ codeFiles: ['event.vue']
},
{
- 'demoId': 'history',
- 'name': { 'zh-CN': '历史记录', 'en-US': 'history' },
- 'desc': {
+ demoId: 'history',
+ name: {
+ 'zh-CN': '历史记录',
+ 'en-US': 'history'
+ },
+ desc: {
'zh-CN':
'当history
不为undefined
时, 将会启用历史记录功能。当用户点击确认时, 将会自动将颜色插入到history
用户行为会更改历史记录, 外部可以更改历史记录。',
'en-US':
'When history
is not undefined
, the history function will be enabled. When the user clicks confirm, the color will automatically be inserted into the history
User behavior can change history, and external users can also change history.'
},
- 'codeFiles': ['history.vue']
+ codeFiles: ['history.vue']
},
{
- 'demoId': 'predefine',
- 'name': {
+ demoId: 'predefine',
+ name: {
'zh-CN': '预定义颜色',
'en-US': 'predefine color'
},
- 'desc': {
+ desc: {
'zh-CN': '通过predefine
预定义颜色值,用户行为不会更改预定义颜色, 但外部可以更改。',
'en-US':
'Bypredefine
predefined color values, user behavior does not change the predefined colors, but they can be changed externally.'
},
- 'codeFiles': ['predefine.vue']
- }
- ],
- apis: [
- {
- 'name': 'color select panel',
- 'type': 'component',
- 'props': [
- {
- name: 'visible',
- type: 'boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否默认显示color select panel',
- 'en-US': 'Is color select panel displayed by default'
- }
- },
- {
- name: 'alpha',
- type: 'boolean',
- defaultValue: 'false',
- desc: {
- 'zh-CN': '是否启用alpha选择',
- 'en-US': 'enable alpha select or not'
- },
- demoId: 'alpha'
- },
- {
- name: 'history',
- type: 'string[] | undefined',
- defaultValue: 'undefined',
- desc: {
- 'zh-CN': '时候启用历史记录',
- 'en-US': 'enable history or not'
- },
- demoId: 'history'
- },
- {
- name: 'predefine',
- type: 'string[] | undefined',
- defaultValue: 'undefined',
- desc: {
- 'zh-CN': '时候启用历史记录',
- 'en-US': 'enable predefine or not'
- },
- demoId: 'predefine'
- }
- ],
- 'events': [
- {
- name: 'confirm',
- type: '(hex:string) => void',
- defaultValue: '',
- desc: {
- 'zh-CN': '按下确认时触发该事件',
- 'en-US': 'When click confirm will trigger confirm event'
- },
- demoId: 'event'
- },
- {
- name: 'cancel',
- type: '()=>void',
- defaultValue: '',
- desc: {
- 'zh-CN': '按下取消或点击外部的时触发该事件',
- 'en-US': 'When click cancel or click out-side will trigger cancel event'
- },
- demoId: 'event'
- },
- {
- name: 'color-update',
- type: '(color:Color) => void',
- defaultValue: '',
- desc: {
- 'zh-cn': '当颜色更新的时候会触发该事件,包括:点击预定义颜色、点击历史记录',
- 'en-US': 'when click predefine color or history, will trigger color-update event'
- }
- }
- ],
- 'slots': []
+ codeFiles: ['predefine.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/color/webdoc/color.js b/examples/sites/demos/pc/app/color/webdoc/color.js
index 8aad0b549..330e918c9 100644
--- a/examples/sites/demos/pc/app/color/webdoc/color.js
+++ b/examples/sites/demos/pc/app/color/webdoc/color.js
@@ -3,23 +3,40 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'main-color',
- 'name': { 'zh-CN': '主色彩', 'en-US': 'Main Color' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['main-color.vue']
+ demoId: 'main-color',
+ name: {
+ 'zh-CN': '主色彩',
+ 'en-US': 'Main Color'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['main-color.vue']
},
{
- 'demoId': 'auxiliary-color',
- 'name': { 'zh-CN': '辅助色', 'en-US': 'Auxiliary Color' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['auxiliary-color.vue']
+ demoId: 'auxiliary-color',
+ name: {
+ 'zh-CN': '辅助色',
+ 'en-US': 'Auxiliary Color'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['auxiliary-color.vue']
},
{
- 'demoId': 'neutral-color',
- 'name': { 'zh-CN': '中性色', 'en-US': 'Neutral Color' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['neutral-color.vue']
+ demoId: 'neutral-color',
+ name: {
+ 'zh-CN': '中性色',
+ 'en-US': 'Neutral Color'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['neutral-color.vue']
}
- ],
- apis: [{ 'name': 'color', 'type': 'component', 'props': [], 'events': [], 'slots': [] }]
+ ]
}
diff --git a/examples/sites/demos/pc/app/company/webdoc/company.js b/examples/sites/demos/pc/app/company/webdoc/company.js
index 7400b00cc..c8fd97072 100644
--- a/examples/sites/demos/pc/app/company/webdoc/company.js
+++ b/examples/sites/demos/pc/app/company/webdoc/company.js
@@ -3,119 +3,43 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['basic-usage.vue']
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'custom-show-num',
- 'name': { 'zh-CN': '自定义数据显示数量', 'en-US': 'User-defined number of data to be displayed' },
- 'desc': {
+ demoId: 'custom-show-num',
+ name: {
+ 'zh-CN': '自定义数据显示数量',
+ 'en-US': 'User-defined number of data to be displayed'
+ },
+ desc: {
'zh-CN':
'可通过 max
属性设置下拉框最大显示的数据条数。clearable
是否显示清除按钮,默认为 true 。
\n',
'en-US':
'You can set the maximum number of records displayed in the drop-down list box through the max
attribute. clearable
Indicates whether to display the Clear button. The default value is true.
\n'
},
- 'codeFiles': ['custom-show-num.vue']
+ codeFiles: ['custom-show-num.vue']
},
{
- 'demoId': 'custom-service',
- 'name': { 'zh-CN': '自定义服务', 'en-US': 'Custom Service' },
- 'desc': {
+ demoId: 'custom-service',
+ name: {
+ 'zh-CN': '自定义服务',
+ 'en-US': 'Custom Service'
+ },
+ desc: {
'zh-CN': '通过 fetch-company
属性可以指定一个方法,在方法中可实现请求自定义的服务。
\n',
'en-US':
'You can use the fetch-company
attribute to specify a method in which the service customized by the request can be implemented.
\n'
},
- 'codeFiles': ['custom-service.vue']
- }
- ],
- apis: [
- {
- 'name': 'company',
- 'type': 'component',
- 'props': [
- {
- 'name': 'modelValue / v-model',
- 'type': 'string , number',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置下拉框的值。', 'en-US': 'Set the value of the drop-down list box.' },
- 'demoId': 'custom-show-num'
- },
- {
- 'name': 'placeholder',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置输入框内的提示占位文本。', 'en-US': 'Set the placeholder text in the text box.' },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'popper-class',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '为 popper 添加类名(可参考 popover 组件)',
- 'en-US': 'Add a class name for the popper. For details, see the popover component.'
- },
- 'demoId': ''
- },
- {
- 'name': 'popper-append-to-body',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 true',
- 'desc': {
- 'zh-CN':
- '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)',
- 'en-US':
- 'Indicates whether to insert the pop-up box to the body element. If a fault occurs in locating the fault in the dialog box that is displayed, you can set this attribute to false (for details, see the select component).'
- },
- 'demoId': ''
- },
- {
- 'name': 'max',
- 'type': 'number',
- 'defaultValue': '该属性的默认值为 1000',
- 'desc': { 'zh-CN': '原生属性,设置最大值', 'en-US': 'Native attribute. Set the maximum value.' },
- 'demoId': 'custom-show-num'
- },
- {
- 'name': 'fetchCompany',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义公司查询接口,fetchCompany返回一个Promise对象',
- 'en-US': 'The fetchCompany interface returns a Promise object.'
- },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'fields',
- 'type': 'object',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义公司数据映射,未使用框架服务时必填',
- 'en-US':
- 'Customized company data mapping. This parameter is mandatory when the framework service is not used.'
- },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'clearable',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 true',
- 'desc': { 'zh-CN': '是否显示清除按钮;是否可清空', 'en-US': 'Whether to display the Clear button; Clearable' },
- 'demoId': 'custom-show-num'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 false',
- 'desc': { 'zh-CN': '禁用', 'en-US': 'Disabled' },
- 'demoId': ''
- }
- ],
- 'events': [],
- 'slots': []
+ codeFiles: ['custom-service.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/components.js b/examples/sites/demos/pc/app/components.js
deleted file mode 100644
index 4402a088c..000000000
--- a/examples/sites/demos/pc/app/components.js
+++ /dev/null
@@ -1,955 +0,0 @@
-export default {
- alert: {
- Attributes: {
- closable: 'closable',
- description: 'description',
- type: 'type',
- icon: 'icon',
- size: 'size',
- title: 'title',
- center: 'center',
- 'show-icon': 'show-icon',
- 'close-text': 'close-text'
- },
- Events: {
- close: 'close'
- },
- Slots: {
- default: 'slot-default',
- title: 'slot-title'
- }
- },
-
- badge: {
- Attributes: {
- value: 'value',
- max: 'max',
- 'is-dot': 'is-dot',
- hidden: 'hidden',
- href: 'href',
- target: 'target',
- type: 'type'
- },
- Slots: {
- default: 'slot-default',
- content: 'slot-content'
- }
- },
-
- breadcrumb: {
- Attributes: {
- separator: 'separator',
- 'separator-class': 'separator',
- replace: 'replace',
- to: 'to'
- },
- Slots: {
- default: 'slot-default'
- }
- },
-
- 'bulletin-board': {
- Attributes: {
- data: 'data',
- 'more-link': 'more-link',
- 'active-name': 'active-name',
- icon: 'icon',
- 'show-more': 'show-more',
- 'tab-title': 'tab-title',
- title: 'title'
- }
- },
-
- button: {
- Attributes: {
- 'native-type': 'native-type',
- type: 'type',
- size: 'size',
- autofocus: 'autofocus',
- circle: 'circle',
- disabled: 'disabled',
- icon: 'icon',
- loading: 'loading',
- plain: 'plain',
- 'reset-time': 'reset-time',
- round: 'round'
- },
- Events: {
- click: 'click'
- },
- Slots: {
- default: 'slot-default'
- }
- },
-
- 'button-group': {
- Attributes: {
- data: 'data',
- disabled: 'disabled',
- plain: 'plain',
- 'text-field': 'text-field',
- value: 'value',
- 'value-field': 'value-field'
- },
- Slots: {
- default: 'slot-default'
- }
- },
-
- input: {
- Attributes: {
- 'suffix-icon': 'suffix-icon',
- maxlength: 'maxlength',
- 'prefix-icon': 'prefix-icon',
- readonly: 'readonly',
- clearable: 'clearable',
- type: 'type',
- 'value / v-model': 'value',
- autocomplete: 'autocomplete',
- counter: 'counter',
- autofocus: 'autofocus',
- autosize: 'autosize',
- disabled: 'disabled',
- form: 'form',
- label: 'label',
- max: 'max',
- min: 'min',
- minlength: 'minlength',
- name: 'name',
- placeholder: 'placeholder',
- resize: 'resize',
- rows: 'rows',
- 'show-password': 'show-password',
- 'show-word-limit': 'show-word-limit',
- size: 'size',
- step: 'step',
- tabindex: 'tabindex',
- 'validate-event': 'validate-event'
- },
- Events: {
- blur: 'event-blur',
- change: 'event-change',
- clear: 'event-clear',
- focus: 'event-focus',
- input: 'event-input'
- },
- Methods: {
- addMemory: 'method-addMemory',
- blur: 'method-blur',
- focus: 'method-focus',
- select: 'method-select'
- },
- Slots: {
- append: 'slot-append',
- prefix: 'slot-prefix',
- prepend: 'slot-prepend',
- suffix: 'slot-suffix'
- }
- },
-
- select: {
- Attributes: {
- multiple: 'multiple',
- clearable: 'clearable',
- 'value / v-model': 'value',
- autocomplete: 'autocomplete',
- 'allow-create': 'allow-create',
- 'automatic-dropdown': 'automatic-dropdown',
- 'collapse-tags': 'collapse-tags',
- 'default-first-option': 'default-first-option',
- disabled: 'disabled',
- 'filter-method': 'filter-method',
- filterable: 'filterable',
- loading: 'loading',
- 'loading-text': 'loading-text',
- 'multiple-limit': 'multiple-limit',
- name: 'name',
- 'no-data-text': 'no-data-text',
- 'no-match-text': 'no-match-text',
- placeholder: 'placeholder',
- 'popper-append-to-body': 'popper-append-to-body',
- 'popper-class': 'popper-class',
- remote: 'remote',
- 'remote-method': 'remote-method',
- 'reserve-keyword': 'reserve-keyword',
- size: 'size',
- 'value-key': 'value-key'
- },
- Methods: {
- blur: 'method-blur',
- focus: 'method-focus'
- },
- Events: {
- change: 'event-change',
- clear: 'event-clear',
- blur: 'event-blur',
- focus: 'event-focus',
- 'remove-tag': 'event-remove-tag',
- 'visible-change': 'event-visible-change'
- },
- Slots: {
- default: 'slot-default',
- empty: 'slot-empty',
- prefix: 'slot-prefix',
- footer: 'slot-footer'
- }
- },
-
- option: {
- Attributes: {
- disabled: 'disabled',
- label: 'label',
- value: 'value'
- }
- },
-
- 'option-group': {
- Attributes: {
- disabled: 'disabled',
- label: 'label'
- }
- },
-
- 'scroll-text': {
- Attributes: {
- direction: 'direction',
- 'hover-stop': 'text',
- text: 'text',
- time: 'text'
- },
- Events: {},
- Methods: {},
- Slots: {
- default: 'slots'
- }
- },
- container: {
- Attributes: {
- 'aside-width': 'base',
- 'footer-height': 'base',
- 'header-height': 'base',
- pattern: 'pattern'
- },
- Events: {},
- Methods: {},
- Slots: {}
- },
- switch: {
- Attributes: {
- disabled: 'disabled',
- mini: 'disabled',
- 'value / v-model': 'truevlue',
- trueValue: 'truevlue',
- falseValue: 'truevlue'
- },
- Events: {},
- Methods: {},
- Slots: {}
- },
- tag: {
- Attributes: {
- border: 'hit',
- hit: 'hit',
- color: 'color3',
- type: 'type',
- closable: 'closable',
- createable: 'closable',
- effect: 'effect',
- disabled: 'disabled',
- mode: 'border',
- readonly: 'disabled',
- selectable: 'border',
- size: 'tag-size',
- value: 'base'
- },
- Events: {
- click: 'tag-event-click',
- close: 'tag-event-close'
- },
- Methods: {},
- Slots: {
- new: 'slotNew',
- text: 'slotText'
- }
- },
- tabs: {
- Attributes: {
- activeName: 'basic-usage',
- tabStyle: 'tab-style-card',
- withAdd: 'with-add',
- withClose: 'with-close',
- position: 'position-bottom',
- 'before-leave': 'before-leave',
- stretch: 'stretch-wh',
- size: 'tabs-size',
- value: 'basic-value'
- },
- Events: {
- add: 'tabs-events-add',
- click: 'tabs-events-click',
- close: 'tabs-events-close',
- edit: 'tabs-events-edit'
- },
- Methods: {},
- Slots: {
- title: 'custom-tab-title'
- }
- },
- 'text-popup': {
- Attributes: {
- label: 'label',
- placeholder: 'placeholder',
- readonly: 'readonly',
- value: 'value',
- width: 'width',
- separtor: 'separtor'
- },
- Events: {},
- Methods: {},
- Slots: {}
- },
- search: {
- Attributes: {
- 'default-value': 'default-value',
- mini: 'mini-mode',
- placeholder: 'basic-usage',
- 'search-types': 'search-types',
- transparent: 'transparent-mode'
- },
- Events: {
- change: 'search-events',
- search: 'search-events'
- },
- Methods: {},
- Slots: {
- poplist: 'custom-search-types',
- text: 'show-selected-types'
- }
- },
- slider: {
- Attributes: {
- value: 'basic-usage',
- mini: 'disabled',
- 'value / v-model': 'truevlue',
- trueValue: 'truevlue',
- falseValue: 'truevlue'
- },
- Events: {},
- Methods: {},
- Slots: {}
- },
- split: {
- Attributes: {
- 'left-top-min': 'base',
- mode: 'base',
- 'right-bottom-min': 'base',
- value: 'base',
- transparent: 'base'
- },
- Events: {
- moveend: 'events',
- movestart: 'events',
- moving: 'events'
- },
- Methods: {},
- Slots: {
- bottom: 'slots',
- left: 'slots',
- right: 'slots',
- top: 'slots',
- trigger: 'slots'
- }
- },
- 'card-template': {
- Attributes: {
- 'body-style': 'base',
- 'header-line': 'base'
- },
- Events: {},
- Methods: {},
- Slots: {
- default: 'slots',
- footer: 'slots',
- header: 'slots'
- }
- },
- col: {
- Attributes: {
- span: 'base',
- move: 'move',
- offset: 'move',
- xs: 'responsive',
- sm: 'responsive',
- xl: 'responsive',
- md: 'responsive',
- lg: 'responsive',
- no: 'move',
- tag: 'tag'
- },
- Events: {},
- Methods: {},
- Slots: {}
- },
- loading: {
- Attributes: {
- text: 'base',
- background: 'background',
- body: 'body',
- customClass: 'custom-class',
- lock: 'lock',
- spinner: 'spinner',
- transparent: 'opacity',
- fullscreen: 'fullscreen',
- target: 'target'
- },
- Events: {},
- Methods: {},
- Slots: {}
- },
- progress: {
- Attributes: {
- color: 'custom-color',
- percentage: 'basic-usage',
- 'show-text': 'format-text',
- status: 'progress-status',
- 'stroke-width': 'progress-width',
- 'text-inside': 'text-inside-or-no-text',
- type: 'progress-type'
- }
- },
- numeric: {
- Attributes: {
- controls: 'controls',
- disabled: 'dynamic-disabled',
- max: 'max-min',
- min: 'max-min',
- mouseWheel: 'mouse-wheel',
- precision: 'precision',
- step: 'about-step'
- }
- },
- milestone: {
- Attributes: {
- data: 'data-source',
- 'completed-field': 'completed-field',
- 'flag-before': 'flag-before',
- 'flag-content-field': 'flag-content-field',
- 'flag-field': 'flag-field',
- 'flag-name-field': 'flag-name-field',
- 'flag-status-field': 'flag-status-field',
- 'line-style': 'line-style',
- 'milestones-status': 'base',
- 'show-number': 'show-number',
- solid: 'solid',
- space: 'space',
- start: 'space',
- 'status-field': 'status-field',
- 'time-field': 'time-field'
- },
- Events: {
- click: 'click',
- flagclick: 'click',
- 'flag-click': 'click'
- },
- Methods: {},
- Slots: {
- bottom: 'bottom',
- flag: 'flag',
- top: 'top'
- }
- },
- modal: {
- Attributes: {
- 'value,v-model': 'value',
- type: 'type',
- id: 'id',
- duration: 'duration',
- fullscreen: 'fullscreen',
- width: 'width',
- height: 'height',
- mask: 'lock-view',
- message: 'message',
- resize: 'resize',
- showFooter: 'showFooter',
- showHeader: 'showHeader',
- status: 'status',
- title: 'title',
- top: 'top',
- zIndex: 'zIndex',
- 'min-width': 'min-width',
- 'min-height': 'min-height',
- 'esc-closable': 'esc-closable',
- 'lock-view': 'lock-view',
- 'lock-scroll': 'lock-scroll',
- 'mask-closable': 'mask-closable'
- },
- Events: {
- confirm: 'confirm-event',
- cancel: 'cancel-event',
- close: 'close-event',
- show: 'show-event',
- hide: 'hide-event',
- zoom: 'zoom-event'
- },
- Methods: {},
- Slots: {
- default: 'value',
- footer: 'footer-slot'
- }
- },
- espace: {
- Attributes: {
- data: 'data'
- },
- Events: {},
- Methods: {},
- Slots: {}
- },
- steps: {
- Attributes: {
- data: 'data-resource',
- active: 'order-progress',
- 'count-field': 'custom-field',
- 'name-field': 'custom-field',
- space: 'space',
- 'status-field': 'custom-field'
- },
- Events: {
- click: 'click'
- },
- Methods: {},
- Slots: {
- item: 'slot'
- }
- },
- 'user-head': {
- Attributes: {
- 'background-color': 'color',
- color: 'color',
- 'message-total': 'message-total',
- 'message-type': 'message-type',
- 'message-upper-limit': 'message-upper-limit',
- min: 'shape',
- round: 'shape',
- type: 'type',
- value: 'type'
- },
- Events: {},
- Methods: {},
- Slots: {
- default: 'slot'
- }
- },
- 'fall-menu': {
- Attributes: {
- data: 'a'
- },
- Events: {},
- Methods: {},
- Slots: {
- left: 'level',
- level1: 'level',
- level2: 'level',
- level3: 'level',
- right: 'level'
- }
- },
- rate: {
- Attributes: {
- colors: 'score',
- 'disabled-void-color': 'disabledcolor',
- 'disabled-void-icon-class': 'disabledcolor',
- 'show-text': 'readiconclass',
- 'icon-classes': 'colors',
- disabled: 'disabledcolor',
- 'text-color': 'readiconclass',
- texts: 'readiconclass',
- 'void-icon-class': 'colors',
- 'allow-half': 'half',
- 'score-template': 'textconfig',
- 'show-score': 'textconfig',
- 'void-color': 'colors',
- 'text-on-bottom': 'half',
- 'value / v-model': 'half',
- size: 'spacesize',
- space: 'spacesize',
- 'high-threshold': 'score',
- 'low-threshold': 'score',
- max: 'score',
- radio: 'radio'
- },
- Events: {
- change: 'events'
- },
- Methods: {},
- Slots: {}
- },
- 'ip-address': {
- Attributes: {
- delimiter: 'delimiter',
- disabled: 'disabled',
- readonly: 'readonly',
- type: 'type',
- value: 'type'
- },
- Events: {
- select: 'select',
- input: 'input',
- change: 'change',
- focus: 'focus',
- blur: 'blur'
- },
- Methods: {},
- Slots: {
- 默认插槽: 'slots'
- }
- },
- row: {
- Attributes: {
- align: 'align',
- gutter: 'gutter',
- justify: 'justify',
- order: 'order',
- tag: 'tag1'
- },
- Events: {},
- Methods: {},
- Slots: {}
- },
- 'user-contact': {
- Attributes: {
- data: 'basic-usage',
- espace: 'support-open-espace',
- 'show-img': 'support-open-espace',
- 'show-name': 'support-open-espace',
- 'show-number': 'support-open-espace'
- },
- Events: {},
- Methods: {},
- Slots: {}
- },
- 'user-link': {
- Attributes: {
- value: 'basic-usage',
- 'value-split': 'value-split',
- 'text-split': 'text-split',
- 'value-field': 'value-field',
- 'text-field': 'text-field',
- service: 'custom-service'
- },
- Events: {},
- Slots: {},
- Methods: {}
- },
- tree: {
- Attributes: {
- accordion: 'accordion-mode',
- 'allow-drag': 'allow-drag',
- data: 'data-source',
- 'allow-drop': 'allow-drop',
- 'auto-expand-parent': 'auto-expand-parent',
- 'basic-usage': 'basic-usage',
- 'check-descendants': 'check-descendants',
- 'check-on-click-node': 'check-on-click-node',
- 'check-strictly': 'check-strictly',
- 'current-node-key': 'current-node-key',
- 'custom-empty-text': 'custom-empty-text',
- 'custom-node-icon': 'custom-node-icon',
- 'default-checked-keys': 'default-checked-keys',
- 'default-expand-all': 'default-expand-all',
- 'default-expanded-keys': 'default-expanded-keys',
- 'disable-node': 'disable-node',
- 'expand-on-click-node': 'expand-on-click-node',
- 'filter-node-method': 'filter-node',
- 'highlight-current': 'highlight-current',
- indent: 'indent',
- 'icon-class': 'icon-class',
- 'node-draggable': 'node-draggable',
- 'node-key': 'node-key',
- props: 'node-props-config',
- 'render-after-expand': 'render-after-expand',
- 'render-content': 'render-content',
- 'show-checkbox': 'show-checkbox',
- 'lazy-load': 'lazy-load-node'
- },
- Events: {},
- Methods: {},
- Slots: {}
- },
-
- 'time-select': {
- Attributes: {
- 'arrow-control': 'arrow-control',
- 'clear-icon': 'clear-icon',
- clearable: 'clearable',
- 'default-time': 'default-time',
- 'default-value': 'default-value',
- disabled: 'disabled',
- editable: 'editable',
- 'start-placeholder': 'range-placeholder',
- 'end-placeholder': 'range-placeholder',
- placeholder: 'basic-usage',
- name: '',
- value: 'basic-usage',
- 'v-model': 'basic-usage',
- 'picker-options': 'picker-options',
- 'popper-class': '',
- 'prefix-icon': 'prefix-icon',
- 'range-separator': '',
- size: 'size-mini'
- },
- Events: {
- add: 'tabs-events-add',
- click: 'tabs-events-click',
- close: 'tabs-events-close',
- edit: 'tabs-events-edit'
- },
- Methods: {},
- Slots: {
- title: 'custom-tab-title'
- }
- },
- transfer: {
- Attributes: {
- 'button-texts': 'custom-button-texts',
- columns: '',
- data: '',
- 'drop-config': 'drop-config',
- 'filter-method': 'custom-filter-method',
- 'filter-placeholder': 'filter-placeholder',
- filterable: 'filterable',
- format: 'checked-format-text',
- 'left-default-checked': 'default-checked',
- 'page-vo': '',
- props: 'props-of-data-source',
- 'render-content': 'custom-render-content',
- 'render-type': '',
- 'right-default-checked': 'default-checked',
- 'show-all-btn': '',
- sortable: '',
- 'target-order': 'custom-data-items',
- titles: 'custom-transfer-titles',
- 'to-left-disable': '',
- 'to-right-disable': '',
- 'value/v-model': 'basic-usage'
- },
- Events: {
- change: 'transfer-events',
- 'left-check-change': 'transfer-events',
- 'right-check-change': 'transfer-events'
- },
- Slots: {
- default: 'custom-data-items',
- 'left-footer': 'custom-footer',
- 'right-footer': 'custom-footer'
- },
- Methods: {
- clearQuery: 'manual-clear-query'
- }
- },
-
- logout: {
- Attributes: {
- guestRole: 'basic-usage',
- service: 'custom-service'
- }
- },
-
- user: {
- Attributes: {
- value: 'basic-usage',
- multiple: 'multiple-users',
- disabled: 'dynamic-disable',
- 'value-split': 'value-split',
- 'value-field': 'value-field',
- 'text-field': 'text-field',
- cache: 'cache-users',
- 'cache-key': 'cache-users',
- delay: 'delay-load',
- 'suggest-length': 'load-after-input-the-length',
- 'cache-fields': 'cache-users',
- service: 'custom-service',
- 'collapse-tags': '',
- placeholder: 'custom-placeholder',
- 'expand-tags': '',
- sortable: 'custom-sort',
- size: 'user-select-size'
- },
- Events: {},
- Slots: {},
- Methods: {}
- },
- carousel: {
- Attributes: {},
- Events: {},
- Methods: {},
- Slots: {}
- },
- checkbox: {
- Attributes: {},
- Events: {},
- Methods: {},
- Slots: {}
- },
- 'dialog-box': {
- Attributes: {},
- Events: {},
- Methods: {},
- Slots: {}
- },
- radio: {
- Attributes: {
- disabled: 'dynamic-disable',
- border: 'with-border',
- label: 'basic-usage',
- name: '',
- size: 'radio-size'
- },
- Events: {
- change: 'radio-events'
- },
- Slots: {
- default: 'basic-usage'
- },
- Methods: {}
- },
- pager: {
- Attributes: {
- 'pager-count': 'pager-count',
- mode: 'pager-mode',
- 'value / v-model': 'basic-usage',
- 'page-sizes': 'page-size',
- layout: 'custom-layout',
- 'current-page': 'current-page',
- 'hide-on-single-page': 'hide-on-single-page',
- 'next-text': 'custom-next-prev-text',
- 'page-count': 'page-count',
- 'page-size': 'page-size',
- 'prev-text': 'custom-next-prev-text',
- total: 'pager-in-grid'
- },
- Events: {
- 'size-change': 'pager-events',
- 'current-change': 'pager-events',
- 'next-click': 'pager-events',
- 'prev-click': 'pager-events'
- },
- Methods: {},
- Slots: {
- default: ''
- }
- },
- collapse: {
- Attributes: {
- 'value / v-model': 'basic-usage',
- accordion: 'accordion'
- },
- Events: {
- change: 'collapse-events'
- },
- Methods: {},
- Slots: {}
- },
- 'slide-bar': {
- Attributes: {
- value: 'basic-usage',
- 'init-blocks': 'basic-usage',
- 'wheel-blocks': 'wheel-blocks',
- tag: 'custom-tag',
- 'sub-tag': 'custom-tag'
- },
- Events: {
- click: 'slide-bar-events',
- 'before-click': 'slide-bar-events'
- },
- Methods: {},
- Slots: {
- default: 'custom-content'
- }
- },
- 'credit-card-form': {
- Attributes: {
- 'form-data': 'basic-usage'
- },
- Events: {
- 'input-card-cvv': 'basic-usage',
- 'input-card-month': 'basic-usage',
- 'input-card-name': 'basic-usage',
- 'input-card-number': 'basic-usage',
- 'input-card-year': 'basic-usage',
- submit: 'basic-usage'
- },
- Methods: {},
- Slots: {}
- },
- 'time-line': {
- Attributes: {
- vertical: 'vertical-step',
- 'show-number': 'show-number',
- 'name-field': 'different-data',
- 'time-field': 'different-data',
- start: 'set-start-value',
- data: 'basic-usage',
- space: 'set-step-width',
- active: 'basic-usage',
- reverse: 'vertical-step'
- },
- Events: {
- click: 'basic-usage'
- },
- Methods: {},
- Slots: {
- top: 'custom-normal-step',
- bottom: 'custom-normal-step',
- left: 'custom-vertical-step',
- right: 'custom-vertical-step'
- }
- },
- 'date-picker': {
- Attributes: {
- 'value/v-model': 'basic-usage',
- align: 'align',
- 'clear-icon': 'about-clear',
- clearable: 'about-clear',
- type: 'date-range',
- 'picker-options': 'date-range-shortcuts',
- 'start-placeholder': 'custom-range',
- 'end-placeholder': 'custom-range',
- 'range-separator': 'custom-range',
- 'default-time': 'default-time-of-range',
- disabled: 'disabled',
- 'default-value': 'default-value',
- editable: 'editable',
- format: 'about-format',
- 'prefix-icon': 'custom-prefix-icon',
- size: 'set-size',
- placeholder: 'custom-placeholder',
- 'unlink-panels': 'unlink-panels'
- },
- Events: {
- blur: 'date-picker-events',
- change: 'date-picker-events',
- focus: 'date-picker-events'
- },
- Methods: {},
- Slots: {}
- },
- 'logon-user': {
- Attributes: {
- service: 'custom-service'
- },
- Events: {},
- Methods: {},
- Slots: {}
- },
- 'user-account': {
- Attributes: {
- service: 'custom-service'
- },
- Events: {},
- Methods: {},
- Slots: {
- default: 'custom-operation'
- }
- }
-}
diff --git a/examples/sites/demos/pc/app/config-provider/webdoc/config-provider.js b/examples/sites/demos/pc/app/config-provider/webdoc/config-provider.js
index b79aaf9a0..d5f7479fc 100644
--- a/examples/sites/demos/pc/app/config-provider/webdoc/config-provider.js
+++ b/examples/sites/demos/pc/app/config-provider/webdoc/config-provider.js
@@ -3,72 +3,43 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'base',
- 'name': { 'zh-CN': '基本使用', 'en-US': 'Basic Use' },
- 'desc': {
+ demoId: 'base',
+ name: {
+ 'zh-CN': '基本使用',
+ 'en-US': 'Basic Use'
+ },
+ desc: {
'zh-CN': '可通过design
属性设置自定义不同设计规范的图标和逻辑。',
'en-US':
'Icons and logic for different design specifications can be customized through the design
attribute configuration.'
},
- 'codeFiles': ['base.vue']
+ codeFiles: ['base.vue']
},
{
- 'demoId': 'text-direct',
- 'name': { 'zh-CN': '改变文字方向', 'en-US': 'Change the direction of text' },
- 'desc': {
+ demoId: 'text-direct',
+ name: {
+ 'zh-CN': '改变文字方向',
+ 'en-US': 'Change the direction of text'
+ },
+ desc: {
'zh-CN':
'可通过direction="ltr"
属性设置文字对齐方向,ltr
为左对齐,rtl
为右对齐。',
'en-US':
'Set the text alignment direction through: direction="ltr"
, whereltr
is left aligned andrtl
is right aligned.'
},
- 'codeFiles': ['text-direct.vue']
+ codeFiles: ['text-direct.vue']
},
{
- 'demoId': 'tag',
- 'name': { 'zh-CN': '自定义标签', 'en-US': 'Custom tags' },
- 'desc': {
+ demoId: 'tag',
+ name: {
+ 'zh-CN': '自定义标签',
+ 'en-US': 'Custom tags'
+ },
+ desc: {
'zh-CN': '可通过tag
属性设置自定义容器标签。',
'en-US': 'Container labels can be customized throughtag
.'
},
- 'codeFiles': ['tag.vue']
- }
- ],
- apis: [
- {
- 'name': 'config-provider',
- 'type': 'component',
- 'props': [
- {
- 'name': 'design',
- 'type': 'ConfigProviderProps',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '规范,可以通过该属于定制一些自定义的交互规范',
- 'en-US': 'Standardization can be achieved by customizing some custom interaction specifications'
- },
- 'demoId': 'base'
- },
- {
- 'name': 'direction',
- 'type': "'ltr' | 'rtl'",
- 'defaultValue': 'ltr',
- 'desc': { 'zh-CN': '文字排版方向', 'en-US': 'Text layout direction' },
- 'demoId': 'text-direct'
- },
- {
- 'name': 'tag',
- 'type': 'object',
- 'defaultValue': "{enable: true,name: 'div'}",
- 'desc': {
- 'zh-CN': '是否被元素包裹, 如果是vue2且没有一个单一节点, 组件会自动创建一个div',
- 'en-US':
- 'Whether it is wrapped by elements, if it is Vue2 and there is no single node, the component will automatically create a div'
- },
- 'demoId': 'tag'
- }
- ],
- 'events': [],
- 'slots': []
+ codeFiles: ['tag.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/container/webdoc/container.js b/examples/sites/demos/pc/app/container/webdoc/container.js
index 8bad4be0c..46804f0a9 100644
--- a/examples/sites/demos/pc/app/container/webdoc/container.js
+++ b/examples/sites/demos/pc/app/container/webdoc/container.js
@@ -3,116 +3,32 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基础用法', 'en-US': 'Basic Usage' },
- 'desc': {
- 'zh-CN': `
- 组件接受header
、 aside
、 footer
、 default
四种插槽。
- 通过 pattern
来设置预定好的组件版型,版型决定了插槽是否显示以及显示位置。
- `,
- 'en-US': `
- The component accepts header
, aside
, footer
, and default
.
- The predefined component pattern is set by pattern
. The pattern determines whether and where the slots are displayed.
- `
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基础用法',
+ 'en-US': 'Basic Usage'
},
- 'codeFiles': ['basic-usage.vue']
+ desc: {
+ 'zh-CN':
+ '\n 组件接受header
、 aside
、 footer
、 default
四种插槽。
\n 通过 pattern
来设置预定好的组件版型,版型决定了插槽是否显示以及显示位置。
\n ',
+ 'en-US':
+ '\n The component accepts header
, aside
, footer
, and default
.
\n The predefined component pattern is set by pattern
. The pattern determines whether and where the slots are displayed.
\n '
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'custom-with-height',
- 'name': { 'zh-CN': '自定义宽度和高度', 'en-US': 'Custom width and height' },
- 'desc': {
- 'zh-CN': `
- 通过 headerHeight
控制 header(头部区域)
高度。
- 通过 footerHeight
控制 footer(底部区域)
高度。
- 通过 asideWidth
控制 aside(左侧区域)
高度。
- 而default(主体区域)
的宽度和高度是自适应的。
- `,
- 'en-US': `
- The header (header area)
height is controlled by headerHeight
.
- Control the height of footer (bottom area)
by footerHeight
.
- Control the aside(left area)
height using asideWidth
.
- The width and height of main
are adaptive.
- `
+ demoId: 'custom-with-height',
+ name: {
+ 'zh-CN': '自定义宽度和高度',
+ 'en-US': 'Custom width and height'
},
- 'codeFiles': ['custom-with-height.vue']
- }
- ],
- apis: [
- {
- 'name': 'container',
- 'type': 'component',
- 'props': [
- {
- 'name': 'pattern',
- 'type': 'IContainerPattern',
- 'typeAnchorName': 'IContainerPattern',
- 'defaultValue': '"default"',
- 'desc': {
- 'zh-CN': '版型类型',
- 'en-US': 'Measurement type'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'aside-width',
- 'type': 'number | string',
- 'defaultValue': '200',
- 'desc': { 'zh-CN': '左侧宽度', 'en-US': 'Left width' },
- 'demoId': 'custom-with-height'
- },
- {
- 'name': 'footer-height',
- 'type': 'number | string',
- 'defaultValue': '60',
- 'desc': { 'zh-CN': '底部高度', 'en-US': 'Height at the bottom' },
- 'demoId': 'custom-with-height'
- },
- {
- 'name': 'header-height',
- 'type': 'number | string',
- 'defaultValue': '60',
- 'desc': { 'zh-CN': '头部高度', 'en-US': 'Head height' },
- 'demoId': 'custom-with-height'
- }
- ],
- 'events': [],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '主要内容插槽', 'en-US': 'Main Content Slot' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'header',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '头部内容插槽', 'en-US': 'Header Content Slot' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'aside',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '侧边内容插槽', 'en-US': 'Side Content Slot' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'footer',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '底部内容插槽', 'en-US': 'Bottom Content Slot' },
- 'demoId': 'classic'
- }
- ]
- }
- ],
- types: [
- {
- name: 'IContainerPattern',
- type: 'interface',
- code: `type IContainerPattern = 'default' | 'simple' | 'legend' | 'classic' | 'fashion'`
+ desc: {
+ 'zh-CN':
+ '\n 通过 headerHeight
控制 header(头部区域)
高度。
\n 通过 footerHeight
控制 footer(底部区域)
高度。
\n 通过 asideWidth
控制 aside(左侧区域)
高度。
\n 而default(主体区域)
的宽度和高度是自适应的。\n ',
+ 'en-US':
+ '\n The header (header area)
height is controlled by headerHeight
.
\n Control the height of footer (bottom area)
by footerHeight
.
\n Control the aside(left area)
height using asideWidth
.
\n The width and height of main
are adaptive.\n '
+ },
+ codeFiles: ['custom-with-height.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/country/webdoc/country.js b/examples/sites/demos/pc/app/country/webdoc/country.js
index 61f32e410..1521f9e04 100644
--- a/examples/sites/demos/pc/app/country/webdoc/country.js
+++ b/examples/sites/demos/pc/app/country/webdoc/country.js
@@ -3,111 +3,42 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['basic-usage.vue']
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'custom-service',
- 'name': { 'zh-CN': '自定义服务', 'en-US': 'Custom Service' },
- 'desc': {
+ demoId: 'custom-service',
+ name: {
+ 'zh-CN': '自定义服务',
+ 'en-US': 'Custom Service'
+ },
+ desc: {
'zh-CN':
'通过 fetch-country
属性可以指定一个方法,在方法中可实现请求自定义的服务。 clearable
设置是否可清空,默认值为 true。
\n',
'en-US':
'You can use the fetch-country
attribute to specify a method in which the service customized by the request can be implemented. clearable
: indicates whether data can be cleared. The default value is true.
\n'
},
- 'codeFiles': ['custom-service.vue']
+ codeFiles: ['custom-service.vue']
},
{
- 'demoId': 'fields',
- 'name': { 'zh-CN': '自定义数据的字段', 'en-US': 'Custom Data Fields' },
- 'desc': {
+ demoId: 'fields',
+ name: {
+ 'zh-CN': '自定义数据的字段',
+ 'en-US': 'Custom Data Fields'
+ },
+ desc: {
'zh-CN': '当使用自定义的数据体时,需要使用fields
来指定字段',
'en-US': 'When a user-defined data body is used, fields
must be used to specify fields.'
},
- 'codeFiles': ['fields.vue']
- }
- ],
- apis: [
- {
- 'name': 'country',
- 'type': 'component',
- 'props': [
- {
- 'name': 'modelValue / v-model',
- 'type': 'string , number',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置下拉框的值。', 'en-US': 'Set the value of the drop-down list box.' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'placeholder',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置输入框内的提示占位文本。', 'en-US': 'Set the placeholder text in the text box.' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'popper-class',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '为 popper 添加类名(可参考 popover 组件)',
- 'en-US': 'Add a class name for the popper. For details, see the popover component.'
- },
- 'demoId': ''
- },
- {
- 'name': 'popper-append-to-body',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 true',
- 'desc': {
- 'zh-CN':
- '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)',
- 'en-US':
- 'Indicates whether to insert the pop-up box to the body element. If a fault occurs in locating the fault in the dialog box that is displayed, you can set this attribute to false (for details, see the select component).'
- },
- 'demoId': ''
- },
- {
- 'name': 'fetchCountry',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义国家查询接口,返回一个Promise对象,未使用框架服务时必填',
- 'en-US':
- 'The user-defined country query interface returns a Promise object. This parameter is mandatory when the framework service is not used.'
- },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'fields',
- 'type': 'object',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义数据映射,未使用框架服务时必填',
- 'en-US': 'Customized data mapping. This parameter is mandatory when the framework service is not used.'
- },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'clearable',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 true',
- 'desc': { 'zh-CN': '是否显示清除按钮;是否可清空', 'en-US': 'Whether to display the Clear button; Clearable' },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 false',
- 'desc': { 'zh-CN': '禁用', 'en-US': 'Disabled' },
- 'demoId': ''
- }
- ],
- 'events': [],
- 'slots': []
+ codeFiles: ['fields.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/credit-card-form/webdoc/credit-card-form.js b/examples/sites/demos/pc/app/credit-card-form/webdoc/credit-card-form.js
index b09f22ea5..718419389 100644
--- a/examples/sites/demos/pc/app/credit-card-form/webdoc/credit-card-form.js
+++ b/examples/sites/demos/pc/app/credit-card-form/webdoc/credit-card-form.js
@@ -7,93 +7,40 @@ export default {
},
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['basic-usage.vue']
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'background-image',
- 'name': { 'zh-CN': '背景图片', 'en-US': 'Background Image' },
- 'desc': {
+ demoId: 'background-image',
+ name: {
+ 'zh-CN': '背景图片',
+ 'en-US': 'Background Image'
+ },
+ desc: {
'zh-CN': '通过 background-image
设置信用卡背景图片。
\n',
'en-US': 'Use background-image
to set the credit card background image.
\n'
},
- 'codeFiles': ['background-image.vue']
+ codeFiles: ['background-image.vue']
},
{
- 'demoId': 'credit-card-form-events',
- 'name': { 'zh-CN': '事件', 'en-US': 'Event' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['credit-card-form-events.vue']
- }
- ],
- apis: [
- {
- 'name': 'credit-card-form',
- 'type': 'component',
- 'props': [
- {
- 'name': 'background-image',
- 'type': 'string , object',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置卡片的背景图片;', 'en-US': 'Set the background image of the card.' },
- 'demoId': 'background-image'
- },
- {
- 'name': 'form-data',
- 'type': 'object',
- 'defaultValue':
- "// 该属性的默认值为 \n{cardCvv: '', cardName: '', cardYear: '', cardMonth: '', cardNumber: ''}",
- 'desc': { 'zh-CN': '设置信用卡显示数据', 'en-US': 'Setting Credit Card Display Data' },
- 'demoId': 'basic-usage'
- }
- ],
- 'events': [
- {
- 'name': 'submit',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '提交时触发的事件', 'en-US': 'Event triggered upon submission' },
- 'demoId': 'credit-card-form-events'
- },
- {
- 'name': 'input-card-number',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '输入卡号时触发的事件', 'en-US': 'Event triggered when a card number is entered' },
- 'demoId': 'credit-card-form-events'
- },
- {
- 'name': 'input-card-name',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '输入卡持有者时触发的事件', 'en-US': 'Event triggered when a card holder is entered' },
- 'demoId': 'credit-card-form-events'
- },
- {
- 'name': 'input-card-month',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '选择月时触发的事件', 'en-US': 'Event triggered when a month is selected' },
- 'demoId': 'credit-card-form-events'
- },
- {
- 'name': 'input-card-year',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '选择年时触发的事件', 'en-US': 'Event triggered when the year is selected' },
- 'demoId': 'credit-card-form-events'
- },
- {
- 'name': 'input-card-cvv',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '输入 cvv 时触发的事件', 'en-US': 'CVV input event triggered' },
- 'demoId': 'credit-card-form-events'
- }
- ],
- 'slots': []
+ demoId: 'credit-card-form-events',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': 'Event'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['credit-card-form-events.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/crop/webdoc/crop.js b/examples/sites/demos/pc/app/crop/webdoc/crop.js
index 7c014de30..ef965aada 100644
--- a/examples/sites/demos/pc/app/crop/webdoc/crop.js
+++ b/examples/sites/demos/pc/app/crop/webdoc/crop.js
@@ -3,673 +3,288 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN':
'通过 src
属性设置默认裁剪的图片源路径,并通过 cropvisible
属性来控制裁剪弹框是否可见。
\n',
'en-US':
'The src
attribute is used to set the default cropping image source path, and the cropvisible
attribute is used to control whether the cropping dialog box is visible.
\n'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'aspect-ratio',
- 'name': { 'zh-CN': '裁剪框宽高比', 'en-US': 'Aspect-to-height ratio of the crop box' },
- 'desc': {
+ demoId: 'aspect-ratio',
+ name: {
+ 'zh-CN': '裁剪框宽高比',
+ 'en-US': 'Aspect-to-height ratio of the crop box'
+ },
+ desc: {
'zh-CN':
'通过 aspect-ratio
属性可以设置裁剪框的宽高比例,默认为 16 / 9
。还可以通过调用 setAspectRatio
方法来设置裁切框的宽高比。\n通过 center
属性可以设置裁剪框是否在图片正中心。
\n',
'en-US':
'You can use the aspect-ratio
attribute to set the aspect ratio of the crop box. The default value is 16 / 9
. You can also set the aspect ratio of the trim box by calling the setAspectRatio
method. \nThe center
attribute can be used to set whether the crop frame is in the center of the image.
\n'
},
- 'codeFiles': ['aspect-ratio.vue']
+ codeFiles: ['aspect-ratio.vue']
},
{
- 'demoId': 'min-crop-box-width-height',
- 'name': { 'zh-CN': '裁剪框最小宽高', 'en-US': 'Minimum width and height of the crop box' },
- 'desc': {
+ demoId: 'min-crop-box-width-height',
+ name: {
+ 'zh-CN': '裁剪框最小宽高',
+ 'en-US': 'Minimum width and height of the crop box'
+ },
+ desc: {
'zh-CN':
'通过属性 min-crop-box-width
、min-crop-box-height
设置裁剪框最小宽高。设置后,调整裁剪框宽高时,调整到最小值后将不能再调整。\n通过属性 min-container-width
、min-container-height
设置容器的最小宽度,最小高度。
\n',
'en-US':
'Set the minimum width and height of the cropping frame through the min-crop-box-width
and min-crop-box-height
attributes. After this parameter is set, the width and height of the cropping box cannot be adjusted after the width and height are adjusted to the minimum value. \n Set the minimum width and height of the container through the min-container-width
and min-container-height
attributes.
\n'
},
- 'codeFiles': ['min-crop-box-width-height.vue']
+ codeFiles: ['min-crop-box-width-height.vue']
},
{
- 'demoId': 'no-background',
- 'name': { 'zh-CN': '不显示网格背景', 'en-US': 'Do not display the grid background' },
- 'desc': {
+ demoId: 'no-background',
+ name: {
+ 'zh-CN': '不显示网格背景',
+ 'en-US': 'Do not display the grid background'
+ },
+ desc: {
'zh-CN': '通过设置 background
属性为 false
后,将不显示容器的网格背景。
\n',
'en-US':
'When background
is set to false
, the grid background of the container is not displayed.
\n'
},
- 'codeFiles': ['no-background.vue']
+ codeFiles: ['no-background.vue']
},
{
- 'demoId': 'no-guides',
- 'name': { 'zh-CN': '不显示虚线', 'en-US': 'Do not display dotted lines' },
- 'desc': {
+ demoId: 'no-guides',
+ name: {
+ 'zh-CN': '不显示虚线',
+ 'en-US': 'Do not display dotted lines'
+ },
+ desc: {
'zh-CN': '通过设置 guides
属性为 false
将取消裁剪框上方的虚线显示。
\n',
'en-US':
'Setting guides
to false
will cancel the dotted line above the crop box.
\n'
},
- 'codeFiles': ['no-guides.vue']
+ codeFiles: ['no-guides.vue']
},
{
- 'demoId': 'no-modal',
- 'name': { 'zh-CN': '不显示模态', 'en-US': 'Do not display modal' },
- 'desc': {
+ demoId: 'no-modal',
+ name: {
+ 'zh-CN': '不显示模态',
+ 'en-US': 'Do not display modal'
+ },
+ desc: {
'zh-CN':
'通过设置 modal
属性为 false
将取消裁剪框下方图片上方的模态层显示。
\n',
'en-US':
'Setting modal
to false
cancels the display of the modal layer above the image below the crop box.
\n'
},
- 'codeFiles': ['no-modal.vue']
+ codeFiles: ['no-modal.vue']
},
{
- 'demoId': 'view-mode',
- 'name': { 'zh-CN': '视图模式', 'en-US': 'View mode' },
- 'desc': {
+ demoId: 'view-mode',
+ name: {
+ 'zh-CN': '视图模式',
+ 'en-US': 'View mode'
+ },
+ desc: {
'zh-CN':
'通过 view-mode
属性可以设置裁剪框的视图模式,有 0
、1
、2
、3
四种选项,默认为 0
。
\nview-mode 选项说明
\n0
:裁剪框可以移动到图片外面。\n1
:裁剪框只能在图片内移动。\n2
:图片不全部铺满容器,缩小时可以有一边出现空隙。\n3
:图片填充整个容器。
\n\n',
'en-US':
'You can set the view mode of the crop box through the view-mode
attribute. There are four options: 0
, 1
, 2
, and 3
. The default value is 0
.
\nview-mode option description
\n0
: The crop box can be moved outside the image. \n1
: The crop box can only be moved within the image. \n2
: The image is not completely covered in the container. A gap may appear on one side when the image is zoomed out. \n3
: fills the entire container with an image.
\n\n'
},
- 'codeFiles': ['view-mode.vue']
+ codeFiles: ['view-mode.vue']
},
{
- 'demoId': 'drag-mode',
- 'name': { 'zh-CN': '拖拽模式', 'en-US': 'Drag Mode' },
- 'desc': {
+ demoId: 'drag-mode',
+ name: {
+ 'zh-CN': '拖拽模式',
+ 'en-US': 'Drag Mode'
+ },
+ desc: {
'zh-CN':
'通过 drag-mode
属性可以设置裁剪框的拖拽模式,有 crop
、move
、none
三种选项,默认为 crop
。
\ndrag-mode 选项说明
\ncrop
:当裁剪框取消后,按住鼠标左键在图片区域拖拽,将产生一个新的裁剪框。\nmove
:当裁剪框取消后,按住鼠标左键将移动图片。\nnone
:当裁剪框取消后,不能裁剪、也不能移动图片。\nmovable
控制图片是否可以移动,默认为 true。
\n\n',
'en-US':
'You can set the drag mode of the crop box through the drag-mode
attribute. There are three options: crop
, move
, and none
. The default value is crop
.
\ndrag-mode Option Description
\ncrop
: After the cropping box is canceled, hold down the left mouse button and drag it in the image area to generate a new cropping box. \nmove
: After the cropping box is canceled, hold down the left mouse button to move the image. \nnone
: After the crop box is canceled, the image cannot be cropped or moved. \nmovable
specifies whether an image can be moved. The default value is true.
\n\n'
},
- 'codeFiles': ['drag-mode.vue']
+ codeFiles: ['drag-mode.vue']
},
{
- 'demoId': 'auto-crop-area',
- 'name': { 'zh-CN': '自动裁剪面积', 'en-US': 'Automatically Cropped Area' },
- 'desc': {
+ demoId: 'auto-crop-area',
+ name: {
+ 'zh-CN': '自动裁剪面积',
+ 'en-US': 'Automatically Cropped Area'
+ },
+ desc: {
'zh-CN':
'初始化时,通过属性 auto-crop-area
可以设置裁剪框自动裁剪的面积,默认为 0.8
,在 auto-crop
属性为 true
时生效。
\n',
'en-US':
'During initialization, the auto-crop-area
attribute can be used to set the area of the cropping box. The default value is 0.8
. This parameter is valid only when auto-crop
is set to true
.
\n'
},
- 'codeFiles': ['auto-crop-area.vue']
+ codeFiles: ['auto-crop-area.vue']
},
{
- 'demoId': 'get-container-data',
- 'name': { 'zh-CN': '获取容器数据', 'en-US': 'Obtain container data' },
- 'desc': {
+ demoId: 'get-container-data',
+ name: {
+ 'zh-CN': '获取容器数据',
+ 'en-US': 'Obtain container data'
+ },
+ desc: {
'zh-CN': '通过调用 getContainerData
方法可以获取容器的大小数据。
\n',
'en-US': 'Invoke the getContainerData
method to obtain the container size data.
\n'
},
- 'codeFiles': ['get-container-data.vue']
+ codeFiles: ['get-container-data.vue']
},
{
- 'demoId': 'get-crop-box-data',
- 'name': { 'zh-CN': '获取剪切框数据', 'en-US': 'Obtain clip box data' },
- 'desc': {
+ demoId: 'get-crop-box-data',
+ name: {
+ 'zh-CN': '获取剪切框数据',
+ 'en-US': 'Obtain clip box data'
+ },
+ desc: {
'zh-CN': '通过调用 getCropBoxData
方法可以获取剪切框的位置和大小数据。
\n',
'en-US':
'Invoke the getCropBoxData
method to obtain the position and size of the clip box.
\n'
},
- 'codeFiles': ['get-crop-box-data.vue']
+ codeFiles: ['get-crop-box-data.vue']
},
{
- 'demoId': 'get-cropped-canvas',
- 'name': { 'zh-CN': '获取裁剪后的图片数据', 'en-US': 'Obtain the cropped image data' },
- 'desc': {
+ demoId: 'get-cropped-canvas',
+ name: {
+ 'zh-CN': '获取裁剪后的图片数据',
+ 'en-US': 'Obtain the cropped image data'
+ },
+ desc: {
'zh-CN':
'通过调用 getCroppedCanvas
方法可以获取裁剪后的图片数据,搭配 toDataURL
方法将转成 base64 图片数据,搭配 toBlob
方法将生成 Blob 图片数据。
\n',
'en-US':
'Invoke the getCroppedCanvas
method to obtain the cropped image data. Use the toDataURL
method to convert the cropped image data to Base64 image data. Use the toBlob
method to generate Blob image data.
\n'
},
- 'codeFiles': ['get-cropped-canvas.vue']
+ codeFiles: ['get-cropped-canvas.vue']
},
{
- 'demoId': 'get-data',
- 'name': { 'zh-CN': '获取裁剪区域数据', 'en-US': 'Obtain crop area data' },
- 'desc': {
+ demoId: 'get-data',
+ name: {
+ 'zh-CN': '获取裁剪区域数据',
+ 'en-US': 'Obtain crop area data'
+ },
+ desc: {
'zh-CN': '通过调用 getData
方法可以获取裁剪区域的位置以及大小。
\n',
'en-US':
'Invoke the getData
method to obtain the position and size of the cropping area.
\n'
},
- 'codeFiles': ['get-data.vue']
+ codeFiles: ['get-data.vue']
},
{
- 'demoId': 'get-image-data',
- 'name': { 'zh-CN': '获取图像数据', 'en-US': 'Obtain Image Data' },
- 'desc': {
+ demoId: 'get-image-data',
+ name: {
+ 'zh-CN': '获取图像数据',
+ 'en-US': 'Obtain Image Data'
+ },
+ desc: {
'zh-CN':
'通过调用 getImageData
方法可以获取图像位置、大小和其他相关数据,若想获取画布位置和大小数据可以调用 getCanvasData
方法。
\n',
'en-US':
'Invoke the getImageData
method to obtain the image position, size, and other related data. To obtain the canvas position and size data, call the getCanvasData
method.
\n'
},
- 'codeFiles': ['get-image-data.vue']
+ codeFiles: ['get-image-data.vue']
},
{
- 'demoId': 'replace-image',
- 'name': { 'zh-CN': '替换图片', 'en-US': 'Replace Image' },
- 'desc': {
+ demoId: 'replace-image',
+ name: {
+ 'zh-CN': '替换图片',
+ 'en-US': 'Replace Image'
+ },
+ desc: {
'zh-CN':
'通过调用 replace
方法可以替换图像的 src 并重新构建 cropper 。 通过 rotatable
属性控制图片旋转,默认为 true。
\n',
'en-US':
'Invoke the replace
method to replace the image src and rebuild the cropper. The rotatable
attribute is used to control image rotation. The default value is true.
\n'
},
- 'codeFiles': ['replace-image.vue']
+ codeFiles: ['replace-image.vue']
},
{
- 'demoId': 'replace-image1',
- 'name': { 'zh-CN': '放大图片', 'en-US': 'Enlarge Image' },
- 'desc': {
+ demoId: 'replace-image1',
+ name: {
+ 'zh-CN': '放大图片',
+ 'en-US': 'Enlarge Image'
+ },
+ desc: {
'zh-CN': '通过zoomable
可放大图片。',
'en-US': 'You can zoom in on the image byzoomable
.'
},
- 'codeFiles': ['replace-image.vue']
+ codeFiles: ['replace-image.vue']
},
{
- 'demoId': 'wheel-zoom-ratio',
- 'name': {
+ demoId: 'wheel-zoom-ratio',
+ name: {
'zh-CN': '鼠标滚轮缩放图像时比例',
'en-US': 'Scale when the mouse wheel is used to zoom in or out an image'
},
- 'desc': {
+ desc: {
'zh-CN':
'通过zoom-on-wheel
属性为 true
情况下,通过 wheel-zoom-ratio
属性可以设置缩放比例,默认为 0.1
。
\n',
'en-US':
'zoom-on-wheel
attribute is set to true
, you can use the wheel-zoom-ratio
attribute to set the scaling ratio. The default value is 0.1
.
\n'
},
- 'codeFiles': ['wheel-zoom-ratio.vue']
+ codeFiles: ['wheel-zoom-ratio.vue']
},
{
- 'demoId': 'zoom-on-wheel',
- 'name': { 'zh-CN': '禁用鼠标滚轮缩放图像', 'en-US': 'Disable the mouse wheel to zoom in or out the image' },
- 'desc': {
+ demoId: 'zoom-on-wheel',
+ name: {
+ 'zh-CN': '禁用鼠标滚轮缩放图像',
+ 'en-US': 'Disable the mouse wheel to zoom in or out the image'
+ },
+ desc: {
'zh-CN':
'通过设置 zoom-on-wheel
属性为 false
后,将不允许通过滚动鼠标滚轮来缩放图像。
\n',
'en-US':
'After the zoom-on-wheel
attribute is set to false
, the image cannot be zoomed in or out by scrolling the mouse wheel.
\n'
},
- 'codeFiles': ['zoom-on-wheel.vue']
+ codeFiles: ['zoom-on-wheel.vue']
},
{
- 'demoId': 'event-ready',
- 'name': { 'zh-CN': 'ready 事件', 'en-US': 'ready event' },
- 'desc': {
+ demoId: 'event-ready',
+ name: {
+ 'zh-CN': 'ready 事件',
+ 'en-US': 'ready event'
+ },
+ desc: {
'zh-CN': '当一个 cropper 实例完全构建时,通过触发 ready
事件。
\n',
'en-US': 'When a cropper instance is completely built, the ready
event is triggered.
\n'
},
- 'codeFiles': ['event-ready.vue']
+ codeFiles: ['event-ready.vue']
},
{
- 'demoId': 'crop-meth',
- 'name': { 'zh-CN': '裁剪框方法 事件', 'en-US': 'Crop box method event' },
- 'desc': {
+ demoId: 'crop-meth',
+ name: {
+ 'zh-CN': '裁剪框方法 事件',
+ 'en-US': 'Crop box method event'
+ },
+ desc: {
'zh-CN':
'当一个 cropper 实例完全构建时,通过触发 disable
方法禁用裁剪框,当触发 enable
启用裁剪框。
\n',
'en-US':
'When a cropper instance is completely built, the disable
method is triggered to disable the cropping box. When the enable
method is triggered to enable the cropping box.
\n'
},
- 'codeFiles': ['crop-meth.vue']
+ codeFiles: ['crop-meth.vue']
},
{
- 'demoId': 'event-about-crop',
- 'name': { 'zh-CN': '裁剪相关事件', 'en-US': 'Cutout Event' },
- 'desc': {
+ demoId: 'event-about-crop',
+ name: {
+ 'zh-CN': '裁剪相关事件',
+ 'en-US': 'Cutout Event'
+ },
+ desc: {
'zh-CN':
'TIP
\n说明当画布或剪切框开始发生变化时触发 cropstart
事件\n当画布或剪切框正在发生变化时触发 cropmove
事件\n当画布或剪切框发生变化结束时触发 cropend
事件\n当画布或裁剪框发生改变时触发 crop
事件\n通过触发 getCanvasData
获取画布 Canvas(图像包装器)位置和大小数据。
\n\n',
'en-US':
'TIP
\n Description: The cropstart
event is triggered when the canvas or clipping box starts to change.\nThe cropmove
event is triggered when the canvas or clipping box is changed.\nThe cropen event is triggered when the canvas or clipping box ends. d
Event\nThe crop
event is triggered when the canvas or crop box changes. \nThe getCanvasData
event is triggered to obtain the position and size data of the canvas (image wrapper).
\n\n'
},
- 'codeFiles': ['event-about-crop.vue']
- }
- ],
- apis: [
- {
- 'name': 'crop',
- 'type': 'component',
- 'props': [
- {
- 'name': 'crop-type',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置图片裁剪后返回的类型,可配置为 blob 和 base64,默认为 base64',
- 'en-US':
- 'Type of the image that is returned after cropping. The value can be blob or base64. The default value is base64'
- },
- 'demoId': 'get-cropped-canvas'
- },
- {
- 'name': 'preview',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置裁剪区域图片是否可预览,默认为 false',
- 'en-US': 'Specifies whether images in the cropping area can be previewed. The default value is false'
- },
- 'demoId': ''
- },
- {
- 'name': 'quality',
- 'type': 'number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置图片裁剪后的压缩比例,值在 0-1 之间,默认为 0.92',
- 'en-US':
- 'Set the compression ratio of the cropped image. The value ranges from 0 to 1. The default value is 0.92'
- },
- 'demoId': ''
- },
- {
- 'name': 'src',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '默认裁剪的源图片', 'en-US': 'Default cropped source image' },
- 'demoId': 'no-background'
- },
- {
- 'name': 'view-mode',
- 'type': 'number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '定义 cropper 的视图模式;默认为 0;0:没有限制,3 可以移动到 2 外。1:3 只能在 2 内移动。2:2 图片不全部铺满 1 (即缩小时可以有一边出现空隙)。3:2 图片填充整个 1',
- 'en-US':
- 'Defines the view mode of the cropper. The default value is 0. 0: no restriction. The value 3 can be moved out of the value 2. 1:3 can only be moved within 2. The 2:2 picture is not completely covered with 1 (i.e., there may be gaps on one side when the picture is zoomed out). 3: 2 The image fills the entire 1'
- },
- 'demoId': 'view-mode'
- },
- {
- 'name': 'drag-mode',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- "定义 cropper 的拖拽模式;默认为 'crop';'crop': 可以产生一个新的裁剪框 3 。'move':只可以移动图片 3 。'none': 什么也不处理",
- 'en-US':
- "Defines the drag mode of the cropper. The default value is'crop'. 'Crop': A new crop box 3 can be generated. 'move': Only image 3 can be moved. 'none': no action is required"
- },
- 'demoId': 'drag-mode'
- },
- {
- 'name': 'aspect-ratio',
- 'type': 'number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '裁剪框的宽高比;默认为 16 / 9',
- 'en-US': 'Aspect-to-height ratio of the crop box; The default value is 16 / 9'
- },
- 'demoId': 'aspect-ratio'
- },
- {
- 'name': 'max-size',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置待裁剪图片的最大大小,默认为 1M ;默认为 1M',
- 'en-US':
- 'Set the maximum size of the image to be cropped. The default value is 1 MB. The default value is 1M'
- },
- 'demoId': ''
- },
- {
- 'name': 'modal',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '是否显示图片上方裁剪框下方的黑色模态;默认为 true',
- 'en-US':
- 'Whether to display the black mode below the cropping box above the image; The default value is true'
- },
- 'demoId': 'no-modal'
- },
- {
- 'name': 'guides',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '是否在裁剪框上方显示虚线;默认为 true',
- 'en-US': 'Whether to display dotted lines above the crop box; The default value is true'
- },
- 'demoId': 'no-guides'
- },
- {
- 'name': 'center',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '裁剪框是否在图片正中心;默认为 true',
- 'en-US': 'Whether the cropping frame is in the center of the image; The default value is true'
- },
- 'demoId': 'aspect-ratio'
- },
- {
- 'name': 'background',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '是否显示容器的网格背景;默认为 true',
- 'en-US': 'Whether to display the grid background of the container; The default value is true'
- },
- 'demoId': 'no-background'
- },
- {
- 'name': 'movable',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '是否允许可以移动后面的图片;默认为 true',
- 'en-US': 'Indicates whether the image can be moved. The default value is true'
- },
- 'demoId': 'drag-mode'
- },
- {
- 'name': 'rotatable',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '是否允许旋转图像;默认为 true',
- 'en-US': 'Indicates whether images can be rotated. The default value is true'
- },
- 'demoId': 'replace-image'
- },
- {
- 'name': 'zoomable',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '是否允许放大图像;默认为 true',
- 'en-US': 'Whether to allow image zooming in; The default value is true'
- },
- 'demoId': 'replace-image'
- },
- {
- 'name': 'zoom-on-wheel',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '是否可以通过滚动鼠标滚轮来缩放图像;默认为 true',
- 'en-US':
- 'Specifies whether you can zoom in or out an image by scrolling the mouse wheel. The default value is true'
- },
- 'demoId': 'zoom-on-wheel'
- },
- {
- 'name': 'wheel-zoom-ratio',
- 'type': 'number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '用鼠标移动图像时,定义缩放比例;默认为 0.1',
- 'en-US': 'Define the scaling ratio when moving the image with the mouse. The default value is 0.1'
- },
- 'demoId': 'wheel-zoom-ratio'
- },
- {
- 'name': 'min-container-width',
- 'type': 'number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '容器的最小宽度;默认为 652',
- 'en-US': 'Minimum width of a container; The default value is 652'
- },
- 'demoId': 'min-crop-box-width-height'
- },
- {
- 'name': 'min-container-height',
- 'type': 'number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '容器的最小高度;默认为 300',
- 'en-US': 'Minimum height of a container; The default value is 300'
- },
- 'demoId': 'min-crop-box-width-height'
- },
- {
- 'name': 'min-crop-box-width',
- 'type': 'number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '裁剪层的最小宽度;默认为 0',
- 'en-US': 'Minimum width of the cropping layer; The default value is 0'
- },
- 'demoId': 'min-crop-box-width-height'
- },
- {
- 'name': 'min-crop-box-height',
- 'type': 'number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '裁剪层的最小高度;默认为 0',
- 'en-US': 'Minimum height of the crop layer; The default value is 0'
- },
- 'demoId': 'min-crop-box-width-height'
- },
- {
- 'name': 'auto-crop',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '初始化时,是否自动显示裁剪框;默认为 true',
- 'en-US':
- 'Indicates whether to automatically display the crop box during initialization. The default value is true'
- },
- 'demoId': 'auto-crop-area'
- },
- {
- 'name': 'auto-crop-area',
- 'type': 'number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '定义自动裁剪面积大小(百分比);默认为 0.8',
- 'en-US': 'Defines the automatic cropping area size (percentage). The default value is 0.8'
- },
- 'demoId': 'auto-crop-area'
- },
- {
- 'name': 'cropvisible',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置裁剪弹框是否可见;默认为 false',
- 'en-US': 'Set whether the cropping dialog box is visible. The default value is false'
- },
- 'demoId': 'min-crop-box-width-height'
- }
- ],
- 'events': [
- {
- 'name': 'ready',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当一个 cropper 实例完全构建时触发',
- 'en-US': 'This event is triggered when a cropper instance is completely built'
- },
- 'demoId': 'event-ready'
- },
- {
- 'name': 'cropdata',
- 'type': 'Function(data)',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': 'cropdata 事件回调函数中可以拿到裁剪后的数据,默认为 base64 数据',
- 'en-US':
- 'The tailored data can be obtained from the cropdata event callback function. The default value is Base64 data'
- },
- 'demoId': 'event-about-crop'
- },
- {
- 'name': 'cropstart',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当画布(图像包装器)或剪切框开始发生变化时触发;回调参数为 (event: Event)',
- 'en-US':
- 'Triggered when the canvas (image wrapper) or clipping box starts to change; The callback parameter is (event: Event)'
- },
- 'demoId': 'event-about-crop'
- },
- {
- 'name': 'cropmove',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当画布(图像包装器)或剪切框正在发生变化时触发;回调参数为 (event: Event)',
- 'en-US':
- 'Triggered when the canvas (image wrapper) or clipping box is changing; The callback parameter is (event: Event)'
- },
- 'demoId': 'event-about-crop'
- },
- {
- 'name': 'cropend',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当画布(图像包装器)或剪切框发生变化结束时触发;回调参数为 (event: Event)',
- 'en-US':
- 'Triggered when the canvas (image wrapper) or clipping box changes. The callback parameter is (event: Event)'
- },
- 'demoId': 'event-about-crop'
- },
- {
- 'name': 'crop',
- 'type': 'Function(value)',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当画布(图像包装器)或裁剪框发生改变时触发;回调参数为 (event: Event),原生事件',
- 'en-US':
- 'Triggered when the canvas (image wrapper) or crop box changes; The callback parameter is (event: Event), native event'
- },
- 'demoId': 'event-about-crop'
- }
- ],
- 'slots': [],
- 'methods': [
- {
- 'name': 'getCroppedCanvas',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '获取裁剪后的图片数据;.getCroppedCanvas().toDataURL():转成 base64 图片;.getCroppedCanvas().toBlob():生成 Blob 图片数据',
- 'en-US':
- 'Obtain the cropped image data. .getCroppedCanvas().toDataURL(): Convert the image to a Base64 image. .getCroppedCanvas().toBlob(): Generate Blob image data'
- },
- 'demoId': 'get-cropped-canvas'
- },
- {
- 'name': 'replace',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '替换图像的 src 并重新构建 cropper;参数为 图片 URL',
- 'en-US': 'Replace the image src and rebuild the cropper. The parameter is the image URL'
- },
- 'demoId': 'replace-image'
- },
- {
- 'name': 'clear',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '清除裁切框', 'en-US': 'Clear the cropping box' },
- 'demoId': 'get-data'
- },
- {
- 'name': 'getData',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '获取最终裁剪的区域位置和大小数据(根据原始图像的自然大小);参数为 (rounded) ,默认 false,设置 true 可以获取其所有数据;返回的数据类型为 object',
- 'en-US':
- 'Obtain the position and size of the final cropped region (based on the natural size of the original image). The parameter is rounded. The default value is false. If this parameter is set to true, all data can be obtained. The returned data type is object'
- },
- 'demoId': 'get-data'
- },
- {
- 'name': 'getContainerData',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '获取 container 容器大小数据;返回的数据类型为 object',
- 'en-US': 'Obtain the container size data. The returned data type is object'
- },
- 'demoId': 'get-container-data'
- },
- {
- 'name': 'getImageData',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '获取图像 image 位置、大小和其他相关数据;返回的数据类型为 object',
- 'en-US': 'Obtain the image position, size, and other related data. The returned data type is object'
- },
- 'demoId': 'get-image-data'
- },
- {
- 'name': 'getCanvasData',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '获取画布 Canvas(图像包装器)位置和大小数据;返回的数据类型为 object',
- 'en-US':
- 'Obtain the position and size of the canvas Canvas (image wrapper). The returned data type is object'
- },
- 'demoId': 'get-image-data'
- },
- {
- 'name': 'getCropBoxData',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '获取剪切框的位置和大小数据;返回的数据类型为 object',
- 'en-US': 'Obtain the position and size of the clip box. The returned data type is object'
- },
- 'demoId': 'get-crop-box-data'
- },
- {
- 'name': 'setAspectRatio',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '改变裁切框的宽高比;参数为(aspectRatio),类型 number,是一个正数',
- 'en-US':
- 'Change the aspect ratio of the cutting frame; The parameter is (aspectRatio) and the type is number. The value is a positive number'
- },
- 'demoId': 'aspect-ratio'
- },
- {
- 'name': 'disable',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '禁用裁切框(裁切框不可移动)',
- 'en-US': 'Disable the cropping box (the cropping box cannot be moved)'
- },
- 'demoId': 'crop-meth'
- },
- {
- 'name': 'enable',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '启用裁切框', 'en-US': 'Enable the cropping box' },
- 'demoId': 'event-ready'
- },
- {
- 'name': 'destroy',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '销毁 cropper 并从图像中删除整个 cropper',
- 'en-US': 'Destroy the cropper and delete the entire cropper from the image'
- },
- 'demoId': 'event-ready'
- }
- ]
+ codeFiles: ['event-about-crop.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/currency/basic-usage.spec.ts b/examples/sites/demos/pc/app/currency/basic-usage.spec.ts
index 5e5b90283..12094c009 100644
--- a/examples/sites/demos/pc/app/currency/basic-usage.spec.ts
+++ b/examples/sites/demos/pc/app/currency/basic-usage.spec.ts
@@ -3,7 +3,7 @@ import { test, expect } from '@playwright/test'
test('基础用法', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('currency#basic-usage')
- await page.getByPlaceholder('请选择').click()
+ await page.getByRole('textbox', { name: '请选择' }).click()
const inputBox = page.locator('.tiny-input input').nth(1)
await expect(inputBox).toHaveAttribute('placeholder', 'VUV')
})
diff --git a/examples/sites/demos/pc/app/currency/custom-service.spec.ts b/examples/sites/demos/pc/app/currency/custom-service.spec.ts
index 885d75192..1aa6b63db 100644
--- a/examples/sites/demos/pc/app/currency/custom-service.spec.ts
+++ b/examples/sites/demos/pc/app/currency/custom-service.spec.ts
@@ -3,9 +3,9 @@ import { test, expect } from '@playwright/test'
test('自定义服务', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('currency#custom-service')
- await page.locator('#preview').getByRole('textbox').click()
+ await page.locator('#custom-service').getByRole('textbox').click()
await page.waitForTimeout(500)
await page.getByRole('listitem').filter({ hasText: 'USD' }).click()
- const inputBox = page.locator('#preview').getByRole('textbox').first()
+ const inputBox = page.locator('#custom-service').getByRole('textbox').first()
await expect(inputBox).toHaveValue('USD')
})
diff --git a/examples/sites/demos/pc/app/currency/filter-composition-api.vue b/examples/sites/demos/pc/app/currency/filter-composition-api.vue
new file mode 100644
index 000000000..ca5bb42d2
--- /dev/null
+++ b/examples/sites/demos/pc/app/currency/filter-composition-api.vue
@@ -0,0 +1,24 @@
+
+
+
+ 当前选中值:{{ value }}
+
+
+
+
diff --git a/examples/sites/demos/pc/app/currency/filter.vue b/examples/sites/demos/pc/app/currency/filter.vue
new file mode 100644
index 000000000..6e27f2ef0
--- /dev/null
+++ b/examples/sites/demos/pc/app/currency/filter.vue
@@ -0,0 +1,33 @@
+
+
+
+ 当前选中值:{{ value }}
+
+
+
+
diff --git a/examples/sites/demos/pc/app/currency/webdoc/currency.js b/examples/sites/demos/pc/app/currency/webdoc/currency.js
index 0caa9d58a..dc887c104 100644
--- a/examples/sites/demos/pc/app/currency/webdoc/currency.js
+++ b/examples/sites/demos/pc/app/currency/webdoc/currency.js
@@ -3,134 +3,69 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['basic-usage.vue']
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'disable-currency',
- 'name': { 'zh-CN': '禁用', 'en-US': 'Disabled' },
- 'desc': {
+ demoId: 'disable-currency',
+ name: {
+ 'zh-CN': '禁用',
+ 'en-US': 'Disabled'
+ },
+ desc: {
'zh-CN': '通过 disabled
属性设置组件是否禁用,默认值为 false。
\n',
'en-US':
'The disabled
attribute is used to set whether to disable the component. The default value is false.
\n'
},
- 'codeFiles': ['disable-currency.vue']
+ codeFiles: ['disable-currency.vue']
},
{
- 'demoId': 'custom-service',
- 'name': { 'zh-CN': '自定义服务', 'en-US': 'Custom Service' },
- 'desc': {
+ demoId: 'custom-service',
+ name: {
+ 'zh-CN': '自定义服务',
+ 'en-US': 'Custom Service'
+ },
+ desc: {
'zh-CN':
'通过 fetch-currency
属性可以指定一个方法,在方法中可实现请求自定义的服务。\n通过 clearable
属性设置是否可以清空,默认值为 true。
\n',
'en-US':
'You can use the fetch-currency
attribute to specify a method in which the service customized by the request can be implemented. \n The clearable
attribute is used to set whether data can be cleared. The default value is true.
\n'
},
- 'codeFiles': ['custom-service.vue']
+ codeFiles: ['custom-service.vue']
},
{
- 'demoId': 'size',
- 'name': { 'zh-CN': '设置组件大小', 'en-US': 'Set Component Size' },
- 'desc': {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '设置组件大小',
+ 'en-US': 'Set Component Size'
+ },
+ desc: {
'zh-CN': '可设置为:medium
,small
,mini
\n',
'en-US': ' can be set to medium
, small
, mini
\n'
},
- 'codeFiles': ['size.vue']
- }
- ],
- apis: [
+ codeFiles: ['size.vue']
+ },
{
- 'name': 'currency',
- 'type': 'component',
- 'props': [
- {
- 'name': 'modelValue / v-model',
- 'type': 'string , number',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置下拉框的值。', 'en-US': 'Set the value of the drop-down list box.' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'placeholder',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置输入框内的提示占位文本。',
- 'en-US': 'Set the prompt placeholder text in the text box.'
- },
- 'demoId': 'disable-currency'
- },
- {
- 'name': 'popper-class',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '为 popper 添加类名(可参考 popover 组件)',
- 'en-US': 'Add a class name for the popper. For details, see the popover component.'
- },
- 'demoId': ''
- },
- {
- 'name': 'popper-append-to-body',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 true',
- 'desc': {
- 'zh-CN':
- '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)',
- 'en-US':
- 'Indicates whether to insert the pop-up box to the body element. If an error occurs in locating a fault in the dialog box that is displayed, set this attribute to false (for details, see the select component).'
- },
- 'demoId': ''
- },
- {
- 'name': 'fetch-currency',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义金额查询接口,返回一个Promise对象',
- 'en-US': 'The user-defined amount query interface returns a Promise object.'
- },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'fields',
- 'type': 'object',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义数据映射,在没有使用框架服务时必填',
- 'en-US': 'User-defined data mapping. This parameter is mandatory when the framework service is not used.'
- },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'size',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '输入框尺寸,只在 type!="textarea" 时有效;该属性的可选值为 medium / small / mini',
- 'en-US':
- 'Size of the text box. This parameter is valid only when type!="textarea". The optional values of this attribute are medium / small / mini'
- },
- 'demoId': 'size'
- },
- {
- 'name': 'clearable',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 true',
- 'desc': { 'zh-CN': '是否显示清除按钮;是否可清空', 'en-US': 'Whether to display the Clear button; Clearable' },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'disabled',
- 'type': 'Boolen',
- 'defaultValue': '该属性的默认值为 false',
- 'desc': { 'zh-CN': '禁用', 'en-US': 'Disabled' },
- 'demoId': 'disable-currency'
- }
- ],
- 'events': [],
- 'slots': []
+ demoId: 'filter',
+ name: {
+ 'zh-CN': '过滤器模式',
+ 'en-US': 'Filter'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 filter 属性切换至过滤器模式。 过滤器模式下可传入 label 显示标题,tip 显示提示信息,clearable 是否显示清除按钮。
',
+ 'en-US':
+ 'Use the filter attribute to switch to filter mode. In filter mode, you can pass the label to display the title, tip to display the prompt information, and clearable to display the clear button.
\n'
+ },
+ codeFiles: ['filter.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/date-picker/webdoc/date-picker.js b/examples/sites/demos/pc/app/date-picker/webdoc/date-picker.js
index 10e6a2404..1ffe14640 100644
--- a/examples/sites/demos/pc/app/date-picker/webdoc/date-picker.js
+++ b/examples/sites/demos/pc/app/date-picker/webdoc/date-picker.js
@@ -3,829 +3,260 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': {
+ demoId: 'basic-usage',
+ name: {
'zh-CN': '基本用法',
'en-US': 'Basic usage'
},
- 'desc': {
+ desc: {
'zh-CN': '支持选择日期、日期时间、周、月份、年份。
',
'en-US': 'Support to select date, date time, week, month, year.'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'date-range',
- 'name': {
+ demoId: 'date-range',
+ name: {
'zh-CN': '范围选择',
'en-US': 'Select date range'
},
- 'desc': {
+ desc: {
'zh-CN':
'设置 type
属性为 daterange
/ datetimerange
/ monthrange
/ yearrange
,可以设置以日期范围的形式进行选择。
\n',
'en-US': 'Set type
to daterange
, you can select a date range.
\n'
},
- 'codeFiles': ['date-range.vue']
+ codeFiles: ['date-range.vue']
},
{
- 'demoId': 'dates',
- 'name': {
+ demoId: 'dates',
+ name: {
'zh-CN': '多日期选择',
'en-US': 'Select multiple dates'
},
- 'desc': {
+ desc: {
'zh-CN': '支持选择多个日期和年份。
',
'en-US': 'Support for selecting multiple dates and years.'
},
- 'codeFiles': ['multiple-dates.vue']
+ codeFiles: ['multiple-dates.vue']
},
{
- 'demoId': 'disabled',
- 'name': {
+ demoId: 'disabled',
+ name: {
'zh-CN': '禁用状态',
'en-US': 'Disabled status'
},
- 'desc': {
- 'zh-CN': `
- 通过设置 disabled
为 true 后,禁用日期输入框。
- 通过设置 picker-options
的 disabledDate
属性,可以实现部分禁用,此时只能选择一部分日期。
- 日期输入框默认可以输入日期,设置 editable
为 false 后,将不能输入。
- 通过 readonly
属性设置日期组件是否只读。
- `,
- 'en-US': `
- After setting disabled
to true, disable the date input box.
- Partial disabling can be achieved by setting the disabledDate
property of picker-options
, and only part of the date can be selected at this time.
- You can enter a date by default in the date input box, but it cannot be entered when editable
is set to false.
- Sets whether the date component is read-only through the readonly
property.
- `
+ desc: {
+ 'zh-CN':
+ '\n 通过设置 disabled
为 true 后,禁用日期输入框。
\n 通过设置 picker-options
的 disabledDate
属性,可以实现部分禁用,此时只能选择一部分日期。
\n 日期输入框默认可以输入日期,设置 editable
为 false 后,将不能输入。
\n 通过 readonly
属性设置日期组件是否只读。
\n ',
+ 'en-US':
+ '\n After setting disabled
to true, disable the date input box.
\n Partial disabling can be achieved by setting the disabledDate
property of picker-options
, and only part of the date can be selected at this time.
\n You can enter a date by default in the date input box, but it cannot be entered when editable
is set to false.
\n Sets whether the date component is read-only through the readonly
property.
\n '
},
- 'codeFiles': ['disabled.vue']
+ codeFiles: ['disabled.vue']
},
{
- 'demoId': 'shortcuts',
- 'name': {
+ demoId: 'shortcuts',
+ name: {
'zh-CN': '快捷选项',
'en-US': 'Select the shortcut options'
},
- 'desc': {
- 'zh-CN': `
- 通过在 picker-options
属性中指定 shortcuts
对象数组可以设置快捷选项。
- 通过type: 'startFrom'
设置某日起始,endDate
属性可设置结束日期,endDate
默认为 2099-12-31
。
- 通过type: 'endAt'
设置某日为止,startDate
属性可设置开始日期,startDate
默认为 1970-01-01
。
- 设置某日起始、某日为止时不用传入 onClick
函数,此函数不会被执行。
- `,
- 'en-US': `
- With the picker-options
attribute, which is an object in which you specify an array of shortcuts
objects to set shortcut options.
- By setting type: 'startFrom'
to a certain day, setting type:' endAt'
to a certain day,
- startDate property to set the start date, and the endDate property to set the end date, startDate defaults to 1970-01-01-01. EndDate defaults to 2099-12-31
- to set the start and end of a certain day without passing the onClick function, because this function will not be executed.
- `
+ desc: {
+ 'zh-CN':
+ "\n 通过在 picker-options
属性中指定 shortcuts
对象数组可以设置快捷选项。
\n 通过type: 'startFrom'
设置某日起始,endDate
属性可设置结束日期,endDate
默认为 2099-12-31
。
\n 通过type: 'endAt'
设置某日为止,startDate
属性可设置开始日期,startDate
默认为 1970-01-01
。
\n 设置某日起始、某日为止时不用传入 onClick
函数,此函数不会被执行。
\n ",
+ 'en-US':
+ "\n With the picker-options
attribute, which is an object in which you specify an array of shortcuts
objects to set shortcut options.
\n By setting type: 'startFrom'
to a certain day, setting type:' endAt'
to a certain day,
\n startDate property to set the start date, and the endDate property to set the end date, startDate defaults to 1970-01-01-01. EndDate defaults to 2099-12-31
\n to set the start and end of a certain day without passing the onClick function, because this function will not be executed.
\n "
},
- 'codeFiles': ['shortcuts.vue']
+ codeFiles: ['shortcuts.vue']
},
{
- 'demoId': 'size',
- 'name': {
+ demoId: 'size',
+ name: {
'zh-CN': '尺寸',
'en-US': 'Size'
},
- 'desc': {
+ desc: {
'zh-CN': '通过 size
属性可以设置日期输入框的尺寸,可选值有 medium、small、mini。
\n',
'en-US':
'You can set the size of the date text box through the size
attribute. The options are medium, small, and mini.
\n'
},
- 'codeFiles': ['size.vue']
+ codeFiles: ['size.vue']
},
{
- 'demoId': 'clear',
- 'name': {
+ demoId: 'clear',
+ name: {
'zh-CN': '清除输入',
'en-US': 'Clear Input'
},
- 'desc': {
+ desc: {
'zh-CN':
'选择日期后,鼠标悬停在输入框时,默认会显示清除图标,单击图标可以清除输入框内容。设置 clearable
属性为 false 后,则不显示清除图标,不可清除。通过 clear-icon
属性可以自定义清除图标。
',
'en-US':
'After you select a date, the clear icon is displayed by default when you hover the cursor over the text box. You can click the icon to clear the text box. If clearable
is set to false, the clear icon is not displayed and cannot be cleared. The clear-icon
property allows you to customize the clear icon.
\n'
},
- 'codeFiles': ['clear.vue']
+ codeFiles: ['clear.vue']
},
{
- 'demoId': 'format',
- 'name': {
+ demoId: 'format',
+ name: {
'zh-CN': '格式化',
'en-US': 'Formatting'
},
- 'desc': {
- 'zh-CN': `
- 通过 format
属性设置输入框中显示的日期格式,time-format
属性设置日期选择面板的时间显示格式,value-format
属性设置绑定值的格式。
- `,
- 'en-US': `
- uses the format
attribute to set the format of the text box, and the value-format
attribute to set the format of the bound value. Date Format Attribute List
- Set the time display format of the date selection panel through the time-format
attribute
- `
+ desc: {
+ 'zh-CN':
+ '\n 通过 format
属性设置输入框中显示的日期格式,time-format
属性设置日期选择面板的时间显示格式,value-format
属性设置绑定值的格式。
\n ',
+ 'en-US':
+ '\n uses the format
attribute to set the format of the text box, and the value-format
attribute to set the format of the bound value. Date Format Attribute List
\n Set the time display format of the date selection panel through the time-format
attribute
\n '
},
- 'codeFiles': ['format.vue']
+ codeFiles: ['format.vue']
},
{
- 'demoId': 'default-value',
- 'name': {
+ demoId: 'default-value',
+ name: {
'zh-CN': '默认值',
'en-US': 'Default value'
},
- 'desc': {
- 'zh-CN': `
- default-value
属性指定日期选择器面板打开时默认显示的日期。
\n
- default-time
属性指定时间选择器面板打开时默认显示的时刻,默认值是 00:00:00。default-time
接受一个数组,数组的每一项都为一个字符串,第一项控制起始日期的时刻,第二项控制结束日期的时刻。
\n
- `,
- 'en-US': `
- By default, you can enter a date in the Date text box. If you set editable
to false, you cannot enter a date in the
Date text box.
\n
- When using datetimerange
to set the date range, you can use default-time
to set the start and end time. The default time is 00:00 on the selected date. 00 as the start and end time. default-time
takes an array. Each item in the array is a string. The first item controls the time of the start date and the second item controls the time of the end date.
\n
- `
+ desc: {
+ 'zh-CN':
+ '\n default-value
属性指定日期选择器面板打开时默认显示的日期。
\n\n default-time
属性指定时间选择器面板打开时默认显示的时刻,默认值是 00:00:00。default-time
接受一个数组,数组的每一项都为一个字符串,第一项控制起始日期的时刻,第二项控制结束日期的时刻。
\n\n ',
+ 'en-US':
+ '\n By default, you can enter a date in the Date text box. If you set editable
to false, you cannot enter a date in the
Date text box.
\n\n When using datetimerange
to set the date range, you can use default-time
to set the start and end time. The default time is 00:00 on the selected date. 00 as the start and end time. default-time
takes an array. Each item in the array is a string. The first item controls the time of the start date and the second item controls the time of the end date.
\n\n '
},
- 'codeFiles': ['default-value.vue']
+ codeFiles: ['default-value.vue']
},
{
- 'demoId': 'custom-weeks',
- 'name': {
+ demoId: 'custom-weeks',
+ name: {
'zh-CN': '周次序号',
'en-US': 'Weekly serial number'
},
- 'desc': {
- 'zh-CN': `
- 通过设置 show-week-number
属性为 true
显示周次序号,通过format-weeks
属性设置周次显示格式,format-weeks
函数有两个参数:
-
- - customWeeks:自定义周次的序号
- - weekFirstDays:获取每周次中的首个日期
-
- 通过 picker-options
的 firstDayOfWeek
属性来设置每周的第一天是星期几,默认值是7,也就是星期天。
- `,
- 'en-US': `
- Display the original weekly sequence number through the show-week-number
attribute, and pass in two parameters through the format-weeks
attribute.
- The parameters are set as follows:
- - customWeeks: set the sequence number of the custom week
- weekFirstDays: get the first date of each week
- Set the day of the week on the first day of the week through the firstDayOfWeek
property of picker-options
. The default value is 7, which is Sunday.
- `
+ desc: {
+ 'zh-CN':
+ '\n 通过设置 show-week-number
属性为 true
显示周次序号,通过format-weeks
属性设置周次显示格式,format-weeks
函数有两个参数:
\n \n - customWeeks:自定义周次的序号
\n - weekFirstDays:获取每周次中的首个日期
\n
\n 通过 picker-options
的 firstDayOfWeek
属性来设置每周的第一天是星期几,默认值是7,也就是星期天。
\n ',
+ 'en-US':
+ '\n Display the original weekly sequence number through the show-week-number
attribute, and pass in two parameters through the format-weeks
attribute.
\n The parameters are set as follows:
\n - customWeeks: set the sequence number of the custom week
- weekFirstDays: get the first date of each week
\n Set the day of the week on the first day of the week through the firstDayOfWeek
property of picker-options
. The default value is 7, which is Sunday.
\n '
},
- 'codeFiles': ['custom-weeks.vue']
+ codeFiles: ['custom-weeks.vue']
},
{
- 'demoId': 'filter-mode',
- 'name': {
+ demoId: 'filter-mode',
+ name: {
'zh-CN': '过滤器模式',
'en-US': 'Filter mode'
},
- 'desc': {
+ desc: {
'zh-CN':
'通过 shape="filter"
属性切换至过滤器模式。
过滤器模式下可传入 label 显示标题,tip 显示提示信息,clearable 是否显示清除按钮。
',
'en-US':
"Switch to filter mode through the shape='filter'
attribute.
in filter mode, label display caption can be passed in, tip displays prompt information, and whether clearable displays the clear button.
"
},
- 'codeFiles': ['filter-mode.vue']
+ codeFiles: ['filter-mode.vue']
},
{
- 'demoId': 'label-inside',
- 'name': {
+ demoId: 'label-inside',
+ name: {
'zh-CN': 'label 内置',
'en-US': ''
},
- 'desc': {
+ desc: {
'zh-CN': '通过 label
属性可以设置日期选择器的 label,使其放置在组件的开始位置。
\n',
'en-US': ''
},
- 'codeFiles': ['label-inside.vue']
+ codeFiles: ['label-inside.vue']
},
{
- 'demoId': 'step',
- 'name': {
+ demoId: 'step',
+ name: {
'zh-CN': '步长',
'en-US': 'Step'
},
- 'desc': {
- 'zh-CN': `
- step
和 time-arrow-control
都是当 type 为 datetime、datetimerange 时使用。
- 通过 step
设置步长,默认值为 { hour: 1, minute: 1, second: 1 }
,其中 hour
的设置范围是 0-23
,minute
、second
的设置范围是 0-60
。可单独设置其中的一项或多项值,未设置的默认值为 1
。
- 将 time-arrow-control
设为 true 可以设置通过箭头按钮控制时间选择,默认为通过鼠标滚轮滚动选择时间。
- `,
- 'en-US': `
- step
and time-arrow-control
are used when type is datetime or datetimerange.
- Set the step size through step
. The default value is {hour: 1, minute: 1, second: 1}
, where the setting range of hour
is 0-23
, minute
, second
is 0-60
. One or more of these values can be set separately, and the unset default value is 1
.
- Setting time-arrow-control
to true sets the time selection to be controlled by arrow buttons, and the default is to scroll through the mouse wheel to select time.
- `
+ desc: {
+ 'zh-CN':
+ '\n step
和 time-arrow-control
都是当 type 为 datetime、datetimerange 时使用。
\n 通过 step
设置步长,默认值为 { hour: 1, minute: 1, second: 1 }
,其中 hour
的设置范围是 0-23
,minute
、second
的设置范围是 0-60
。可单独设置其中的一项或多项值,未设置的默认值为 1
。
\n 将 time-arrow-control
设为 true 可以设置通过箭头按钮控制时间选择,默认为通过鼠标滚轮滚动选择时间。
\n ',
+ 'en-US':
+ '\n step
and time-arrow-control
are used when type is datetime or datetimerange.
\n Set the step size through step
. The default value is {hour: 1, minute: 1, second: 1}
, where the setting range of hour
is 0-23
, minute
, second
is 0-60
. One or more of these values can be set separately, and the unset default value is 1
.
\n Setting time-arrow-control
to true sets the time selection to be controlled by arrow buttons, and the default is to scroll through the mouse wheel to select time.
\n '
},
- 'codeFiles': ['step.vue']
+ codeFiles: ['step.vue']
},
{
- 'demoId': 'align',
- 'name': {
+ demoId: 'align',
+ name: {
'zh-CN': '对齐方式',
'en-US': 'Alignment'
},
- 'desc': {
+ desc: {
'zh-CN':
'通过 align
属性可以设置日期选择面板与输入框之间的对齐方式,可选值有 left、right、center,默认为 left 左对齐。
\n',
'en-US':
'You can use the align
attribute to set the alignment mode between the date selection panel and the text box. The options are left, right, and center. The default value is left.
\n'
},
- 'codeFiles': ['align.vue']
+ codeFiles: ['align.vue']
},
{
- 'demoId': 'custom-suffix-icon',
- 'name': {
+ demoId: 'custom-suffix-icon',
+ name: {
'zh-CN': '后置图标',
'en-US': 'Customized rear icon'
},
- 'desc': {
- 'zh-CN': `
- 通过 suffix-icon
属性设置日期输入框后置图标,从 @opentiny/vue-icon
中导入一个图标并进行初始化后传给 suffix-icon
。
- 通过 popper-class
属性可以为 DatePicker 下拉弹框添加 class 类名。
- `,
- 'en-US': `
- Uses the suffix-icon
attribute to set the icon behind the date text box. An icon is imported from the @opentiny/vue-icon
, initialized, and transferred to the suffix-icon
.
- Uses the popper-class
attribute to add the class name to the DatePicker drop-down box
- `
+ desc: {
+ 'zh-CN':
+ '\n 通过 suffix-icon
属性设置日期输入框后置图标,从 @opentiny/vue-icon
中导入一个图标并进行初始化后传给 suffix-icon
。
\n 通过 popper-class
属性可以为 DatePicker 下拉弹框添加 class 类名。
\n ',
+ 'en-US':
+ '\n Uses the suffix-icon
attribute to set the icon behind the date text box. An icon is imported from the @opentiny/vue-icon
, initialized, and transferred to the suffix-icon
.
\n Uses the popper-class
attribute to add the class name to the DatePicker drop-down box
\n '
},
- 'codeFiles': ['custom-suffix-icon.vue']
+ codeFiles: ['custom-suffix-icon.vue']
},
{
- 'demoId': 'unlink-panels',
- 'name': {
+ demoId: 'unlink-panels',
+ name: {
'zh-CN': '面板联动',
'en-US': 'Default time setting when the selector is enabled'
},
- 'desc': {
+ desc: {
'zh-CN':
'范围选择时,默认情况下,在开始日期面板中单击上一月或上一年箭头图标时,结束日期面板中日期也联动切换到上一月或上一年。在结束日期面板中切换下一月或下一年时,开始日期面板也随之联动。但若配置 unlink-panels
属性为 true ,面板之间就不再联动,切换年月时只对当前面板生效。
\n',
'en-US':
'default-value
property specifies the date that is selected by default when the date picker panel opens.
\n'
},
- 'codeFiles': ['unlink-panels.vue']
+ codeFiles: ['unlink-panels.vue']
},
{
- 'demoId': 'timezone',
- 'name': {
+ demoId: 'timezone',
+ name: {
'zh-CN': '时区选择',
'en-US': 'Time Zone Selection'
},
- 'desc': {
- 'zh-CN': `
- 通过 show-timezone
属性可以设置日期选择面板时区选择,同时需要引入 timezoneData 时区数据。
- 通过 isutc8
属性可以设置是否显示为东八区时间。
- `,
- 'en-US': `
- You can set the time zone of the date selection panel through the show-timezone
attribute, and import timezoneData time zone data
- The isutc8
property allows you to set whether it is displayed as East eighth District time.
- `
+ desc: {
+ 'zh-CN':
+ '\n 通过 show-timezone
属性可以设置日期选择面板时区选择,同时需要引入 timezoneData 时区数据。
\n 通过 isutc8
属性可以设置是否显示为东八区时间。
\n ',
+ 'en-US':
+ '\n You can set the time zone of the date selection panel through the show-timezone
attribute, and import timezoneData time zone data
\n The isutc8
property allows you to set whether it is displayed as East eighth District time.
\n '
},
- 'codeFiles': ['timezone.vue']
+ codeFiles: ['timezone.vue']
},
{
- 'demoId': 'validate-event',
- 'name': {
+ demoId: 'validate-event',
+ name: {
'zh-CN': '表单校验',
'en-US': 'Validate event'
},
- 'desc': {
+ desc: {
'zh-CN':
'日期选择器在输入时默认会触发表单校验,触发方式有 blur、change。但若设置 validate-event
属性为 false,将不再触发表单校验。
\n',
'en-US': ''
},
- 'codeFiles': ['validate-event.vue']
+ codeFiles: ['validate-event.vue']
},
{
- 'demoId': 'events',
- 'name': {
+ demoId: 'events',
+ name: {
'zh-CN': '事件',
'en-US': 'Events'
},
- 'desc': {
+ desc: {
'zh-CN':
'支持 focus
、blur
、change
、onPick
事件。
onPick
代表获取选中日期后执行的回调,需要与 daterange
或 datetimerange
类型配合使用才生效,配置在 picker-options
中。
',
'en-US': 'The main events are focus, blur and change.
'
},
- 'codeFiles': ['events.vue']
- }
- ],
- apis: [
- {
- 'name': 'date-picker',
- 'type': 'component',
- 'props': [
- {
- 'name': 'align',
- 'type': "'left' | 'center' | 'right'",
- 'defaultValue': "'left'",
- 'desc': {
- 'zh-CN': '日期选择面板和输入框的对齐方式',
- 'en-US': 'Alignment of the date selection panel and the input box'
- },
- 'demoId': 'align'
- },
- {
- 'name': 'clearable',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否显示清除按钮',
- 'en-US': 'Display Clear Button'
- },
- 'demoId': 'clear'
- },
- {
- 'name': 'clear-icon',
- 'type': 'Component',
- 'defaultValue': 'IconOperationfaild',
- 'desc': {
- 'zh-CN': '自定义清空图标',
- 'en-US': ''
- },
- 'demoId': 'clear'
- },
- {
- 'name': 'default-time',
- 'type': 'string | string[]',
- 'defaultValue': "'00:00:00' | ['00:00:00', '00:00:00']",
- 'desc': {
- 'zh-CN':
- 'type="datetime" 时,default-time 是一个字符串,用于设置选择一个日期后,时间输入框中的默认值;
type="datetimerange" 时,default-time 是一个字符串数组,用于设置选择一个日期范围后,开始和结束时间输入框中的默认值',
- 'en-US': ''
- },
- 'demoId': 'default-value'
- },
- {
- 'name': 'default-value',
- 'type': 'string | Date',
- 'defaultValue': 'new Date()',
- 'desc': {
- 'zh-CN':
- '当选中的日期值为空时,选择器面板打开时默认显示的时间,可以是日期格式或者能被 new Date() 解析的字符串',
- 'en-US':
- 'Use the arrow button to select the time. This parameter is used when type is set to datetime or datetimerange. By default, the time is selected by scrolling the mouse wheel'
- },
- 'demoId': 'default-value'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '禁用',
- 'en-US': 'Disabled'
- },
- 'demoId': 'disabled'
- },
- {
- 'name': 'editable',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '文本框可输入',
- 'en-US': 'The text box can be entered.'
- },
- 'demoId': 'disabled'
- },
- {
- 'name': 'end-placeholder',
- 'type': 'string',
- 'defaultValue': "''",
- 'desc': {
- 'zh-CN': '范围选择时结束日期的占位内容',
- 'en-US': 'Placeholder of the end date when the range is selected'
- },
- 'demoId': 'date-range'
- },
- {
- 'name': 'format',
- 'type': 'string',
- 'defaultValue': "'yyyy-MM-dd'",
- 'desc': {
- 'zh-CN': '显示在输入框中的格式',
- 'en-US': 'Display format in the text box'
- },
- 'demoId': 'format'
- },
- {
- 'name': 'format-weeks',
- 'type': '(customWeeks: number, weekFirstDays: string[]) => string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '格式化周次序号,该回调函数有两个参数,customWeeks 用来获取自定义周次的序号,weekFirstDays 用来获取每周次中的首个日期',
- 'en-US': 'The following table lists the options of the current time and date selector.'
- },
- 'demoId': 'custom-weeks'
- },
- {
- 'name': 'isutc8',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN':
- '默认值为 false,设置为 true 时切换系统默认时区,时间依然显示为东八区时间,适用场景为海外地区显示东八区时间',
- 'en-US':
- 'The default value is false. If this parameter is set to true, the time in GMT+8 is still displayed when the default time zone is switched. Applicable scenario: The GMT+8 time is displayed in regions outside China'
- },
- 'demoId': 'isutc8'
- },
- {
- 'name': 'label',
- 'type': 'string',
- 'defaultValue': "''",
- 'desc': {
- 'zh-CN':
- '设置 shape="filter" 属性之后,代表过滤器模式下显示的标题,单独设置 label 属性可以使 label 放置在组件的开始位置',
- 'en-US':
- 'Optional. When the selected date is empty, the time displayed by default when the selector panel is opened. Set it to a value that can be parsed by new Date().'
- },
- 'demoId': 'filter-mode'
- },
- {
- 'name': 'modelValue / v-model',
- 'type': 'Date | string | number | Array',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '绑定值',
- 'en-US': 'Set the initial value of the calendar component. ;Bound Value'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'name',
- 'type': 'string',
- 'defaultValue': "''",
- 'desc': {
- 'zh-CN': '原生属性',
- 'en-US': ''
- },
- 'demoId': ''
- },
- {
- 'name': 'picker-options',
- 'type': 'IPickerOptions',
- 'typeAnchorName': 'IPickerOptions',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '配置部分禁用、快捷选项等,包含 firstDayOfWeek / disabledDate / onPick / shortcuts 属性,详细用法可参考 IPickerOptions 类型声明',
- 'en-US': "Custom selector's rear icon"
- },
- 'demoId': 'shortcuts'
- },
- {
- 'name': 'placeholder',
- 'type': 'string',
- 'defaultValue': "''",
- 'desc': {
- 'zh-CN': '非范围选择时的占位内容',
- 'en-US': 'Placeholder content for non-range selection'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'popper-append-to-body',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN':
- '是否将弹出框插入至 body 元素,在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)',
- 'en-US':
- 'Indicates whether to insert a pop-up box to the body element. When a fault occurs in the dialog box that is displayed, you can set this attribute to false (for details, see the select component).'
- },
- 'demoId': ''
- },
- {
- 'name': 'popper-class',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '为 DatePicker 下拉弹框添加的 class 类名',
- 'en-US': 'Cancel the linkage between two date panels in the range selector.'
- },
- 'demoId': 'custom-suffix-icon'
- },
- {
- 'name': 'range-separator',
- 'type': 'string',
- 'defaultValue': "'-'",
- 'desc': {
- 'zh-CN': '选择范围时的分隔符',
- 'en-US': 'Custom Clear Icon'
- },
- 'demoId': 'date-range'
- },
- {
- 'name': 'readonly',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '设置日历组件是否只读',
- 'en-US': 'Set whether the calendar component is read-only.'
- },
- 'demoId': 'disabled'
- },
- {
- 'name': 'shape',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '通过 shape="filter" 属性切换至过滤器模式',
- 'en-US': 'Separator for selecting a range'
- },
- 'demoId': 'filter-mode'
- },
- {
- 'name': 'show-timezone',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否开启设置日期选择面板时区选择',
- 'en-US': 'Whether to enable the time zone selection function on the date selection panel'
- },
- 'demoId': 'timezone'
- },
- {
- 'name': 'show-week-number',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否展示周次序号',
- 'en-US': 'Class name added to the DatePicker drop-down list box'
- },
- 'demoId': 'custom-weeks'
- },
- {
- 'name': 'size',
- 'type': "'medium' | 'small' | 'mini'",
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '输入框尺寸',
- 'en-US': 'Text box size; The values of this attribute are medium, small, and mini'
- },
- 'demoId': 'size'
- },
- {
- 'name': 'start-placeholder',
- 'type': 'string',
- 'defaultValue': "''",
- 'desc': {
- 'zh-CN': '范围选择时开始日期的占位内容',
- 'en-US': 'Placeholder of the start date when the range is selected'
- },
- 'demoId': 'date-range'
- },
- {
- 'name': 'step',
- 'type': 'IStep',
- 'typeAnchorName': 'time-picker#IStep',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '设置 type="datetime" 或者 type="datetimerange" 属性之后,可以通过 step 配置时间的步长,step 是一个对象,包含三个属性:hour、minute、second,分别用来配置时、分、秒的步长',
- 'en-US': 'Native attribute'
- },
- 'demoId': 'step'
- },
- {
- 'name': 'suffix-icon',
- 'type': 'Component',
- 'defaultValue': 'IconCalendar',
- 'desc': {
- 'zh-CN': '自定义选择器的后置图标',
- 'en-US': ''
- },
- 'demoId': 'custom-suffix-icon'
- },
- {
- 'name': 'time-arrow-control',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN':
- '通过箭头按钮控制时间选择,当 type 为 datetime、datetimerange 时使用,默认为 通过鼠标滚轮滚动选择时间',
- 'en-US': ''
- },
- 'demoId': 'step'
- },
- {
- 'name': 'time-format',
- 'type': 'string',
- 'defaultValue': "'HH:mm:ss'",
- 'desc': {
- 'zh-CN': '当自定义的 format 格式无法自动区分时间与日期时,可配置该选项用来辅助确定格式',
- 'en-US':
- 'If the user-defined format cannot automatically distinguish the time and date, you can set this parameter to assist in determining the format.'
- },
- 'demoId': 'format'
- },
- {
- 'name': 'tip',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '过滤器模式下显示的提示信息',
- 'en-US':
- 'The specific time of the current day used by the selected date during range selection; The optional value of this attribute is see date format'
- },
- 'demoId': 'filter-mode'
- },
- {
- 'name': 'type',
- 'type': 'IType',
- 'typeAnchorName': 'IType',
- 'defaultValue': "'date'",
- 'desc': {
- 'zh-CN': '显示类型,该属性的可选值可参考 IType 类型声明',
- 'en-US':
- 'Display type; The optional value of this attribute is year / month / dates / week / daterange / date / datetime / datetimerange / monthrange'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'unlink-panels',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '在范围选择器里取消两个日期面板之间的联动',
- 'en-US': ''
- },
- 'demoId': 'unlink-panels'
- },
- {
- 'name': 'validate-event',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '设置日期选择器在输入时是否会触发表单校验',
- 'en-US': ''
- },
- 'demoId': 'validate-event'
- },
- {
- 'name': 'value-format',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '指定绑定值的格式,不指定则绑定值为 Date 对象',
- 'en-US':
- 'Specifies the format of the binding value. If this parameter is not specified, the binding value is Date'
- },
- 'demoId': 'format'
- }
- ],
- 'events': [
- {
- 'name': 'blur',
- 'type': '() => void',
- 'desc': {
- 'zh-CN': '当 input 失去焦点时触发',
- 'en-US': 'This event is triggered when the input loses focus; blur() {\n//do something you want...\n}'
- },
- 'demoId': 'events'
- },
- {
- 'name': 'change',
- 'type': '(value: Date) => void',
- 'desc': {
- 'zh-CN': '用户确认选定的值时触发',
- 'en-US':
- 'This event is triggered when the user confirms the selected value. change (arg1) {//arg1 is the changed date or date set of datepicker}'
- },
- 'demoId': 'events'
- },
- {
- 'name': 'focus',
- 'type': '() => void',
- 'desc': {
- 'zh-CN': '当 input 获得焦点时触发',
- 'en-US':
- 'This event is triggered when the input is focused. focus(arg1}{\n// arg1 = to component vue instance\n//do something you want...\n}'
- },
- 'demoId': 'events'
- }
- ],
- 'slots': [],
- 'methods': [
- {
- 'name': 'focus',
- 'type': '() => void',
- 'desc': {
- 'zh-CN': '使 input 获取焦点',
- 'en-US': 'Enable input to focus.'
- },
- 'demoId': ''
- }
- ],
- 'format': [
- {
- 'name': 'a',
- 'desc': { 'zh-CN': 'am/pm', 'en-US': '' },
- 'demoId': ''
- },
- {
- 'name': 'A',
- 'desc': { 'zh-CN': 'AM/PM', 'en-US': '' },
- 'demoId': ''
- },
- {
- 'name': 'd',
- 'desc': { 'zh-CN': '日,不补0', 'en-US': '' }
- },
- {
- 'name': 'dd',
- 'desc': { 'zh-CN': '日', 'en-US': '' }
- },
- {
- 'name': 'h',
- 'desc': { 'zh-CN': '小时,12小时制,需要和 A 或 a 一起使用,不补0', 'en-US': '' },
- 'demoId': ''
- },
- {
- 'name': 'H',
- 'desc': { 'zh-CN': '小时,24小时制,不补0', 'en-US': '' },
- 'demoId': ''
- },
- {
- 'name': 'hh',
- 'desc': { 'zh-CN': '小时,12小时制,需要和 A 或 a 一起使用', 'en-US': '' },
- 'demoId': ''
- },
- {
- 'name': 'HH',
- 'desc': { 'zh-CN': '小时,24小时制', 'en-US': '' },
- 'demoId': ''
- },
- {
- 'name': 'm',
- 'desc': { 'zh-CN': '分钟,不补0', 'en-US': '' },
- 'demoId': ''
- },
- {
- 'name': 'M',
- 'desc': { 'zh-CN': '月,不补0', 'en-US': '' }
- },
- {
- 'name': 'mm',
- 'desc': { 'zh-CN': '分钟', 'en-US': '' },
- 'demoId': ''
- },
- {
- 'name': 'MM',
- 'desc': { 'zh-CN': '月', 'en-US': '' }
- },
- {
- 'name': 's',
- 'desc': { 'zh-CN': '秒,不补0', 'en-US': '' },
- 'demoId': ''
- },
- {
- 'name': 'ss',
- 'desc': { 'zh-CN': '秒', 'en-US': '' },
- 'demoId': ''
- },
- {
- 'name': 'W',
- 'desc': { 'zh-CN': '周,不补0', 'en-US': '' }
- },
- {
- 'name': 'WW',
- 'desc': { 'zh-CN': '周', 'en-US': '' }
- },
- {
- 'name': 'yyyy',
- 'desc': { 'zh-CN': '年', 'en-US': '' }
- }
- ]
- }
- ],
- 'types': [
- {
- name: 'IPickerOptions',
- type: 'interface',
- code: `
-interface IPickerOptions {
- // 每周的第一天是星期几,默认值是7,也就是星期天
- firstDayOfWeek: number
- // 实现部分禁用,此时只能选择一部分日期
- disabledDate: (time: Date) => boolean
- // 选中日期后执行的回调,需要与 daterange 或 datetimerange 类型配合使用才生效
- onPick: (range: { minDate: Date, maxDate: Date }) => void
- // 快捷选项
- shortcuts: {
- text: string
- onClick: (picker: { $emit: (type: string, date: Date) => void }) => void
- type: 'startFrom' | 'EndAt'
- startDate: Date
- endDate: Date
- }[]
-}
- `
- },
- {
- name: 'IType',
- type: 'type',
- code: `
-type IType = 'date' | 'dates' | 'daterange' | 'datetime' | 'datetimerange' | 'week' | 'month' | 'monthrange' | 'year' | 'years' | 'yearrange'
- `
+ codeFiles: ['events.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/dept/webdoc/dept.js b/examples/sites/demos/pc/app/dept/webdoc/dept.js
index 7ccd2b585..32c1df9f7 100644
--- a/examples/sites/demos/pc/app/dept/webdoc/dept.js
+++ b/examples/sites/demos/pc/app/dept/webdoc/dept.js
@@ -3,272 +3,166 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['basic-usage.vue']
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'dept-events',
- 'name': { 'zh-CN': 'open 和 change 事件', 'en-US': 'open and change events' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['dept-events.vue']
+ demoId: 'dept-events',
+ name: {
+ 'zh-CN': 'open 和 change 事件',
+ 'en-US': 'open and change events'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['dept-events.vue']
},
{
- 'demoId': 'dept-selected',
- 'name': { 'zh-CN': 'selected 事件', 'en-US': 'selected event' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['dept-selected.vue']
+ demoId: 'dept-selected',
+ name: {
+ 'zh-CN': 'selected 事件',
+ 'en-US': 'selected event'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['dept-selected.vue']
},
{
- 'demoId': 'dept-close',
- 'name': { 'zh-CN': 'close 事件', 'en-US': 'close event' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['dept-close.vue']
+ demoId: 'dept-close',
+ name: {
+ 'zh-CN': 'close 事件',
+ 'en-US': 'close event'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['dept-close.vue']
},
{
- 'demoId': 'dept-confirm',
- 'name': { 'zh-CN': 'confirm 事件', 'en-US': 'confirm event' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['dept-confirm.vue']
+ demoId: 'dept-confirm',
+ name: {
+ 'zh-CN': 'confirm 事件',
+ 'en-US': 'confirm event'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['dept-confirm.vue']
},
{
- 'demoId': 'dept-cancel',
- 'name': { 'zh-CN': 'cancel 事件', 'en-US': 'cancel event' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['dept-cancel.vue']
+ demoId: 'dept-cancel',
+ name: {
+ 'zh-CN': 'cancel 事件',
+ 'en-US': 'cancel event'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['dept-cancel.vue']
},
{
- 'demoId': 'size',
- 'name': { 'zh-CN': '设置组件大小', 'en-US': 'Set Component Size' },
- 'desc': {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '设置组件大小',
+ 'en-US': 'Set Component Size'
+ },
+ desc: {
'zh-CN': '可以设置为:medium
,small
,mini
\n',
'en-US': ' can be set to medium
, small
, mini
\n'
},
- 'codeFiles': ['size.vue']
+ codeFiles: ['size.vue']
},
{
- 'demoId': 'before-confirm',
- 'name': { 'zh-CN': '阻止弹框关闭', 'en-US': 'Prevent pop-up dialog box closing' },
- 'desc': {
+ demoId: 'before-confirm',
+ name: {
+ 'zh-CN': '阻止弹框关闭',
+ 'en-US': 'Prevent pop-up dialog box closing'
+ },
+ desc: {
'zh-CN': 'before-confirm(确认前回调事件),方法里面 return true/false,表示是否关闭弹框
\n',
'en-US':
'before-confirm (callback event before confirmation). In the method, return true/false indicates whether to close the dialog box.
\n'
},
- 'codeFiles': ['before-confirm.vue']
+ codeFiles: ['before-confirm.vue']
},
{
- 'demoId': 'auto-select',
- 'name': { 'zh-CN': '部门信息自动选中', 'en-US': 'Department information is automatically selected.' },
- 'desc': {
+ demoId: 'auto-select',
+ name: {
+ 'zh-CN': '部门信息自动选中',
+ 'en-US': 'Department information is automatically selected.'
+ },
+ desc: {
'zh-CN':
'auto-select
默认值为 true,配置该属性为 false 可以阻止当部门信息仅一个时自动补全选中行为。
\n',
'en-US':
'The default value of auto-select
is true. If this parameter is set to false, the system automatically supplements the selected information when there is only one department.
\n'
},
- 'codeFiles': ['auto-select.vue']
+ codeFiles: ['auto-select.vue']
},
{
- 'demoId': 'custom-service',
- 'name': { 'zh-CN': '自定义服务数据', 'en-US': 'Customized Service Data' },
- 'desc': {
+ demoId: 'custom-service',
+ name: {
+ 'zh-CN': '自定义服务数据',
+ 'en-US': 'Customized Service Data'
+ },
+ desc: {
'zh-CN':
'提供 fetch-dept-by-value
、fetch-dept
、fetch-dept-list
属性用于自定义部门服务。
\n',
'en-US':
' provides the fetch-dept-by-value
, fetch-dept, and fetch-dept-list
attributes for customizing department services.
\n'
},
- 'codeFiles': ['custom-service.vue']
+ codeFiles: ['custom-service.vue']
},
{
- 'demoId': 'dynamic-disable',
- 'name': { 'zh-CN': '禁用', 'en-US': 'Disabled' },
- 'desc': {
+ demoId: 'dynamic-disable',
+ name: {
+ 'zh-CN': '禁用',
+ 'en-US': 'Disabled'
+ },
+ desc: {
'zh-CN': '可通过 disabled
设置是否禁用,默认为 fase
\n',
'en-US':
'You can use disabled
to set whether to disable the function. The default value is fase
\n'
},
- 'codeFiles': ['dynamic-disable.vue']
+ codeFiles: ['dynamic-disable.vue']
},
{
- 'demoId': 'title',
- 'name': { 'zh-CN': '设置弹出框标题', 'en-US': 'Set the dialog box title.' },
- 'desc': {
+ demoId: 'title',
+ name: {
+ 'zh-CN': '设置弹出框标题',
+ 'en-US': 'Set the dialog box title.'
+ },
+ desc: {
'zh-CN': '自定义弹出框标题,该属性默认值为空。
\n',
'en-US': 'Customized dialog box title. The default value of this attribute is null.
\n'
},
- 'codeFiles': ['title.vue']
+ codeFiles: ['title.vue']
},
{
- 'demoId': 'slot-hrapprover',
- 'name': { 'zh-CN': '权签人插槽', 'en-US': 'Approval Slot' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['slot-hrapprover.vue']
- }
- ],
- apis: [
- {
- 'name': 'dept',
- 'type': 'component',
- 'props': [
- {
- 'name': 'value',
- 'type': 'string ',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置部门组件的初始化时的显示值。',
- 'en-US': 'Set the display value of the department component during initialization.'
- },
- 'demoId': 'size'
- },
- {
- 'name': 'size',
- 'type': 'string ',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置组件大小', 'en-US': 'Set the component size' },
- 'demoId': 'size'
- },
- {
- 'name': 'title',
- 'type': 'string ',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置弹窗标题', 'en-US': 'Set the pop-up window title.' },
- 'demoId': ''
- },
- {
- 'name': 'disabled',
- 'type': 'Boolen',
- 'defaultValue': '该属性的默认值为 false',
- 'desc': { 'zh-CN': '禁用', 'en-US': 'Disabled' },
- 'demoId': 'dynamic-disable'
- },
- {
- 'name': 'autoSelect',
- 'type': 'Boolen',
- 'defaultValue': '该属性的默认值为 true',
- 'desc': {
- 'zh-CN': '设置当部门信息仅一条数据时时自动补全选中',
- 'en-US':
- 'Specify that when there is only one piece of department information, the system automatically completes the information.'
- },
- 'demoId': 'auto-select'
- },
- {
- 'name': 'fetchDeptList',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义部门列表查询接口,返回一个Promise对象,未使用框架服务时必填',
- 'en-US':
- 'The interface for querying the customized department list returns a Promise object. This parameter is mandatory when the framework service is not used.'
- },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'fetchDeptByValue',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义部门详情查询接口,返回一个Promise对象,未使用框架服务时必填',
- 'en-US':
- 'The interface for querying customized department details returns a Promise object. This parameter is mandatory when the framework service is not used.'
- },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'fetchDept',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义部门搜索查询接口,返回一个Promise对象,未使用框架服务时必填',
- 'en-US':
- 'The interface for querying customized departments returns a Promise object. This parameter is mandatory when the framework service is not used.'
- },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'beforeConfirm',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '确认之前的钩子,若返回 false 或者返回 Promise 且被 reject,则阻止弹框关闭',
- 'en-US': 'If false is returned or Promise is returned and rejected, the dialog box is not closed.'
- },
- 'demoId': 'before-confirm'
- }
- ],
- 'events': [
- {
- 'name': 'confirm',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点击确认按钮触发的事件。',
- 'en-US': 'This event is triggered when the OK button is clicked.'
- },
- 'demoId': 'dept-confirm'
- },
- {
- 'name': 'cancel',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点击取消按钮触发的事件。',
- 'en-US': 'This event is triggered when the Cancel button is clicked.'
- },
- 'demoId': 'dept-cancel'
- },
- {
- 'name': 'selected',
- 'type': 'Function(value)',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点击选中部门触发的事件,回调参数为选中的部门编码。',
- 'en-US':
- 'This event is triggered when you click a selected department. The callback parameter is the selected department code.'
- },
- 'demoId': 'dept-selected'
- },
- {
- 'name': 'open',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点击弹出弹框触发的事件。',
- 'en-US': 'This event is triggered when a user clicks a dialog box that is displayed.'
- },
- 'demoId': 'dept-events'
- },
- {
- 'name': 'change',
- 'type': 'Function(value)',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '选择的部门值改变时触发,回调参数为改变后的部门编码。;value: 改变后的值',
- 'en-US':
- 'This event is triggered when the selected department value changes. The callback parameter is the new department code. ; value: changed value'
- },
- 'demoId': 'dept-events'
- },
- {
- 'name': 'close',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '关闭部门弹出框时触发该事件。',
- 'en-US': 'This event is triggered when a department dialog box is closed.'
- },
- 'demoId': 'dept-close'
- }
- ],
- 'slots': [
- {
- 'name': 'hrapprover',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '权签人', 'en-US': 'Approval' },
- 'demoId': 'slot-hrapprover'
- }
- ]
+ demoId: 'slot-hrapprover',
+ name: {
+ 'zh-CN': '权签人插槽',
+ 'en-US': 'Approval Slot'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['slot-hrapprover.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/detail-page/webdoc/detail-page.js b/examples/sites/demos/pc/app/detail-page/webdoc/detail-page.js
index 9b29fc357..83f948f91 100644
--- a/examples/sites/demos/pc/app/detail-page/webdoc/detail-page.js
+++ b/examples/sites/demos/pc/app/detail-page/webdoc/detail-page.js
@@ -7,142 +7,32 @@ export default {
},
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
- 'zh-CN': `
-
通过 modelValue / v-model
设置要显示的数据。
- 在每个数据对象中可设置 hidden: true
来指定默认隐藏的数据。
- 用户点击组件右上角的图标可以弹出个性化弹窗,弹窗里能选择是否隐藏指定数据。
- `,
- 'en-US': `
-
Sets the data to be displayed with modelValue/v-model
.
- can set hidden: true
in each data object to specify the default hidden data.
- The user clicks the icon in the upper right corner of the component to pop up a personalized popup window, which can choose whether to hide the specified data.
- `
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
},
- 'codeFiles': ['basic-usage.vue']
+ desc: {
+ 'zh-CN':
+ '\n
通过 modelValue / v-model
设置要显示的数据。\n 在每个数据对象中可设置 hidden: true
来指定默认隐藏的数据。\n 用户点击组件右上角的图标可以弹出个性化弹窗,弹窗里能选择是否隐藏指定数据。\n ',
+ 'en-US':
+ '\n
Sets the data to be displayed with modelValue/v-model
. \n can set hidden: true
in each data object to specify the default hidden data. \n The user clicks the icon in the upper right corner of the component to pop up a personalized popup window, which can choose whether to hide the specified data. \n '
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'custom-show-text',
- 'name': { 'zh-CN': '自定义展示文本', 'en-US': 'Custom Text' },
- 'desc': {
+ demoId: 'custom-show-text',
+ name: {
+ 'zh-CN': '自定义展示文本',
+ 'en-US': 'Custom Text'
+ },
+ desc: {
'zh-CN':
'通过 title
、text-split
、dialog-title
、label-title
、value-title
、tips
、save-button
、cancel-button
这些属性可指定表头详情栏组件不同位置的展示文本。
\n',
'en-US':
' via title
, text-split
, dialog-title
, label-title
, value-title The
, tips
, save-button
, and cancel-button
attributes specify the display text in different positions of the header details bar component.
\n'
},
- 'codeFiles': ['custom-show-text.vue']
- }
- ],
- apis: [
- {
- 'name': 'detail-page',
- 'type': 'component',
- 'props': [
- {
- 'name': 'modelValue / v-model',
- 'type': 'IDetailPageItem[]',
- 'typeAnchorName': 'IDetailPageItem',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置表头详情栏的数据', 'en-US': 'Set the data in the table header details column' },
- 'demoId': ''
- },
- {
- 'name': 'title',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': `详情栏标, 默认为 '数据'`,
- 'en-US': `Details field, default value is' Data '`
- },
- 'demoId': 'custom-show-text'
- },
- {
- 'name': 'text-split',
- 'type': 'string',
- 'defaultValue': `'---'`,
- 'desc': {
- 'zh-CN': `详情栏标题分隔符`,
- 'en-US': 'Details column title separator'
- },
- 'demoId': 'custom-show-text'
- },
- {
- 'name': 'dialog-title',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': "个性化弹窗标题,默认为 '个性化标题'",
- 'en-US': "Personalize pop-up title, default is'Personalized title'"
- },
- 'demoId': 'custom-show-text'
- },
- {
- 'name': 'label-title',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': "个性化弹窗表头文本标题栏字段;默认为 '文本字段'",
- 'en-US': "Personalized pop-up window header text title bar field, The default value is 'Title'"
- },
- 'demoId': 'custom-show-text'
- },
- {
- 'name': 'tips',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': "提示不能全部隐藏的提示语,默认为 '不能全部隐藏'",
- 'en-US': "Prompt message that cannot be completely hidden, The default value is 'Cannot hide all' "
- },
- 'demoId': 'custom-show-text'
- },
- {
- 'name': 'value-title',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': "个性化弹窗表头文本操作栏字段,默认为 '勾选隐藏'",
- 'en-US':
- "Personalized pop-up window header text operation column field, The default value is'Click to hide'"
- },
- 'demoId': 'custom-show-text'
- },
- {
- 'name': 'save-button',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': "个性化弹窗确定按钮的文本,默认为 '确定'",
- 'en-US': "Text of the confirmation button in the personalized pop-up window, The default value is'Confirm'"
- },
- 'demoId': 'custom-show-text'
- },
- {
- 'name': 'cancel-button',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': "个性化弹窗取消按钮的文本,默认为 '取消'",
- 'en-US': "Text of the cancel button in the personalized pop-up window, The default value is'Cancel'"
- },
- 'demoId': 'custom-show-text'
- }
- ],
- 'events': [],
- 'slots': []
- }
- ],
- types: [
- {
- name: 'IDetailPageItem',
- type: 'interface',
- code: `interface IDetailPageItem {
- label: string
- value: string
- hidden?: boolean
-}`
+ codeFiles: ['custom-show-text.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/dialog-box/draggable-composition-api.vue b/examples/sites/demos/pc/app/dialog-box/draggable-composition-api.vue
index e98966341..5579d58dd 100644
--- a/examples/sites/demos/pc/app/dialog-box/draggable-composition-api.vue
+++ b/examples/sites/demos/pc/app/dialog-box/draggable-composition-api.vue
@@ -1,6 +1,7 @@
可拖拽弹窗
+ 可编辑拖拽弹窗
+
+
+
+
+
+
dialog-box内容
确 定
@@ -20,10 +28,11 @@
diff --git a/examples/sites/demos/pc/app/dialog-box/draggable.vue b/examples/sites/demos/pc/app/dialog-box/draggable.vue
index 8ab19b565..67b7c162f 100644
--- a/examples/sites/demos/pc/app/dialog-box/draggable.vue
+++ b/examples/sites/demos/pc/app/dialog-box/draggable.vue
@@ -9,7 +9,14 @@
@drag-start="dragStart"
@drag-end="dragEnd"
@drag-move="dragMove"
+ @before-close="beforeClose"
>
+
+
+
+
+
+
dialog-box内容
确 定
@@ -19,15 +26,17 @@
-
-
diff --git a/examples/sites/demos/pc/app/drawer/before-close-composition-api.vue b/examples/sites/demos/pc/app/drawer/before-close-composition-api.vue
new file mode 100644
index 000000000..203e426e1
--- /dev/null
+++ b/examples/sites/demos/pc/app/drawer/before-close-composition-api.vue
@@ -0,0 +1,24 @@
+
+
+ 点击展开 Drawer
+
+ 关闭 Drawer
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/drawer/before-close.spec.ts b/examples/sites/demos/pc/app/drawer/before-close.spec.ts
new file mode 100644
index 000000000..c51021d31
--- /dev/null
+++ b/examples/sites/demos/pc/app/drawer/before-close.spec.ts
@@ -0,0 +1,33 @@
+import { test, expect } from '@playwright/test'
+
+test('拦截弹窗关闭', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('drawer#before-close')
+
+ const drawer = page.locator('.tiny-drawer__main')
+ const message = page.locator('.tiny-modal.type__message')
+
+ await page.getByRole('button', { name: '点击展开 Drawer' }).click()
+ await expect(drawer).toBeVisible()
+
+ // 点击关闭按钮
+ await page.getByRole('button', { name: 'Close' }).click()
+ await expect(message).toContainText('close')
+ await expect(drawer).toBeVisible()
+
+ // 点击遮罩层
+ await page.locator('.tiny-drawer__mask').click()
+ await expect(drawer).toBeVisible()
+
+ // 点击底部确认按钮
+ await page.locator('#before-close').getByRole('button', { name: '确定' }).click()
+ await expect(drawer).toBeVisible()
+
+ // 点击底部取消按钮
+ await page.getByRole('button', { name: '取消' }).click()
+ await expect(drawer).toBeVisible()
+
+ // 自定义关闭方法
+ await page.getByRole('button', { name: '关闭 Drawer' }).click()
+ await expect(drawer).not.toBeVisible()
+})
diff --git a/examples/sites/demos/pc/app/drawer/before-close.vue b/examples/sites/demos/pc/app/drawer/before-close.vue
new file mode 100644
index 000000000..1490d60c7
--- /dev/null
+++ b/examples/sites/demos/pc/app/drawer/before-close.vue
@@ -0,0 +1,39 @@
+
+
+ 点击展开 Drawer
+
+ 关闭 Drawer
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/drawer/confirm-event.spec.ts b/examples/sites/demos/pc/app/drawer/confirm-event.spec.ts
index 423569645..220c501c0 100644
--- a/examples/sites/demos/pc/app/drawer/confirm-event.spec.ts
+++ b/examples/sites/demos/pc/app/drawer/confirm-event.spec.ts
@@ -6,6 +6,6 @@ test('确认事件', async ({ page }) => {
const message = page.locator('.tiny-modal.type__message').filter({ hasText: '确认事件' }).first()
await page.getByRole('button', { name: '确认事件示例' }).click()
- await page.getByRole('button', { name: '确认' }).nth(1).click()
+ await page.getByRole('button', { name: '确定' }).click()
await expect(message).toBeVisible()
})
diff --git a/examples/sites/demos/pc/app/drawer/header-right-slot-composition-api.vue b/examples/sites/demos/pc/app/drawer/header-right-slot-composition-api.vue
index 129c8824d..032fa668e 100644
--- a/examples/sites/demos/pc/app/drawer/header-right-slot-composition-api.vue
+++ b/examples/sites/demos/pc/app/drawer/header-right-slot-composition-api.vue
@@ -1,7 +1,7 @@
头部右侧插槽示例
-
+
自定义头部右侧
diff --git a/examples/sites/demos/pc/app/drawer/header-right-slot.vue b/examples/sites/demos/pc/app/drawer/header-right-slot.vue
index cd2da0a1e..469f7d5b1 100644
--- a/examples/sites/demos/pc/app/drawer/header-right-slot.vue
+++ b/examples/sites/demos/pc/app/drawer/header-right-slot.vue
@@ -1,7 +1,7 @@
头部右侧插槽示例
-
+
自定义头部右侧
diff --git a/examples/sites/demos/pc/app/drawer/webdoc/drawer.js b/examples/sites/demos/pc/app/drawer/webdoc/drawer.js
index 2c48daf74..7b5ec8b7e 100644
--- a/examples/sites/demos/pc/app/drawer/webdoc/drawer.js
+++ b/examples/sites/demos/pc/app/drawer/webdoc/drawer.js
@@ -3,298 +3,213 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': '' },
- 'desc': { 'zh-CN': '详细用法参考如下示例。
', 'en-US': '' },
- 'codeFiles': ['basic-usage.vue']
- },
- {
- 'demoId': 'placement',
- 'name': { 'zh-CN': '抽屉方向', 'en-US': '' },
- 'desc': {
- 'zh-CN': `添加 placement
属性设置抽屉的方向,可选值有 'left' | 'right' | 'top' | 'bottom'
,默认值为 'right'
。
`,
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
'en-US': ''
},
- 'codeFiles': ['placement.vue']
- },
- {
- 'demoId': 'width',
- 'name': { 'zh-CN': '抽屉宽度', 'en-US': '' },
- 'desc': {
- 'zh-CN': '添加width
属性设置抽屉的宽度,默认值为 500px
。
',
+ desc: {
+ 'zh-CN': '详细用法参考如下示例。
',
'en-US': ''
},
- 'codeFiles': ['width.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'dragable',
- 'name': { 'zh-CN': '宽度拖拽功能', 'en-US': '' },
- 'desc': {
+ demoId: 'placement',
+ name: {
+ 'zh-CN': '抽屉方向',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN':
+ "添加 placement
属性设置抽屉的方向,可选值有 'left' | 'right' | 'top' | 'bottom'
,默认值为 'right'
。
",
+ 'en-US': ''
+ },
+ codeFiles: ['placement.vue']
+ },
+ {
+ demoId: 'width',
+ name: {
+ 'zh-CN': '抽屉宽度',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN': '添加 width
属性设置抽屉的宽度,默认值为 500px
。
',
+ 'en-US': ''
+ },
+ codeFiles: ['width.vue']
+ },
+ {
+ demoId: 'dragable',
+ name: {
+ 'zh-CN': '宽度拖拽功能',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN': '添加 dragable
属性开启抽屉宽度拖拽功能,默认值为 false
。
',
'en-US': ''
},
- 'codeFiles': ['dragable.vue']
+ codeFiles: ['dragable.vue']
},
{
- 'demoId': 'mask',
- 'name': { 'zh-CN': '遮罩层显示隐藏', 'en-US': '' },
- 'desc': {
+ demoId: 'mask',
+ name: {
+ 'zh-CN': '遮罩层显示隐藏',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN': '添加 mask
属性可以控制遮罩层显示隐藏,默认值为 true
。
',
'en-US': ''
},
- 'codeFiles': ['mask.vue']
+ codeFiles: ['mask.vue']
},
{
- 'demoId': 'mask-closable',
- 'name': { 'zh-CN': '点击遮罩层关闭抽屉', 'en-US': '' },
- 'desc': {
+ demoId: 'before-close',
+ name: {
+ 'zh-CN': '拦截抽屉关闭',
+ 'en-US': 'Block Drawer Close'
+ },
+ desc: {
+ 'zh-CN':
+ '\n 通过 before-close
属性可以配置一个拦截弹窗关闭的方法。如果方法返回 false
值,则拦截弹窗关闭;否则不拦截。
\n 可以通过该拦截方法传入的参数获取关闭的操作类型 type
弹窗有以下关闭类型:
\n \n - confirm:点击确认时关闭
\n - cancel:点击取消时关闭
\n - close:点击关闭按钮时关闭
\n - mask:点击遮罩层时关闭
\n
\n ',
+ 'en-US':
+ 'The before-close
attribute can be used to configure a method that intercepts closing of the pop-up window. If the method returns a value of false
, then the pop-up window is prevented from closing; otherwise it is not intercepted.
\n The parameter passed through this interception method can be used to obtain the type of closing operation type
for the pop-up window. The following are the types of closing operations:
\n \n - confirm: click confirm button
\n - cancel: click cancel button
\n - close: click close button
\n - mask: click mask
\n
\n '
+ },
+ codeFiles: ['before-close.vue']
+ },
+ {
+ demoId: 'mask-closable',
+ name: {
+ 'zh-CN': '点击遮罩层关闭抽屉',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN':
'默认弹窗打开后,可以单击遮罩层关闭弹窗,设置 mask-closable
为 false
后将禁用该功能,默认值为 true
。
',
'en-US': ''
},
- 'codeFiles': ['mask-closable.vue']
+ codeFiles: ['mask-closable.vue']
},
{
- 'demoId': 'show-close',
- 'name': { 'zh-CN': '关闭图标显示', 'en-US': '' },
- 'desc': { 'zh-CN': 'show-close
控制显示关闭图标,默认值为 true
。
', 'en-US': '' },
- 'codeFiles': ['show-close.vue']
+ demoId: 'show-close',
+ name: {
+ 'zh-CN': '关闭图标显示',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN': 'show-close
控制显示关闭图标,默认值为 true
。
',
+ 'en-US': ''
+ },
+ codeFiles: ['show-close.vue']
},
{
- 'demoId': 'show-header',
- 'name': { 'zh-CN': '头部显示', 'en-US': '' },
- 'desc': { 'zh-CN': 'show-header
控制显示头部,默认值为 true
。
', 'en-US': '' },
- 'codeFiles': ['show-header.vue']
+ demoId: 'show-header',
+ name: {
+ 'zh-CN': '头部显示',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN': 'show-header
控制显示头部,默认值为 true
。
',
+ 'en-US': ''
+ },
+ codeFiles: ['show-header.vue']
},
{
- 'demoId': 'show-footer',
- 'name': { 'zh-CN': '底部显示', 'en-US': '' },
- 'desc': { 'zh-CN': 'show-footer
控制显示底部,默认值为 false
。
', 'en-US': '' },
- 'codeFiles': ['show-footer.vue']
+ demoId: 'show-footer',
+ name: {
+ 'zh-CN': '底部显示',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN': 'show-footer
控制显示底部,默认值为 false
。
',
+ 'en-US': ''
+ },
+ codeFiles: ['show-footer.vue']
},
{
- 'demoId': 'z-index',
- 'name': { 'zh-CN': '自定义堆叠顺序', 'en-US': '' },
- 'desc': {
+ demoId: 'z-index',
+ name: {
+ 'zh-CN': '自定义堆叠顺序',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN':
'可通过 z-index
属性设置自定义堆叠顺序(对于某些特殊场景,比如被遮挡时可能会用到)。
\n',
'en-US': ''
},
- 'codeFiles': ['z-index.vue']
+ codeFiles: ['z-index.vue']
},
{
- 'demoId': 'default-slot',
- 'name': { 'zh-CN': '默认插槽', 'en-US': '' },
- 'desc': { 'zh-CN': '自定义抽屉主体内容。
', 'en-US': '' },
- 'codeFiles': ['default-slot.vue']
- },
- {
- 'demoId': 'header-slot',
- 'name': { 'zh-CN': '头部插槽', 'en-US': '' },
- 'desc': {
- 'zh-CN': '自定义头部内容,当show-header
取值为 true
时有效。
',
+ demoId: 'default-slot',
+ name: {
+ 'zh-CN': '默认插槽',
'en-US': ''
},
- 'codeFiles': ['header-slot.vue']
- },
- {
- 'demoId': 'header-right-slot',
- 'name': { 'zh-CN': '头部右侧插槽', 'en-US': '' },
- 'desc': {
- 'zh-CN': '自定义头部右侧内容,当show-header
取值为 true
时有效。
',
+ desc: {
+ 'zh-CN': '自定义抽屉主体内容。
',
'en-US': ''
},
- 'codeFiles': ['header-right-slot.vue']
+ codeFiles: ['default-slot.vue']
},
{
- 'demoId': 'footer-slot',
- 'name': { 'zh-CN': '底部插槽', 'en-US': '' },
- 'desc': { 'zh-CN': '底部插槽,默认隐藏底部,设置 :show-footer="true"
时有效。
', 'en-US': '' },
- 'codeFiles': ['footer-slot.vue']
+ demoId: 'header-slot',
+ name: {
+ 'zh-CN': '头部插槽',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN': '
自定义头部内容,当 show-header
取值为 true
时有效。
',
+ 'en-US': ''
+ },
+ codeFiles: ['header-slot.vue']
},
{
- 'demoId': 'close-event',
- 'name': { 'zh-CN': '关闭事件', 'en-US': '' },
- 'desc': { 'zh-CN': '关闭抽屉事件。
', 'en-US': '' },
- 'codeFiles': ['close-event.vue']
+ demoId: 'header-right-slot',
+ name: {
+ 'zh-CN': '头部右侧插槽',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN': '自定义头部右侧内容,当 show-header
取值为 true
时有效。
',
+ 'en-US': ''
+ },
+ codeFiles: ['header-right-slot.vue']
},
{
- 'demoId': 'confirm-event',
- 'name': { 'zh-CN': '确认事件', 'en-US': '' },
- 'desc': { 'zh-CN': '确认事件,设置 :show-footer="true"
时有效。
', 'en-US': '' },
- 'codeFiles': ['confirm-event.vue']
- }
- ],
- apis: [
+ demoId: 'footer-slot',
+ name: {
+ 'zh-CN': '底部插槽',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN': '底部插槽,默认隐藏底部,设置 :show-footer="true"
时有效。
',
+ 'en-US': ''
+ },
+ codeFiles: ['footer-slot.vue']
+ },
{
- 'name': 'drawer',
- 'type': 'component',
- 'props': [
- {
- 'name': 'dragable',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '控制抽屉开启或关闭宽度拖拽功能',
- 'en-US': ''
- },
- 'demoId': 'dragable'
- },
- {
- 'name': 'mask',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '控制遮罩层显示隐藏 ',
- 'en-US': ''
- },
- 'demoId': 'mask'
- },
- {
- 'name': 'mask-closable',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '默认弹窗打开后,可以单击遮罩层关闭弹窗,设置 mask-closable 为 false 后将禁用该功能',
- 'en-US': ''
- },
- 'demoId': 'mask-closable'
- },
- {
- 'name': 'placement',
- 'type': "'left' | 'right' | 'top' | 'bottom' ",
- 'defaultValue': "'right'",
- 'desc': {
- 'zh-CN': '添加 placement 属性设置抽屉的方向',
- 'en-US': ''
- },
- 'demoId': 'placement'
- },
- {
- 'name': 'show-close',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '控制关闭图标显示',
- 'en-US': ''
- },
- 'demoId': 'show-close'
- },
- {
- 'name': 'show-footer',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '控制底部显示',
- 'en-US': ''
- },
- 'demoId': 'show-footer'
- },
- {
- 'name': 'show-header',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '控制头部显示',
- 'en-US': ''
- },
- 'demoId': 'show-header'
- },
- {
- 'name': 'visible',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '控制抽屉显示与关闭',
- 'en-US': ''
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'width',
- 'type': 'string',
- 'defaultValue': "'500px'",
- 'desc': {
- 'zh-CN': '设置抽屉的宽度',
- 'en-US': ''
- },
- 'demoId': 'width'
- },
- {
- 'name': 'z-index',
- 'type': 'number',
- 'defaultValue': '2000',
- 'desc': {
- 'zh-CN': '自定义堆叠顺序(对于某些特殊场景,比如被遮挡时可能会用到)',
- 'en-US': ''
- },
- 'demoId': 'z-index'
- }
- ],
- 'events': [
- {
- 'name': 'close',
- 'type': '()=> void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '关闭抽屉事件',
- 'en-US': ''
- },
- 'demoId': 'close-event'
- },
- {
- 'name': 'confirm',
- 'type': '()=> void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '确认事件,设置 :show-footer="true" 时有效',
- 'en-US': ''
- },
- 'demoId': 'confirm-event'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '--',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '默认插槽',
- 'en-US': ''
- },
- 'demoId': 'default-slot'
- },
- {
- 'name': 'footer',
- 'type': '--',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '底部插槽',
- 'en-US': ''
- },
- 'demoId': 'footer-slot'
- },
- {
- 'name': 'header',
- 'type': '--',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '头部插槽',
- 'en-US': ''
- },
- 'demoId': 'header-slot'
- },
- {
- 'name': 'header-right',
- 'type': '--',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '头部右侧插槽',
- 'en-US': ''
- },
- 'demoId': 'header-right-slot'
- }
- ]
+ demoId: 'close-event',
+ name: {
+ 'zh-CN': '关闭事件',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN': '
关闭抽屉事件。
',
+ 'en-US': ''
+ },
+ codeFiles: ['close-event.vue']
+ },
+ {
+ demoId: 'confirm-event',
+ name: {
+ 'zh-CN': '确认事件',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN': '确认事件,设置 :show-footer="true"
时有效。
',
+ 'en-US': ''
+ },
+ codeFiles: ['confirm-event.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/drop-roles/webdoc/drop-roles.js b/examples/sites/demos/pc/app/drop-roles/webdoc/drop-roles.js
index 215bd8bc0..8f17cf8a7 100644
--- a/examples/sites/demos/pc/app/drop-roles/webdoc/drop-roles.js
+++ b/examples/sites/demos/pc/app/drop-roles/webdoc/drop-roles.js
@@ -3,136 +3,55 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['basic-usage.vue']
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'change-role-event',
- 'name': { 'zh-CN': 'change 事件', 'en-US': 'change event' },
- 'desc': {
+ demoId: 'change-role-event',
+ name: {
+ 'zh-CN': 'change 事件',
+ 'en-US': 'change event'
+ },
+ desc: {
'zh-CN': '切换下拉角色时触发 change 事件,需要通过 change 事件回调方法去发送请求。
\n',
'en-US':
'The change event is triggered when the drop-down role is switched. The change event callback method needs to be used to send the request.
\n'
},
- 'codeFiles': ['change-role-event.vue']
+ codeFiles: ['change-role-event.vue']
},
{
- 'demoId': 'size',
- 'name': { 'zh-CN': '设置组件大小', 'en-US': 'Set Component Size' },
- 'desc': {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '设置组件大小',
+ 'en-US': 'Set Component Size'
+ },
+ desc: {
'zh-CN': '可设置为:medium
,small
,mini
\n',
'en-US': ' can be set to medium
, small
, mini
\n'
},
- 'codeFiles': ['size.vue']
+ codeFiles: ['size.vue']
},
{
- 'demoId': 'custom-service',
- 'name': { 'zh-CN': '自定义服务', 'en-US': 'Custom Service' },
- 'desc': {
+ demoId: 'custom-service',
+ name: {
+ 'zh-CN': '自定义服务',
+ 'en-US': 'Custom Service'
+ },
+ desc: {
'zh-CN':
'可通过 fetch-role
和 fetch-current-role
两个方法自定义服务,同时可通过 fields
属性指定显示和绑定值对应的字段。\n可通过 placeholder
展示占位符。
\n',
'en-US':
'You can use the fetch-role
and fetch-current-role
methods to customize services. In addition, you can use the fields
attribute to specify the fields corresponding to the display and binding values. \n You can use placeholder
to display placeholders.
\n'
},
- 'codeFiles': ['custom-service.vue']
- }
- ],
- apis: [
- {
- 'name': 'drop-roles',
- 'type': 'component',
- 'props': [
- {
- 'name': 'modelValue / v-model',
- 'type': 'string , number',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置文本显示的值。;绑定值', 'en-US': 'Sets the text display value. ;Bound Value' },
- 'demoId': 'change-role-event'
- },
- {
- 'name': 'size',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置组件大小', 'en-US': 'Set the component size' },
- 'demoId': 'size'
- },
- {
- 'name': 'placeholder',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置输入框内的提示占位文本。', 'en-US': 'Set the placeholder text in the text box.' },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'popper-class',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '为 popper 添加类名(可参考 popover 组件)',
- 'en-US': 'Add a class name for the popper. For details, see the popover component.'
- },
- 'demoId': ''
- },
- {
- 'name': 'popper-append-to-body',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 true',
- 'desc': {
- 'zh-CN':
- '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)',
- 'en-US':
- 'Indicates whether to insert a pop-up box to the body element. If a fault occurs in locating the fault in the dialog box that is displayed, you can set this attribute to false (for details, see the select component).'
- },
- 'demoId': ''
- },
- {
- 'name': 'fetchRole',
- 'type': 'object',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义获取角色列表接口,未使用框架服务时必填',
- 'en-US':
- 'User-defined API for obtaining the role list. This parameter is mandatory when the framework service is not used.'
- },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'fetchCurrentRole',
- 'type': 'object',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义获取当前用户角色接口,未使用框架服务时必填',
- 'en-US':
- 'User-defined interface for obtaining the role of the current user. This parameter is mandatory when the framework service is not used.'
- },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'fields',
- 'type': 'object',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义数据映射,未使用框架服务时必填',
- 'en-US': 'Customized data mapping. This parameter is mandatory when the framework service is not used.'
- },
- 'demoId': 'custom-service'
- }
- ],
- 'events': [
- {
- 'name': 'change',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当前角色切换后触发',
- 'en-US': 'This event is triggered after the current role is switched.'
- },
- 'demoId': 'change-role-event'
- }
- ],
- 'slots': []
+ codeFiles: ['custom-service.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/drop-times/webdoc/drop-times.js b/examples/sites/demos/pc/app/drop-times/webdoc/drop-times.js
index 3fcdb83dc..efd749f2e 100644
--- a/examples/sites/demos/pc/app/drop-times/webdoc/drop-times.js
+++ b/examples/sites/demos/pc/app/drop-times/webdoc/drop-times.js
@@ -3,140 +3,42 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['basic-usage.vue']
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'start-end-step',
- 'name': { 'zh-CN': '步长与时间区间', 'en-US': 'Step and Time Range' },
- 'desc': {
+ demoId: 'start-end-step',
+ name: {
+ 'zh-CN': '步长与时间区间',
+ 'en-US': 'Step and Time Range'
+ },
+ desc: {
'zh-CN':
'start
设置区间的起始时间,默认为 0 ,end
设置区间的结束时间,默认为 24 * 60 ,step
设置间隔的步长,默认为 15 。
\n',
'en-US':
'start
: indicates the start time of the interval. The default value is 0. end
indicates the end time of the interval. The default value is 24 x 60. step
indicates the step of the interval. The default value is 15.
\n'
},
- 'codeFiles': ['start-end-step.vue']
+ codeFiles: ['start-end-step.vue']
},
{
- 'demoId': 'size',
- 'name': { 'zh-CN': '尺寸', 'en-US': 'Set the size attribute of the component size' },
- 'desc': {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '尺寸',
+ 'en-US': 'Set the size attribute of the component size'
+ },
+ desc: {
'zh-CN': '可设置为:medium,small,mini
\n',
'en-US': 'The value can be medium, small, or mini
\n'
},
- 'codeFiles': ['size.vue']
- }
- ],
- apis: [
- {
- 'name': 'drop-times',
- 'type': 'component',
- 'props': [
- {
- 'name': 'modelValue / v-model',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '绑定值', 'en-US': 'Set the component size. The value can be medium, small, or mini.' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'size',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '输入框尺寸',
- 'en-US': 'Class name added to the DropTimes drop-down list box'
- },
- 'demoId': 'size'
- },
- {
- 'name': 'popper-class',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '为 DropTimes 下拉弹框添加的 class 类名',
- 'en-US':
- 'Indicates whether to insert the pop-up box to the body element. If a fault occurs in locating the fault in the dialog box that is displayed, you can set this attribute to false (for details, see the select component).'
- },
- 'demoId': ''
- },
- {
- 'name': 'popper-append-to-body',
- 'type': 'boolean',
- 'defaultValue': ' true',
- 'desc': {
- 'zh-CN':
- '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)',
- 'en-US': 'Bound Value'
- },
- 'demoId': ''
- },
- {
- 'name': 'placeholder',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置输入框内的提示占位文本',
- 'en-US': 'Set the prompt placeholder text in the text box.'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'end',
- 'type': 'number',
- 'defaultValue': ' 1440',
- 'desc': {
- 'zh-CN': '结束时间,以分钟计算',
- 'en-US': 'End time, in minutes. The default value is 1440.'
- },
- 'demoId': 'start-end-step'
- },
- {
- 'name': 'start',
- 'type': 'number',
- 'defaultValue': ' 0',
- 'desc': {
- 'zh-CN': '开始时间,以分钟计算',
- 'en-US': 'Start time, in minutes. The default value is 0.'
- },
- 'demoId': 'start-end-step'
- },
- {
- 'name': 'step',
- 'type': 'number',
- 'defaultValue': ' 15',
- 'desc': {
- 'zh-CN': '间隔时间,以分钟计算',
- 'en-US': 'Interval, in minutes. The default value is 15.'
- },
- 'demoId': 'start-end-step'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': ' false',
- 'desc': {
- 'zh-CN': '禁用状态',
- 'en-US': 'Disabled state'
- },
- 'demoId': ''
- }
- ],
- 'events': [
- {
- 'name': 'change',
- 'type': '(value: string) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '下拉切换当前时间后触发该事件',
- 'en-US': 'This event is triggered after the current time is switched by the pull-down button.'
- },
- 'demoId': 'basic-usage'
- }
- ],
- 'slots': []
+ codeFiles: ['size.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/dropdown/border-composition-api.vue b/examples/sites/demos/pc/app/dropdown/border-composition-api.vue
new file mode 100644
index 000000000..87a87e9b1
--- /dev/null
+++ b/examples/sites/demos/pc/app/dropdown/border-composition-api.vue
@@ -0,0 +1,58 @@
+
+
+ 场景1:显示边框
+
+
+ 下拉菜单
+
+
+ 黄金糕
+ 狮子头
+ 螺蛳粉
+ 双皮奶
+ 蚵仔煎
+
+
+
+
+
+ 场景2:显示边框并圆角
+
+
+ 下拉菜单
+
+
+ 黄金糕
+ 狮子头
+ 螺蛳粉
+ 双皮奶
+ 蚵仔煎
+
+
+
+
+
+ 场景3:显示边框 + 不显示图标
+
+
+ 下拉菜单
+
+
+ 黄金糕
+ 狮子头
+ 螺蛳粉
+ 双皮奶
+ 蚵仔煎
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/dropdown/border.vue b/examples/sites/demos/pc/app/dropdown/border.vue
new file mode 100644
index 000000000..3227bea63
--- /dev/null
+++ b/examples/sites/demos/pc/app/dropdown/border.vue
@@ -0,0 +1,62 @@
+
+
+ 场景1:显示边框
+
+
+ 下拉菜单
+
+
+ 黄金糕
+ 狮子头
+ 螺蛳粉
+ 双皮奶
+ 蚵仔煎
+
+
+
+
+
+ 场景2:显示边框并圆角
+
+
+ 下拉菜单
+
+
+ 黄金糕
+ 狮子头
+ 螺蛳粉
+ 双皮奶
+ 蚵仔煎
+
+
+
+
+
+ 场景3:显示边框 + 不显示图标
+
+
+ 下拉菜单
+
+
+ 黄金糕
+ 狮子头
+ 螺蛳粉
+ 双皮奶
+ 蚵仔煎
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/dropdown/check-status-composition-api.vue b/examples/sites/demos/pc/app/dropdown/check-status-composition-api.vue
new file mode 100644
index 000000000..db905ae91
--- /dev/null
+++ b/examples/sites/demos/pc/app/dropdown/check-status-composition-api.vue
@@ -0,0 +1,30 @@
+
+
+ 更多
+
+
+
+ 选择一
+ 选择二
+ 选择三
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/dropdown/check-status.vue b/examples/sites/demos/pc/app/dropdown/check-status.vue
new file mode 100644
index 000000000..33a071725
--- /dev/null
+++ b/examples/sites/demos/pc/app/dropdown/check-status.vue
@@ -0,0 +1,34 @@
+
+
+ 更多
+
+
+
+ 选择一
+ 选择二
+ 选择三
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/dropdown/events-composition-api.vue b/examples/sites/demos/pc/app/dropdown/events-composition-api.vue
index 370573f24..42c2db97b 100644
--- a/examples/sites/demos/pc/app/dropdown/events-composition-api.vue
+++ b/examples/sites/demos/pc/app/dropdown/events-composition-api.vue
@@ -57,7 +57,10 @@ const options = [
}
]
-const itemClick = (data) => {
+const itemClick = (data, vm) => {
+ // Aurora主题 item-click 有第二个参数,其他主题只有第一个参数
+ const label = vm?.label || data.vm.label
+
Notify({
type: 'info',
title: 'itemClick 回调事件',
diff --git a/examples/sites/demos/pc/app/dropdown/events.vue b/examples/sites/demos/pc/app/dropdown/events.vue
index 0a16c1e68..ac06df54c 100644
--- a/examples/sites/demos/pc/app/dropdown/events.vue
+++ b/examples/sites/demos/pc/app/dropdown/events.vue
@@ -61,11 +61,14 @@ export default {
}
},
methods: {
- itemClick(data) {
+ itemClick(data, vm) {
+ // Aurora主题 item-click 有第二个参数,其他主题只有第一个参数
+ const label = vm?.label || data.vm.label
+
Notify({
type: 'info',
title: 'itemClick 回调事件',
- message: `使用 dropdown-item 的label属性:${data.vm.label}`,
+ message: `使用 dropdown-item 的label属性:${label}`,
position: 'top-right',
duration: 2000
})
diff --git a/examples/sites/demos/pc/app/dropdown/split-button-composition-api.vue b/examples/sites/demos/pc/app/dropdown/split-button-composition-api.vue
index ca2f536ea..f608da0fc 100644
--- a/examples/sites/demos/pc/app/dropdown/split-button-composition-api.vue
+++ b/examples/sites/demos/pc/app/dropdown/split-button-composition-api.vue
@@ -1,16 +1,36 @@
-
- 更多菜单
-
-
- 黄金糕
- 狮子头
- 螺蛳粉
- 双皮奶
- 蚵仔煎
-
-
-
+
+ 场景1:设置按钮类型
+
+
+ 更多菜单
+
+
+ 黄金糕
+ 狮子头
+ 螺蛳粉
+ 双皮奶
+ 蚵仔煎
+
+
+
+
+
+ 场景2:设置按钮状态
+
+
+ 更多菜单
+
+
+ 黄金糕
+ 狮子头
+ 螺蛳粉
+ 双皮奶
+ 蚵仔煎
+
+
+
+
diff --git a/examples/sites/demos/pc/app/fall-menu/custom-menuitem.vue b/examples/sites/demos/pc/app/fall-menu/custom-menuitem.vue
index 678ad7fdf..f9f26b34d 100644
--- a/examples/sites/demos/pc/app/fall-menu/custom-menuitem.vue
+++ b/examples/sites/demos/pc/app/fall-menu/custom-menuitem.vue
@@ -175,8 +175,8 @@ export default {
{ title: '测试', url: '' },
{ title: '帮助', url: '' },
{ title: '支持', url: '' },
- { title: '示例', url: '' },
- { title: '工具', url: '' },
+ { title: '示例列表', url: '' },
+ { title: '工具列表', url: '' },
{ title: '资源列表', url: '' }
]
}
diff --git a/examples/sites/demos/pc/app/fall-menu/custom-slider-icon-composition-api.vue b/examples/sites/demos/pc/app/fall-menu/custom-slider-icon-composition-api.vue
index 75df41eb6..01bf05bac 100644
--- a/examples/sites/demos/pc/app/fall-menu/custom-slider-icon-composition-api.vue
+++ b/examples/sites/demos/pc/app/fall-menu/custom-slider-icon-composition-api.vue
@@ -167,10 +167,17 @@ const dataset = ref([
{ title: '更新日志', url: '#/zh-CN/guide/changelog' },
{ title: '测试', url: '' },
{ title: '帮助', url: '' },
- { title: '支持', url: '' },
- { title: '示例', url: '' },
- { title: '工具', url: '' },
- { title: '资源列表', url: '' }
+ { title: '支持列表', url: '' },
+ { title: '示例列表', url: '' },
+ { title: '工具列表', url: '' },
+ { title: '测试列表', url: '' },
+ { title: '开发列表', url: '' },
+ { title: '资源列表', url: '' },
+ { title: '测试开发', url: '' },
+ { title: '开发扩容', url: '' },
+ { title: '运维扩容', url: '' },
+ { title: '扩容部署', url: '' },
+ { title: '部署发布', url: '' }
])
const TinyIconLeft = iconLeft()
const TinyIconRight = iconRight()
diff --git a/examples/sites/demos/pc/app/fall-menu/custom-slider-icon.vue b/examples/sites/demos/pc/app/fall-menu/custom-slider-icon.vue
index bb6a1bbb6..d0c1e9c99 100644
--- a/examples/sites/demos/pc/app/fall-menu/custom-slider-icon.vue
+++ b/examples/sites/demos/pc/app/fall-menu/custom-slider-icon.vue
@@ -16,7 +16,6 @@ import { FallMenu } from '@opentiny/vue'
import { IconLeft, IconRight } from '@opentiny/vue-icon'
export default {
- name: 'T-FallMenu',
components: {
FallMenu,
IconLeft: IconLeft(),
@@ -175,10 +174,18 @@ export default {
{ title: '更新日志', url: '#/zh-CN/guide/changelog' },
{ title: '测试', url: '' },
{ title: '帮助', url: '' },
- { title: '支持', url: '' },
- { title: '示例', url: '' },
- { title: '工具', url: '' },
- { title: '资源列表', url: '' }
+ { title: '支持列表', url: '' },
+ { title: '示例列表', url: '' },
+ { title: '工具列表', url: '' },
+ { title: '资源列表', url: '' },
+ { title: '测试列表', url: '' },
+ { title: '开发列表', url: '' },
+ { title: '资源列表', url: '' },
+ { title: '测试开发', url: '' },
+ { title: '开发扩容', url: '' },
+ { title: '运维扩容', url: '' },
+ { title: '扩容部署', url: '' },
+ { title: '部署发布', url: '' }
]
}
}
diff --git a/examples/sites/demos/pc/app/fall-menu/webdoc/fall-menu.js b/examples/sites/demos/pc/app/fall-menu/webdoc/fall-menu.js
index 354e815d6..d9e6a3ea0 100644
--- a/examples/sites/demos/pc/app/fall-menu/webdoc/fall-menu.js
+++ b/examples/sites/demos/pc/app/fall-menu/webdoc/fall-menu.js
@@ -3,92 +3,44 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'data-basic',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'data-basic',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '可通过data
属性设置瀑布菜单数据。',
'en-US': 'Menu data can be set through thedata
attribute.'
},
- 'codeFiles': ['data-resource.vue']
+ codeFiles: ['data-resource.vue']
},
{
- 'demoId': 'custom-slider-icon',
- 'name': { 'zh-CN': '自定义左/右侧图标', 'en-US': 'Customizing Left/Right Icons' },
- 'desc': {
+ demoId: 'custom-slider-icon',
+ name: {
+ 'zh-CN': '自定义左/右侧图标',
+ 'en-US': 'Customizing Left/Right Icons'
+ },
+ desc: {
'zh-CN':
'可通过 left
属性设置插槽自定义左侧切换图标为 IconLeft , right
属性设置插槽右侧切换图标 IconRight 。
\n',
'en-US':
'Use the left
slot to set the left switch icon to IconLeft, and use the right
slot to set the right switch icon to IconRight.
\n'
},
- 'codeFiles': ['custom-slider-icon.vue']
+ codeFiles: ['custom-slider-icon.vue']
},
{
- 'demoId': 'custom-menuitem',
- 'name': { 'zh-CN': '自定义内容', 'en-US': 'Custom Content' },
- 'desc': {
+ demoId: 'custom-menuitem',
+ name: {
+ 'zh-CN': '自定义内容',
+ 'en-US': 'Custom Content'
+ },
+ desc: {
'zh-CN':
'可通过 level1
属性设置插槽自定义一级菜单内容,level2
属性设置插槽自定义二级菜单内容,level3
属性设置插槽自定义三级菜单内容。
\n',
'en-US':
'The level-1 menu content is customized through the level1
slot, the level-2 menu content is customized through the level2
slot, and the level-3 menu content is customized through the level3
slot.
\n'
},
- 'codeFiles': ['custom-menuitem.vue']
- }
- ],
- apis: [
- {
- 'name': 'fall-menu',
- 'type': 'component',
- 'props': [
- {
- 'name': 'data',
- 'type': 'object | object[]',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置瀑布菜单的数据。',
- 'en-US': 'Set the waterfall menu data. ;Set the data of the waterfall menu.'
- },
- 'demoId': 'data-resource'
- }
- ],
- 'events': [],
- 'slots': [
- {
- 'name': 'level1',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '自定义一级菜单', 'en-US': 'User-defined level-1 menu' },
- 'demoId': 'custom-menuitem'
- },
- {
- 'name': 'level2',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '自定义二级菜单', 'en-US': 'Customized level-2 menu' },
- 'demoId': 'custom-menuitem'
- },
- {
- 'name': 'level3',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '自定义三级菜单', 'en-US': 'Customized Level-3 Menu' },
- 'demoId': 'custom-menuitem'
- },
- {
- 'name': 'left',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '自定义左侧切换图标', 'en-US': 'Customize the switch icon on the left.' },
- 'demoId': 'custom-slider-icon'
- },
- {
- 'name': 'right',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '自定义右侧切换图标', 'en-US': 'Customize the switch icon on the right.' },
- 'demoId': 'custom-slider-icon'
- }
- ],
- types: []
+ codeFiles: ['custom-menuitem.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/file-upload/abort-quest-composition-api.vue b/examples/sites/demos/pc/app/file-upload/abort-quest-composition-api.vue
index 4467442e5..24f496ad7 100644
--- a/examples/sites/demos/pc/app/file-upload/abort-quest-composition-api.vue
+++ b/examples/sites/demos/pc/app/file-upload/abort-quest-composition-api.vue
@@ -8,7 +8,7 @@
-
diff --git a/examples/sites/demos/pc/app/file-upload/custom-prefix.spec.ts b/examples/sites/demos/pc/app/file-upload/custom-prefix.spec.ts
new file mode 100644
index 000000000..66e4b0f3d
--- /dev/null
+++ b/examples/sites/demos/pc/app/file-upload/custom-prefix.spec.ts
@@ -0,0 +1,21 @@
+import { test, expect } from '@playwright/test'
+
+test('文件选择前确认', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('file-upload#custom-prefix')
+
+ const upload = page.getByRole('button', { name: '点击上传' })
+
+ await upload.click()
+ await page.locator('.tiny-modal').filter({ hasText: 'beforeAddFile 钩子函数' }).isVisible()
+
+ const confirmBtn = page.getByRole('button', { name: '确认' })
+ const [fileChooser] = await Promise.all([page.waitForEvent('filechooser'), confirmBtn.click()])
+
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
+ const path = require('node:path')
+ const currentPath = path.resolve(__dirname, '测试.jpg')
+
+ await fileChooser.setFiles(currentPath)
+ await page.getByText('测试.jpg').isVisible()
+})
diff --git a/examples/sites/demos/pc/app/file-upload/custom-prefix.vue b/examples/sites/demos/pc/app/file-upload/custom-prefix.vue
new file mode 100644
index 000000000..7fc1082e1
--- /dev/null
+++ b/examples/sites/demos/pc/app/file-upload/custom-prefix.vue
@@ -0,0 +1,77 @@
+
+
+
+ 点击上传
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/file-upload/custom-trigger-composition-api.vue b/examples/sites/demos/pc/app/file-upload/custom-trigger-composition-api.vue
index 2f73bdeb3..1ad9e2491 100644
--- a/examples/sites/demos/pc/app/file-upload/custom-trigger-composition-api.vue
+++ b/examples/sites/demos/pc/app/file-upload/custom-trigger-composition-api.vue
@@ -6,7 +6,7 @@
-
diff --git a/examples/sites/demos/pc/app/file-upload/disabled.vue b/examples/sites/demos/pc/app/file-upload/disabled.vue
index 8e2c3a297..c9f9a0997 100644
--- a/examples/sites/demos/pc/app/file-upload/disabled.vue
+++ b/examples/sites/demos/pc/app/file-upload/disabled.vue
@@ -6,7 +6,7 @@
-
diff --git a/examples/sites/demos/pc/app/file-upload/encrypt-config.spec.ts b/examples/sites/demos/pc/app/file-upload/encrypt-config.spec.ts
new file mode 100644
index 000000000..d940876e4
--- /dev/null
+++ b/examples/sites/demos/pc/app/file-upload/encrypt-config.spec.ts
@@ -0,0 +1,25 @@
+import { test, expect } from '@playwright/test'
+
+test('水印和加密弹窗', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('file-upload#encrypt-config')
+
+ const upload = page.getByRole('button', { name: '点击上传' })
+ const dialogBox = page.locator('.tiny-file-upload > .tiny-dialog-box__wrapper')
+ const header = page.getByText('水印及加密设置')
+ const footer = page.getByRole('button', { name: '选择文件' })
+ const lists = page.locator('.tiny-upload-list__li')
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
+ const path = require('node:path')
+ const currentPath = path.resolve(__dirname, '测试.jpg')
+
+ await upload.click()
+ await dialogBox.isVisible()
+ await header.isVisible()
+ await footer.isVisible()
+ const [fileChooser] = await Promise.all([page.waitForEvent('filechooser'), footer.click()])
+
+ await fileChooser.setFiles(currentPath)
+ await page.getByText('测试.jpg').isVisible()
+ await expect(lists).toHaveText('测试.jpg按 delete 键可删除')
+})
diff --git a/examples/sites/demos/pc/app/file-upload/encrypt-config.vue b/examples/sites/demos/pc/app/file-upload/encrypt-config.vue
new file mode 100644
index 000000000..4b95bc680
--- /dev/null
+++ b/examples/sites/demos/pc/app/file-upload/encrypt-config.vue
@@ -0,0 +1,37 @@
+
+
+ {{ encryptConfig }}
+
+ 点击上传
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/file-upload/file-picture-card-composition-api.vue b/examples/sites/demos/pc/app/file-upload/file-picture-card-composition-api.vue
index 3835990ff..bf3eb54c9 100644
--- a/examples/sites/demos/pc/app/file-upload/file-picture-card-composition-api.vue
+++ b/examples/sites/demos/pc/app/file-upload/file-picture-card-composition-api.vue
@@ -33,7 +33,7 @@
-
diff --git a/examples/sites/demos/pc/app/file-upload/upload-file-list-saas.spec.ts b/examples/sites/demos/pc/app/file-upload/upload-file-list-saas.spec.ts
new file mode 100644
index 000000000..ac9af7df1
--- /dev/null
+++ b/examples/sites/demos/pc/app/file-upload/upload-file-list-saas.spec.ts
@@ -0,0 +1,35 @@
+import { test, expect } from '@playwright/test'
+
+test('SaaS 风格文件列表', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('file-upload#upload-file-list-saas')
+
+ const upload = page.getByRole('button', { name: '文件上传' })
+ const lists = page.locator('div').filter({ hasText: /^test2\.doc删除16\.84M$/ })
+
+ await upload.isVisible()
+ await expect(lists).toHaveCount(2)
+ await page
+ .locator('div')
+ .filter({ hasText: /^test3\.png删除60K\/200K$/ })
+ .first()
+ .isVisible()
+ await page
+ .locator('div')
+ .filter({ hasText: /^test4\.doc删除上传失败$/ })
+ .first()
+ .isVisible()
+ await page
+ .locator('div')
+ .filter({
+ hasText:
+ /^test5超长超长超长超长超长超长超长超长超长超长超长超长超长超长超长超长超长超长超长超长超长超长超长\.doc删除16\.84M$/
+ })
+ .first()
+ .isVisible()
+ await page
+ .locator('div')
+ .filter({ hasText: /^没有文件大小\.doc删除$/ })
+ .first()
+ .isVisible()
+})
diff --git a/examples/sites/demos/pc/app/file-upload/upload-file-list-saas.vue b/examples/sites/demos/pc/app/file-upload/upload-file-list-saas.vue
new file mode 100644
index 000000000..2802233f6
--- /dev/null
+++ b/examples/sites/demos/pc/app/file-upload/upload-file-list-saas.vue
@@ -0,0 +1,76 @@
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/file-upload/upload-file-list-thumb-composition-api.vue b/examples/sites/demos/pc/app/file-upload/upload-file-list-thumb-composition-api.vue
index c1c47c0a3..8a42303fc 100644
--- a/examples/sites/demos/pc/app/file-upload/upload-file-list-thumb-composition-api.vue
+++ b/examples/sites/demos/pc/app/file-upload/upload-file-list-thumb-composition-api.vue
@@ -12,7 +12,7 @@
-
+
+
diff --git a/examples/sites/demos/pc/app/filter-panel/code.spec.ts b/examples/sites/demos/pc/app/filter-panel/code.spec.ts
new file mode 100644
index 000000000..f0d4e9022
--- /dev/null
+++ b/examples/sites/demos/pc/app/filter-panel/code.spec.ts
@@ -0,0 +1,16 @@
+import { test, expect } from '@playwright/test'
+
+test('编码下拉框正常展示', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('filter-panel#code')
+
+ const panel = page.locator('.tiny-filter-panel')
+ const button = panel.locator('.tiny-filter-box')
+
+ await button.click()
+ await page.locator('textarea').isVisible()
+ await page.getByText('支持输入多个值,用分号区隔').isVisible()
+ await page.getByRole('button', { name: '确定' }).isVisible()
+ await page.locator('textarea').fill('111')
+ await page.getByText('编码编码111').isVisible()
+})
diff --git a/examples/sites/demos/pc/app/filter-panel/code.vue b/examples/sites/demos/pc/app/filter-panel/code.vue
new file mode 100644
index 000000000..02e1e5983
--- /dev/null
+++ b/examples/sites/demos/pc/app/filter-panel/code.vue
@@ -0,0 +1,78 @@
+
+
+
+
+ 支持输入多个值,用分号区隔
+
+
+ 确定
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/filter-panel/tip-composition-api.vue b/examples/sites/demos/pc/app/filter-panel/tip-composition-api.vue
index f64bea8be..429a7c241 100644
--- a/examples/sites/demos/pc/app/filter-panel/tip-composition-api.vue
+++ b/examples/sites/demos/pc/app/filter-panel/tip-composition-api.vue
@@ -1,6 +1,9 @@
-
+
+ {{ isBlank ? '透明' : '非透明' }}
+
+
大于
等于
@@ -17,12 +20,15 @@ import {
FilterPanel as TinyFilterPanel,
Radio as TinyRadio,
RadioGroup as TinyRadioGroup,
- Input as TinyInput
+ Input as TinyInput,
+ Switch as TinySwitch
} from '@opentiny/vue'
const tip = ref('请选择物品数量')
const inputVal = ref('')
const radioVal = ref('')
+const isBlank = ref(false)
+
const value = computed(() => {
return radioVal.value + inputVal.value
})
diff --git a/examples/sites/demos/pc/app/filter-panel/tip.vue b/examples/sites/demos/pc/app/filter-panel/tip.vue
index 5f8ac7f23..60e2ed49c 100644
--- a/examples/sites/demos/pc/app/filter-panel/tip.vue
+++ b/examples/sites/demos/pc/app/filter-panel/tip.vue
@@ -1,6 +1,9 @@
-
+
+ {{ isBlank ? '透明' : '非透明' }}
+
+
大于
等于
@@ -12,20 +15,22 @@
diff --git a/examples/sites/demos/pc/app/grid/tree-table/tree-grid-index-checkfield.spec.js b/examples/sites/demos/pc/app/grid/tree-table/tree-grid-index-checkfield.spec.js
new file mode 100644
index 000000000..89865c443
--- /dev/null
+++ b/examples/sites/demos/pc/app/grid/tree-table/tree-grid-index-checkfield.spec.js
@@ -0,0 +1,10 @@
+import { test, expect } from '@playwright/test'
+
+test('树表-选中关联字段', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('grid-tree-table#tree-table-tree-grid-index-checkfield')
+ await page.getByRole('cell', { name: 'GFD科技有限公司' }).getByRole('img').click()
+
+ await expect(page.locator('.tiny-grid-body__row input').nth(0)).toBeChecked()
+ await expect(page.locator('.tiny-grid-body__row input').nth(1)).toBeChecked()
+})
diff --git a/examples/sites/demos/pc/app/grid/tree-table/tree-grid-index-checkfield.vue b/examples/sites/demos/pc/app/grid/tree-table/tree-grid-index-checkfield.vue
new file mode 100644
index 000000000..8a5071c21
--- /dev/null
+++ b/examples/sites/demos/pc/app/grid/tree-table/tree-grid-index-checkfield.vue
@@ -0,0 +1,154 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/grid/validation/before-submit-validation-composition-api.vue b/examples/sites/demos/pc/app/grid/validation/before-submit-validation-composition-api.vue
index 821a083c3..82967d727 100644
--- a/examples/sites/demos/pc/app/grid/validation/before-submit-validation-composition-api.vue
+++ b/examples/sites/demos/pc/app/grid/validation/before-submit-validation-composition-api.vue
@@ -181,7 +181,6 @@ function toolbarButtonClickEvent({ code }) {
TinyModal.alert('校验成功,触发了 then!')
})
.catch((error) => {
- // eslint-disable-next-line no-console
console.log(error)
TinyModal.alert('校验不通过,触发了 catch')
})
@@ -194,7 +193,6 @@ function toolbarButtonClickEvent({ code }) {
TinyModal.alert('校验成功,触发了 then!')
})
.catch((error) => {
- // eslint-disable-next-line no-console
console.log(error)
TinyModal.alert('校验不通过,触发了 catch')
})
diff --git a/examples/sites/demos/pc/app/grid/validation/before-submit-validation.vue b/examples/sites/demos/pc/app/grid/validation/before-submit-validation.vue
index 488ee6213..25d46413a 100644
--- a/examples/sites/demos/pc/app/grid/validation/before-submit-validation.vue
+++ b/examples/sites/demos/pc/app/grid/validation/before-submit-validation.vue
@@ -184,7 +184,6 @@ export default {
TinyModal.alert('校验成功,触发了 then!')
})
.catch((error) => {
- // eslint-disable-next-line no-console
console.log(error)
TinyModal.alert('校验不通过,触发了 catch')
})
@@ -197,7 +196,6 @@ export default {
TinyModal.alert('校验成功,触发了 then!')
})
.catch((error) => {
- // eslint-disable-next-line no-console
console.log(error)
TinyModal.alert('校验不通过,触发了 catch')
})
diff --git a/examples/sites/demos/pc/app/grid/validation/editing-validation-composition-api.vue b/examples/sites/demos/pc/app/grid/validation/editing-validation-composition-api.vue
index 0089cb8d7..8493150a8 100644
--- a/examples/sites/demos/pc/app/grid/validation/editing-validation-composition-api.vue
+++ b/examples/sites/demos/pc/app/grid/validation/editing-validation-composition-api.vue
@@ -6,7 +6,13 @@
:edit-rules="validRules"
>
-
+
diff --git a/examples/sites/demos/pc/app/grid/validation/editing-validation.vue b/examples/sites/demos/pc/app/grid/validation/editing-validation.vue
index 3d1fd2ad2..1e88e1a44 100644
--- a/examples/sites/demos/pc/app/grid/validation/editing-validation.vue
+++ b/examples/sites/demos/pc/app/grid/validation/editing-validation.vue
@@ -6,7 +6,13 @@
:edit-rules="validRules"
>
-
+
diff --git a/examples/sites/demos/pc/app/grid/webdoc/grid-serial-column.js b/examples/sites/demos/pc/app/grid/webdoc/grid-serial-column.js
index 809e5b7c5..3555c2847 100644
--- a/examples/sites/demos/pc/app/grid/webdoc/grid-serial-column.js
+++ b/examples/sites/demos/pc/app/grid/webdoc/grid-serial-column.js
@@ -28,7 +28,7 @@ export default {
'name': { 'zh-CN': '序号列的起始值', 'en-US': 'Start value of the user-defined sequence number column' },
'desc': {
'zh-CN':
- '表格列属性设置 type="index"
显示序号列,start-index
设置自定义序号列的起始值。
\n',
+ '表格列属性设置 type="index"
显示序号列,start-index
设置自定义序号列的起始值;通过 seq-serial
设置序号连续
\n',
'en-US':
'Set the table column attribute type="index"
to display the sequence number column, and start-index
to set the start value of the customized sequence number column.
\n'
},
diff --git a/examples/sites/demos/pc/app/grid/webdoc/grid-tree-table.js b/examples/sites/demos/pc/app/grid/webdoc/grid-tree-table.js
index 95d6c9018..b4c136bcf 100644
--- a/examples/sites/demos/pc/app/grid/webdoc/grid-tree-table.js
+++ b/examples/sites/demos/pc/app/grid/webdoc/grid-tree-table.js
@@ -48,6 +48,17 @@ export default {
},
'codeFiles': ['tree-table/tree-grid-operation-column.vue']
},
+ {
+ 'demoId': 'tree-table-tree-grid-index-checkfield',
+ 'name': { 'zh-CN': '选中关联字段', 'en-US': 'Operation Column' },
+ 'desc': {
+ 'zh-CN':
+ '通过 selectConfig
属性中配置 checkField
为行字段名称,可以将行的选中与该字段关联。被关联字段应该为布尔取值,并且在父子关联时父行初始设置为选中,应保证其所有子行也设置为选中。
',
+ 'en-US':
+ 'In the column, you can set type="radio" to enable single selection and type="selection" to enable multiple selection
\n'
+ },
+ 'codeFiles': ['tree-table/tree-grid-index-checkfield.vue']
+ },
{
'demoId': 'tree-table-set-tree-expansion',
'name': { 'zh-CN': '树节点展开操作', 'en-US': 'Manually expand a specified tree node' },
diff --git a/examples/sites/demos/pc/app/grid/webdoc/grid.js b/examples/sites/demos/pc/app/grid/webdoc/grid.js
index de2731258..0cab63900 100644
--- a/examples/sites/demos/pc/app/grid/webdoc/grid.js
+++ b/examples/sites/demos/pc/app/grid/webdoc/grid.js
@@ -3,3460 +3,28 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'base-basic-usage',
- 'name': { 'zh-CN': '标签式', 'en-US': 'Label' },
- 'desc': {
+ demoId: 'base-basic-usage',
+ name: {
+ 'zh-CN': '标签式',
+ 'en-US': 'Label'
+ },
+ desc: {
'zh-CN': '通过 tiny-grid-column
标签配置表格列。',
'en-US': 'For details, see the following example.'
},
- 'codeFiles': ['base/basic-usage.vue']
+ codeFiles: ['base/basic-usage.vue']
},
{
- 'demoId': 'base-basic-usage-conf',
- 'name': { 'zh-CN': '配置式', 'en-US': 'Profile' },
- 'desc': {
+ demoId: 'base-basic-usage-conf',
+ name: {
+ 'zh-CN': '配置式',
+ 'en-US': 'Profile'
+ },
+ desc: {
'zh-CN': '通过 columns
属性描述表格列。',
'en-US': 'For details, see the following example.'
},
- 'codeFiles': ['base/basic-usage-conf.vue']
- }
- ],
- apis: [
- {
- 'name': 'grid',
- 'type': 'component',
- 'props': [
- {
- 'name': 'pager',
- 'type': 'IPagerConfig',
- 'typeAnchorName': 'IPagerConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '分页配置项',
- 'en-US': ''
- },
- 'demoId': 'grid-pager#pager-inner-pager'
- },
- {
- 'name': 'fetch-data',
- 'type': 'IDataHandler',
- 'typeAnchorName': 'IDataHandler',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '服务端数据查询方法', 'en-US': 'Querying Server Data' },
- 'demoId': 'grid-data-source#data-source-request-service'
- },
- {
- 'name': 'save-data',
- 'type': 'IDataHandler',
- 'typeAnchorName': 'IDataHandler',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '服务端数据保存方法', 'en-US': 'Method of saving server data' },
- 'demoId': 'grid-toolbar#toolbar-save-data'
- },
- {
- 'name': 'delete-data',
- 'type': 'IDataHandler',
- 'typeAnchorName': 'IDataHandler',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '服务端数据删除方法',
- 'en-US': ''
- },
- 'demoId': 'grid-toolbar#toolbar-save-data'
- },
- {
- 'name': 'row-group',
- 'type': 'IRowGroup',
- 'typeAnchorName': 'IRowGroup',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': 'row-group 属性可以配置行分组,行分组会将具有相同值的列进行分组展示',
- 'en-US':
- 'The row group attribute can be configured. Columns with the same value are displayed in a row group.'
- },
- 'demoId': 'grid-row-grouping#row-grouping-row-grouping'
- },
- {
- 'name': 'toolbar',
- 'type': 'IToolbarConfig',
- 'typeAnchorName': 'IToolbarConfig',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '工具栏配置', 'en-US': 'Toolbar configuration' },
- 'demoId': 'grid-toolbar#toolbar-toolbar-op-config'
- },
- {
- 'name': 'align',
- 'type': `'left' | 'center' | 'right'`,
- 'defaultValue': `'left'`,
- 'desc': {
- 'zh-CN': '所有表格列的对齐方式',
- 'en-US':
- 'All column alignment mode; The optional values of this attribute are left (left-aligned), center (center-aligned), and right (right-aligned)'
- },
- 'demoId': 'grid-align#align-grid-align'
- },
- {
- 'name': 'auto-resize',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '父元素响应式监听(对于父元素可能存在动态变化的场景可能会用到)',
- 'en-US':
- 'Parent element responsive listening (This may be used in scenarios where the parent element may have dynamic changes.)'
- },
- 'demoId': 'grid-size#size-auto-height'
- },
- {
- 'name': 'border',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否带有纵向边框', 'en-US': 'Whether there is a vertical border' },
- 'demoId': 'grid-appearance-settings#appearance-settings-grid-border'
- },
- {
- 'name': 'is-before-page-change',
- 'type': 'boolean',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '是否打开页面改变时的前置处理特性。在值为 true 时,翻页操作或者改变页大小操作不会立即生效,留给用户处理业务逻辑,之后通过调用预留的 callback 或者 rollback 使之生效或者失效,详看事件 before-page-change ',
- 'en-US':
- 'Whether to enable the preprocessing feature when the page changes. If the value is true, the page turning operation or page size change operation does not take effect immediately. The service logic is left for the user to process. Then, the reserved callback or rollback is invoked to make the operation take effect or invalid. For details, see the before-page-change event'
- },
- 'demoId': 'grid-event#event-page-before-change-event'
- },
- {
- 'name': 'cell-class-name',
- 'type': 'string | (args: IClassNameArgs) => string',
- 'typeAnchorName': 'IClassNameArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '给单元格附加 className,也可以是函数',
- 'en-US': 'Add a class name to a cell. The class name can also be the Function'
- },
- 'demoId': 'grid-custom-style#custom-style-body-style'
- },
- {
- 'name': 'column-key',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否需要为每一列的 VNode 设置 key 属性(非特殊情况下不需要使用)',
- 'en-US': 'Whether to set the key attribute for VNodes in each column (not required in special cases).'
- },
- 'demoId': ''
- },
- {
- 'name': 'column-min-width',
- 'type': 'number | string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '设置可以调整到的最小宽度,不设置时默认为列头 span 的宽度 + 36(头部固定宽度) ;所有最小列宽度;会自动将剩余空间按比例分配;该属性的可选值为 整数, px,%',
- 'en-US':
- 'Minimum width that can be adjusted. If this parameter is not set, the default value is the width of the column head span plus 36 (fixed width of the head).; all minimum column widths; The remaining space will be allocated in proportion automatically. The optional values of this attribute are integers, px,%'
- },
- 'demoId': 'grid-size#size-column-min-width'
- },
- {
- 'name': 'column-width',
- 'type': 'number | string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '所有列宽度;该属性的可选值为 整数, px,%',
- 'en-US': 'Width of all columns; The optional values of this attribute are integers, px,%'
- },
- 'demoId': 'grid-size#size-column-width'
- },
- {
- 'name': 'context-menu',
- 'type': 'IContextMenuConfig',
- 'typeAnchorName': 'IContextMenuConfig',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '快捷菜单配置项', 'en-US': 'Shortcut menu configuration item' },
- 'demoId': 'grid-context-menu#context-menu-footer-menu'
- },
- {
- 'name': 'edit-rules',
- 'type': 'IValidRules',
- 'typeAnchorName': 'IValidRules',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '校验规则配置项', 'en-US': 'Check rule configuration item' },
- 'demoId': 'grid-validation#validation-editing-validation'
- },
- {
- 'name': 'expand-config',
- 'type': 'IExpandConfig',
- 'typeAnchorName': 'IExpandConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '展开行配置项',
- 'en-US': ''
- },
- 'demoId': 'grid-expand#expand-expand-config'
- },
- {
- 'name': 'fit',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '所有列的宽度是否自撑开',
- 'en-US': 'Whether the widths of all columns are extended automatically.'
- },
- 'demoId': 'grid-size#size-adaptive-column-width'
- },
- {
- 'name': 'footer-align',
- 'type': `'left' | 'center' | 'right'`,
- 'defaultValue': `'left'`,
- 'desc': {
- 'zh-CN': '所有的表尾列的对齐方式',
- 'en-US':
- 'Alignment mode of all table tail columns; The optional values of this attribute are left (left-aligned), center (center-aligned), and right (right-aligned)'
- },
- 'demoId': 'grid-align#align-footer-align'
- },
- {
- 'name': 'optimization',
- 'type': 'IOptimizationConfig',
- 'typeAnchorName': 'IOptimizationConfig',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '表格虚拟滚动的优化配置项', 'en-US': 'Optimize configuration items' },
- 'demoId': 'grid-large-data#large-data-virtual-rolling'
- },
- {
- 'name': 'footer-cell-class-name',
- 'type': 'string | (args: IClassNameArgs) => string',
- 'typeAnchorName': 'IClassNameArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '给表尾的单元格附加 className,也可以是函数',
- 'en-US': 'Add the class name to the cell at the end of the table. The class name can also be the function'
- },
- 'demoId': 'grid-custom-style#custom-style-footer-style'
- },
- {
- 'name': 'footer-method',
- 'type': '({columns: IColumnConfig[], data: IRow[]}) => string[][]',
- 'typeAnchorName': 'IColumnConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '表尾合计的计算方法 columns:所有的列配置数据, data: 当前所有的表格数据',
- 'en-US':
- 'Calculation method of table tail total Function({columns, data});params:{columns: all column configuration data: all table data}'
- },
- 'demoId': 'grid-footer#footer-footer-summation-empty'
- },
- {
- 'name': 'footer-row-class-name',
- 'type': 'string | (args: IClassNameArgs) => string',
- 'typeAnchorName': 'IClassNameArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '给表尾的行附加 className',
- 'en-US': 'Add className to the row at the end of the table'
- },
- 'demoId': 'grid-custom-style#custom-style-footer-style'
- },
- {
- 'name': 'footer-span-method',
- 'type': '(args: ISpanMethodArgs) => { rowspan: number, colspan: number }',
- 'typeAnchorName': 'ISpanMethodArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '表尾合并行或列,该函数返回计算后的值;通过 footer-method 和 footer-span-method 设置表尾合计行或列逻辑 必须配置 show-footer',
- 'en-US': ''
- },
- 'demoId': 'grid-footer#footer-footer-row-or-column-span'
- },
- {
- 'name': 'header-align',
- 'type': `'left' | 'center' | 'right'`,
- 'defaultValue': `'left'`,
- 'desc': {
- 'zh-CN': '所有的表头列的对齐方式',
- 'en-US':
- 'Alignment mode of all table header columns; The optional values of this attribute are left (left-aligned), center (center-aligned), and right (right-aligned)'
- },
- 'demoId': 'grid-align#align-header-align'
- },
- {
- 'name': 'header-cell-class-name',
- 'type': 'string | (args: IClassNameArgs) => string',
- 'typeAnchorName': 'IClassNameArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '给表头的单元格附加 className,也可以是函数',
- 'en-US': 'Add a class name to the cell in the table header. The class name can also be the function'
- },
- 'demoId': 'grid-custom-style#custom-style-header-style'
- },
- {
- 'name': 'header-row-class-name',
- 'type': 'string | (args: IClassNameArgs) => string',
- 'typeAnchorName': 'IClassNameArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '表头的行附加 className,也可以是函数',
- 'en-US': 'Add className to the row in the table header. It can also be the function'
- },
- 'demoId': 'grid-custom-style#custom-style-header-style'
- },
- {
- 'name': 'height',
- 'type': 'number | string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '设置表格内容区域(不含表格头部,底部)的高度。 不设置时,表格内容区域的高度度自适应;表格的高度;支持铺满父容器或者固定宽高;该属性的可选值为 整数, px,%',
- 'en-US':
- 'Set the height of the table content area (excluding the table header and bottom). If this parameter is not set, the height of the table content area is adaptive.; height of table; Supports full parent containers or fixed width and height. The optional values of this attribute are integers, px,%'
- },
- 'demoId': 'grid-size#size-fixed-grid-height'
- },
- {
- 'name': 'highlight-cell',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '只对 editConfig 配置时有效,是否在编辑时高亮单元格边框',
- 'en-US':
- 'This parameter is valid only when editConfig is configured. Whether to highlight the cell border during edit.'
- },
- 'demoId': 'grid-highlight#highlight-highlight-cell'
- },
- {
- 'name': 'highlight-current-column',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否要高亮当前列', 'en-US': 'Do you want to highlight the current column?' },
- 'demoId': 'grid-highlight#highlight-highlight-current-column'
- },
- {
- 'name': 'highlight-current-row',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否要高亮当前行', 'en-US': 'Do you want to highlight the current line?' },
- 'demoId': 'grid-highlight#highlight-highlight-current-row'
- },
- {
- 'name': 'highlight-hover-column',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '鼠标移到列是否要高亮显示',
- 'en-US': 'Do you want to highlight the column when you move the cursor to the column?'
- },
- 'demoId': 'grid-highlight#highlight-highlight-hover-column'
- },
- {
- 'name': 'highlight-hover-row',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '鼠标移到行是否要高亮显示',
- 'en-US': 'Do you want to highlight the line when you move the cursor to the line?'
- },
- 'demoId': 'grid-highlight#highlight-highlight-hover-row'
- },
- {
- 'name': 'keyboard-config',
- 'type': 'IKeyboardConfig',
- 'typeAnchorName': 'IKeyboardConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '按键配置项',
- 'en-US': 'Key configuration item; {isArrow: true //Enable the arrow keys}'
- },
- 'demoId': 'grid-mouse-keyboard#mouse-keyboard-keyboard-navigation'
- },
- {
- 'name': 'loading',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': { 'zh-CN': '表格是否显示加载中', 'en-US': 'Whether the table is being loaded.' },
- 'demoId': 'grid-loading#loading-grid-loading-tip'
- },
- {
- 'name': 'loading-component',
- 'type': 'Component',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '自定义表格 loading ', 'en-US': 'Whether the table is being loaded.' },
- 'demoId': 'grid-loading#loading-grid-custom-loading'
- },
- {
- 'name': 'max-height',
- 'type': 'number | string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '设置表格内容区域(不含表格头部,底部)的最大高度;该属性的可选值为:整数, px,%',
- 'en-US':
- 'Set the maximum height of the table content area (excluding the table header and bottom).; The optional values of this attribute are integers, px,%'
- },
- 'demoId': 'grid-size#size-max-min-grid-height'
- },
- {
- 'name': 'mouse-config',
- 'type': 'IMouseConfig',
- 'typeAnchorName': 'IMouseConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '鼠标配置项',
- 'en-US':
- 'Mouse configuration item; {selected: true //Whether to enable the function of selecting cells by left-clicking. This function is valid only for edit-config.mode=cell. The default value is false.}'
- },
- 'demoId': 'grid-mouse-keyboard#mouse-keyboard-mouse-config'
- },
- {
- 'name': 'radio-config',
- 'type': 'IRadioConfig',
- 'typeAnchorName': 'IRadioConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '单选框配置项',
- 'en-US': ''
- },
- 'demoId': 'grid-operation-column#operation-column-radio-config'
- },
- {
- 'name': 'remote-filter',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '所有列是否使用服务端筛选,如果设置为 true 则不会对数据进行处理',
- 'en-US':
- 'Whether to use server filtering for all columns. If this parameter is set to true, data will not be processed.'
- },
- 'demoId': 'grid-filter#filter-server-filter'
- },
- {
- 'name': 'remote-sort',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否将服务端的全部数据进行排序。默认为 false 不进行服务端排序',
- 'en-US':
- 'Whether to sort all data on the server. The default value is false. The server-side sorting is not performed.'
- },
- 'demoId': 'grid-sort#sort-server-sort'
- },
- {
- 'name': 'resizable',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': { 'zh-CN': '设置是否允许调整列宽', 'en-US': 'Set whether to allow column width adjustment' },
- 'demoId': 'grid-size#size-resize-column-width'
- },
- {
- 'name': 'row-class-name',
- 'type': 'string | (args: IClassNameArgs) => string',
- 'typeAnchorName': 'IClassNameArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '自定义表格行类名,用于自定义表格的行样式的场景。可以直接设置字符串类名,也可以是用函数',
- 'en-US':
- 'User-defined table row class name, which is used in the scenario where the row style of the table is customized. You can set the string class name directly or use the Function.'
- },
- 'demoId': 'grid-custom-style#custom-style-body-style'
- },
- {
- 'name': 'row-id',
- 'type': 'string',
- 'defaultValue': `'_RID'`,
- 'desc': {
- 'zh-CN': '自定义行数据唯一主键的字段名(行数据必须要有唯一主键,默认自动生成)',
- 'en-US':
- 'Field name of the unique primary key of the customized row data (The row data must have a unique primary key, which is automatically generated by default)'
- },
- 'demoId': 'grid-operation-column#operation-column-grid-pager-reserve'
- },
- {
- 'name': 'select-config',
- 'type': 'ISelectConfig',
- 'typeAnchorName': 'ISelectConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '复选框配置项',
- 'en-US': ''
- },
- 'demoId': 'grid-operation-column#operation-column-selection-config'
- },
- {
- 'name': 'show-footer',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否显示表尾合计', 'en-US': 'Display the total at the end of the table' },
- 'demoId': 'grid-footer#footer-footer-summation-empty'
- },
- {
- 'name': 'show-header',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': { 'zh-CN': '是否显示表头', 'en-US': 'Whether to display the table header' },
- 'demoId': 'grid-header#header-hide-grid-header'
- },
- {
- 'name': 'show-header-overflow',
- 'type': `boolean | 'ellipsis' | 'tooltip' | 'title'`,
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '设置表头所有内容过长时显示为省略号;该属性的可选值为 ellipsis(只显示省略号),title(并且显示为原生 title),tooltip(并且显示为 tooltip 提示)',
- 'en-US':
- 'Sets the display of all contents in the table header as ellipsis if the length is too long. The optional values for this property are ellipsis (only the ellipsis is displayed), title (and the native title is displayed), and tooltip (and tooltip is displayed)'
- },
- 'demoId': 'grid-tip#tip-column-header-tip'
- },
- {
- 'name': 'show-overflow',
- 'type': `boolean | 'ellipsis' | 'tooltip' | 'title'`,
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '设置所有内容过长时显示为省略号(如果是固定列建议设置该值,提升渲染速度);该属性的可选值为 ellipsis(只显示省略号),title(并且显示为原生 title),tooltip(并且显示为 tooltip 提示)',
- 'en-US':
- 'Set the display of all content as ellipsis when the content is too long. (If the column is fixed, you are advised to set this parameter to improve the rendering speed.) The optional values for this property are ellipsis (only the ellipsis is displayed), title (and the native title is displayed), tooltip (and the tooltip prompt is displayed)'
- },
- 'demoId': 'grid-tip#tip-cell-tip'
- },
- {
- 'name': 'size',
- 'type': `'medium' | 'small' | 'mini'`,
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '表格的尺寸',
- 'en-US': 'Table size; The options of this attribute are medium, small, and mini'
- },
- 'demoId': 'grid-size#size-grid-size'
- },
- {
- 'name': 'sort-config',
- 'type': 'ISortConfig',
- 'typeAnchorName': 'ISortConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '排序配置项',
- 'en-US': 'Sort configuration items'
- },
- 'demoId': 'grid-sort#sort-default-sort'
- },
- {
- 'name': 'sort-method',
- 'type': '(row1: IRow, row2: IRow)=> boolean',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '自定义所有列的排序方法,当触发排序时会调用该函数返回排序后的结果;自定义排序方法,类似原生的sort排序',
- 'en-US':
- 'Customize the sorting method of all columns. When sorting is triggered, the function is invoked to return the sorting result. User-defined sorting method, similar to the native sort sorting method'
- },
- 'demoId': 'grid-sort#sort-custom-sort'
- },
- {
- 'name': 'span-method',
- 'type': '(args: ISpanMethodArgs) => { rowspan: number, colspan: number }',
- 'typeAnchorName': 'ISpanMethodArgs',
- 'defaultValue': '{ rowspan: 1, colspan: 1 }',
- 'desc': {
- 'zh-CN': '合并行或列,该函数返回计算后的值',
- 'en-US': 'Consolidate rows or columns. This function returns the calculated value.'
- },
- 'demoId': 'grid-span#span-row-span'
- },
- {
- 'name': 'start-index',
- 'type': 'number',
- 'defaultValue': '0',
- 'desc': {
- 'zh-CN': '只对 type=index 的列有效,动态索引的起始值',
- 'en-US':
- 'This parameter is valid only for columns whose type is index. The value of this parameter is the start value of the dynamic index.'
- },
- 'demoId': 'grid-serial-column#serial-column-start-index'
- },
- {
- 'name': 'stripe',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否带有斑马纹', 'en-US': 'Zebra pattern' },
- 'demoId': 'grid-appearance-settings#appearance-settings-stripe'
- },
- {
- 'name': 'sync-resize',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '响应式跟随某个属性(对于通过某个属性来控制显示/隐藏切换的场景可能会用到)',
- 'en-US':
- 'Responsively follow an attribute. (This may be used in scenarios where the display/hide switchover is controlled by an attribute)'
- },
- 'demoId': ''
- },
- {
- 'name': 'tree-config',
- 'type': 'ITreeConfig',
- 'typeAnchorName': 'ITreeConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '树形结构配置项',
- 'en-US': 'tree structure configuration item'
- },
- 'demoId': 'grid-tree-table#tree-table-tree-grid-base'
- },
- {
- 'name': 'valid-config',
- 'type': 'IValidConfig',
- 'typeAnchorName': 'IValidConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '校验配置项',
- 'en-US': 'Check configuration items'
- },
- 'demoId': 'grid-validation#validation-bubbling'
- },
- {
- 'name': 'summary-config',
- 'type': 'ISummaryConfig',
- 'typeAnchorName': 'ISummaryConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '表格统计功能配置项',
- 'en-US': 'Configuration item of the table statistics function'
- },
- 'demoId': 'grid-footer#footer-configuration-summary'
- },
- {
- 'name': 'sortable',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '设置是否允许列数据排序。默认为 true 可排序',
- 'en-US': 'Whether to allow column data sorting. The default value is true, which can be sorted.'
- },
- 'demoId': 'grid-sort#sort-default-sort'
- },
- {
- 'name': 'auto-load',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': { 'zh-CN': '是否开启自动请求服务,配置 fetch-data 时有效', 'en-US': '' },
- 'demoId': 'grid-data-source#data-source-auto-load'
- },
- {
- 'name': 'is-async-column',
- 'type': 'boolean',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '设置表格的列是否延迟加载;是否开启异步列功能,配合 scrollLoad 一起使用',
- 'en-US':
- 'Sets whether to delay the loading of columns in the table. Indicates whether to enable the asynchronous column function. This parameter is used together with scrollLoad'
- },
- 'demoId': 'grid-data-source#data-source-column-asyn-rendering'
- },
- {
- 'name': 'columns',
- 'type': 'IColumnConfig[]',
- 'typeAnchorName': 'IColumnConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '表格列的配置信息,具体参考列配置项',
- 'en-US': 'Configuration information of the table column. For details, see the column configuration items.'
- },
- 'demoId': 'grid-data-source#data-source-columns'
- },
- {
- 'name': 'row-span',
- 'type': '{ field: string }[]',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '设置行合并,该属性仅适用于普通表格,不可与 tree-config 同时使用',
- 'en-US':
- 'Set row combination. This attribute applies only to common tables and cannot be used together with tree-config.'
- },
- 'demoId': 'grid-span#span-row-span-easy'
- },
- {
- 'name': 'render-empty',
- 'type': '()=> string | VNode',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '空数据渲染', 'en-US': 'Render empty data' },
- 'demoId': 'grid-empty#empty-empty-data-tip'
- },
- {
- 'name': 'events',
- 'type': 'IEventsConfig',
- 'typeAnchorName': 'IEventsConfig',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '事件对象', 'en-US': 'Event object' },
- 'demoId': 'grid-event#event-grid-events'
- },
- {
- 'name': 'data',
- 'type': 'Row[]',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '设置表格的数据', 'en-US': 'Set table data.' },
- 'demoId': 'grid-data-source#data-source-static-data'
- },
- {
- 'name': 'min-height',
- 'type': 'number | string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '设置表格内容区域(不含表格头部,底部)的最小高度。',
- 'en-US': 'Set the minimum height of the table content area (excluding the table header and bottom).'
- },
- 'demoId': 'grid-size#size-max-min-grid-height'
- },
- {
- 'name': 'drop-config',
- 'type': 'IDropConfig',
- 'typeAnchorName': 'IDropConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '表格拖拽配置项',
- 'en-US': 'Drag configuration items in a table'
- },
- 'demoId': 'grid-drag#drag-row-drag'
- },
- {
- 'name': 'edit-config',
- 'type': 'IEditConfig',
- 'typeAnchorName': 'IEditConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '表格编辑配置项',
- 'en-US': 'Configuration item for editing the table'
- },
- 'demoId': 'grid-editor#editor-inner-editor'
- },
- {
- 'name': 'seq-serial',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '设置行序号是否连续,开启分页时有效, seqSerial 当 showSeq 为 true 时有效',
- 'en-US':
- 'Whether to set the row sequence number consecutive. This parameter is valid only when showSeq is set to true.'
- },
- 'demoId': 'grid-pager#pager-inner-pager'
- },
- {
- 'name': 'show-save-msg',
- 'type': 'boolean',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '切换分页时有未保存的数据时是否进行提示',
- 'en-US': 'Whether to display a prompt when there is unsaved data during page switching.'
- },
- 'demoId': 'grid-pager#pager-show-save-msg'
- },
- {
- 'name': 'tooltip-config',
- 'type': 'IToolTipConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': 'Grid 内置 tooltip 配置项,请参考 Tooltip 组件属性说明',
- 'en-US':
- 'Configuration item of the built-in tooltip of the Grid. For details, see the Tooltip Attribute Description.'
- },
- 'demoId': 'grid-tip#tip-cell-tip-config'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '默认插槽(表格列)',
- 'en-US': 'Default slot (Table column)'
- },
- 'demoId': 'grid-slot#slot-default-slot'
- },
- {
- 'name': 'toolbar',
- 'type': '',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '工具栏,(包含:缩放、个性化、刷新表格、自定义按钮)',
- 'en-US': 'Toolbar, (Includes: Zoom, Personalize, Refresh Table, and Custom Buttons)'
- },
- 'demoId': 'grid-slot#slot-buttons-slot'
- },
- {
- 'name': 'empty',
- 'type': '',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '空数据时显示的文本内容', 'en-US': 'Text content displayed when the data is empty' },
- 'demoId': 'grid-slot#slot-empty-slot'
- }
- ],
- 'methods': [
- {
- 'name': 'clearActived',
- 'type': '()=> void',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '手动清除单元格激活状态', 'en-US': 'Manually clear cell activation status' },
- 'demoId': 'grid-edit#edit-has-row-change'
- },
- {
- 'name': 'clearAll',
- 'type': '()=> void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '手动清除表格所有条件,还原到初始状态(对于增删改查的场景中可能会用到,比如在数据保存之后清除表格缓存)',
- 'en-US':
- 'Manually clear all conditions in the table and restore the table to the initial state. (This may be used in the scenario of adding, deleting, modifying, and querying, for example, clearing the table cache after data is saved.)'
- },
- 'demoId': 'grid-toolbar#toolbar-insert-delete-update'
- },
- {
- 'name': 'clearCurrentColumn',
- 'type': '()=> void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '用于当前列,手动清空当前高亮的状态',
- 'en-US': 'This command is used to manually clear the current highlighted status.'
- },
- 'demoId': 'grid-highlight#highlight-highlight-current-column'
- },
- {
- 'name': 'clearCurrentRow',
- 'type': '()=> void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '用于当前行,手动清空当前高亮的状态',
- 'en-US': 'For the current line. Manually clear the highlighted status.'
- },
- 'demoId': 'grid-highlight#highlight-highlight-current-row'
- },
- {
- 'name': 'clearData',
- 'type': '(rows?: IRow | IRow[], field?: string)=> void',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '手动清空单元格内容,如果不传参数,则清空整个表格内容,如果传了行则清空指定行内容,如果传了指定字段,则清空该字段内容',
- 'en-US':
- 'Manually clear the cell content. If no parameter is transferred, the entire table content is cleared. If a row is transferred, the specified row content is cleared. If a specified field is transferred, the field content is cleared.'
- },
- 'demoId': 'grid-toolbar#toolbar-clear-data'
- },
- {
- 'name': 'clearFilter',
- 'type': '(field: string)=> void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '手动清空筛选条件(如果不传 field 则清空所有筛选条件),数据会恢复成未筛选的状态',
- 'en-US':
- 'Manually clear the filter criteria (if field is not transferred, all filter criteria are cleared). Data will be restored to the unfiltered state.'
- },
- 'demoId': 'grid-filter#filter-default-filter'
- },
- {
- 'name': 'clearRadioRow',
- 'type': '()=> void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '用于单选行,手动清空用户的选择',
- 'en-US': 'This is used to select a single row. Manually clear the user selection.'
- },
- 'demoId': 'grid-operation-column#operation-column-clear-and-set-radio-row'
- },
- {
- 'name': 'clearRowExpand',
- 'type': '()=> void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '手动清空展开行状态,数据会恢复成未展开的状态',
- 'en-US': 'Manually clear the expanded row status. The data will be restored to the unexpanded state.'
- },
- 'demoId': 'grid-expand#expand-set-row-expansion'
- },
- {
- 'name': 'clearScroll',
- 'type': '()=> void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '手动清除滚动相关信息,还原到初始状态',
- 'en-US': 'Manually clear scrolling information and restore the original state.'
- },
- 'demoId': 'grid-size#size-max-min-grid-height'
- },
- {
- 'name': 'clearSelected',
- 'type': '()=> void',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '手动清除单元格选中状态', 'en-US': 'Clear cell selection manually' },
- 'demoId': 'grid-highlight#highlight-highlight-cell'
- },
- {
- 'name': 'clearSelection',
- 'type': '()=> void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '用于多选行,手动清空用户的选择',
- 'en-US': 'For selecting multiple lines. Manually clear the user selection.'
- },
- 'demoId': 'grid-operation-column#operation-column-selection-operation'
- },
- {
- 'name': 'clearSort',
- 'type': '()=> void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '手动清空排序条件,数据会恢复成未排序的状态',
- 'en-US': 'Manually clear the sorting conditions. Data will be restored to the unsorted state.'
- },
- 'demoId': 'grid-sort#sort-default-sort'
- },
- {
- 'name': 'clearTreeExpand',
- 'type': '()=> void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '手动清空树形节点的展开状态,数据会恢复成未展开的状态',
- 'en-US':
- 'Manually clear the expanded state of the tree node. The data will be restored to the un-folded state.'
- },
- 'demoId': 'grid-tree-table#tree-table-tree-grid-insert-delete-update'
- },
- {
- 'name': 'closeFilter',
- 'type': '()=> void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '手动关闭筛选面板(某些特殊场景可能会用到)',
- 'en-US': 'Manually close the filter panel (which may be used in some special scenarios)'
- },
- 'demoId': 'grid-filter#filter-default-filter'
- },
- {
- 'name': 'closeMenu',
- 'type': '()=> void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '手动关闭快捷菜单(某些特殊场景可能会用到)',
- 'en-US': 'Manually close the shortcut menu (which may be used in some special scenarios)'
- },
- 'demoId': 'grid-context-menu#context-menu-cell-menu'
- },
- {
- 'name': 'createRow',
- 'type': '(records: IRow | IRow[])=> Promise',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '创建 IRow | IRows 对象(对于某些特殊场景需要对数据进行手动插入时可能会用到)',
- 'en-US':
- 'Create a IRow | IRows object. (This method may be used when data needs to be manually inserted in some special scenarios.)'
- },
- 'demoId': 'grid-tree-table#tree-table-tree-grid-insert-delete-update'
- },
- {
- 'name': 'exportCsv',
- 'type': '(options: IExportCsvOptions)=> void',
- 'typeAnchorName': 'IExportCsvOptions',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '将表格数据导出为 .csv 文件(支持所有主流的浏览器,不支持合并行或列)',
- 'en-US':
- 'Exports table data to a .csv file. (All mainstream browsers are supported. IRows or columns cannot be combined.)'
- },
- 'demoId': 'grid-import-export#import-export-export-excel'
- },
- {
- 'name': 'fullValidate',
- 'type': '(rows: IRow[], callback: ()=> void)=> Promise',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '表格完整校验函数,和 validate 的区别就是会对全量数据的所有规则进行完整校验',
- 'en-US':
- 'Complete table verification function. The difference between this function and validate is that all rules of full data are verified.'
- },
- 'demoId': 'grid-validation#validation-before-submit-validation'
- },
- {
- 'name': 'getActiveRow',
- 'type': '()=> IRow',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '获取已激活的行数据', 'en-US': 'Obtain activated row data' },
- 'demoId': 'grid-edit#edit-trigger-mode-hm-editing'
- },
- {
- 'name': 'getColumnByField',
- 'type': '(field: string)=> IColumnConfig',
- 'typeAnchorName': 'IColumnConfig',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '根据列的字段名获取列', 'en-US': 'Obtain columns based on column field names.' },
- 'demoId': 'grid-large-data#large-data-scroll-to'
- },
- {
- 'name': 'getColumnById',
- 'type': '(colid: string)=> IColumnConfig',
- 'typeAnchorName': 'IColumnConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '根据列的唯一主键获取列',
- 'en-US': 'Obtain a column based on the unique primary key of the column.'
- },
- 'demoId': ''
- },
- {
- 'name': 'getColumnIndex',
- 'type': '(column: IColumnConfig)=> number',
- 'typeAnchorName': 'IColumnConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '根据 column 获取相对于 columns 中的索引',
- 'en-US': 'Obtain the index relative to the column based on the column.'
- },
- 'demoId': ''
- },
- {
- 'name': 'getColumnNode',
- 'type': '(cell: HTMLElement)=> IColumnConfig',
- 'typeAnchorName': 'IColumnConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '根据 th/td 元素获取对应的 column 信息',
- 'en-US': 'Obtain the column information based on the th/td element.'
- },
- 'demoId': ''
- },
- {
- 'name': 'getColumns',
- 'type': '(columnIndex?: number)=> IColumnConfig | IColumnConfig[]',
- 'typeAnchorName': 'IColumnConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '获取表格的可视列,也可以指定索引获取列',
- 'en-US': 'Obtains the visual column of the table or specifies the index to obtain the column.'
- },
- 'demoId': 'grid-custom#custom-server-storage'
- },
- {
- 'name': 'getCurrentRow',
- 'type': '()=> IRow',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '用于当前行,获取当前行的数据',
- 'en-US': 'This is used for the current row to obtain the data of the current row.'
- },
- 'demoId': 'grid-event#event-get-row-method'
- },
- {
- 'name': 'getData',
- 'type': '(rowIndex?: number)=> IRow | IRow[]',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '获取数据,和 data 的行为一致,也可以指定索引获取数据',
- 'en-US':
- 'The behavior of obtaining data is the same as that of data. You can also specify an index to obtain data.'
- },
- 'demoId': 'grid-toolbar#toolbar-clear-data'
- },
- {
- 'name': 'getInsertRecords',
- 'type': '()=> IRow[]',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '获取新增的数据', 'en-US': 'Obtain the new data' },
- 'demoId': 'grid-toolbar#toolbar-insert-delete-update'
- },
- {
- 'name': 'getRadioRow',
- 'type': '()=> IRow',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '用于单选行,获取当已选中的数据',
- 'en-US': 'This command is used to select a single row to obtain the selected data.'
- },
- 'demoId': 'grid-event#event-get-row-method'
- },
- {
- 'name': 'getRecordset',
- 'type': '()=> IRecordset',
- 'typeAnchorName': 'IRecordset',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '获取表格数据集(获取新增、删除、更改的数据,对于增删改查表格非常方便)',
- 'en-US':
- 'Obtaining a table data set (Obtain the data of adding, deleting, and changing. It is very convenient for adding, deleting, modifying, and querying tables.)'
- },
- 'demoId': 'grid-toolbar#toolbar-insert-delete-update'
- },
- {
- 'name': 'getRemoveRecords',
- 'type': '()=> IRow[]',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '获取已删除的数据', 'en-US': 'Obtain deleted data' },
- 'demoId': 'grid-toolbar#toolbar-insert-delete-update'
- },
- {
- 'name': 'getRowById',
- 'type': '(rowid: string)=> IRow',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '根据行的唯一主键获取行',
- 'en-US': 'Obtain a row based on the unique primary key of the row.'
- },
- 'demoId': 'grid-event#event-get-row-method'
- },
- {
- 'name': 'getRowIndex',
- 'type': '(row: IRow)=> number',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '根据 row 获取相对于 data 中的索引',
- 'en-US': 'Obtains indexes relative to data based on rows.'
- },
- 'demoId': 'grid-event#event-get-row-method'
- },
- {
- 'name': 'getRowNode',
- 'type': '(tr: HTMLElement)=> IRow',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '根据 tr 元素获取对应的 row 信息',
- 'en-US': 'Obtain row information based on the tr element.'
- },
- 'demoId': 'grid-event#event-get-row-method'
- },
- {
- 'name': 'getSelectRecords',
- 'type': '()=> IRow[]',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '用于多选行,获取已选中的数据',
- 'en-US': 'This command is used to select multiple lines to obtain the selected data.'
- },
- 'demoId': 'grid-toolbar#toolbar-insert-delete-update'
- },
- {
- 'name': 'getTableColumn',
- 'type': '()=> IRow[]',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '获取当前表格的列(完整的全量表头列、处理条件之后的全量表头列、当前渲染中的表头列)',
- 'en-US':
- 'Obtains columns in the current table. (full table header column, full table header column after processing condition, table header column in current rendering)'
- },
- 'demoId': 'grid-custom#custom-hide-column'
- },
- {
- 'name': 'getTableData',
- 'type': '()=> IRow[]',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '获取当前表格的数据(完整的全量表体数据、处理条件之后的全量表体数据、当前渲染中的表体数据、当前渲染中的表尾数据)',
- 'en-US':
- 'Obtains data in the current table. (complete table body data, full table body data after processing conditions, table body data in the current rendering, table tail data in the current rendering)'
- },
- 'demoId': 'grid-toolbar#toolbar-clear-data'
- },
- {
- 'name': 'getUpdateRecords',
- 'type': '()=> IRow[]',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '获取已修改的数据', 'en-US': 'Obtain modified data' },
- 'demoId': 'grid-toolbar#toolbar-insert-delete-update'
- },
- {
- 'name': 'handleFetch',
- 'type': '()=> Promise',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '触发表格的 fetch-data ', 'en-US': 'Fetch-data of the trigger table' },
- 'demoId': 'grid-data-source#data-source-request-service'
- },
- {
- 'name': 'hasActiveRow',
- 'type': '(row: IRow)=> boolean',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '检查行是否已激活为编辑状态',
- 'en-US': 'Check whether the row has been activated and is in the editing state.'
- },
- 'demoId': 'grid-edit#edit-trigger-mode-hm-editing'
- },
- {
- 'name': 'hasRowChange',
- 'type': '(row: IRow, field: string)=> boolean',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '检查行或列数据是否发生改变',
- 'en-US': 'Check whether the row or column data is changed.'
- },
- 'demoId': 'grid-edit#edit-has-row-change'
- },
- {
- 'name': 'hasRowExpand',
- 'type': '(row: IRow)=> boolean',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '检查行是否已展开', 'en-US': 'Check whether the row is expanded.' },
- 'demoId': 'grid-expand#expand-has-row-expand'
- },
- {
- 'name': 'hasTreeExpand',
- 'type': '(row: IRow)=> boolean',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '检查树节点是否已展开', 'en-US': 'Check whether the tree node is expanded.' },
- 'demoId': 'grid-tree-table#tree-table-has-tree-expand'
- },
- {
- 'name': 'hideColumn',
- 'type': '(column: IColumnConfig)=> Promise',
- 'typeAnchorName': 'IColumnConfig',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '隐藏指定列', 'en-US': 'Hide a specified column.' },
- 'demoId': 'grid-custom#custom-hide-column'
- },
- {
- 'name': 'insert',
- 'type': '(records: IRow | IRow[])=> Promise',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '在表格中新增数据;往表格插入数据,从第一行新增一行或多行新数据',
- 'en-US':
- 'Add data to the table.; Insert data into the table, add one or more rows of data from the first row'
- },
- 'demoId': 'grid-toolbar#toolbar-insert-delete-update'
- },
- {
- 'name': 'insertAt',
- 'type': '(records: IRow | IRow[], row: IRow | null | -1)=> Promise',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '往表格插入数据,从指定位置插入一行或多行;第二个参数:row 指定位置(不支持树表格)、null从第一行插入、-1 从最后插入',
- 'en-US':
- 'Inserts one or more rows into a table. Second parameter: row specified position (tree tables are not supported), null inserted from the first row, and –1 inserted from the last row'
- },
- 'demoId': 'grid-toolbar#toolbar-insert-remove-rows'
- },
- {
- 'name': 'loadColumn',
- 'type': '(columns: IColumnConfig[])=> Promise',
- 'typeAnchorName': 'IColumnConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '加载列配置(对于表格列需要重载、局部递增场景下可能会用到)',
- 'en-US':
- 'Load column configuration (This function may be used in the scenario where table columns need to be reloaded or partially incremented.)'
- },
- 'demoId': 'grid-large-data#large-data-load-column'
- },
- {
- 'name': 'loadData',
- 'type': '(data: IRow[])=> Promise',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '加载数据(对于表格数据需要重载、局部递增场景下可能会用到)',
- 'en-US':
- 'Load data (This parameter may be used in the scenario where table data needs to be reloaded or partially incremented.)'
- },
- 'demoId': 'grid-large-data#large-data-full-data-loading'
- },
- {
- 'name': 'recalculate',
- 'type': '()=> Promise',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '重新计算表格(对于某些特殊场景可能会用到,比如隐藏的表格、更新列宽...等)',
- 'en-US':
- 'Recalculate the table. (This may be used in some special scenarios, such as hidden tables and column width update.)'
- },
- 'demoId': 'grid-size#size-recalculate'
- },
- {
- 'name': 'refreshColumn',
- 'type': '()=> Promise',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '刷新列配置(对于显示/隐藏列场景下可能会用到)',
- 'en-US':
- 'Refresh column configuration (This parameter may be used in the scenario of displaying or hiding columns.)'
- },
- 'demoId': 'grid-custom#custom-hide-column'
- },
- {
- 'name': 'refreshData',
- 'type': '()=> Promise',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '同步刷新 data 数据;如果用了该方法,那么组件将不再记录增删改的状态,只能自行实现对应逻辑(对于某些特殊的场景,比如深层树节点元素发生变动时可能会用到)',
- 'en-US':
- 'Data data is refreshed synchronously. If this method is used, the component does not record the status of adding, deleting, and modifying, and can only implement the corresponding logic. (This parameter may be used in some special scenarios, for example, when a node element in a deep tree changes.)'
- },
- 'demoId': 'grid-tree-table#tree-table-tree-grid-insert-delete-update'
- },
- {
- 'name': 'reloadCustoms',
- 'type': '(customs: IColumnConfig[], sortable?: boolean)=> Promise',
- 'typeAnchorName': 'IColumnConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '初始化加载显示/隐藏列(对于异步更新的场景下可能会用到),customs表示列信息集合,sortable表示是否按列顺序加载',
- 'en-US':
- 'Initialize loading to display or hide columns (which may be used in asynchronous update scenarios).'
- },
- 'demoId': 'grid-custom#custom-server-storage'
- },
- {
- 'name': 'remove',
- 'type': '(rows: IRow | IRow[])=> Promise',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '删除指定行数据,指定 row 或 [row, ...] 删除多条数据,如果为空则删除所有数据',
- 'en-US':
- 'Deletes data in a specified row. Multiple data records in a specified row or [row, ...] are deleted. If the value is empty, all data records are deleted.'
- },
- 'demoId': 'grid-toolbar#toolbar-insert-delete-update'
- },
- {
- 'name': 'removeSelecteds',
- 'type': '()=> Promise',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '删除已选中的所有行数据', 'en-US': 'Delete all selected rows.' },
- 'demoId': 'grid-toolbar#toolbar-insert-delete-update'
- },
- {
- 'name': 'resetAll',
- 'type': '()=> void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '手动重置列的所有操作,还原到初始状态(如果已关联工具栏,则会同步更新)',
- 'en-US':
- 'Manually reset all operations in the column to the initial state. If the toolbar has been associated, the operations will be updated accordingly.'
- },
- 'demoId': 'grid-custom#custom-reset-resizable'
- },
- {
- 'name': 'resetCustoms',
- 'type': '()=> Promise',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '手动重置列的显示/隐藏操作,还原到初始状态(如果已关联工具栏,则会同步更新)',
- 'en-US':
- 'Manually reset the display/hide operations of columns to restore the initial status (if the toolbar has been associated, it will be updated accordingly)'
- },
- 'demoId': 'grid-custom#custom-reset-resizable'
- },
- {
- 'name': 'resetResizable',
- 'type': '()=> Promise',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '手动重置列宽拖动的操作,还原到初始状态(如果已关联工具栏,则会同步更新)',
- 'en-US':
- 'Manually reset the column width and drag the column width to the initial state (if the toolbar has been associated, the column width will be updated accordingly).'
- },
- 'demoId': 'grid-custom#custom-reset-resizable'
- },
- {
- 'name': 'revertData',
- 'type': '(rows: IRow | IRow[], field?: string)=> Promise',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '还原更改,还原指定行 row 或者整个表格的数据',
- 'en-US': 'Restore the data of a specified row or the entire table.'
- },
- 'demoId': 'grid-edit#edit-revert-data'
- },
- {
- 'name': 'scrollTo',
- 'type': '(scrollLeft: number, scrollTop: number)=> Promise',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '如果有滚动条,则滚动到对应的位置',
- 'en-US': 'If there is a scroll bar, scroll to the corresponding position.'
- },
- 'demoId': 'grid-large-data#large-data-scroll-to'
- },
- {
- 'name': 'scrollToColumn',
- 'type': '(column: IColumnConfig)=> Promise',
- 'typeAnchorName': 'IColumnConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '如果有滚动条,则滚动到对应的列',
- 'en-US': 'If there is a scroll bar, scroll to the corresponding column.'
- },
- 'demoId': 'grid-large-data#large-data-scroll-to'
- },
- {
- 'name': 'scrollToRow',
- 'type': '(row: IRow)=> Promise',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '如果有滚动条,则滚动到对应的行',
- 'en-US': 'If there is a scroll bar, scroll to the corresponding line.'
- },
- 'demoId': 'grid-large-data#large-data-scroll-to'
- },
- {
- 'name': 'setActiveCell',
- 'type': '(row: IRow, field: string)=> Promise',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '激活单元格编辑', 'en-US': 'Activate cell editing' },
- 'demoId': 'grid-edit#edit-trigger-mode-hm-editing'
- },
- {
- 'name': 'setActiveRow',
- 'type': '(row: IRow)=> Promise',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '激活行编辑,如果是 mode=cell 则默认激活第一个单元格',
- 'en-US': 'Activate line editing. If mode=cell is selected, the first cell is activated by default.'
- },
- 'demoId': 'grid-edit#edit-trigger-mode-hm-editing'
- },
- {
- 'name': 'setAllRowExpansion',
- 'type': '(checked: boolean)=> Promise',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '设置所有行的展开与否', 'en-US': 'Set whether to expand all rows.' },
- 'demoId': 'grid-expand#expand-set-row-expansion'
- },
- {
- 'name': 'setAllSelection',
- 'type': '(checked: boolean)=> void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '入参为boolean,用于多选行,设置所有行的选中状态,',
- 'en-US':
- 'The input parameter is boolean, which is used to select multiple lines and set the selected status of all lines.'
- },
- 'demoId': 'grid-operation-column#operation-column-selection-operation'
- },
- {
- 'name': 'setAllTreeExpansion',
- 'type': '(checked: boolean)=> Promise',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '设置所有树节点的展开与否', 'en-US': 'Sets whether to expand all tree nodes.' },
- 'demoId': 'grid-tree-table#tree-table-set-tree-expansion'
- },
- {
- 'name': 'setCurrentRow',
- 'type': '(row: IRow)=> Promise',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '用于当前行,设置某一行为高亮状态',
- 'en-US': 'Sets the highlight status of a row for the current row.'
- },
- 'demoId': 'grid-highlight#highlight-set-current-row'
- },
- {
- 'name': 'setRadioRow',
- 'type': '(row: IRow)=> Promise',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '用于单选行,设置某一行为选中状态',
- 'en-US': 'Select a row and set the selected status of a row.'
- },
- 'demoId': 'grid-operation-column#operation-column-clear-and-set-radio-row'
- },
- {
- 'name': 'setRowExpansion',
- 'type': '(rows: IRow | IRow[], checked: boolean)=> Promise',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '设置展开行,第二个参数设置这一行展开与否',
- 'en-US': 'Set the expansion row, and set whether to expand the row.'
- },
- 'demoId': 'grid-expand#expand-set-row-expansion'
- },
- {
- 'name': 'setSelection',
- 'type': '(rows: IRow | IRow[], checked: boolean)=> Promise',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '用于多选行,设置行为选中状态,第二个参数为选中与否',
- 'en-US':
- 'This parameter is used to select multiple lines. The second parameter is whether to select or not.'
- },
- 'demoId': 'grid-operation-column#operation-column-selection-operation'
- },
- {
- 'name': 'setTreeExpansion',
- 'type': '(rows: IRow | IRow[], checked: boolean)=> Promise',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '设置展开树形节点,第二个参数设置这一行展开与否',
- 'en-US': 'Set the expansion tree node and set whether to expand the row.'
- },
- 'demoId': 'grid-tree-table#tree-table-set-tree-expansion'
- },
- {
- 'name': 'showColumn',
- 'type': '(column: IColumnConfig)=> Promise',
- 'typeAnchorName': 'IColumnConfig',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '显示指定列', 'en-US': 'Display the specified column.' },
- 'demoId': 'grid-custom#custom-hide-column'
- },
- {
- 'name': 'sort',
- 'type': `(field: string, order?: 'asc' | 'desc')=> Promise`,
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '手动对表格进行排序(如果 order 为空则自动切换排序)',
- 'en-US': 'Sort the table manually. If the value of order is empty, the table is automatically sorted.'
- },
- 'demoId': 'grid-sort#sort-sort'
- },
- {
- 'name': 'toggleAllSelection',
- 'type': '()=> Promise',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '用于多选行,切换所有行的选中状态',
- 'en-US': 'Selection of multiple lines and switch the selected status of all lines.'
- },
- 'demoId': 'grid-operation-column#operation-column-selection-operation'
- },
- {
- 'name': 'toggleRowExpansion',
- 'type': '(row: IRow)=> Promise',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '用于可展开表格,切换展开行', 'en-US': 'For expanding tables or switching rows.' },
- 'demoId': 'grid-expand#expand-set-row-expansion'
- },
- {
- 'name': 'toggleRowSelection',
- 'type': '(row: IRow)=> Promise',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '用于多选行,切换某一行的选中状态',
- 'en-US': 'Selection of multiple lines and switch the selected status of a line.'
- },
- 'demoId': 'grid-operation-column#operation-column-selection-operation'
- },
- {
- 'name': 'toggleTreeExpansion',
- 'type': '(row: IRow)=> Promise',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '用于可树形表格,切换展开树形节点',
- 'en-US': 'This parameter is used to switch and expand tree nodes in a tree table.'
- },
- 'demoId': 'grid-tree-table#tree-table-set-tree-expansion'
- },
- {
- 'name': 'validate',
- 'type': '(rows: IRow | IRow[], callback: ()=> void)=> Promise',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '表格校验函数,如果指定 row 或 rows 则校验指定一行或多行,否则校验整个表格。该回调函数会在校验结束后被调用,并传入两个参数:(是否校验成功,最近一列未通过校验的字段)。若不传入回调函数,则会返回一个 promise',
- 'en-US':
- 'Table verification function. If a row or rows is specified, the specified row or multiple rows are verified. Otherwise, the entire table is verified. This callback function is called after the verification is complete and the following parameters are transferred: (Whether the verification is successful. The fields in the latest column fail the verification.) If no callback function is passed in, a promise is returned'
- },
- 'demoId': 'grid-validation#validation-before-submit-validation'
- }
- ],
- 'events': [
- {
- 'name': 'page-change',
- 'type': '(args: IPageChangeArgs)=> void',
- 'typeAnchorName': 'IPageChangeArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '只对 pager-config 配置时有效,分页发生改变时会触发该事件 ',
- 'en-US':
- 'This event is valid only when pager-config is configured. This event is triggered when the paging is changed'
- },
- 'demoId': 'grid-event#event-page-change-event'
- },
- {
- 'name': 'before-page-change',
- 'type': '(args: IBeforePageChangeArgs)=> void',
- 'typeAnchorName': 'IBeforePageChangeArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '在打开页面改变时的前置处理特性,并且进行翻页操作或者改变页大小操作时触发',
- 'en-US': 'triggered when the page is changed and the page is turned or the page size is changed'
- },
- 'demoId': 'grid-event#event-page-before-change-event'
- },
- {
- 'name': 'toolbar-button-click',
- 'type': '(args: IToolbarButtonClickArgs, event: Event)=> void',
- 'typeAnchorName': 'IToolbarButtonClickArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '只对 toolbar.buttons 配置时有效,当工具栏的按钮被点击时会后触发该事件',
- 'en-US':
- 'This event is valid only when toolbar.buttons are configured. This event is triggered when a toolbar button is clicked'
- },
- 'demoId': 'grid-event#event-toolbar-button-click-event'
- },
- {
- 'name': 'cell-click',
- 'type': '(args: ICellClickArgs, event: Event)=> void',
- 'typeAnchorName': 'ICellClickArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '单元格被点击时会触发该事件',
- 'en-US': 'This event is triggered when a cell is clicked'
- },
- 'demoId': 'grid-event#event-click-event'
- },
- {
- 'name': 'cancel-page-change',
- 'type': '($grid: Component)=> void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '切换分页时有未保存的数据时,提示框确定按钮事件',
- 'en-US':
- 'When there is unsaved data during pagination switchover, a dialog box is displayed to determine the button event.'
- },
- 'demoId': 'grid-pager#pager-show-save-msg'
- },
- {
- 'name': 'cell-context-menu',
- 'type': '(args: ICellContextMenuArgs)=> void',
- 'typeAnchorName': 'ICellContextMenuArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '单元格被鼠标右键点击时触发该事件',
- 'en-US': 'This event is triggered when a cell is right-clicked'
- },
- 'demoId': 'grid-context-menu#context-menu-cell-menu'
- },
- {
- 'name': 'cell-dblclick',
- 'type': '(args: ICellArgs, event: Event)=> void',
- 'typeAnchorName': 'ICellArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '单元格被双击时会触发该事件',
- 'en-US': 'This event is triggered when a cell is double-clicked'
- },
- 'demoId': 'grid-event#event-click-event'
- },
- {
- 'name': 'cell-mouseenter',
- 'type': '(args: ICellArgs, event: Event)=> void',
- 'typeAnchorName': 'ICellArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '当单元格 hover 进入时会触发该事件',
- 'en-US': 'This event is triggered when the cell hovers'
- },
- 'demoId': 'grid-event#event-cell-mouse-event'
- },
- {
- 'name': 'cell-mouseleave',
- 'type': '(args: ICellArgs, event: Event)=> void',
- 'typeAnchorName': 'ICellArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '当单元格 hover 退出时会触发该事件',
- 'en-US': 'This event is triggered when the cell hovers.'
- },
- 'demoId': 'grid-event#event-cell-mouse-event'
- },
- {
- 'name': 'context-menu-click',
- 'type': '(args: IContextMenuArgs, event: Event)=> void',
- 'typeAnchorName': 'IContextMenuArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '只对 context-menu 配置时有效,当点击快捷菜单时会触发该事件',
- 'en-US':
- 'This event is valid only when context-menu is configured. This event is triggered when the shortcut menu is clicked'
- },
- 'demoId': 'grid-event#event-context-menu-event'
- },
- {
- 'name': 'current-change',
- 'type': '(args: ICurrentChangeArgs, event: Event)=> void',
- 'typeAnchorName': 'ICurrentChangeArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '只对 highlightCurrentRow 有效,当手动选中行并且值发生改变时触发的事件',
- 'en-US':
- 'This parameter is valid only for highlightCurrentRow. This parameter is triggered when a row is manually selected and the value changes'
- },
- 'demoId': 'grid-highlight#highlight-highlight-cell'
- },
- {
- 'name': 'edit-actived',
- 'type': '(args: IEditActivedArgs, event: Event)=> void',
- 'typeAnchorName': 'IEditActivedArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '单元格被激活编辑时会触发该事件',
- 'en-US': 'This event is triggered when a cell is activated for editing'
- },
- 'demoId': 'grid-event#event-edit-event'
- },
- {
- 'name': 'edit-closed',
- 'type': '(args: IEditClosedArgs, event: Event)=> void',
- 'typeAnchorName': 'IEditClosedArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '单元格编辑状态下被关闭时会触发该事件',
- 'en-US': 'This event is triggered when a cell is closed in the editing state'
- },
- 'demoId': 'grid-event#event-edit-event'
- },
- {
- 'name': 'edit-disabled',
- 'type': '(args: IEditDisabledArgs, event: Event)=> void',
- 'typeAnchorName': 'IEditDisabledArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '当单元格激活时如果是禁用状态时会触发该事件',
- 'en-US': 'This event is triggered when a cell is activated and is disabled'
- },
- 'demoId': 'grid-event#event-edit-event'
- },
- {
- 'name': 'filter-change',
- 'type': '(args: IFilterChangeArgs)=> void',
- 'typeAnchorName': 'IFilterChangeArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '当筛选条件发生变化时会触发该事件',
- 'en-US': 'This event is triggered when the filter condition changes'
- },
- 'demoId': 'grid-filter#filter-server-filter'
- },
- {
- 'name': 'footer-cell-click',
- 'type': '(args: IFooterCellClickArgs, event: Event)=> void',
- 'typeAnchorName': 'IFooterCellClickArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '表尾单元格被点击时会触发该事件',
- 'en-US': 'This event is triggered when a cell at the end of a table is clicked'
- },
- 'demoId': 'grid-event#event-click-event'
- },
- {
- 'name': 'footer-cell-context-menu',
- 'type': '(args: IContextMenuArgs, event: Event)=> void',
- 'typeAnchorName': 'IContextMenuArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '表尾单元格被鼠标右键点击时触发该事件',
- 'en-US': 'This event is triggered when a cell at the end of the table is right-clicked'
- },
- 'demoId': 'grid-event#event-context-menu-event'
- },
- {
- 'name': 'footer-cell-dblclick',
- 'type': '(args: IFooterCellDblClickArgs, event: Event)=> void',
- 'typeAnchorName': 'IFooterCellDblClickArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '表尾单元格被双击时会触发该事件',
- 'en-US': 'This event is triggered when a cell at the end of a table is double-clicked'
- },
- 'demoId': 'grid-event#event-click-event'
- },
- {
- 'name': 'header-cell-click',
- 'type': '(args: IHeaderCellClickArgs, event: Event)=> void',
- 'typeAnchorName': 'IHeaderCellClickArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '表头单元格被点击时会触发该事件',
- 'en-US': 'This event is triggered when a cell in the table header is clicked'
- },
- 'demoId': 'grid-event#event-click-event'
- },
- {
- 'name': 'header-cell-context-menu',
- 'type': '(args: IContextMenuArgs, event: Event)=> void',
- 'typeAnchorName': 'IContextMenuArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '表头单元格被鼠标右键点击时触发该事件',
- 'en-US': 'This event is triggered when a cell in the table header is right-clicked'
- },
- 'demoId': 'grid-event#event-context-menu-event'
- },
- {
- 'name': 'header-cell-dblclick',
- 'type': '(args: IHeaderCellDblClickArgs, event: Event)=> void',
- 'typeAnchorName': 'IHeaderCellDblClickArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '表头单元格被双击时会触发该事件',
- 'en-US': 'This event is triggered when a table header cell is double-clicked'
- },
- 'demoId': 'grid-event#event-click-event'
- },
- {
- 'name': 'radio-change',
- 'type': '($table: Component, event: Event)=> void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '只对 type=radio 有效,当手动勾选并且值发生改变时触发的事件',
- 'en-US':
- 'This parameter is valid only for the event whose type is radio. It is triggered when the value is manually selected and the value changes'
- },
- 'demoId': 'grid-event#event-radio-change-event'
- },
- {
- 'name': 'resizable-change',
- 'type': '(args: IResizableChangeArgs)=> void',
- 'typeAnchorName': 'IResizableChangeArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '当列宽拖动发生变化时会触发该事件',
- 'en-US': 'This event is triggered when the column width changes'
- },
- 'demoId': 'grid-event#event-resizable-change-event'
- },
- {
- 'name': 'scroll',
- 'type': '(args: IScrollArgs)=> void',
- 'typeAnchorName': 'IScrollArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '表格滚动时会触发该事件',
- 'en-US': 'This event is triggered when the table scrolls'
- },
- 'demoId': 'grid-event#event-grid-scroll-event'
- },
- {
- 'name': 'select-all',
- 'type': '(args: ISelectAllArgs, event: Event)=> void',
- 'typeAnchorName': 'ISelectAllArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '只对 type=selection 有效,当手动勾选全选时触发的事件',
- 'en-US': 'This event is valid only when type=selection and is triggered when all are selected manually'
- },
- 'demoId': 'grid-event#event-select-event'
- },
- {
- 'name': 'select-change',
- 'type': '(args: ISelectChangeArgs, event: Event)=> void',
- 'typeAnchorName': 'ISelectChangeArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '只对 type=selection 有效,当手动勾选并且值发生改变时触发的事件',
- 'en-US':
- 'This event is valid only for type=selection. It is triggered when the value is manually selected and the value changes'
- },
- 'demoId': 'grid-event#event-select-event'
- },
- {
- 'name': 'toggle-expand-change',
- 'type': '(args: IToggleExpandChangeArgs, event: Event)=> void',
- 'typeAnchorName': 'IToggleExpandChangeArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '当行展开或收起时会触发该事件',
- 'en-US': 'This event is triggered when a row is expanded or closed'
- },
- 'demoId': 'grid-event#event-toggle-expand-change-event'
- },
- {
- 'name': 'toggle-tree-change',
- 'type': '(args: IToggleTreeChangeArgs, event: Event)=> void',
- 'typeAnchorName': 'IToggleTreeChangeArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '当树节点展开或收起时会触发该事件',
- 'en-US': 'This event is triggered when a tree node is expanded or closed'
- },
- 'demoId': 'grid-event#event-toggle-tree-change-event'
- },
- {
- 'name': 'valid-error',
- 'type': '(args: IValidErrorArgs)=> void',
- 'typeAnchorName': 'IValidErrorArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '当数据校验不通过时会触发该事件',
- 'en-US': 'This event is triggered when data verification fails'
- },
- 'demoId': 'grid-event#event-valid-error-event'
- },
- {
- 'name': 'sort-change',
- 'type': '(args: ISortChangeArgs)=> void',
- 'typeAnchorName': 'ISortChangeArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '点击列头,执行数据排序前触发的事件',
- 'en-US': 'Event triggered before data sorting is performed when a column header is clicked'
- },
- 'demoId': 'grid-sort#sort-server-sort'
- },
- {
- 'name': 'fullscreen',
- 'type': '()=> void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '全屏时或关闭全屏时触发的时间',
- 'en-US': 'Time triggered when full screen is enabled or disabled'
- },
- 'demoId': 'grid-toolbar#toolbar-grid-full-screen'
- }
- ]
- },
- {
- 'name': 'grid-column',
- 'type': 'component',
- 'props': [
- {
- 'name': 'align',
- 'type': `'left' | 'center' | 'right'`,
- 'defaultValue': `'left'`,
- 'desc': {
- 'zh-CN': '列对其方式',
- 'en-US': 'Column pair mode; The optional values for this property are left, center, right'
- },
- 'demoId': 'grid-align#align-grid-align'
- },
- {
- 'name': 'class-name',
- 'type': 'string | (args: IClassNameArgs)=> string',
- 'typeAnchorName': 'IClassNameArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '给单元格附加 className,也可以是函数',
- 'en-US': 'Add a class name to a cell. The class name can also be the Function'
- },
- 'demoId': 'grid-custom-style#custom-style-class-name'
- },
- {
- 'name': 'multi',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN':
- '是 filter 对象内置的属性,筛选是否允许多选;设置选择列是否显示复选框。当 columnType 为 select 时有效',
- 'en-US':
- "is an attribute built in the filter object. Whether multiple selections are allowed for filtering. Sets whether to display the check box in the selected column. This parameter is valid only when columnType is set to'select'."
- },
- 'demoId': 'grid-filter#filter-default-filter'
- },
- {
- 'name': 'fixed',
- 'type': `'left' | 'right'`,
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '将列固定在左侧,其中 freezable 可冻结可解冻,在表格个性化面板中可操作,而 frozen 只能冻结不能解冻,在个性化面板中不可操作;将列固定在左侧或者右侧(注意:固定列应该放在左右两侧的位置)',
- 'en-US':
- 'Fix columns on the left. Freezable can be frozen or unfrozen, but can be operated in the table personalized panel. Frozen can only be frozen but cannot be operated in the personalized panel. Fix the column to the left or right (Note: The fixed columns should be placed on the left and right sides.) The optional values of this attribute are left (fixed left) and right (fixed right)'
- },
- 'demoId': 'grid-fixed#fixed-left-fixed'
- },
- {
- 'name': 'footer-align',
- 'type': `'left' | 'center' | 'right'`,
- 'defaultValue': `'left'`,
- 'desc': {
- 'zh-CN': '表尾列的对齐方式)',
- 'en-US':
- 'Alignment mode of the column at the end of the table; The optional values for this property are left, center, right'
- },
- 'demoId': 'grid-align#align-footer-align'
- },
- {
- 'name': 'footer-class-name',
- 'type': 'string | (args: IClassNameArgs)=> string',
- 'typeAnchorName': 'IClassNameArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '给表尾的单元格附加 className,也可以是函数',
- 'en-US': 'Add a class name to the cell at the end of the table. The class name can also be the Function'
- },
- 'demoId': 'grid-custom-style#custom-style-footer-style'
- },
- {
- 'name': 'header-align',
- 'type': "'left' | 'center' | 'right'",
- 'defaultValue': `'left'`,
- 'desc': {
- 'zh-CN': '表头列的对齐方式',
- 'en-US':
- 'The alignment mode of the table header column; The optional values for this property are left, center, right'
- },
- 'demoId': 'grid-align#align-header-align'
- },
- {
- 'name': 'header-class-name',
- 'type': 'string | (args: IClassNameArgs)=> string',
- 'typeAnchorName': 'IClassNameArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '设置列头样式名称;给表头的单元格附加 className,也可以是函数',
- 'en-US': 'Set the column header style name. Add className to the cell in the table header, or the function'
- },
- 'demoId': 'grid-custom-style#custom-style-header-style'
- },
- {
- 'name': 'index-method',
- 'type': 'string | (args: IIndexMethodArgs)=> string',
- 'typeAnchorName': 'IIndexMethodArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '只对 type=index 有效,自定义索引方法',
- 'en-US': 'This parameter is valid only for type=index'
- },
- 'demoId': 'grid-serial-column#serial-column-custom-serial-column'
- },
- {
- 'name': 'min-width',
- 'type': 'number | string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '最小列宽度;会自动将剩余空间按比例分配;该属性的可选值为 整数, px,%',
- 'en-US':
- 'Minimum column width; The remaining space will be allocated in proportion. The optional values of this property are integers, px,%'
- },
- 'demoId': 'grid-size#size-min-width'
- },
- {
- 'name': 'show-icon',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否显示列头编辑图标,在编辑时有效',
- 'en-US': 'Whether to display the column header editing icon. This parameter is valid during editing.'
- },
- 'demoId': 'grid-edit#edit-editing'
- },
- {
- 'name': 'params',
- 'type': 'object',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '额外的参数(自定义一些数据参数,对于某些特殊的场景可能会用到)',
- 'en-US': 'Extra parameters (User-defined data parameters, which may be used in some special scenarios)'
- },
- 'demoId': ''
- },
- {
- 'name': 'remote-sort',
- 'type': 'boolean',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '是否使用服务端排序,如果设置为 true 则不会对数据进行处理',
- 'en-US': 'Whether to use server sorting. If this parameter is set to true, data will not be processed.'
- },
- 'demoId': 'grid-sort#sort-server-sort'
- },
- {
- 'name': 'resizable',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '设置该列是否可以调整列宽;列是否允许拖动列宽调整大小',
- 'en-US':
- 'Set whether the column width can be adjusted. Allows you to drag the column width to adjust the column size.'
- },
- 'demoId': 'grid-custom#custom-column-width'
- },
- {
- 'name': 'show-header-overflow',
- 'type': 'string | boolean',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '当表头内容过长时显示为省略号;该属性的可选值为 ellipsis (只显示省略号), title (并且显示为原生 title ), tooltip (并且显示为 tooltip 提示)',
- 'en-US':
- 'When the table header content is too long, the ellipsis is displayed. The optional values for this property are ellipsis (only the ellipsis is displayed), title (and the native title is displayed), tooltip (and the tooltip prompt is displayed)'
- },
- 'demoId': 'grid-tip#tip-column-header-tip'
- },
- {
- 'name': 'show-overflow',
- 'type': 'string | boolean',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '当内容过长时显示为省略号;该属性的可选值为 ellipsis(只显示省略号), title(并且显示为原生 title), tooltip(并且显示为 tooltip 提示)',
- 'en-US':
- 'When the content is too long, an ellipsis is displayed. The optional values for this property are ellipsis (only the ellipsis is displayed), title (and the native title is displayed), tooltip (and the tooltip is displayed)'
- },
- 'demoId': 'grid-tip#tip-cell-tip'
- },
- {
- 'name': 'sort-by',
- 'type': 'string | string[]',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '只对 sortable 有效,自定义排序的属性',
- 'en-US': 'This parameter is valid only for sortable. It is a user-defined sorting attribute.'
- },
- 'demoId': 'grid-sort#sort-combinations-sort'
- },
- {
- 'name': 'rules',
- 'type': 'IValidRules',
- 'typeAnchorName': 'IValidRules',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '表单的验证功能', 'en-US': 'Form verification function' },
- 'demoId': ''
- },
- {
- 'name': 'required',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否必填,如不设置,则会根据校验规则自动生成',
- 'en-US':
- 'Mandatory. If this parameter is not set, the system will automatically generate a value based on the verification rule.'
- },
- 'demoId': ''
- },
- {
- 'name': 'sort-method',
- 'type': '(row1: IRow, row2: IRow)=> boolean',
- 'typeAnchorName': 'IRow',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '自定义所有列的排序方法,当触发排序时会调用该函数',
- 'en-US': 'Customize the sorting method of all columns. When sorting is triggered.'
- },
- 'demoId': 'grid-sort#sort-custom-sort'
- },
- {
- 'name': 'sortable',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '设置该列数据是否可以排序',
- 'en-US': 'Whether the data in the column can be sorted.; Allow Sorting Columns'
- },
- 'demoId': 'grid-sort#sort-default-sort'
- },
- {
- 'name': 'title',
- 'type': 'string | (h, params)=> string | VNode',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '列标题(支持开启国际化),可以是函数',
- 'en-US': 'Column title (internationalization can be enabled). It can be the function'
- },
- 'demoId': 'grid#base-basic-usage'
- },
- {
- 'name': 'tree-node',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '只对 tree-config 配置时有效,指定为树节点',
- 'en-US': 'This parameter is valid only when tree-config is configured. It is specified as a tree node.'
- },
- 'demoId': 'grid-tree-table#tree-table-tree-grid-base'
- },
- {
- 'name': 'format-text',
- 'type': 'IFormatText',
- 'typeAnchorName': 'IFormatText',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '设置当前表格列的显示获取编辑类型;设置当前表格列的显示获取编辑类型,也可以是函数',
- 'en-US':
- 'Sets the display and editing mode of the current table column. Sets the display and obtaining editing type of the current table column. It can also be the function'
- },
- 'demoId': 'grid-renderer#renderer-inner-renderer'
- },
- {
- 'name': 'type',
- 'type': `'index' | 'selection' | 'radio' | 'expand'`,
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '设置内置列的类型',
- 'en-US': 'Set the type of the built-in column'
- },
- 'demoId': 'grid-serial-column#serial-column-default-serial-column'
- },
- {
- 'name': 'width',
- 'type': 'number | string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '设置列的宽度,可以是像素或者百分比或者 auto ,设置为 auto 时,列宽会自动适应;该属性的可选值为 整数 , px ,%',
- 'en-US':
- 'Set the column width. The value can be pixel, percentage, or auto. If the value is auto, the column width automatically adapts.; column width; The optional value of this property is integer/px/%'
- },
- 'demoId': 'grid-size#size-fixed-column-width'
- },
- {
- 'name': 'format-config',
- 'type': 'IFormatConfig',
- 'typeAnchorName': 'IFormatConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '开启该列数据异步渲染。',
- 'en-US': 'Enable the asynchronous rendering of the column data'
- },
- 'demoId': 'grid-renderer#renderer-inner-renderer'
- },
- {
- 'name': 'class-name',
- 'type': 'string | IClassNameArgs',
- 'typeAnchorName': 'IClassNameArgs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '给单元格附加 className,也可以是函数',
- 'en-US': 'Add a class name to a cell. The class name can also be the function'
- },
- 'demoId': 'grid-custom-style#custom-style-class-name'
- },
- {
- 'name': 'editor',
- 'type': 'IEditorConfig | (h, {row:Row, column: IColumnConfig})=> Component',
- 'typeAnchorName': 'IEditorConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '单元格编辑渲染配置项,也可以是函数返回 Vue 组件',
- 'en-US':
- 'Cell editing rendering configuration item, which can also be the function Function(h, params). Sets the editing type of the table column'
- },
- 'demoId': 'grid-editor#editor-custom-editor-select'
- },
- {
- 'name': 'filter',
- 'type': 'boolean | IFilterConfig',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '设置表格列的筛选配置信息。默认值为 false 不配置筛选信息',
- 'en-US':
- 'Set the filtering configuration of the table column. The default value is false. No filtering information is configured.'
- },
- 'demoId': 'grid-filter#filter-default-filter'
- },
- {
- 'name': 'renderer',
- 'type': 'IEditorConfig | (h, {row: IRow, column: IColumnConfig})=> Component',
- 'typeAnchorName': 'IEditorConfig',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '设置表格列的渲染类型。其优先级高于列的 type 属性配置;单元格渲染配置项,其优先级高于列的 formatText 属性配置',
- 'en-US':
- 'Set the rendering type of the table column. The priority of the column is higher than that of the column type attribute. Cell rendering configuration item. Its priority is higher than that of the formatText attribute of the column'
- },
- 'demoId': 'grid-renderer#renderer-custom-renderer'
- },
- {
- 'name': 'show-tip',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '表格列单元格是否需要提示', 'en-US': 'Does the table column cells require prompts?' },
- 'demoId': 'grid-tip#tip-cell-tip'
- },
- {
- 'name': 'show-header-tip',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '表格列头是否需要提示', 'en-US': 'Whether to prompt the table column header.' },
- 'demoId': 'grid-tip#tip-column-header-tip'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '自定义显示内容模板,作用插槽参数说明:slots.default({ $table, column, row },h),$table:表格组件对象,column:当前列配置,row:当前行数据,h:vue的渲染函数',
- 'en-US': 'Customized display content template'
- },
- 'demoId': 'grid-slot#slot-default-slot'
- },
- {
- 'name': 'edit',
- 'type': '',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '自定义可编辑组件模板,作用插槽参数说明:slots.edit({ $table, column, row },h),$table:表格组件对象,column:当前列配置,row:当前行数据,h:vue的渲染函数',
- 'en-US': 'Customized Editable Component Template'
- },
- 'demoId': 'grid-slot#slot-editor-slot'
- },
- {
- 'name': 'filter',
- 'type': '',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '自定义筛选模板,作用插槽参数说明:slots.filter({ $grid, values, args, context },h),$grid:表格组件对象,values:筛选项集合,args:筛选相关参数,context:筛选面板组件上下文对象',
- 'en-US': 'User-defined filtering template'
- },
- 'demoId': 'grid-filter#filter-custom-filter'
- },
- {
- 'name': 'header',
- 'type': '',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '自定义表头内容的模板,作用插槽参数说明:slots.header({ $table, column, columnIndex,$rowIndex},h),$table:表格组件对象,column:当前列配置,columnIndex:当前列索引,$rowIndex:当前行索引,h:vue的渲染函数',
- 'en-US': 'Template of custom table header content'
- },
- 'demoId': 'grid-slot#slot-header-slot'
- }
- ]
- },
- {
- 'name': 'grid-toolbar',
- 'type': 'component',
- 'props': [
- {
- 'name': 'buttons',
- 'type': `{
- code: string
- name: string
- }[]`,
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '按钮列表', 'en-US': 'Button List' },
- 'demoId': 'grid-toolbar#toolbar-insert-delete-update'
- },
- {
- 'name': 'id',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '唯一 ID 标识', 'en-US': 'Unique ID' },
- 'demoId': 'grid-custom#custom-column-width'
- },
- {
- 'name': 'refresh',
- 'type': 'boolean',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '工具栏组件开启表格刷新功能。',
- 'en-US': 'The table refresh function is enabled for the toolbar component.'
- },
- 'demoId': 'grid-toolbar#toolbar-refresh-grid'
- },
- {
- 'name': 'resizable',
- 'type': 'boolean | {storage: boolean}',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '列宽拖动配置(需要设置 id)',
- 'en-US': 'Column width dragging configuration (id needs to be set)'
- },
- 'demoId': 'grid-custom#custom-column-width'
- },
- {
- 'name': 'setting',
- 'type': `boolean | IToolbarSetting`,
- 'typeAnchorName': 'IToolbarSetting',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN':
- '设置表格属性是否显示个性化面板,当设置表格的 name 属性时有效;设置工具栏属性是否显示个性化配置(需要设置 id )',
- 'en-US':
- 'Whether to display the table attribute on the personalized panel. This parameter is valid only when the name attribute of the table is set. Set whether to display personalized configuration for toolbar attributes (id needs to be set)'
- },
- 'demoId': 'grid-custom#custom-column-width'
- },
- {
- 'name': 'full-screen',
- 'type': 'boolean',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '设置表格是否可以全屏,或者需要全屏的容器;设置工具栏属性是否显示全屏按钮',
- 'en-US':
- 'Sets whether the table can be displayed in full screen mode or whether the container needs to be displayed in full screen mode.; Sets whether to display the full-screen button on the toolbar.'
- },
- 'demoId': 'grid-toolbar#toolbar-grid-full-screen'
- },
- {
- 'name': 'size',
- 'type': `'medium' | 'small' | 'mini'`,
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '表格的尺寸',
- 'en-US': 'Dimension; The options of this attribute are medium, small, and mini'
- },
- 'demoId': 'grid-toolbar#toolbar-copy-row-data'
- },
- {
- 'name': 'before-open-full-screen',
- 'type': '()=> boolean',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '全屏前的拦截方法,返回 false 则阻止全屏,返回 true 则不阻止',
- 'en-US':
- 'Intercept method before full screen, If false is returned, the full screen is blocked. If true is returned, the full screen is not blocked.'
- },
- 'demoId': 'grid-toolbar#toolbar-grid-full-screen'
- },
- {
- 'name': 'before-close-full-screen',
- 'type': '()=> boolean',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '关闭全屏前的拦截方法,返回 false 则阻止关闭全屏,返回 true 则不阻止',
- 'en-US':
- 'Intercept method before full screen is disabled. If false is returned, the full screen is disabled. If true is returned, the full screen is not disabled.'
- },
- 'demoId': 'grid-toolbar#toolbar-grid-full-screen'
- }
- ],
- 'slots': [
- {
- 'name': 'toolbar',
- 'type': '',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '工具栏插槽', 'en-US': 'Toolbar slot' },
- 'demoId': 'grid-toolbar#toolbar-custom-toolbar'
- },
- {
- 'name': 'buttons',
- 'type': '',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '按钮列表', 'en-US': 'Button List' },
- 'demoId': 'grid-toolbar#toolbar-custom-toolbar'
- }
- ],
- 'events': [
- {
- 'name': 'button-click',
- 'type': '(args: IButtonClick, event: Event)=> void',
- 'typeAnchorName': 'IButtonClick',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '当工具栏的按钮被点击时会后触发该事件',
- 'en-US': 'This event is triggered when a button on the toolbar is clicked'
- },
- 'demoId': 'grid-validation#validation-before-submit-validation'
- },
- {
- 'name': 'save-setting',
- 'type': '(args: ISettingConfigs)=> void',
- 'typeAnchorName': 'ISettingConfigs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '点击个性化面板的确认按钮触发该事件',
- 'en-US':
- 'Click the OK button on the personalized panel to trigger the event. settingConfigs: personalized data of the table'
- },
- 'demoId': 'grid-custom#custom-ordercolumn-local'
- },
- {
- 'name': 'cancel-setting',
- 'type': '(args: ISettingConfigs)=> void',
- 'typeAnchorName': 'ISettingConfigs',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '点击个性化面板的取消按钮触发该事件',
- 'en-US':
- 'Click the Cancel button on the personalized panel to trigger the event. settingConfigs: personalized data of the table'
- },
- 'demoId': 'grid-custom#custom-ordercolumn-local'
- },
- {
- 'name': 'reset-setting',
- 'type': '()=> void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '点击个性化面板的重置按钮触发该事件。',
- 'en-US': 'Click the Reset button on the personalized panel to trigger the event.'
- },
- 'demoId': 'grid-custom#custom-ordercolumn-local'
- }
- ]
- }
- ],
- types: [
- {
- name: 'IRow',
- type: 'interface',
- code: `
-interface IRow {
- // 表格行数据
- [filed: string]: any
-}
- `
- },
- {
- name: 'IColumnConfig',
- type: 'interface',
- code: `
-interface IColumnConfig {
- type: 'index' | 'radio' | 'checkbox'
- id: string
- prop: string
- rules: IValidRules
- required: boolean
- property: string
- title: string
- label: string
- width: string | number
- minWidth: string | number
- resizable: boolean
- fixed: boolean
- align: 'left' | 'center' | 'right'
- headerAlign: 'left' | 'center' | 'right'
- footerAlign: 'left' | 'center' | 'right'
- showOverflow: boolean | 'ellipsis' | 'tooltip' | 'title'
- showHeaderOverflow: boolean | 'ellipsis' | 'tooltip' | 'title'
- showTip: boolean
- showHeaderTip: boolean
- className: string
- headerClassName: string
- footerClassName: string
-}
- `
- },
- {
- name: 'IPagerConfig',
- type: 'interface',
- code: `
-interface IPagerConfig {
- component?: Component
- attrs: {
- currentPage: number
- pageSize: number
- pageSizes: number[]
- total: number
- // 分页组件布局默认值:'total, prev, pager, next, jumper, sizes'
- layout: string
- }
-}
- `
- },
- {
- name: 'IDataHandler',
- type: 'type',
- code: `
-interface IDataHandler {
- api: ()=> Promise
-}
- `
- },
- {
- name: 'IRowGroup',
- type: 'type',
- code: `
-interface IRowGroup {
- // 列标识符,行分组会将具有相同值的列进行分组展示
- field: string
-}
- `
- },
- {
- name: 'IToolbarConfig',
- type: 'type',
- code: `
-interface IToolbarConfig {
- component: GridToolbar
- buttons: {
- code: string
- name: string
- }[]
-}
- `
- },
- {
- name: 'IContextMenuConfig',
- type: 'type',
- code: `
-interface IMenuOptions {
- code: string
- name: string
- visible?: boolean
- disabled?: boolean
-}
-
-interface IContextMenuConfig {
- body?: {
- options: IMenuOptions
- }
- footer?: {
- options: IMenuOptions
- }
- visibleMethod?: ()=> boolean
-}
- `
- },
- {
- name: 'IValidRules',
- type: 'type',
- code: `
-interface IValidRules {
- [filed:string]: {
- type?: string
- required?: boolean
- validator?: () => boolean
- message?: string
- min?: number
- max?: number
- }
-}[]
- `
- },
- {
- name: 'IExpandConfig',
- type: 'type',
- code: `
-interface IExpandConfig {
- // 默认展开所有行
- expandAll?: boolean
- // 触发方式 default(点击按钮触发),cell(点击单元格触发),row(点击行触发)
- trigger?: 'default' | 'row' | cell
- // 默认展开指定行(需要有 row-id)
- expandRowKeys?: string[]
- // 对于同一级的节点,每次只能展开一个
- accordion?: boolean
- // 控制是否渲染展开行
- activeMethod?:({row: IRow})=> boolean
- // 配置是否显示展开图标
- showIcon?: boolean
-}
- `
- },
- {
- name: 'IOptimizationConfig',
- type: 'type',
- code: `
-interface IOptimizationConfig {
- animat: boolean
- delayHover: number
- scrollX: {
- // 指定大于多少范围时自动启动虚拟滚动(启用 X 虚拟滚动,必须固定所有列宽,否则无法兼容)默认100
- gt?: number
- // 当剩余数据少于指定范围时触发重新渲染 默认自动计算
- oSize?: number
- // 每次渲染条数 默认自动计算
- rSize?: number
- // 指定可视区域条数
- vSize?: number
- }
- scrollY: {
- // 指定大于多少范围时自动启动虚拟滚动(启用 Y 虚拟滚动,必须固定所有行高,否则无法兼容)默认500
- gt?: number
- // 当剩余数据少于指定范围时触发重新渲染 默认自动计算
- oSize?: number
- // 每次渲染条数 默认自动计算
- rSize?: number
- // 指定可视区域条数 默认自动计算
- vSize?: number
- // 指定行高 默认自动计算
- rHeight?: number
- // 自动适配最优的渲染方式 默认true
- adaptive?: boolean
- }
-}
- `
- },
- {
- name: 'IKeyboardConfig',
- type: 'type',
- code: `
-interface IKeyboardConfig {
- // 启用方向键功能
- isArrow?: boolean
- isDel?: boolean
- isTab?: boolean
- isEdit?: boolean
-}
- `
- },
- {
- name: 'IMouseConfig',
- type: 'type',
- code: `
-interface IMouseConfig {
- // 是否开启左键选中单元格功能(只对 editConfig.mode=cell 有效),默认为 false
- selected: boolean
-}
- `
- },
- {
- name: 'IRadioConfig',
- type: 'type',
- code: `
-interface IRadioConfig {
- // 触发选中的方式,可选项包括 cell(单击图标所在单元格触发) / row(点击行触发),默认点击图标触发
- trigger?: 'cell' | 'row'
- // 单选框显示的字段名,可以直接显示在单选框中
- labelField?: string |
- // 默认选中指定行(只会在初始化时被触发一次,需要有 row-id)
- checkRowKey?: string
- // 是否允许选中的方法,该方法的返回值用来决定这一行的 Radio 是否可以选中
- checkMethod?: ()=> boolean
-}
- `
- },
- {
- name: 'ISelectConfig',
- type: 'type',
- code: `
-interface ISelectConfig {
- // 触发选中的方式,可选项包括 cell(单击图标所在单元格触发) / row(点击行触发),默认点击图标触发
- trigger?: 'cell' | 'row'
- // 复选框显示的字段名,可以直接显示在复选框中
- labelField?: string
- // 默认勾选开指定行(只会在初始化时被触发一次,需要有 row-id)
- checkRowKeys?: string[]
- // 是否允许选中的方法,该方法的返回值用来决定这一行的 checkbox 是否可以勾选
- checkMethod?: ()=> boolean
- // 默认勾选所有(只会在初始化时被触发一次)}
- checkAll?: boolean
- // 是否显示全选按钮(如果 checkStrictly=true 则默认为 false)
- showHeader?: boolean
- // 是否严格的遵循父子不互相关联的做法
- checkStrictly?: boolean
- // 翻页操作是否保留历史选择数据
- reserve?: boolean
-}
- `
- },
- {
- name: 'ISortConfig',
- type: 'type',
- code: `
-interface ISortConfig {
- // 排序触发方式,可配置为 cell(点击头部单元格触发排序),不配置时默认为点击上下箭头触发排序
- trigger?: 'cell'
-}
- `
- },
- {
- name: 'ITreeConfig',
- type: 'type',
- code: `
-interface ITreeConfig {
- // 展开子级触发方式:'default'(点击按钮触发);'cell'(点击单元格触发);'row'(点击行触发)
- trigger?: 'default' | 'cell' | 'row'
- // 子级索引是否按数字递增显示:true(子级索引按数字递增显示,父级1,子级2);false(子级索引在父级索引基础上增加,父级1,子级1.1)
- ordered?: boolean
- // 控制水平缩进距离,默认 16,单位 px
- indent?: number
- // 指定子级数据的字段名
- children?: string
- // 是否展开所有行
- expandAll?: boolean
- // 默认展开所给数组中的指定行,需要有row-id,可以由行的'_RID'属性获取
- expandRowKeys?: string[]
- // 对于同一级的多个子节点,是否只能同时展开一个子节点
- accordion?: boolean
-}
- `
- },
- {
- name: 'IValidConfig',
- type: 'type',
- code: `
-interface IValidConfig {
- // 校验提示类型,'inline'(内置提示);'tooltip'(tooltip文字提示)
- message?: 'inline' | 'tooltip'
-}
- `
- },
- {
- name: 'ISummaryConfig',
- type: 'type',
- code: `
-interface ISummaryConfig {
- // 统计字段名
- fields: string[]
- // 小数点后保留的小数位
- fraction?: boolean
- // 是否截断,默认为四舍五入,不截断
- truncate?: boolean
- // 统计显示的文本
- text?: string
-}
- `
- },
- {
- name: 'IScrollLoadConfig',
- type: 'type',
- code: `
-interface IScrollLoadConfig {
- // 是否连续
- isInfinity: boolean
- // 每次加载多少条
- pageSize: number
-}
- `
- },
- {
- name: 'IEventsConfig',
- type: 'type',
- code: `
-interface IEventsConfig {
- [field: string]: ()=> void
-}
- `
- },
- {
- name: 'IDropConfig',
- type: 'type',
- code: `
-interface IDropConfig {
- // sortablejs 插件
- plugin: Sortable
- // 开启行拖拽
- row: boolean
- // 开启列拖拽
- column: boolean
- // 拖拽前函数,返回 false 取消拖动
- onBeforeMove?: ()=> boolean
- // 拖拽触发源选择器一般是class类名
- trigger?: string
- // 根据行的类名来控制是否可以拖动
- filter?: string
- // 如果变动了树层级,可以指定是否需要刷新数据
- refresh?: boolean
- }
- `
- },
- {
- name: 'IEditConfig',
- type: 'type',
- code: `
-interface IEditConfig {
- // 激活触发方式
- trigger: 'click' | 'dblclick' | 'manual'
- // 激活类型单元格激活或者行
- mode: 'cell' | 'row'
- // 是否显示状态
- showStatus?: boolean
- // 自定义编辑规则,返回true可以编辑返回false则禁止编辑
- activeMethod?: ({row: IRow, column: IColumnConfig})=> boolean
-}
- `
- },
- {
- name: 'IRecordset',
- type: 'type',
- code: `
-interface IRecordset {
- insertRecords: IRow[]
- removeRecords: IRow[]
- updateRecords: IRow[]
-}
- `
- },
- {
- name: 'IPageChangeArgs',
- type: 'type',
- code: `
-interface IPageChangeArgs {
- // table组件vue实例
- $grid: Component
- // 当前页码
- currentPage: number
- //当前分页组件布局信息 'total, prev, pager, next, jumper, sizes'
- layout: string
- // 当前每页显示条数
- pageSize: number
- //可切换的每页条数
- pageSizes: number[]
- //总数据条数
- total: number
-}
- `
- },
- {
- name: 'IBeforePageChangeArgs',
- type: 'type',
- code: `
-interface IBeforePageChangeArgs {
- //新页码
- newPage: number
- //新的分页大小
- newPageSize: number
- //当前页码
- currentPage: number
- //当前的页大小
- currentPageSize: number
- //生效回调
- callback: ()=> void
- //失效回调
- rollback: ()=> void
-}
- `
- },
- {
- name: 'IToolbarButtonClickArgs',
- type: 'type',
- code: `
-interface IToolbarButtonClickArgs {
- //表格组件实例对象信息
- $grid: Component
- //按钮信息对象
- button: {
- code: string
- name: string
- }[]
- // 按钮功能类型
- code: string
-}
- `
- },
- {
- name: 'ICellClickArgs',
- type: 'type',
- code: `
-interface ICellClickArgs {
- // 当前行
- row: object,
- // 当前行的下标
- rowIndex: number
- // 当前列
- column: object
- // 当前列的下标
- columnIndex: number
-}
- `
- },
- {
- name: 'ICellClickArgs',
- type: 'type',
- code: `
-interface ICellClickArgs {
- // 当前行
- row: object
- // 当前行的下标
- rowIndex: number
- // 当前列
- column: object
- // 当前列的下标
- columnIndex: number
-}
- `
- },
- {
- name: 'ICellContextMenuArgs',
- type: 'type',
- code: `
-interface ICellContextMenuArgs {
- // 当前行
- row: object
-}
- `
- },
- {
- name: 'ICellArgs',
- type: 'type',
- code: `
-interface ICellArgs {
- //当前行
- row: object
- //当前行的下标
- rowIndex: number
- // 当前列
- column: object
- // 当前列的下标
- columnIndex: number
-}
- `
- },
- {
- name: 'ICurrentChangeArgs',
- type: 'type',
- code: `
-interface ICurrentChangeArgs {
- // 当前行
- row: object
-}
- `
- },
- {
- name: 'IEditActivedArgs',
- type: 'type',
- code: `
-interface IEditActivedArgs {
- // 当前行
- row: object
- // 当前列
- column: object
-}
- `
- },
- {
- name: 'IEditClosedArgs',
- type: 'type',
- code: `
-interface IEditClosedArgs {
- // 当前行
- row: object
- // 当前列
- column: object
-}
- `
- },
- {
- name: 'IEditDisabledArgs',
- type: 'type',
- code: `
-interface IEditDisabledArgs {
- //当前行
- row: object
- // 当前列
- column: object
-}
- `
- },
- {
- name: 'IFilterChangeArgs',
- type: 'type',
- code: `
-interface IFilterChangeArgs {
- //表格的信息对象
- $table: Component
- //过滤列的过滤数据信息
- filters: object
-}
- `
- },
- {
- name: 'IFooterCellClickArgs',
- type: 'type',
- code: `
-interface IFooterCellClickArgs {
- $columnIndex: number
- $rowIndex: number
- // table组件vue实例
- $table: Component
- // 当前单元格节点
- cell: HTMLElement
- // 当前列信息
- column: object
- columnIndex: number
-}
- `
- },
- {
- name: 'IContextMenuArgs',
- type: 'type',
- code: `
-interface IContextMenuArgs {
- $columnIndex: number
- $rowIndex: number
- // table组件vue实例
- $table: Component
- // 当前单元格节点
- cell: HTMLElement
- // 当前列信息
- column: object
- columnIndex: number
- // 配置清除等功能信息
- options: object[]
- // 表格区域类型
- type: 'header' | 'footer' | 'body'
-}
- `
- },
- {
- name: 'IFooterCellDblClickArgs',
- type: 'type',
- code: `
-interface IFooterCellDblClickArgs {
- $columnIndex: number
- $rowIndex: number
- // table组件vue实例
- $table: Component
- // 当前单元格节点
- cell: HTMLElement
- // 当前列信息
- column: object
- columnIndex: number
-}
- `
- },
- {
- name: 'IHeaderCellClickArgs',
- type: 'type',
- code: `
-interface IHeaderCellClickArgs {
- $columnIndex: number
- $rowIndex: number
- // table组件vue实例
- $table: Component
- // 点击表头单元格
- cell: HTMLElement
- // 当前列信息
- column: object
- columnIndex: number
- // 当前点击节点过滤标识
- triggerFilter: boolean
- // 当前点击节点排序标识
- triggerSort: boolean
-}
- `
- },
- {
- name: 'IHeaderCellDblClickArgs',
- type: 'type',
- code: `
-interface IHeaderCellDblClickArgs {
- // 列数据
- column: object
- // 列索引
- columnIndex: number
- // table组件 vue实例
- $table: Component
- // 点击的单元格dom
- cell: HTMLElement
-}
- `
- },
- {
- name: 'IResizableChangeArgs',
- type: 'type',
- code: `
-interface IResizableChangeArgs {
- // table组件的vue 实例
- $table: Component,
- // 列配置信息
- column: object
- // 拖动列的索引
- columnIndex: number
- // 是否固定列
- fixed: boolean
-}
- `
- },
- {
- name: 'IScrollArgs',
- type: 'type',
- code: `
-interface IScrollArgs {
- // 表格实例对象信息
- $table: Component
- fixed: boolean
- // X轴滚动
- isX: boolean
- // Y轴滚动
- isY: true
- // X轴滚动距离
- scrollLeft: number
- // Y轴滚动距离
- scrollTop: number
- type: 'body' | 'header' | 'footer'
-}
- `
- },
- {
- name: 'ISelectAllArgs',
- type: 'type',
- code: `
-interface ISelectAllArgs {
- $columnIndex: number
- $rowIndex: number
- $seq: string
- // 表格实例对象信息
- $table: Component
- // 勾选状态
- checked: boolean
- // 列信息
- column: IColumnConfig
- // 列下标
- columnIndex: number
- // 表格数据
- data: IRow[]
- fixed: boolean
- isHidden: boolean
- level: number
- // 勾选项的行数据信息
- row: IRow
- // 勾选项的行下标
- rowIndex: number
- // 选中的数据
- selection: IRow[]
- seq: number
-}
- `
- },
- {
- name: 'IToggleExpandChangeArgs',
- type: 'type',
- code: `
-interface IToggleExpandChangeArgs {
- // 表格实例对象信息
- $table: Component,
- //点击展开行的数据信息对象
- row: IRow
- // 点击展开行的下标
- rowIndex: number
-}
- `
- },
- {
- name: 'IToggleTreeChangeArgs',
- type: 'type',
- code: `
-interface IToggleTreeChangeArgs {
- // 表格实例对象信息
- $table: Component,
- //点击展开行的数据信息对象
- row: IRow
- // 点击展开行的下标
- rowIndex: number
-}
- `
- },
- {
- name: 'IValidErrorArgs',
- type: 'type',
- code: `
-interface IValidErrorArgs {
- // 校验的单元格信息对象
- cell: Cell
- //校验单元格所在列的列配置信息对象
- column: IColumnConfig
- //校验单元格所在行的信息对象
- row: IRow
- // 校验规则信息对象
- rule: object
-}
- `
- },
- {
- name: 'ISortChangeArgs',
- type: 'type',
- code: `
-interface ISortChangeArgs {
- // 表格实例对象信息
- $grid: Component
- // 列信息
- column: IColumnConfig
- // 排序的字段名
- field: string
- // 排序类型升序或降序
- order: 'asc' | 'desc'
- prop: string
- property: string
-}
- `
- },
- {
- name: 'IClassNameArgs',
- type: 'type',
- code: `
-interface IClassNameArgs {
- seq: number
- row: IRow
- rowIndex: number
- $rowIndex: number
- column: IColumnConfig
- columnIndex: number
- $columnIndex: number
-}
- `
- },
- {
- name: 'IIndexMethodArgs',
- type: 'type',
- code: `
-interface IIndexMethodArgs {
- row: IRow
- rowIndex: number
- column: IColumnConfig
- columnIndex: number
-}
- `
- },
- {
- name: 'IFormatConfig',
- type: 'type',
- code: `
-interface IFormatConfig {
- // 列数据源
- data: IColumnConfig[]
- // 内置渲染器类型,与 format-text 属性取值相同
- type: 'money' | 'enum' | 'select' | 'number' | 'integer' | 'filesize' | 'date' | 'dateTime' | 'longDateTime' | 'time' | 'longTime' | 'yearMonth' | 'ellipsis' | 'rate'
- // 配置为 true 后,支持动态修改 data 的数据。还可以配置为对象,配置为对象时,对象中可以配置 splitConfig.enabled(是否启用分隔配置)、splitConfig.valueSplit(指定 value 值的分隔符)、splitConfig.textSplit(指定 text 的分隔符)、fetch(列数据异步渲染,请求数据)
- async: true,
- // 单元格显示内容的映射
- label: string
- // 单元格取值的映射
- value: string
-}
- `
- },
- {
- name: 'IButtonClick',
- type: 'type',
- code: `
-interface IButtonClick {
- // 表格组件实例对象信息
- $grid: Component
- // 按钮列表信息对象
- button: {
- code: string
- name: string
- }[]
- // 按钮类型
- code: string
- }
- `
- },
- {
- name: 'ISettingConfigs',
- type: 'type',
- code: `
-interface ISettingConfigs {
- sortType: 'page' | 'all'
- pageSize: number
- columns: {
- property: string
- order: 'asc' | 'desc' | null
- visible: boolean
- sortable: boolean
- }[]
-}
- `
- },
- {
- name: 'ISpanMethodArgs',
- type: 'type',
- code: `
-interface ISpanMethodArgs {
- // 行标
- $rowIndex: number
- // 列数据
- column: IColumnConfig
- // 列下标
- columnIndex: number
- // 一个数组,保存了当前合并和计算的数据
- data: (string | number | null)[][]
-}
- `
- },
- {
- name: 'IExportCsvOptions',
- type: 'type',
- code: `
-interface IExportCsvOptions {
- filename: string
- original: boolean
- isHeader: boolean
- data: IRow[]
-}
- `
- },
- {
- name: 'IEditorConfig',
- type: 'type',
- code: `
-interface IEditorConfig {
- // 内置组件名称或者自定义组件实例
- component: 'input' | 'select' | Component
- // 传递给组件的事件集合
- events?: {
- [event]: ()=> void
- }
- // 传递给编辑器组件的属性集合
- attrs?: {
- [prop]: any
- }
- // select 内置组件独有的下拉数据配置项
- options?: object[]
-}
- `
- },
- {
- name: 'IFilterConfig',
- type: 'type',
- code: `
-interface IFilterConfig {
- // 设置在显示枚举选项功能是否为多选, 仅在 enumable:true 下有效
- multi: boolean
- // 设置在过滤面板中显示枚举选项
- enumable: boolean
- // 设置在过滤面板中显示默认的筛选条件
- defaultFilter: boolean
- // 设置在过滤面板中显示输入筛选的项
- inputFilter: boolean
- // 设置在显示枚举选项功能(enumable)下制定静态数据源,也可以是函数返回一个Promise对象
- values: {
- // 设置枚举数据的显示值属性字段, 默认'label'
- label: string
- // 设置枚举数据的实际值属性字段, 默认'value'
- value: string
- }[] | ()=> Promise
-}
- `
- },
- {
- name: 'IOPConfig',
- type: 'type',
- code: `
-interface IOPConfig {
- editConfig?: IEditConfig
- pagerConfig?: IPagerConfig
- columns: IColumnConfig[]
- data: IRow[]
-}
- `
- },
- {
- name: 'IFormatText',
- type: 'type',
- code: `
- 'money' | 'enum' | 'select' | 'number' | 'integer' | 'filesize' | 'date' | 'dateTime' | 'longDateTime' | 'time' | 'longTime' | 'yearMonth' | 'ellipsis' | 'rate' | 'boole' | (params)=> string
- `
- },
- {
- name: 'IToolbarSetting',
- type: 'type',
- code: `
- interface IToolbarSetting {
- remote?: boolean
- storage?: string
- sortable?: Sortable
- }
- `
+ codeFiles: ['base/basic-usage-conf.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/guide/webdoc/guide.js b/examples/sites/demos/pc/app/guide/webdoc/guide.js
index c6ce15a37..8d2975297 100644
--- a/examples/sites/demos/pc/app/guide/webdoc/guide.js
+++ b/examples/sites/demos/pc/app/guide/webdoc/guide.js
@@ -3,278 +3,117 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基础用法', 'en-US': '' },
- 'desc': {
- 'zh-CN': '通过 dom-data
设置每一个步骤要显示的内容,show-step
设置为 true
即可开启指引。dom-data
详细配置可参考 IDomData 类型。
',
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基础用法',
'en-US': ''
},
- 'codeFiles': ['basic-usage.vue']
- },
- {
- 'demoId': 'arrow-position',
- 'name': { 'zh-CN': '箭头位置', 'en-US': '' },
- 'desc': {
- 'zh-CN': `
- 通过 pop-position
属性设置箭头位置,该属性的可选值可参考 IPosition 类型。
- 若存在多个步骤,需要单独给每个步骤设置不同的展示位置,可以在 dom-data
里面添加 popPosition
属性并赋值,若存在单独设置的箭头位置,则会覆盖全局的箭头位置。
- `,
+ desc: {
+ 'zh-CN':
+ '通过 dom-data
设置每一个步骤要显示的内容,show-step
设置为 true
即可开启指引。dom-data
详细配置可参考 IDomData 类型。
',
'en-US': ''
},
- 'codeFiles': ['arrow-position.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'only-content',
- 'name': { 'zh-CN': '纯段落用户引导', 'en-US': '' },
- 'desc': {
+ demoId: 'arrow-position',
+ name: {
+ 'zh-CN': '箭头位置',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN':
+ '\n 通过 pop-position
属性设置箭头位置,该属性的可选值可参考 IPosition 类型。
\n 若存在多个步骤,需要单独给每个步骤设置不同的展示位置,可以在 dom-data
里面添加 popPosition
属性并赋值,若存在单独设置的箭头位置,则会覆盖全局的箭头位置。
\n ',
+ 'en-US': ''
+ },
+ codeFiles: ['arrow-position.vue']
+ },
+ {
+ demoId: 'only-content',
+ name: {
+ 'zh-CN': '纯段落用户引导',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN': '通过添加 only-content
类名实现纯段落用户引导。
',
'en-US': ''
},
- 'codeFiles': ['only-content.vue']
+ codeFiles: ['only-content.vue']
},
{
- 'demoId': 'highlight-box',
- 'name': { 'zh-CN': '高亮多处', 'en-US': '' },
- 'desc': {
+ demoId: 'highlight-box',
+ name: {
+ 'zh-CN': '高亮多处',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN': '在 dom-data
里面通过 hightBox
属性添加需要高亮的元素。
',
'en-US': ''
},
- 'codeFiles': ['highlight-box.vue']
+ codeFiles: ['highlight-box.vue']
},
{
- 'demoId': 'offset',
- 'name': { 'zh-CN': '引导框偏移量', 'en-US': '' },
- 'desc': {
- 'zh-CN': '通过 main-axis
/ cross-axis
/ alignment-axis
设置纵轴、横轴和对齐轴的偏移量。
',
+ demoId: 'offset',
+ name: {
+ 'zh-CN': '引导框偏移量',
'en-US': ''
},
- 'codeFiles': ['offset.vue']
- },
- {
- 'demoId': 'image-text',
- 'name': { 'zh-CN': '图文结合用户引导', 'en-US': '' },
- 'desc': {
- 'zh-CN': '可以在插槽里面添加任何 html
或通过 dom-data
里面的 text
属性实现图文结合用户引导。
',
+ desc: {
+ 'zh-CN':
+ '通过 main-axis
/ cross-axis
/ alignment-axis
设置纵轴、横轴和对齐轴的偏移量。
',
'en-US': ''
},
- 'codeFiles': ['image-text.vue']
+ codeFiles: ['offset.vue']
},
{
- 'demoId': 'size',
- 'name': { 'zh-CN': '自定义宽高', 'en-US': '' },
- 'desc': {
+ demoId: 'image-text',
+ name: {
+ 'zh-CN': '图文结合用户引导',
+ 'en-US': ''
+ },
+ desc: {
+ 'zh-CN':
+ '可以在插槽里面添加任何 html
或通过 dom-data
里面的 text
属性实现图文结合用户引导。
',
+ 'en-US': ''
+ },
+ codeFiles: ['image-text.vue']
+ },
+ {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '自定义宽高',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN': '通过添加 width
和 height
来自定义宽高。
',
'en-US': ''
},
- 'codeFiles': ['size.vue']
+ codeFiles: ['size.vue']
},
{
- 'demoId': 'modal-overlay-opening',
- 'name': { 'zh-CN': '模态叠加层开口', 'en-US': '' },
- 'desc': {
- 'zh-CN': `
- modal-overlay-opening-padding
:可以在模态叠加层开口周围添加的填充量,控制引导元素高亮范围。
- modal-overlay-opening-radius
:可以在模态叠加层开口周围添加的边界半径量,控制引导元素高亮圆角。
- `,
+ demoId: 'modal-overlay-opening',
+ name: {
+ 'zh-CN': '模态叠加层开口',
'en-US': ''
},
- 'codeFiles': ['modal-overlay-opening.vue']
+ desc: {
+ 'zh-CN':
+ '\n modal-overlay-opening-padding
:可以在模态叠加层开口周围添加的填充量,控制引导元素高亮范围。
\n modal-overlay-opening-radius
:可以在模态叠加层开口周围添加的边界半径量,控制引导元素高亮圆角。
\n ',
+ 'en-US': ''
+ },
+ codeFiles: ['modal-overlay-opening.vue']
},
{
- 'demoId': 'callback',
- 'name': { 'zh-CN': '事件回调', 'en-US': '' },
- 'desc': {
+ demoId: 'callback',
+ name: {
+ 'zh-CN': '事件回调',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN': '事件回调在 dom-data
中使用,详情可参考 IDomData 类型。
',
'en-US': ''
},
- 'codeFiles': ['callback.vue']
- }
- ],
- apis: [
- {
- 'name': 'guide',
- 'type': 'component',
- 'props': [
- {
- 'name': 'alignment-axis',
- 'type': 'number',
- 'defaultValue': '0',
- 'desc': {
- 'zh-CN': '设置引导框对齐轴距离',
- 'en-US': ''
- },
- 'demoId': 'offset'
- },
- {
- 'name': 'arrow',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否显示工具提示的箭头',
- 'en-US': ''
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'cross-axis',
- 'type': 'number',
- 'defaultValue': '0',
- 'desc': {
- 'zh-CN': '设置引导框横轴距离',
- 'en-US': ''
- },
- 'demoId': 'offset'
- },
- {
- 'name': 'dom-data',
- 'type': 'IDomData[]',
- 'typeAnchorName': 'IDomData',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '用户引导参数',
- 'en-US': ''
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'height',
- 'type': 'number',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '设置引导框高度',
- 'en-US': ''
- },
- 'demoId': 'size'
- },
- {
- 'name': 'light-class',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '当元素突出显示时(即,当其步骤处于活动状态时)应用于元素的类名',
- 'en-US': ''
- },
- 'demoId': ''
- },
- {
- 'name': 'main-axis',
- 'type': 'number',
- 'defaultValue': '18',
- 'desc': {
- 'zh-CN': '设置引导框主轴(纵轴)距离',
- 'en-US': ''
- },
- 'demoId': 'offset'
- },
- {
- 'name': 'modal-overlay-opening-padding',
- 'type': 'number',
- 'defaultValue': '0',
- 'desc': {
- 'zh-CN': '在模态叠加层开口周围添加的填充量',
- 'en-US': ''
- },
- 'demoId': 'modal-overlay-opening'
- },
- {
- 'name': 'modal-overlay-opening-radius',
- 'type': 'number',
- 'defaultValue': '0',
- 'desc': {
- 'zh-CN': '在模态叠加层开口周围添加的边界半径量',
- 'en-US': ''
- },
- 'demoId': 'modal-overlay-opening'
- },
- {
- 'name': 'pop-position',
- 'type': 'IPosition',
- 'typeAnchorName': 'IPosition',
- 'defaultValue': '\'bottom\'',
- 'desc': {
- 'zh-CN': '引导框箭头位置,该属性的可选值可参考 IPosition 类型',
- 'en-US': ''
- },
- 'demoId': 'arrow-position'
- },
- {
- 'name': 'width',
- 'type': 'number',
- 'defaultValue': '510',
- 'desc': {
- 'zh-CN': '设置引导框宽度',
- 'en-US': ''
- },
- 'demoId': 'size'
- }
- ],
- 'events': [],
- 'slots': [
- {
- 'name': 'main',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置引导框内容',
- 'en-US': ''
- },
- 'demoId': 'highlight-box'
- }
- ]
- }
- ],
- 'types': [
- {
- name: 'IDomData',
- type: 'interface',
- code: `
-interface IDomData {
- // 指引的标题
- title: string
- // 指引的内容(可以是 html)
- text: string
- // 需要绑定指引的元素类名(只能是类名,若未传入则显示为上下左右居中且无指示箭头)
- domElement: string
- // 添加需要高亮的元素的类名
- hightBox: string[]
- // 要添加到步骤的内容元素的一串类名
- classes: string
-
- // 展示前的回调函数
- beforeShow: () => void
- // 隐藏前的回调函数
- beforeHide: () => void
- // 显示的回调函数
- show: () => void
- // 隐藏的回调函数
- hide: () => void
- // 关闭的回调函数
- cancel: () => void
- //销毁的回调函数
- destroy: () => void
- // 完成的回调函数
- completey: () => void
-
- // 需要设置的按钮组
- button: {
- // 按钮名
- text: string
- // 需要执行的步骤,包含 next(下一步)、back(返回)、complete(完成)
- action: 'next' | 'back' | 'complete'
- // 按钮的类名
- classes: string
- // 是否是次要按钮
- secondary: boolean
- }[]
-}
- `
- },
- {
- name: 'IPosition',
- type: 'type',
- code: `
-type IPosition = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'
- `
+ codeFiles: ['callback.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/hrapprover/basic-usage-composition-api.vue b/examples/sites/demos/pc/app/hrapprover/basic-usage-composition-api.vue
index c039dff13..7ef3c6470 100644
--- a/examples/sites/demos/pc/app/hrapprover/basic-usage-composition-api.vue
+++ b/examples/sites/demos/pc/app/hrapprover/basic-usage-composition-api.vue
@@ -1,9 +1,5 @@
-
+
+
+
diff --git a/examples/sites/demos/pc/app/image/custom-placeholder.spec.ts b/examples/sites/demos/pc/app/image/custom-placeholder.spec.ts
new file mode 100644
index 000000000..7e198acd3
--- /dev/null
+++ b/examples/sites/demos/pc/app/image/custom-placeholder.spec.ts
@@ -0,0 +1,16 @@
+import { test, expect } from '@playwright/test'
+
+test('占位内容', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('image#basic-usage')
+
+ const preview = page.locator('.pc-demo-container')
+ const imgs = preview.locator('.tiny-image > .tiny-image__inner')
+ await expect(imgs).toHaveCount(5)
+
+ await expect(imgs.nth(0)).toHaveCSS('object-fit', 'fill')
+ await expect(imgs.nth(1)).toHaveCSS('object-fit', 'contain')
+ await expect(imgs.nth(2)).toHaveCSS('object-fit', 'cover')
+ await expect(imgs.nth(3)).toHaveCSS('object-fit', 'none')
+ await expect(imgs.nth(4)).toHaveCSS('object-fit', 'scale-down')
+})
diff --git a/examples/sites/demos/pc/app/image/custom-placeholder.vue b/examples/sites/demos/pc/app/image/custom-placeholder.vue
new file mode 100644
index 000000000..45d35d94b
--- /dev/null
+++ b/examples/sites/demos/pc/app/image/custom-placeholder.vue
@@ -0,0 +1,42 @@
+
+
+
+ 默认
+
+
+
+
+ 自定义
+
+
+ 加载中...
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/image/events-composition-api.vue b/examples/sites/demos/pc/app/image/events-composition-api.vue
index 8f0fe6cda..83b5f380d 100644
--- a/examples/sites/demos/pc/app/image/events-composition-api.vue
+++ b/examples/sites/demos/pc/app/image/events-composition-api.vue
@@ -1,12 +1,14 @@
-
+
+
-
diff --git a/examples/sites/demos/pc/app/image/preview-in-dialog-composition-api.vue b/examples/sites/demos/pc/app/image/preview-in-dialog-composition-api.vue
index 0c73f025e..84cce92d1 100644
--- a/examples/sites/demos/pc/app/image/preview-in-dialog-composition-api.vue
+++ b/examples/sites/demos/pc/app/image/preview-in-dialog-composition-api.vue
@@ -1,18 +1,16 @@
-
- 弹出Dialog
-
-
-
-
-
- 确 定
-
-
-
+ 弹出Dialog
+
+
+
+
+
+ 确 定
+
+
-
+
+
diff --git a/examples/sites/demos/pc/app/image/preview-in-dialog.vue b/examples/sites/demos/pc/app/image/preview-in-dialog.vue
index c6ec945c8..7f21f76a9 100644
--- a/examples/sites/demos/pc/app/image/preview-in-dialog.vue
+++ b/examples/sites/demos/pc/app/image/preview-in-dialog.vue
@@ -2,8 +2,8 @@
弹出Dialog
-
-
+
+
确 定
@@ -12,7 +12,7 @@
-
+
+
diff --git a/examples/sites/demos/pc/app/image/preview.vue b/examples/sites/demos/pc/app/image/preview.vue
index 4ecafa71c..a3ab32151 100644
--- a/examples/sites/demos/pc/app/image/preview.vue
+++ b/examples/sites/demos/pc/app/image/preview.vue
@@ -1,8 +1,10 @@
-
+
+
+
-
+
+
diff --git a/examples/sites/demos/pc/app/image/slot-composition-api.vue b/examples/sites/demos/pc/app/image/slot-composition-api.vue
index f3ae4adee..7458048d0 100644
--- a/examples/sites/demos/pc/app/image/slot-composition-api.vue
+++ b/examples/sites/demos/pc/app/image/slot-composition-api.vue
@@ -1,6 +1,6 @@
-
-
+
+
加载中
@@ -8,17 +8,17 @@
-
+
默认加载失败
-
+
自定义加载失败
-
+
图片已丢失
- 404 IMAGE
+ 404 IMAGE
@@ -26,7 +26,7 @@
-
diff --git a/examples/sites/demos/pc/app/image/slot.vue b/examples/sites/demos/pc/app/image/slot.vue
index 8183e97e5..60c8c530b 100644
--- a/examples/sites/demos/pc/app/image/slot.vue
+++ b/examples/sites/demos/pc/app/image/slot.vue
@@ -1,6 +1,6 @@
-
-
+
+
加载中
@@ -8,17 +8,17 @@
-
+
默认加载失败
-
+
自定义加载失败
-
+
图片已丢失
- 404 IMAGE
+ 404 IMAGE
@@ -26,7 +26,7 @@
-
diff --git a/examples/sites/demos/pc/app/image/webdoc/image.js b/examples/sites/demos/pc/app/image/webdoc/image.js
index 06befe977..46046c340 100644
--- a/examples/sites/demos/pc/app/image/webdoc/image.js
+++ b/examples/sites/demos/pc/app/image/webdoc/image.js
@@ -3,226 +3,98 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
- 'zh-CN': `
- 通过 src
设置图片路径。
- 通过 fit
属性确定图片如何适应到容器框,同原生 css 的 object-fit 属性。
-
- object-fit 说明
- fill:被替换的内容将被缩放,以在填充元素的内容框时保持其宽高比
- contain:被替换的内容大小可以填充元素的内容框
- cover:被替换的内容大小保持其宽高比,同时填充元素的整个内容框
- none:被替换的内容尺寸不会被改变
- scale-down:内容的尺寸就像是指定了none 或 contain,取决于哪一个将导致更小的对象尺寸。
-
-
- `,
- 'en-US': `
- Set the image path using src
.
- The fit
attribute determines how the image will fit into the container frame, the same as the object-fit attribute of native css.
-
- object-fit Description
- fill: The content being replaced will be scaled to maintain its aspect ratio as it fills the element's content box
- contain: The size of the content to fill the element's content box
- cover: The size of the content being replaced maintains its aspect ratio while filling the element's entire content box
- none: The size of the content to be replaced will not be changed
- scale-down: The size of the content is specified as either none or contain, depending on which will result in a smaller object size.
-
-
- `
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
},
- 'codeFiles': ['basic-usage.vue']
+ desc: {
+ 'zh-CN':
+ '\n 通过 src
设置图片路径。
\n 通过 fit
属性确定图片如何适应到容器框,同原生 css 的 object-fit 属性。
\n \n object-fit 说明
\n fill:被替换的内容将被缩放,以在填充元素的内容框时保持其宽高比
\n contain:被替换的内容大小可以填充元素的内容框
\n cover:被替换的内容大小保持其宽高比,同时填充元素的整个内容框
\n none:被替换的内容尺寸不会被改变
\n scale-down:内容的尺寸就像是指定了none 或 contain,取决于哪一个将导致更小的对象尺寸。\n
\n \n ',
+ 'en-US':
+ '\n Set the image path using src
.
\n The fit
attribute determines how the image will fit into the container frame, the same as the object-fit attribute of native css.
\n \n object-fit Description
\n fill: The content being replaced will be scaled to maintain its aspect ratio as it fills the element\'s content box
\n contain: The size of the content to fill the element\'s content box
\n cover: The size of the content being replaced maintains its aspect ratio while filling the element\'s entire content box
\n none: The size of the content to be replaced will not be changed
\n scale-down: The size of the content is specified as either none or contain, depending on which will result in a smaller object size.\n
\n \n '
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'lazy',
- 'name': { 'zh-CN': '懒加载', 'en-US': 'Lazy Loading' },
- 'desc': {
- 'zh-CN': `
- 通过 lazy
开启懒加载功能,当图片滚动到可视范围内才会加载。
- 通过 scroll-container
来设置滚动容器,若未定义,则为最近一个 overflow
值为 auto
或 scroll
的父元素。\n
-
- lazy 懒加载的图片必须是远程的图片,不支持静态图片懒加载。
-
- `,
- 'en-US': `
- Enable lazy loading with lazy
, and the image will only load when it is in visual range.
- Set the scroll container by scroll-container
. If not defined, Is the parent element of the last overflow
value auto
or scroll
. \n
-
- lazy Lazy loading images must be remote images. Lazy loading of static images is not supported.
-
- `
+ demoId: 'custom-placeholder',
+ name: {
+ 'zh-CN': '占位内容',
+ 'en-US': 'Placeholder Content'
},
- 'codeFiles': ['lazy.vue']
+ desc: {
+ 'zh-CN': '通过 slot = placeholder
自定义占位内容。',
+ 'en-US': 'Set slot = placeholder
to customize the placeholder content.'
+ },
+ codeFiles: ['custom-placeholder.vue']
},
{
- 'demoId': 'preview',
- 'name': { 'zh-CN': '预览大图', 'en-US': 'Preview Large Image' },
- 'desc': {
- 'zh-CN': `
- 通过 preview-src-list
属性 ,传入一组图片url的数组,点击图片后,会进入预览大图的模式。
- 通过 z-index
设置预览图片的元素的z-index。
- `,
- 'en-US': `
- Pass in an array of image urls via the preview-src-list
property, and click on the image to enter the mode of previewing a large image.
- Set the z-index of the element of the preview image by z-index
.
- `
+ demoId: 'lazy',
+ name: {
+ 'zh-CN': '懒加载',
+ 'en-US': 'Lazy Loading'
},
- 'codeFiles': ['preview.vue']
+ desc: {
+ 'zh-CN':
+ '\n 通过 lazy
开启懒加载功能,当图片滚动到可视范围内才会加载。
\n 通过 scroll-container
来设置滚动容器,若未定义,则为最近一个 overflow
值为 auto
或 scroll
的父元素。\n\n \n lazy 懒加载的图片必须是远程的图片,不支持静态图片懒加载。
\n \n ',
+ 'en-US':
+ '\n Enable lazy loading with lazy
, and the image will only load when it is in visual range.
\n Set the scroll container by scroll-container
. If not defined, Is the parent element of the last overflow
value auto
or scroll
. \n\n \n lazy Lazy loading images must be remote images. Lazy loading of static images is not supported.
\n \n '
+ },
+ codeFiles: ['lazy.vue']
},
{
- 'demoId': 'preview-in-dialog',
- 'name': { 'zh-CN': '对话框中预览图片', 'en-US': 'Preview image in a dialog box' },
- 'desc': {
+ demoId: 'preview',
+ name: {
+ 'zh-CN': '预览大图',
+ 'en-US': 'Preview Large Image'
+ },
+ desc: {
+ 'zh-CN':
+ '\n 通过 preview-src-list
属性 ,传入一组图片url的数组,点击图片后,会进入预览大图的模式。
\n 通过 z-index
设置预览图片的元素的z-index。\n ',
+ 'en-US':
+ '\n Pass in an array of image urls via the preview-src-list
property, and click on the image to enter the mode of previewing a large image.
\n Set the z-index of the element of the preview image by z-index
.\n '
+ },
+ codeFiles: ['preview.vue']
+ },
+ {
+ demoId: 'preview-in-dialog',
+ name: {
+ 'zh-CN': '对话框中预览图片',
+ 'en-US': 'Preview image in a dialog box'
+ },
+ desc: {
'zh-CN': '在 dialog-box
元素中嵌入 image
进行图片预览。',
'en-US': 'Preview the image by embedding image
in the dialog-box
element. '
},
- 'codeFiles': ['preview-in-dialog.vue']
- },
-
- {
- 'demoId': 'slot',
- 'name': { 'zh-CN': '插槽', 'en-US': 'Slots' },
- 'desc': {
- 'zh-CN': `
- 通过 placeholder
插槽,定义图片在加载中时的占位内容。通常由于图片加载快,会看不到这个插槽的出现,只有大图片时,会看到加载中的插槽。
- 通过 error
插槽,定义图片在加载失败后的占位内容。
- `,
- 'en-US': `
- The placeholder
slot defines the placeholder content for images when loaded. Usually, because the image loads quickly, you will not see the appearance of this slot, only a large image, you will see the loading slot.
- Using the error
slot, define the placeholder content of the image after loading failure.
- `
- },
- 'codeFiles': ['slot.vue']
+ codeFiles: ['preview-in-dialog.vue']
},
{
- 'demoId': 'events',
- 'name': { 'zh-CN': '事件', 'en-US': 'Events' },
- 'desc': {
- 'zh-CN': `
- load
事件: 图片加载成功触发 。
- error
事件: 图片加载失败触发 。
- `,
- 'en-US': `
- load
event: The image is successfully loaded.
- error
event: The image failed to be loaded.
- `
+ demoId: 'slot',
+ name: {
+ 'zh-CN': '插槽',
+ 'en-US': 'Slots'
},
- 'codeFiles': ['events.vue']
- }
- ],
- apis: [
+ desc: {
+ 'zh-CN':
+ '\n 通过 placeholder
插槽,定义图片在加载中时的占位内容。通常由于图片加载快,会看不到这个插槽的出现,只有大图片时,会看到加载中的插槽。
\n 通过 error
插槽,定义图片在加载失败后的占位内容。 \n ',
+ 'en-US':
+ '\n The placeholder
slot defines the placeholder content for images when loaded. Usually, because the image loads quickly, you will not see the appearance of this slot, only a large image, you will see the loading slot.
\n Using the error
slot, define the placeholder content of the image after loading failure.\n '
+ },
+ codeFiles: ['slot.vue']
+ },
{
- 'name': 'image',
- 'type': 'component',
- 'props': [
- {
- 'name': 'src',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置图片路径',
- 'en-US': 'Set the path of the preview image.'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'fit',
- 'type': `'fill' | 'contain' | 'cover' | 'none' | 'scale-down '`,
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '确定图片如何适应容器大小',
- 'en-US': 'Determine how the image adapts to the container frame '
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'lazy',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否懒加载', 'en-US': 'Whether to enable lazy loading' },
- 'demoId': 'lazy'
- },
- {
- 'name': 'scroll-container',
- 'type': 'string | HTMLElement',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': `指定滚动容器。启用懒加载时,监听滚动容器的 scroll 事件来懒加载。
- 该属性用于设置图片的容器,当未设置容器时,默认会取最近一个 overflow 值为 auto 或 scroll 的父元素做为滚动容器
- `,
- 'en-US': `Specifies the scroll container. When lazy loading is enabled, the scroll event of the image component container is monitored for lazy loading.
- This property is used to set the image container. When the container is not set, the default will take the parent element of the last overflow value as auto or scroll as the scroll container
- `
- },
- 'demoId': ''
- },
- {
- 'name': 'preview-src-list',
- 'type': 'string[]',
- 'defaultValue': '[]',
- 'desc': {
- 'zh-CN': '指定预览大图时的图片列表',
- 'en-US': 'Specifies the list of images to use when previewing a large image'
- },
- 'demoId': 'preview'
- },
- {
- 'name': 'z-index',
- 'type': 'number',
- 'defaultValue': '2000',
- 'desc': {
- 'zh-CN': '图片预览功能时,设置最外层元素的 z-index',
- 'en-US': 'For the image preview function, set the z-index of the outermost element'
- },
- 'demoId': ''
- }
- ],
- 'events': [
- {
- 'name': 'load',
- 'type': '(ev) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '图片加载成功的触发的事件,参数为原生的成功事件',
- 'en-US': 'When the image loading success triggered,the parameter is a native success event.'
- },
- 'demoId': 'events'
- },
- {
- 'name': 'error',
- 'type': '(ev) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '图片加载失败后触发的事件,参数为原生的失败事件',
- 'en-US': 'When the Image loading failure triggered,the parameter is a native failure event'
- },
- 'demoId': 'events'
- }
- ],
- 'slots': [
- {
- 'name': 'placeholder',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '图片加载的占位内容插槽',
- 'en-US': 'Placeholder Slot that is not loaded to the image'
- },
- 'demoId': 'slot'
- },
- {
- 'name': 'error',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '图片加载失败的占位内容插槽',
- 'en-US': 'Error Slot that fails to be loaded'
- },
- 'demoId': 'slot'
- }
- ]
+ demoId: 'events',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': 'Events'
+ },
+ desc: {
+ 'zh-CN':
+ '\n load
事件: 图片加载成功触发 。
\n error
事件: 图片加载失败触发 。
\n ',
+ 'en-US':
+ '\n load
event: The image is successfully loaded.
\n error
event: The image failed to be loaded.
\n '
+ },
+ codeFiles: ['events.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/index.js b/examples/sites/demos/pc/app/index.js
deleted file mode 100644
index 9d5735e41..000000000
--- a/examples/sites/demos/pc/app/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import Components from './components'
-
-export const getDemoCode = ({ component, type, name }) => `${component}/${Components[component][type][name]}`
diff --git a/examples/sites/demos/pc/app/infinite-scroll/webdoc/infinite-scroll.js b/examples/sites/demos/pc/app/infinite-scroll/webdoc/infinite-scroll.js
index ba62330f6..9fbd25e9e 100644
--- a/examples/sites/demos/pc/app/infinite-scroll/webdoc/infinite-scroll.js
+++ b/examples/sites/demos/pc/app/infinite-scroll/webdoc/infinite-scroll.js
@@ -3,84 +3,31 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN':
'要实现滚动加载,需要在列表上添加指令 v-infinite-scroll
并指定加载方法,参考示例。
\n',
'en-US':
'To implement rolling loading, you need to add the directive v-infinite-scroll
to the list and specify the loading method. For details, see the example.
\n'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'disabled',
- 'name': { 'zh-CN': '禁用加载', 'en-US': 'Disabling loading' },
- 'desc': {
+ demoId: 'disabled',
+ name: {
+ 'zh-CN': '禁用加载',
+ 'en-US': 'Disabling loading'
+ },
+ desc: {
'zh-CN': '在滚动加载列表上添加属性 infinite-scroll-disabled
控制是否禁用加载,参考示例。
\n',
'en-US':
'Adds the property infinite-scroll-disabled
to the scrolling load list to control whether loading is disabled. For details, see the example.
\n'
},
- 'codeFiles': ['disabled.vue']
- }
- ],
- apis: [
- {
- 'name': 'infinite-scroll',
- 'type': 'directive',
- 'props': [
- {
- 'name': 'v-infinite-scroll',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '无限滚动加载指令,指定加载方法',
- 'en-US': 'Infinite roll load instruction, specifying the load method.'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'infinite-scroll-disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否禁用滚动',
- 'en-US': 'Whether to disable scrolling. '
- },
- 'demoId': 'disabled'
- },
- {
- 'name': 'infinite-scroll-immediate',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否立即加载,以防初始状态下内容无法撑满容器',
- 'en-US':
- 'Indicates whether to load the container immediately to prevent the container from being full in the initial state.'
- },
- 'demoId': ''
- },
- {
- 'name': 'infinite-scroll-delay',
- 'type': 'number',
- 'defaultValue': '200',
- 'desc': {
- 'zh-CN': '加载延时,单位为 ms',
- 'en-US': 'Loading delay, the unit is millisecond.'
- },
- 'demoId': ''
- },
- {
- 'name': 'infinite-scroll-distance',
- 'type': 'number',
- 'defaultValue': '0',
- 'desc': {
- 'zh-CN': '加载触发距离阈值,单位为 px',
- 'en-US': 'Threshold of the load triggering distance,the unit is px. '
- },
- 'demoId': ''
- }
- ]
+ codeFiles: ['disabled.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/input/counter.spec.ts b/examples/sites/demos/pc/app/input/counter.spec.ts
index 37a96538c..e3584a263 100644
--- a/examples/sites/demos/pc/app/input/counter.spec.ts
+++ b/examples/sites/demos/pc/app/input/counter.spec.ts
@@ -6,6 +6,6 @@ test('[Input]counter', async ({ page }) => {
const input = page.locator('.demo-input > .tiny-input')
await input.getByRole('textbox').click()
await input.getByRole('textbox').fill('123')
- const num = page.locator('.tiny-input__count-upper-limit')
+ const num = page.locator('.tiny-input__count-inner')
await expect(num).toHaveText('3')
})
diff --git a/examples/sites/demos/pc/app/input/display-only-composition-api.vue b/examples/sites/demos/pc/app/input/display-only-composition-api.vue
new file mode 100644
index 000000000..8966336b1
--- /dev/null
+++ b/examples/sites/demos/pc/app/input/display-only-composition-api.vue
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/input/display-only.vue b/examples/sites/demos/pc/app/input/display-only.vue
new file mode 100644
index 000000000..50a9ceb37
--- /dev/null
+++ b/examples/sites/demos/pc/app/input/display-only.vue
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/input/mask-composition-api.vue b/examples/sites/demos/pc/app/input/mask-composition-api.vue
new file mode 100644
index 000000000..eb12a12af
--- /dev/null
+++ b/examples/sites/demos/pc/app/input/mask-composition-api.vue
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/input/mask.vue b/examples/sites/demos/pc/app/input/mask.vue
new file mode 100644
index 000000000..1a655b211
--- /dev/null
+++ b/examples/sites/demos/pc/app/input/mask.vue
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/input/resize-composition-api.vue b/examples/sites/demos/pc/app/input/resize-composition-api.vue
index a9e96be7a..27caf0b00 100644
--- a/examples/sites/demos/pc/app/input/resize-composition-api.vue
+++ b/examples/sites/demos/pc/app/input/resize-composition-api.vue
@@ -6,8 +6,30 @@
autosize
-
+
+ hover-expand
+
+
@@ -17,6 +39,7 @@ import { Input as TinyInput } from '@opentiny/vue'
const input = ref('')
const textarea = ref('')
+const hoverText = ref('')
diff --git a/examples/sites/demos/pc/app/input/resize.vue b/examples/sites/demos/pc/app/input/resize.vue
index 74561cc9d..2112f11ea 100644
--- a/examples/sites/demos/pc/app/input/resize.vue
+++ b/examples/sites/demos/pc/app/input/resize.vue
@@ -6,8 +6,30 @@
autosize
-
+
+ hover-expand
+
+
@@ -21,7 +43,8 @@ export default {
data() {
return {
input: '',
- textarea: ''
+ textarea: '',
+ hoverText: ''
}
}
}
@@ -32,4 +55,8 @@ export default {
width: auto;
margin: 5px;
}
+
+.demo-input .expand {
+ width: 200px;
+}
diff --git a/examples/sites/demos/pc/app/input/show-word-limit.spec.ts b/examples/sites/demos/pc/app/input/show-word-limit.spec.ts
index 8fe33d84d..2d2e256e4 100644
--- a/examples/sites/demos/pc/app/input/show-word-limit.spec.ts
+++ b/examples/sites/demos/pc/app/input/show-word-limit.spec.ts
@@ -7,17 +7,16 @@ test('[Input]show-word-limit', async ({ page }) => {
const inputComponent = page.locator('.demo-input .tiny-input')
const input = inputComponent.locator('input')
const inputLength = inputComponent.locator('.tiny-input__count-text-length')
- const inputLimit= inputComponent.locator('.tiny-input__count-upper-limit')
+ const inputLimit = inputComponent.locator('.tiny-input__count-upper-limit')
await expect(inputLimit).toContainText('/10')
await input.fill('22')
await expect(inputLength).toContainText('2')
-
const textareaComponent = page.locator('.demo-input .tiny-textarea')
const textarea = textareaComponent.locator('textarea')
const textareaLength = textareaComponent.locator('.tiny-input__count-text-length')
- const textareaLimit= textareaComponent.locator('.tiny-input__count-upper-limit')
+ const textareaLimit = textareaComponent.locator('.tiny-input__count-upper-limit')
await expect(textareaLimit).toContainText('/20')
await textarea.fill('555')
diff --git a/examples/sites/demos/pc/app/input/webdoc/input.js b/examples/sites/demos/pc/app/input/webdoc/input.js
index ea368db31..d06c330fd 100644
--- a/examples/sites/demos/pc/app/input/webdoc/input.js
+++ b/examples/sites/demos/pc/app/input/webdoc/input.js
@@ -3,605 +3,245 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '详细用法参考如下示例。
', 'en-US': 'For details, see the following example.
' },
- 'codeFiles': ['basic-usage.vue']
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例。
',
+ 'en-US': 'For details, see the following example.
'
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'clearable',
- 'name': { 'zh-CN': '一键清空', 'en-US': 'Clearable' },
- 'desc': {
+ demoId: 'clearable',
+ name: {
+ 'zh-CN': '一键清空',
+ 'en-US': 'Clearable'
+ },
+ desc: {
'zh-CN': '可通过 clearable
属性设置输入框显示清空图标按钮。
',
'en-US':
'You can set the clearable
attribute to display the clear icon button in the text box
'
},
- 'codeFiles': ['clearable.vue']
+ codeFiles: ['clearable.vue']
},
{
- 'demoId': 'show-password',
- 'name': { 'zh-CN': '密码框', 'en-US': 'Password Box' },
- 'desc': {
+ demoId: 'show-password',
+ name: {
+ 'zh-CN': '密码框',
+ 'en-US': 'Password Box'
+ },
+ desc: {
'zh-CN':
'当 type
为 password
时,可通过 show-password
属性设置输入框显示密码显示/隐藏切换图标按钮。
\n',
'en-US':
'When type
is set to password
, you can set the show-password
attribute to display or hide the password switch button in the text box
\n'
},
- 'codeFiles': ['show-password.vue']
+ codeFiles: ['show-password.vue']
},
{
- 'demoId': 'size',
- 'name': { 'zh-CN': '尺寸', 'en-US': 'Size' },
- 'desc': {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '尺寸',
+ 'en-US': 'Size'
+ },
+ desc: {
'zh-CN':
'可通过 size
属性设置尺寸大小,可选值:medium / small / mini
。注意:只在 type!="textarea"
时有效。
\n',
'en-US':
'You can set the size through the size
attribute. The options are as follows: medium, small, and mini
. Note: This parameter is valid only when type!="textarea"
is used
\n'
},
- 'codeFiles': ['size.vue']
+ codeFiles: ['size.vue']
},
{
- 'demoId': 'methods',
- 'name': { 'zh-CN': '实例方法', 'en-US': 'Instance Method' },
- 'desc': { 'zh-CN': '可使用组件的实例方法。', 'en-US': 'Instance methods for components that can be used' },
- 'codeFiles': ['methods.vue']
+ demoId: 'methods',
+ name: {
+ 'zh-CN': '实例方法',
+ 'en-US': 'Instance Method'
+ },
+ desc: {
+ 'zh-CN': '可使用组件的实例方法。',
+ 'en-US': 'Instance methods for components that can be used'
+ },
+ codeFiles: ['methods.vue']
},
{
- 'demoId': 'input-icon',
- 'name': { 'zh-CN': '图标', 'en-US': 'Icon' },
- 'desc': {
+ demoId: 'input-icon',
+ name: {
+ 'zh-CN': '图标',
+ 'en-US': 'Icon'
+ },
+ desc: {
'zh-CN': '可通过 prefix-icon, suffix-icon
属性设置输入框头部、尾部图标。
\n',
'en-US':
'You can set the header icon or the end icon of the text box through the prefix-icon, suffix-icon
attribute
\n'
},
- 'codeFiles': ['input-icon.vue']
+ codeFiles: ['input-icon.vue']
},
{
- 'demoId': 'slot',
- 'name': { 'zh-CN': '插槽', 'en-US': 'Slot' },
- 'desc': {
+ demoId: 'slot',
+ name: {
+ 'zh-CN': '插槽',
+ 'en-US': 'Slot'
+ },
+ desc: {
'zh-CN':
'配置 prepend, append, prefix, suffix
slot,设置输入框前置、后置、头部、尾部内容,注意:只对 type=text
有效。
',
'en-US':
'Configure the prepend, append, prefix, suffix
slot. Set the front, back, header, and tail contents of the text box. Note: This parameter is valid only for type=text
'
},
- 'codeFiles': ['slot.vue']
+ codeFiles: ['slot.vue']
},
{
- 'demoId': 'rows',
- 'name': { 'zh-CN': '文本域行数与宽', 'en-US': 'Lines and Width Of Textarea' },
- 'desc': {
- 'zh-CN': `
- 可通过 rows
属性设置文本域显示行数。注意:只在 type="textarea"
时有效。
- 可通过 cols
属性设置文本域显示宽度。注意:只在 type="textarea"
时有效。
- `,
- 'en-US': `
- You can set the number of lines displayed in the text field through the rows
property. Note: This parameter is valid only when text="textarea"
is used.
- You can set the width of the text field through the cols
attribute. Note: This parameter is valid only when text="textarea"
is used.
- `
+ demoId: 'mask',
+ name: {
+ 'zh-CN': '掩码',
+ 'en-US': 'Mask'
},
- 'codeFiles': ['rows.vue']
- },
- {
- 'demoId': 'resize',
- 'name': { 'zh-CN': '可缩放文本域', 'en-US': 'Scalable Text Field' },
- 'desc': {
- 'zh-CN': `
- 可通过 resize
属性设置文本域的缩放。可选值:none / both / horizontal / vertical
。注意:只在 type="textarea"
时有效。
- 可通过 autosize
属性设置文本域自适应内容高度。可传入对象,如{ minRows: 2, maxRows: 6 }
。注意:只对 type="textarea"
有效。
- `,
- 'en-US': `
- You can use the resize
property to set the zoom of the text field. The value can be none / both / horizontal / vertical
. Note: This parameter is valid only when type="textarea"
is used.
- You can use the autosize
attribute to set the text field to adapt to the content height. You can transfer an object, for example, {minRows: 2, maxRows: 6}
. Note: This parameter is valid only for type="textarea"
.
- `
+ desc: {
+ 'zh-CN':
+ '\n
可通过 mask 属性启用掩码功能,只在 disabled 和 display-only 状态下生效。
\n 注意:不要与 type="password" 和 show-password 一同使用
\n ',
+ 'en-US':
+ '\n
The mask attribute can be used to enable the mask function, which takes effect only in the disabled and display-only states.
\n Note: Do not use
with type="password" and show-password\n '
},
- 'codeFiles': ['resize.vue']
+ codeFiles: ['mask.vue']
},
{
- 'demoId': 'show-word-limit',
- 'name': { 'zh-CN': '输入字数统计', 'en-US': 'Input Word Count' },
- 'desc': {
+ demoId: 'rows',
+ name: {
+ 'zh-CN': '文本域行数与宽',
+ 'en-US': 'Lines and Width Of Textarea'
+ },
+ desc: {
+ 'zh-CN':
+ '\n 可通过 rows
属性设置文本域显示行数。注意:只在 type="textarea"
时有效。
\n 可通过 cols
属性设置文本域显示宽度。注意:只在 type="textarea"
时有效。
\n ',
+ 'en-US':
+ '\n You can set the number of lines displayed in the text field through the rows
property. Note: This parameter is valid only when text="textarea"
is used.
\n You can set the width of the text field through the cols
attribute. Note: This parameter is valid only when text="textarea"
is used.
\n '
+ },
+ codeFiles: ['rows.vue']
+ },
+ {
+ demoId: 'resize',
+ name: {
+ 'zh-CN': '可缩放文本域',
+ 'en-US': 'Scalable Text Field'
+ },
+ desc: {
+ 'zh-CN':
+ '\n 可通过 resize
属性设置文本域的缩放。可选值:none / both / horizontal / vertical
。注意:只在 type="textarea"
时有效。
\n 可通过 autosize
属性设置文本域自适应内容高度。可传入对象,如{ minRows: 2, maxRows: 6 }
。注意:只对 type="textarea"
有效。
\n ',
+ 'en-US':
+ '\n You can use the resize
property to set the zoom of the text field. The value can be none / both / horizontal / vertical
. Note: This parameter is valid only when type="textarea"
is used.
\n You can use the autosize
attribute to set the text field to adapt to the content height. You can transfer an object, for example, {minRows: 2, maxRows: 6}
. Note: This parameter is valid only for type="textarea"
.
\n '
+ },
+ codeFiles: ['resize.vue']
+ },
+ {
+ demoId: 'show-word-limit',
+ name: {
+ 'zh-CN': '输入字数统计',
+ 'en-US': 'Input Word Count'
+ },
+ desc: {
'zh-CN':
'可通过 show-word-limit
属性设置是否显示输入字数统计,只在 type = "text" 或 type = "textarea" 时有效。
',
'en-US':
'The show-word-limit
attribute can be used to set whether to display the input word statistics, only when type = "text" or type = "textarea" is valid
\n'
},
- 'codeFiles': ['show-word-limit.vue']
+ codeFiles: ['show-word-limit.vue']
},
{
- 'demoId': 'counter',
- 'name': { 'zh-CN': '计数器', 'en-US': 'Counter' },
- 'desc': {
+ demoId: 'counter',
+ name: {
+ 'zh-CN': '计数器',
+ 'en-US': 'Counter'
+ },
+ desc: {
'zh-CN': '可通过 counter
属性设置显示输入框字符计数器。
\n',
'en-US':
'You can use the counter
attribute to set the character counter for displaying the text box.
\n'
},
- 'codeFiles': ['counter.vue']
+ codeFiles: ['counter.vue']
},
{
- 'demoId': 'validate-event',
- 'name': { 'zh-CN': '表单校验', 'en-US': 'Form validation triggered upon input' },
- 'desc': {
+ demoId: 'validate-event',
+ name: {
+ 'zh-CN': '表单校验',
+ 'en-US': 'Form validation triggered upon input'
+ },
+ desc: {
'zh-CN':
'可通过 validate-event
属性设置输入时触发表单校验。通过 trigger
配置触发校验规则的方式,为 change
时,当输入框值改变即触发校验,为 blur
时则失焦后触发校验。
\n',
'en-US':
'You can set the validate-event
attribute to trigger form validation upon input. Use trigger
to configure the mode of triggering the validation rule. If change
is used, the validation is triggered when the value in the text box changes. If blur
is used, the validation is triggered after the focus is lost
\n'
},
- 'codeFiles': ['validate-event.vue']
+ codeFiles: ['validate-event.vue']
},
{
- 'demoId': 'method-addMemory',
- 'name': { 'zh-CN': '记忆历史输入', 'en-US': 'Memory History Input' },
- 'desc': {
+ demoId: 'display-only',
+ name: {
+ 'zh-CN': '内容只读',
+ 'en-US': 'Display Only'
+ },
+ desc: {
+ 'zh-CN': '可通过 display-only
或display-only-content
属性设置只读态。
',
+ 'en-US':
+ ' The read-only state can be set using the display-only
or display-only content
property.
'
+ },
+ codeFiles: ['display-only.vue']
+ },
+ {
+ demoId: 'method-addMemory',
+ name: {
+ 'zh-CN': '记忆历史输入',
+ 'en-US': 'Memory History Input'
+ },
+ desc: {
'zh-CN': '参考以下例子,输入完成后,输入会被记住。
',
'en-US': 'Refer to the following example. After the input is complete, the input will be remembered
'
},
- 'codeFiles': ['method-addMemory.vue']
+ codeFiles: ['method-addMemory.vue']
},
{
- 'demoId': 'type',
- 'name': { 'zh-CN': '类型', 'en-US': 'Type' },
- 'desc': {
+ demoId: 'type',
+ name: {
+ 'zh-CN': '类型',
+ 'en-US': 'Type'
+ },
+ desc: {
'zh-CN':
'通过对应的 type
属性,可以设置为对应的类型。默认为 text,可选值为 text,textarea 和其他 原生 input 的 type 值。
\n',
'en-US':
'You can set the corresponding type through the corresponding type
attribute. The default value is text. The options are text, textarea, and other type values of the native input
\n'
},
- 'codeFiles': ['type.vue']
+ codeFiles: ['type.vue']
},
{
- 'demoId': 'native',
- 'name': { 'zh-CN': '原生属性', 'en-US': 'Native Attribute' },
- 'desc': {
+ demoId: 'native',
+ name: {
+ 'zh-CN': '原生属性',
+ 'en-US': 'Native Attribute'
+ },
+ desc: {
'zh-CN': '可设置 name
disabled
readonly
等原生属性。
\n',
'en-US':
'You can set native attributes such as name
disabled
readonly
.
\n'
},
- 'codeFiles': ['native.vue']
+ codeFiles: ['native.vue']
},
{
- 'demoId': 'event',
- 'name': { 'zh-CN': '事件', 'en-US': 'Event' },
- 'desc': {
- 'zh-CN': `
- 输入框的事件,包括
- input
(输入值时触发),
- blur
(失去焦点时触发),
- focus
(获取焦点时触发),
- change
(值改变时触发),
- clear
(清除按钮时触发)。
-
- `,
- 'en-US': `
- Event of the text box, including:
- input
(triggered when a value is entered)
- blur
(triggered when the focus is lost)
- focus
(triggered when the focus is obtained)
- change
(triggered when the value changes)
- clear
(triggered when the button is cleared)
-
- `
+ demoId: 'event',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': 'Event'
},
- 'codeFiles': ['event.vue']
- }
- ],
- apis: [
- {
- 'name': 'input',
- 'type': 'component',
- 'props': [
- {
- 'name': 'autocomplete',
- 'type': 'string',
- 'defaultValue': `'off'`,
- 'desc': {
- 'zh-CN': '原生 autocomplete 属性',
- 'en-US': 'Native autocomplete attribute'
- },
- 'demoId': 'native'
- },
- {
- 'name': 'autofocus',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '原生属性,页面加载时,自动获取焦点',
- 'en-US': 'Native attribute. The focus is automatically obtained during page loading.'
- },
- 'demoId': ''
- },
- {
- 'name': 'autosize',
- 'type': 'boolean | { minRows: number, maxRows: number }',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN':
- '自适应内容高度,只对 type="textarea"
有效。可传入对象,如,{ minRows: 2, maxRows: 6 }',
- 'en-US':
- 'Adaptive content height. This parameter is valid only for type="textarea"
. Objects can be transferred, for example, {minRows: 2, maxRows: 6}'
- },
- 'demoId': 'resize'
- },
- {
- 'name': 'clearable',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '是否显示清除按钮,该属性不适用于 type="textarea"
',
- 'en-US':
- 'Whether to display the clear button. This attribute is not applicable to type="textarea"
.'
- },
- 'demoId': 'clearable'
- },
- {
- 'name': 'cols',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '原生属性,设置宽度,在 type ="textarea" 时有效',
- 'en-US':
- 'Native attribute, which is used to set the width. This parameter is valid only when type is "textarea"'
- },
- 'demoId': 'rows'
- },
- {
- 'name': 'counter',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否显示字数统计,只在 type = "text" 或 type = "textarea" 时有效',
- 'en-US':
- 'Whether to display the word count statistics. This parameter is valid only when type is "text" or type is "textarea"'
- },
- 'demoId': 'counter'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否禁用',
- 'en-US': 'Disable'
- },
- 'demoId': 'native'
- },
- {
- 'name': 'form',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '原生属性',
- 'en-US': 'Native attribute'
- },
- 'demoId': ''
- },
- {
- 'name': 'label',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '等价于原生 input aria-label 属性',
- 'en-US': 'Equiphorus input aria-label attribute'
- },
- 'demoId': ''
- },
- {
- 'name': 'max',
- 'type': 'number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '原生属性,设置最大值',
- 'en-US': 'Native attribute, set the maximum value'
- },
- 'demoId': 'native'
- },
- {
- 'name': 'memory-space',
- 'type': 'number',
- 'defaultValue': '5',
- 'desc': {
- 'zh-CN': '设置 addMemory 方法中,最大能保存条目的数量',
- 'en-US': 'Sets the maximum number of entries that can be saved in the addMemory method'
- },
- 'demoId': 'method-addMemory'
- },
- {
- 'name': 'maxlength',
- 'type': 'number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '原生属性,最大输入长度',
- 'en-US': 'Native attribute, maximum input length'
- },
- 'demoId': 'native'
- },
- {
- 'name': 'min',
- 'type': 'number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '原生属性,设置最小值',
- 'en-US': 'Native attribute, which sets the minimum value'
- },
- 'demoId': 'native'
- },
- {
- 'name': 'modelValue / v-model',
- 'type': 'string | number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置文本的绑定值',
- 'en-US': 'Sets the binding value of the text'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'name',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '原生 input name 属性',
- 'en-US': 'Native input name attribute'
- },
- 'demoId': ''
- },
- {
- 'name': 'placeholder',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '输入框占位文本',
- 'en-US': 'Enter the place-holder text in the text box'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'prefix-icon',
- 'type': 'Component',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '输入框头部图标',
- 'en-US': 'Icon at the head of the input box'
- },
- 'demoId': 'input-icon'
- },
- {
- 'name': 'readonly',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '原生属性,是否只读',
- 'en-US': 'Native attribute, read-only'
- },
- 'demoId': 'native'
- },
- {
- 'name': 'resize',
- 'type': `'both' | 'horizontal' | 'vertical' | 'none'`,
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '控制是否能被用户缩放',
- 'en-US': 'Whether the user can zoom in or out'
- },
- 'demoId': 'resize'
- },
- {
- 'name': 'rows',
- 'type': 'number',
- 'defaultValue': '2',
- 'desc': {
- 'zh-CN': '输入框行数,只对 type="textarea" 有效',
- 'en-US': 'Number of lines in the input box. This parameter is valid only for type="textarea"'
- },
- 'demoId': 'rows'
- },
- {
- 'name': 'show-password',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否显示切换密码图标',
- 'en-US': 'Whether to display the switchover password icon'
- },
- 'demoId': 'show-password'
- },
- {
- 'name': 'show-word-limit',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否显示输入字数统计,只在 type = "text" 或 type = "textarea" 时有效',
- 'en-US':
- 'Whether to display the number of input words. This parameter is valid only when type is "text" or type is "textarea"'
- },
- 'demoId': 'show-word-limit'
- },
- {
- 'name': 'size',
- 'type': `'medium' | 'small' | 'mini'`,
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '输入框尺寸,只在 type!="textarea" 时有效',
- 'en-US': 'Size of the text box. This parameter is valid only when type!="textarea". '
- },
- 'demoId': 'size'
- },
- {
- 'name': 'step',
- 'type': 'number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '原生属性,设置输入字段的合法数字间隔',
- 'en-US': 'Native attribute, which is used to set the valid digit interval of the input field.'
- },
- 'demoId': 'native'
- },
- {
- 'name': 'suffix-icon',
- 'type': 'Component',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '输入框尾部图标',
- 'en-US': 'Input box end icon'
- },
- 'demoId': 'input-icon'
- },
- {
- 'name': 'tabindex',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '原生属性,输入框的 tabindex',
- 'en-US': 'Native attribute, tabindex in the text box'
- },
- 'demoId': ''
- },
- {
- 'name': 'type',
- 'type': `'text' | 'textarea' | 'password' | InputHTMLAttributes.type`,
- 'defaultValue': `'text'`,
- 'desc': {
- 'zh-CN': '设置 input 框的 type 属性,默认为 "text",可选值 "text","textarea" 和其他 原生 input 的 type 值',
- 'en-US':
- 'Set the type attribute of the input box. The default value is "text". The options are "text", "textarea", and type values of other native inputs.'
- },
- 'demoId': 'type'
- },
- {
- 'name': 'validate-event',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '输入时是否触发表单的校验',
- 'en-US': 'Trigger form verification upon input'
- },
- 'demoId': 'validate-event'
- }
- ],
- 'events': [
- {
- 'name': 'blur',
- 'type': '(event: FocusEvent) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '在 Input 失去焦点时触发',
- 'en-US': 'Trigger when Input loses focus'
- },
- 'demoId': 'event'
- },
- {
- 'name': 'change',
- 'type': '(value: string | number) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '在 Input 值改变时触发',
- 'en-US': 'triggered when the input value changes.'
- },
- 'demoId': 'event'
- },
- {
- 'name': 'clear',
- 'type': '() => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '在点击由 clearable 属性生成的清空按钮时触发',
- 'en-US': 'Trigger when the clear button generated by the clearable property is clicked'
- },
- 'demoId': 'event'
- },
- {
- 'name': 'focus',
- 'type': '(event: FocusEvent) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '在 Input 获得焦点时触发',
- 'en-US': 'Trigger when Input obtains focus'
- },
- 'demoId': 'event'
- },
- {
- 'name': 'input',
- 'type': '(event: InputEvent) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '输入值时触发事件',
- 'en-US': 'An event is triggered when a value is entered.'
- },
- 'demoId': 'event'
- }
- ],
- 'slots': [
- {
- 'name': 'append',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '输入框后置内容,只对 type="text" 有效',
- 'en-US': 'Content at the end of the text box. This field is valid only for type="text"'
- },
- 'demoId': 'slot'
- },
- {
- 'name': 'prefix',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '输入框头部内容,只对 type="text" 有效',
- 'en-US': 'Content in the header of the text box, which is valid only for type="text"'
- },
- 'demoId': 'slot'
- },
- {
- 'name': 'suffix',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '输入框尾部内容,只对 type="text" 有效',
- 'en-US': 'The content at the end of the text box is valid only for type="text"'
- },
- 'demoId': 'slot'
- },
- {
- 'name': 'prepend',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '输入框前置内容,只对 type="text" 有效',
- 'en-US': 'Content before the text box, which is valid only for type="text"'
- },
- 'demoId': 'slot'
- }
- ],
- 'methods': [
- {
- 'name': 'addMemory',
- 'type': '(value: string) => void',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '历史输入内容的记忆方法', 'en-US': 'Memorization method of historical input content' },
- 'demoId': 'method-addMemory'
- },
- {
- 'name': 'blur',
- 'type': '() => void',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '使 input 失去焦点', 'en-US': 'The input loses focus.' },
- 'demoId': 'methods'
- },
- {
- 'name': 'focus',
- 'type': '() => void',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '使 input 获取焦点', 'en-US': 'To enable the input to obtain the focus' },
- 'demoId': 'methods'
- },
- {
- 'name': 'select',
- 'type': '() => void',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '选中 input 中的文字', 'en-US': 'Select the text in input.' },
- 'demoId': 'methods'
- }
- ]
+ desc: {
+ 'zh-CN':
+ '\n 输入框的事件,包括\n input
(输入值时触发), \n blur
(失去焦点时触发), \n focus
(获取焦点时触发), \n change
(值改变时触发), \n clear
(清除按钮时触发)。\n
\n ',
+ 'en-US':
+ '\n Event of the text box, including:\n input
(triggered when a value is entered)\n blur
(triggered when the focus is lost)\n focus
(triggered when the focus is obtained)\n change
(triggered when the value changes)\n clear
(triggered when the button is cleared)\n
\n '
+ },
+ codeFiles: ['event.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/ip-address/basic-usage.vue b/examples/sites/demos/pc/app/ip-address/basic-usage.vue
index 6ceb5d978..13efdabab 100644
--- a/examples/sites/demos/pc/app/ip-address/basic-usage.vue
+++ b/examples/sites/demos/pc/app/ip-address/basic-usage.vue
@@ -1,6 +1,8 @@
-
-
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/link/basic-usage.spec.ts b/examples/sites/demos/pc/app/link/basic-usage.spec.ts
index 038fb95a4..c4e482157 100644
--- a/examples/sites/demos/pc/app/link/basic-usage.spec.ts
+++ b/examples/sites/demos/pc/app/link/basic-usage.spec.ts
@@ -4,7 +4,10 @@ test('基础用法', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('link#basic-usage')
const preview = page.locator('#basic-usage')
- const anchor = preview.locator('a')
- await anchor.hover()
- await expect(anchor).toHaveCSS('color', 'rgb(82, 110, 204)')
+ const link = preview.locator('a')
+
+ await expect(link.first()).toHaveText('默认链接')
+ await expect(link.nth(1)).toHaveText('默认链接2')
+ await link.first().hover()
+ await expect(link.first()).toHaveCSS('color', 'rgb(82, 110, 204)')
})
diff --git a/examples/sites/demos/pc/app/link/basic-usage.vue b/examples/sites/demos/pc/app/link/basic-usage.vue
index 418eb069f..fe33647f7 100644
--- a/examples/sites/demos/pc/app/link/basic-usage.vue
+++ b/examples/sites/demos/pc/app/link/basic-usage.vue
@@ -1,8 +1,11 @@
- 默认链接
+
+ 默认链接
+
+
-
+
+
diff --git a/examples/sites/demos/pc/app/link/config-href-composition-api.vue b/examples/sites/demos/pc/app/link/config-href-composition-api.vue
index 4cf8e0a95..853d5fe98 100644
--- a/examples/sites/demos/pc/app/link/config-href-composition-api.vue
+++ b/examples/sites/demos/pc/app/link/config-href-composition-api.vue
@@ -2,6 +2,6 @@
默认链接
-
diff --git a/examples/sites/demos/pc/app/link/config-href.vue b/examples/sites/demos/pc/app/link/config-href.vue
index cd239d922..993b8d873 100644
--- a/examples/sites/demos/pc/app/link/config-href.vue
+++ b/examples/sites/demos/pc/app/link/config-href.vue
@@ -2,7 +2,7 @@
默认链接
-
-
diff --git a/examples/sites/demos/pc/app/link/size.vue b/examples/sites/demos/pc/app/link/size.vue
new file mode 100644
index 000000000..28f4cf787
--- /dev/null
+++ b/examples/sites/demos/pc/app/link/size.vue
@@ -0,0 +1,40 @@
+
+
+ 默认链接
+
+ 默认链接
+
+ 编辑
+
+ 编辑
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/link/webdoc/link.js b/examples/sites/demos/pc/app/link/webdoc/link.js
index a51ea1fc5..9a285a867 100644
--- a/examples/sites/demos/pc/app/link/webdoc/link.js
+++ b/examples/sites/demos/pc/app/link/webdoc/link.js
@@ -3,121 +3,91 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['basic-usage.vue']
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '通过 value
或者默认插槽设置链接显示内容。
',
+ 'en-US': 'Set the link to display content via value
or the default slot.
'
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'link-style',
- 'name': { 'zh-CN': '主题样式', 'en-US': 'Theme Style' },
- 'desc': {
+ demoId: 'link-style',
+ name: {
+ 'zh-CN': '主题样式',
+ 'en-US': 'Theme Style'
+ },
+ desc: {
'zh-CN': '通过 type
设置链接的主题类型。
',
'en-US': 'Set the topic type of the link through the type
attribute.
'
},
- 'codeFiles': ['link-style.vue']
+ codeFiles: ['link-style.vue']
},
{
- 'demoId': 'dynamic-disable',
- 'name': { 'zh-CN': '禁用链接', 'en-US': 'Disable links' },
- 'desc': {
+ demoId: 'dynamic-disable',
+ name: {
+ 'zh-CN': '禁用链接',
+ 'en-US': 'Disable links'
+ },
+ desc: {
'zh-CN': '通过 disabled
设置是否禁用链接。
',
'en-US': 'You can use the disabled
attribute to specify whether to disable links.
'
},
- 'codeFiles': ['dynamic-disable.vue']
+ codeFiles: ['dynamic-disable.vue']
},
{
- 'demoId': 'focus-no-underline',
- 'name': { 'zh-CN': '聚焦时不显示下划线', 'en-US': 'Do not display underscores when focusing.' },
- 'desc': {
+ demoId: 'focus-no-underline',
+ name: {
+ 'zh-CN': '聚焦时不显示下划线',
+ 'en-US': 'Do not display underscores when focusing.'
+ },
+ desc: {
'zh-CN': '通过 underline
设置鼠标悬浮是否显示下划线。
',
'en-US':
'When you hover the cursor over a link, the underline is displayed by default. If underline
is set to false, the underline is not displayed when you focus.
'
},
- 'codeFiles': ['focus-no-underline.vue']
+ codeFiles: ['focus-no-underline.vue']
},
{
- 'demoId': 'custom-icon',
- 'name': { 'zh-CN': '自定义图标', 'en-US': 'Custom Icon' },
- 'desc': {
+ demoId: 'custom-icon',
+ name: {
+ 'zh-CN': '自定义图标',
+ 'en-US': 'Custom Icon'
+ },
+ desc: {
'zh-CN': '通过属性 icon
、默认插槽、icon
插槽都可以自定义图标。
',
'en-US':
'Icon can be customized by attribute icon
, default slot, and icon
slot.
'
},
- 'codeFiles': ['custom-icon.vue']
+ codeFiles: ['custom-icon.vue']
},
{
- 'demoId': 'config-href',
- 'name': { 'zh-CN': '链接地址', 'en-US': 'Link' },
- 'desc': {
+ demoId: 'config-href',
+ name: {
+ 'zh-CN': '链接地址',
+ 'en-US': 'Link'
+ },
+ desc: {
'zh-CN': '通过 href
设置跳转连接,可配合原生属性 target
一起使用。
',
'en-US':
'Use the href
attribute to specify the URL to be redirected to. This attribute can be used together with the native attribute target
.
'
},
- 'codeFiles': ['config-href.vue']
+ codeFiles: ['config-href.vue']
}
],
- apis: [
- {
- 'name': 'link',
- 'type': 'component',
- 'props': [
- {
- 'name': 'type',
- 'type': "'primary' | 'success' | 'warning' | 'danger' | 'info'",
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '文本链接类型',
- 'en-US': 'Text link type'
- },
- 'demoId': 'link-style'
- },
- {
- 'name': 'underline',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': { 'zh-CN': '是否下划线', 'en-US': 'Whether has Underline' },
- 'demoId': 'focus-no-underline'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否禁用状态', 'en-US': 'Is disabled' },
- 'demoId': 'dynamic-disable'
- },
- {
- 'name': 'href',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '原生 href 属性', 'en-US': 'Native href attribute' },
- 'demoId': 'config-href'
- },
- {
- 'name': 'icon',
- 'type': 'Component',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '图标组件', 'en-US': 'Icon component' },
- 'demoId': 'custom-icon'
- }
- ],
- 'events': [],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '默认插槽', 'en-US': 'Default slot' },
- 'demoId': 'custom-icon'
- },
- {
- 'name': 'icon',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '图标', 'en-US': 'Icon' },
- 'demoId': 'custom-icon'
- }
- ]
- }
- ]
+ hiddenDemo: {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '尺寸',
+ 'en-US': 'Size'
+ },
+ desc: {
+ 'zh-CN': '通过 size
属性设置尺寸,仅支持 medium
尺寸
',
+ 'en-US': ''
+ },
+ codeFiles: ['size.vue']
+ }
}
diff --git a/examples/sites/demos/pc/app/loading/webdoc/loading.js b/examples/sites/demos/pc/app/loading/webdoc/loading.js
index 3c29fc142..03fc71ee5 100644
--- a/examples/sites/demos/pc/app/loading/webdoc/loading.js
+++ b/examples/sites/demos/pc/app/loading/webdoc/loading.js
@@ -3,246 +3,104 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '通过静态方法 Loading.service
在指定 target
上设置加载。
\n',
'en-US':
'Sets loading on the specified target
using the static method Loading.service
.
\n'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'size',
- 'name': { 'zh-CN': '尺寸', 'en-US': 'Customized loading prompt text' },
- 'desc': {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '尺寸',
+ 'en-US': 'Customized loading prompt text'
+ },
+ desc: {
'zh-CN':
'可通过 size
属性设置尺寸大小,可选值:medium
/ small
/ large
。
\n',
'en-US': 'Customize the prompt text of the loaded text through text
.
\n'
},
- 'codeFiles': ['size.vue']
+ codeFiles: ['size.vue']
},
{
- 'demoId': 'loading-tip-text',
- 'name': { 'zh-CN': '加载提示文本', 'en-US': 'Loading Text' },
- 'desc': {
+ demoId: 'loading-tip-text',
+ name: {
+ 'zh-CN': '加载提示文本',
+ 'en-US': 'Loading Text'
+ },
+ desc: {
'zh-CN': '通过 text
自定义加载文字的提示文本。
\n',
'en-US': 'Customize the background color and transparency through background
.
\n'
},
- 'codeFiles': ['loading-tip-text.vue']
+ codeFiles: ['loading-tip-text.vue']
},
{
- 'demoId': 'background',
- 'name': { 'zh-CN': '遮罩背景色', 'en-US': 'Background Color' },
- 'desc': {
+ demoId: 'background',
+ name: {
+ 'zh-CN': '遮罩背景色',
+ 'en-US': 'Background Color'
+ },
+ desc: {
'zh-CN': '通过 background
自定义背景颜色和透明度。
\n',
'en-US': 'Use customClass
to specify the class name to modify the style.
\n'
},
- 'codeFiles': ['background.vue']
+ codeFiles: ['background.vue']
},
{
- 'demoId': 'custom-class',
- 'name': { 'zh-CN': '样式', 'en-US': 'Class' },
- 'desc': {
+ demoId: 'custom-class',
+ name: {
+ 'zh-CN': '样式',
+ 'en-US': 'Class'
+ },
+ desc: {
'zh-CN': '通过 customClass
指定类名进行样式修改。
\n',
'en-US': 'For details, see the following example.'
},
- 'codeFiles': ['custom-class.vue']
+ codeFiles: ['custom-class.vue']
},
{
- 'demoId': 'directive',
- 'name': { 'zh-CN': '指令', 'en-US': 'Directive' },
- 'desc': {
+ demoId: 'directive',
+ name: {
+ 'zh-CN': '指令',
+ 'en-US': 'Directive'
+ },
+ desc: {
'zh-CN': '通过v-loading使用指令。
',
- 'en-US': `Use instructions via v-loading
`
+ 'en-US': 'Use instructions via v-loading
'
},
- 'codeFiles': ['directive.vue']
+ codeFiles: ['directive.vue']
},
{
- 'demoId': 'fullscreen',
- 'name': { 'zh-CN': '全屏加载', 'en-US': 'Fullscreen Loading' },
- 'desc': {
- 'zh-CN': `
-
通过 v-loading.lock.fullscreen
指令添加修饰符进行全屏加载
- 也能通过Loading.service
并配置属性进行全屏加载
- `,
- 'en-US': `
-
Adds modifiers for fullscreen loading via the v-load.lock.fullscreen
directive
- can also load full screen through Load.service
and configure properties
- `
+ demoId: 'fullscreen',
+ name: {
+ 'zh-CN': '全屏加载',
+ 'en-US': 'Fullscreen Loading'
},
- 'codeFiles': ['fullscreen.vue']
+ desc: {
+ 'zh-CN':
+ '\n
通过 v-loading.lock.fullscreen
指令添加修饰符进行全屏加载\n 也能通过Loading.service
并配置属性进行全屏加载\n ',
+ 'en-US':
+ '\n
Adds modifiers for fullscreen loading via the v-load.lock.fullscreen
directive\n can also load full screen through Load.service
and configure properties \n '
+ },
+ codeFiles: ['fullscreen.vue']
},
{
- 'demoId': 'spinner',
- 'name': { 'zh-CN': '加载图标', 'en-US': 'Loading Icon' },
- 'desc': {
+ demoId: 'spinner',
+ name: {
+ 'zh-CN': '加载图标',
+ 'en-US': 'Loading Icon'
+ },
+ desc: {
'zh-CN': '通过 spinner
自定义加载图标。
\n',
'en-US': 'Use target
to specify the DOM node to be overwritten by Loading.
\n'
},
- 'codeFiles': ['spinner.vue']
- }
- ],
- apis: [
- {
- 'name': 'loading',
- 'type': 'component',
- 'props': [
- {
- 'name': 'text',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '显示在加载图标下方的加载文案',
- 'en-US': 'Load copy displayed below the load icon'
- },
- 'demoId': 'loading-tip-text'
- },
- {
- 'name': 'fullscreen',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '属性为 true 显示全屏,同 v-loading 指令中的 fullscreen 修饰符',
- 'en-US': 'Set true to display the full screen. Same as the fullscreen modifier in the v-loading instruction'
- },
- 'demoId': 'fullscreen'
- },
- {
- 'name': 'size',
- 'type': `'medium' | 'small' | 'large'`,
- 'defaultValue': `'small'`,
- 'desc': { 'zh-CN': '加载图标尺寸', 'en-US': 'Load icon size' },
- 'demoId': 'size'
- },
- {
- 'name': 'target',
- 'type': 'HTMLElement | string',
- 'defaultValue': 'document.body',
- 'desc': {
- 'zh-CN':
- 'Loading 需要覆盖的 DOM 节点。可传入一个 DOM 对象或字符串;若传入字符串,则会将其作为参数传入 document.querySelector 以获取到对应 DOM 节点',
- 'en-US':
- 'Loading the DOM node to be overwritten. A DOM object or character string can be transferred. If a character string is transferred, it is transferred to document.querySelector as a parameter to obtain the corresponding DOM node.'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'body',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '遮罩层是否在body上,同 v-loading 指令中的 body 修饰符',
- 'en-US': 'The same as the body modifier in the v-loading instruction'
- }
- },
- {
- 'name': 'lock',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '全屏时是否锁定滚动,同 v-loading 指令中的 lock 修饰符',
- 'en-US': 'The same as the lock modifier in the v-loading instruction'
- },
- 'demoId': 'fullscreen'
- },
- {
- 'name': 'spinner',
- 'type': 'Component',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '自定义加载图标', 'en-US': 'Customized loading icon class name' },
- 'demoId': 'spinner'
- },
- {
- 'name': 'background',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '遮罩背景色', 'en-US': 'Mask background color' },
- 'demoId': 'background'
- },
- {
- 'name': 'customClass',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': 'Loading 的自定义类名', 'en-US': 'User-defined loading class name' },
- 'demoId': 'custom-class'
- }
- ]
- },
- {
- 'name': 'loading',
- 'type': 'directive',
- 'props': [
- {
- 'name': 'v-loading',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '是否显示加载动画',
- 'en-US': 'Whether to display loading animation'
- },
- 'demoId': 'directive'
- },
- {
- 'name': 'tiny-loading__text',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '显示在加载图标下方的加载文案',
- 'en-US': 'The load copy displayed below the load icon'
- },
- 'demoId': 'directive'
- },
- {
- 'name': 'tiny-loading__background',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '遮罩背景色',
- 'en-US': 'Mask background color'
- },
- 'demoId': 'directive'
- },
- {
- 'name': 'tiny-loading__custom-class',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': 'Loading 的自定义类名',
- 'en-US': 'Custom class name for Loading'
- },
- 'demoId': 'directive'
- },
- {
- 'name': 'fullscreen',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '命令修饰符:是否显示全屏',
- 'en-US': 'Command modifier: Whether to display full screen'
- },
- 'demoId': 'fullscreen'
- },
- {
- 'name': 'body',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '命令修饰符:遮罩层是否在body上',
- 'en-US': 'Command modifier: Whether the mask is on the body'
- }
- },
- {
- 'name': 'lock',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '命令修饰符:全屏时是否锁定滚动',
- 'en-US': 'Command modifier: Whether to lock scroll in full screen'
- },
- 'demoId': 'fullscreen'
- }
- ]
+ codeFiles: ['spinner.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/locales/webdoc/locales.js b/examples/sites/demos/pc/app/locales/webdoc/locales.js
index 32e47f351..faef5b6fa 100644
--- a/examples/sites/demos/pc/app/locales/webdoc/locales.js
+++ b/examples/sites/demos/pc/app/locales/webdoc/locales.js
@@ -3,114 +3,44 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '配置 local
属性后,不会自动调用服务,仅用做当前语言切换,不会刷新页面。
\n',
'en-US':
'After the local
attribute is configured, the service is not automatically invoked. It is only used to switch the current language and does not refresh the page.
\n'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'custom-service',
- 'name': { 'zh-CN': '自定义服务', 'en-US': 'Custom Service' },
- 'desc': {
+ demoId: 'custom-service',
+ name: {
+ 'zh-CN': '自定义服务',
+ 'en-US': 'Custom Service'
+ },
+ desc: {
'zh-CN':
'get-locale
可用于自定义获取所有语言。get-current-locale
用于获取当前语言。get-change-locale-url
用于获取改变语言后的 URL,参数为切换后的语言。
\n',
'en-US':
'get-locale
can be used to customize all languages. get-current-locale
is used to obtain the current language. get-change-locale-url
is used to obtain the URL after the language is changed. The parameter is the language after the language is changed.
\n'
},
- 'codeFiles': ['custom-service.vue']
+ codeFiles: ['custom-service.vue']
},
{
- 'demoId': 'change-lang',
- 'name': { 'zh-CN': '语言切换', 'en-US': 'Switch Language' },
- 'desc': {
+ demoId: 'change-lang',
+ name: {
+ 'zh-CN': '语言切换',
+ 'en-US': 'Switch Language'
+ },
+ desc: {
'zh-CN': '提供 change-lang
函数用于自定义语言切换的逻辑,不设置则使用内置的切换方法。
\n',
'en-US':
'Provides the change-lang
function to customize the language switching logic. If this function is not set, the built-in switching method is used.
\n'
},
- 'codeFiles': ['change-lang.vue']
- }
- ],
- apis: [
- {
- 'name': 'locales',
- 'type': 'component',
- 'props': [
- {
- 'name': 'local',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 false',
- 'desc': { 'zh-CN': '是否本地', 'en-US': 'Local or not' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'change-lang',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '切换语言', 'en-US': 'Switch Language' },
- 'demoId': 'change-lang'
- },
- {
- 'name': 'getLocale',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义获取系统语言列表接口,未使用框架服务时必填',
- 'en-US':
- 'User-defined interface for obtaining the system language list. This parameter is mandatory when the framework service is not used.'
- },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'popper-class',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '为 popper 添加类名(可参考 popover 组件)',
- 'en-US': 'Add a class name for the popper. For details, see the popover component.'
- },
- 'demoId': ''
- },
- {
- 'name': 'popper-append-to-body',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 true',
- 'desc': {
- 'zh-CN':
- '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)',
- 'en-US':
- 'Indicates whether to insert the pop-up box to the body element. If a fault occurs in locating the fault in the dialog box that is displayed, you can set this attribute to false (for details, see the select component).'
- },
- 'demoId': ''
- },
- {
- 'name': 'getCurrentLocale',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义获取当前语种接口,未使用框架服务时必填',
- 'en-US':
- 'Customized interface for obtaining the current language. This parameter is mandatory when the framework service is not used.'
- },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'getChangeLocaleUrl',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义更新语言服务接口,未使用框架服务并且未配置 change-lang 时必填',
- 'en-US':
- 'Customized language update service interface. This parameter is mandatory when the framework service is not used and change-lang is not configured.'
- },
- 'demoId': 'custom-service'
- }
- ],
- 'events': [],
- 'slots': []
+ codeFiles: ['change-lang.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/logon-user/basic-usage-composition-api.vue b/examples/sites/demos/pc/app/logon-user/basic-usage-composition-api.vue
index 47db9d344..1462503b6 100644
--- a/examples/sites/demos/pc/app/logon-user/basic-usage-composition-api.vue
+++ b/examples/sites/demos/pc/app/logon-user/basic-usage-composition-api.vue
@@ -1,7 +1,14 @@
-
+
diff --git a/examples/sites/demos/pc/app/logon-user/basic-usage.vue b/examples/sites/demos/pc/app/logon-user/basic-usage.vue
index fa142211b..ef76cb525 100644
--- a/examples/sites/demos/pc/app/logon-user/basic-usage.vue
+++ b/examples/sites/demos/pc/app/logon-user/basic-usage.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/examples/sites/demos/pc/app/logon-user/webdoc/logon-user.js b/examples/sites/demos/pc/app/logon-user/webdoc/logon-user.js
index 2fbae2470..f9756f395 100644
--- a/examples/sites/demos/pc/app/logon-user/webdoc/logon-user.js
+++ b/examples/sites/demos/pc/app/logon-user/webdoc/logon-user.js
@@ -3,39 +3,28 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['basic-usage.vue']
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '可通过get-user-info
属性设置用户信息。',
+ 'en-US': 'You can use the get-user-info
attribute to set user information.'
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'custom-service',
- 'name': { 'zh-CN': '自定义服务', 'en-US': 'Custom Service' },
- 'desc': {
+ demoId: 'custom-service',
+ name: {
+ 'zh-CN': '自定义服务',
+ 'en-US': 'Custom Service'
+ },
+ desc: {
'zh-CN': '可通过 service
属性设置自定义服务。
\n',
'en-US': 'You can set a custom service through the service
attribute.
\n'
},
- 'codeFiles': ['custom-service.vue']
- }
- ],
- apis: [
- {
- 'name': 'logon-user',
- 'type': 'component',
- 'props': [
- {
- 'name': 'getUserInfo',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '配置查询系统当前用户接口',
- 'en-US': 'Configure the interface for querying current system users.'
- },
- 'demoId': 'custom-service'
- }
- ],
- 'events': [],
- 'slots': []
+ codeFiles: ['custom-service.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/logout/basic-usage-composition-api.vue b/examples/sites/demos/pc/app/logout/basic-usage-composition-api.vue
index 0296fe245..51aecdecb 100644
--- a/examples/sites/demos/pc/app/logout/basic-usage-composition-api.vue
+++ b/examples/sites/demos/pc/app/logout/basic-usage-composition-api.vue
@@ -1,7 +1,52 @@
-
+
+ 是否登录:{{ isLogin }}
+
+
diff --git a/examples/sites/demos/pc/app/logout/custom-service.spec.ts b/examples/sites/demos/pc/app/logout/basic-usage.spec.ts
similarity index 100%
rename from examples/sites/demos/pc/app/logout/custom-service.spec.ts
rename to examples/sites/demos/pc/app/logout/basic-usage.spec.ts
diff --git a/examples/sites/demos/pc/app/logout/basic-usage.vue b/examples/sites/demos/pc/app/logout/basic-usage.vue
index 5b280d6c1..8c9619e9a 100644
--- a/examples/sites/demos/pc/app/logout/basic-usage.vue
+++ b/examples/sites/demos/pc/app/logout/basic-usage.vue
@@ -1,13 +1,56 @@
-
+
+ 是否登录:{{ isLogin }}
+
+
diff --git a/examples/sites/demos/pc/app/logout/custom-service-composition-api.vue b/examples/sites/demos/pc/app/logout/custom-service-composition-api.vue
deleted file mode 100644
index 3affd3361..000000000
--- a/examples/sites/demos/pc/app/logout/custom-service-composition-api.vue
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
- 是否登录:{{ isLogin }}
-
-
-
-
-
diff --git a/examples/sites/demos/pc/app/logout/custom-service.vue b/examples/sites/demos/pc/app/logout/custom-service.vue
deleted file mode 100644
index 1e3401bca..000000000
--- a/examples/sites/demos/pc/app/logout/custom-service.vue
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
- 是否登录:{{ isLogin }}
-
-
-
-
-
diff --git a/examples/sites/demos/pc/app/logout/webdoc/logout.js b/examples/sites/demos/pc/app/logout/webdoc/logout.js
index abae7c54d..d13915642 100644
--- a/examples/sites/demos/pc/app/logout/webdoc/logout.js
+++ b/examples/sites/demos/pc/app/logout/webdoc/logout.js
@@ -3,62 +3,28 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['basic-usage.vue']
- },
- {
- 'demoId': 'custom-service',
- 'name': { 'zh-CN': '自定义服务', 'en-US': 'Custom Service' },
- 'desc': {
- 'zh-CN': '可通过 service
属性设置自定义服务。
\n',
- 'en-US': 'You can set a custom service through the service
attribute.
\n'
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
},
- 'codeFiles': ['custom-service.vue']
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'redirecturl',
- 'name': { 'zh-CN': '自定义配置注销后跳转地址', 'en-US': 'User-defined redirection address after deregistration' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['redirecturl.vue']
- }
- ],
- apis: [
- {
- 'name': 'logout',
- 'type': 'component',
- 'props': [
- {
- 'name': 'getLogoutUrl',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义获取注销服务接口',
- 'en-US': 'User-defined interface for obtaining the deregistration service'
- },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'redirectUrl',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义配置注销后跳转地址',
- 'en-US': 'User-defined redirection address after deregistration'
- },
- 'demoId': 'redirecturl'
- },
- {
- 'name': 'beforeLogout',
- 'type': 'Function(params)',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '注销前的回调函数', 'en-US': 'Callback function before deregistration' },
- 'demoId': ''
- }
- ],
- 'events': [],
- 'slots': []
+ demoId: 'redirecturl',
+ name: {
+ 'zh-CN': '自定义配置注销后跳转地址',
+ 'en-US': 'User-defined redirection address after deregistration'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['redirecturl.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/milestone/webdoc/milestone.js b/examples/sites/demos/pc/app/milestone/webdoc/milestone.js
index 26e1ec47b..f42e58ef4 100644
--- a/examples/sites/demos/pc/app/milestone/webdoc/milestone.js
+++ b/examples/sites/demos/pc/app/milestone/webdoc/milestone.js
@@ -3,399 +3,137 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN':
'通过 data
设置每个节点的标题、日期、和状态; milestones-status
设置每种状态对应的颜色值;前者的 status
字段对应后者的键值。',
'en-US':
'Set the title, date, and status of each node through data
; Milestones status
Set the color values corresponding to each state; The status
field of the former corresponds to the key value of the latter.'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'flag-before',
- 'name': { 'zh-CN': '旗子数据来源', 'en-US': 'Flag data source' },
- 'desc': {
+ demoId: 'flag-before',
+ name: {
+ 'zh-CN': '旗子数据来源',
+ 'en-US': 'Flag data source'
+ },
+ desc: {
'zh-CN':
'通过 flag-before
设置旗子的数据来源,是来自前面还是后面的节点,默认为 false
取后面节点上的数据。',
'en-US':
'Set the data source of the flag through flag-before
, whether it comes from the preceding or following nodes. The default value is false
to retrieve the data from the following nodes.'
},
- 'codeFiles': ['flag-before.vue']
+ codeFiles: ['flag-before.vue']
},
{
- 'demoId': 'line-style',
- 'name': { 'zh-CN': '线条颜色和间距', 'en-US': 'Line color and Space' },
- 'desc': {
+ demoId: 'line-style',
+ name: {
+ 'zh-CN': '线条颜色和间距',
+ 'en-US': 'Line color and Space'
+ },
+ desc: {
'zh-CN': '通过 line-style
设置线条颜色, space
设置节点间距。',
'en-US': 'Set the line color and node spacing through line-style
.'
},
- 'codeFiles': ['line-style.vue']
+ codeFiles: ['line-style.vue']
},
{
- 'demoId': 'show-number',
- 'name': {
+ demoId: 'show-number',
+ name: {
'zh-CN': '序号',
'en-US': 'Sequence number'
},
- 'desc': {
+ desc: {
'zh-CN':
'通过 show-number
设置未完成状态的节点是否显示序号;默认为 true
显示; start
设置节点的序号起始值,默认为 -1
。',
'en-US':
'Set whether nodes in incomplete status display serial numbers through show-number
; Default to display as true
; start
Set the starting value of the nodes sequence number, which defaults to -1
.'
},
- 'codeFiles': ['show-number.vue']
+ codeFiles: ['show-number.vue']
},
{
- 'demoId': 'solid-style',
- 'name': { 'zh-CN': '实心显示', 'en-US': 'Completed node solid display' },
- 'desc': {
+ demoId: 'solid-style',
+ name: {
+ 'zh-CN': '实心显示',
+ 'en-US': 'Completed node solid display'
+ },
+ desc: {
'zh-CN':
'通过 solid
设置已完成状态的节点是否实心显示,实心显示则光晕不透明;默认为 false
不显示。',
'en-US':
'Set whether nodes in the completed state are displayed as solid through solid
, and if solid is displayed, the halo is opaque; The default is not displayed as false
.'
},
- 'codeFiles': ['solid-style.vue']
+ codeFiles: ['solid-style.vue']
},
{
- 'demoId': 'data-field-mapping',
- 'name': { 'zh-CN': '数据字段映射', 'en-US': 'Data Field Mapping' },
- 'desc': {
- 'zh-CN': `
-
- 自定义 data
属性的键名和键值:
- completed-field
设置完成状态对应的键值,默认为 completed
;
- flag-field
设置旗子信息数组对应的键名,默认为 flags
;
- flag-content-field
设置旗子描述对应的键名,默认为 content
;
- flag-name-field
设置旗子标题对应的键名,默认为 name
;
- flag-status-field
设置旗子状态对应的键名,默认为 status
;
- name-field
设置节点名称对应的键名,默认为 name
;
- status-field
设置节点状态对应的键名,默认为 status
;
- time-field
设置节点时间对应的键名,默认为 time
。`,
- 'en-US': `
-
- Customize the key names and values of data
attributes:
- completed-field
Set the key value corresponding to the completion status, which defaults to completed
;
- flag-field
Set the key name corresponding to the flag information array, which defaults to flags
;
- flag-content-field
Set the key name corresponding to the flag description, which defaults to content
;
- flag-name-field
Set the key name corresponding to the flag subtitle, which defaults to name
;
- flag-status-field
Set the key name corresponding to the flag state, which defaults to status
;
- name-field
Set the key name corresponding to the node name, which defaults to name
;
- status-field
Set the key name corresponding to the node state, which defaults to status
;
- time-field
Set the key name corresponding to the node time, which defaults to time
. `
+ demoId: 'data-field-mapping',
+ name: {
+ 'zh-CN': '数据字段映射',
+ 'en-US': 'Data Field Mapping'
},
- 'codeFiles': ['data-field-mapping.vue']
+ desc: {
+ 'zh-CN':
+ '\n \n 自定义 data
属性的键名和键值:
\n completed-field
设置完成状态对应的键值,默认为 completed
;
\n flag-field
设置旗子信息数组对应的键名,默认为 flags
;
\n flag-content-field
设置旗子描述对应的键名,默认为 content
;
\n flag-name-field
设置旗子标题对应的键名,默认为 name
;
\n flag-status-field
设置旗子状态对应的键名,默认为 status
;
\n name-field
设置节点名称对应的键名,默认为 name
;
\n status-field
设置节点状态对应的键名,默认为 status
;
\n time-field
设置节点时间对应的键名,默认为 time
。',
+ 'en-US':
+ '\n \n Customize the key names and values of data
attributes:
\n completed-field
Set the key value corresponding to the completion status, which defaults to completed
;
\n flag-field
Set the key name corresponding to the flag information array, which defaults to flags
;
\n flag-content-field
Set the key name corresponding to the flag description, which defaults to content
;
\n flag-name-field
Set the key name corresponding to the flag subtitle, which defaults to name
;
\n flag-status-field
Set the key name corresponding to the flag state, which defaults to status
;
\n name-field
Set the key name corresponding to the node name, which defaults to name
;
\n status-field
Set the key name corresponding to the node state, which defaults to status
;
\n time-field
Set the key name corresponding to the node time, which defaults to time
. '
+ },
+ codeFiles: ['data-field-mapping.vue']
},
{
- 'demoId': 'custom-icon-slot',
- 'name': { 'zh-CN': '定义图标', 'en-US': 'Custom Node Icons' },
- 'desc': {
+ demoId: 'custom-icon-slot',
+ name: {
+ 'zh-CN': '定义图标',
+ 'en-US': 'Custom Node Icons'
+ },
+ desc: {
'zh-CN': '通过 icon
作用域插槽自定义节点的图标。',
'en-US': 'Customize the node icon through the icon
scope slot.'
},
- 'codeFiles': ['custom-icon-slot.vue']
+ codeFiles: ['custom-icon-slot.vue']
},
{
- 'demoId': 'custom-bottom-top',
- 'name': { 'zh-CN': '定义上下方内容', 'en-US': 'Define the content above and below' },
- 'desc': {
+ demoId: 'custom-bottom-top',
+ name: {
+ 'zh-CN': '定义上下方内容',
+ 'en-US': 'Define the content above and below'
+ },
+ desc: {
'zh-CN':
'通过 bottom
作用域插槽自定义节点下方的内容;
通过 top
作用域插槽自定义节点上方的内容。',
'en-US':
'Customize the content below the node through the bottom
scope slot;
Customize the content above the node through the top
scope slot.'
},
- 'codeFiles': ['custom-bottom-top.vue']
+ codeFiles: ['custom-bottom-top.vue']
},
{
- 'demoId': 'custom-flag',
- 'name': { 'zh-CN': '定义旗帜内容', 'en-US': 'Custom Flag Content' },
- 'desc': {
+ demoId: 'custom-flag',
+ name: {
+ 'zh-CN': '定义旗帜内容',
+ 'en-US': 'Custom Flag Content'
+ },
+ desc: {
'zh-CN': '通过 flag
作用域插槽自定义节点旗子的内容。',
'en-US': 'Customize the content of node flags through the flag
scope slot.'
},
- 'codeFiles': ['custom-flag.vue']
+ codeFiles: ['custom-flag.vue']
},
{
- 'demoId': 'milestone-events',
- 'name': { 'zh-CN': '事件', 'en-US': 'Event' },
- 'desc': {
+ demoId: 'milestone-events',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': 'Event'
+ },
+ desc: {
'zh-CN': '通过 click
监听单击节点事件, flag-click
监听单击旗子事件。',
'en-US':
'Listen for click node events through click
, and flag-click
listen for click flag sub events.'
},
- 'codeFiles': ['milestone-events.vue']
- }
- ],
- apis: [
- {
- 'name': 'milestone',
- 'type': 'component',
- 'props': [
- {
- 'name': 'completed-field',
- 'type': 'string',
- 'defaultValue': `'completed'`,
- 'desc': {
- 'zh-CN': '设置节点完成状态对应的键值',
- 'en-US': 'Set the key values corresponding to the node completion status'
- },
- 'demoId': 'data-field-mapping'
- },
- {
- 'name': 'data',
- 'type': 'ICustomData | ICustomData[]',
- 'typeAnchorName': 'ICustomData',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置步骤条的数据,可自定义键值映射',
- 'en-US': 'Set the step bar data, Customizable key value mapping'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'flag-before',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '设置旗子的数据是取自前面还是后面的节点,默认取后面节点上的数据',
- 'en-US':
- 'Set whether the flag data is taken from the preceding or following nodes, and default to taking data from the following nodes'
- },
- 'demoId': 'flag-before'
- },
- {
- 'name': 'flag-content-field',
- 'type': 'string',
- 'defaultValue': `'content'`,
- 'desc': {
- 'zh-CN': '设置旗子内容描述部分对应的键名',
- 'en-US': 'Set the key name corresponding to the flag content description section'
- },
- 'demoId': 'data-field-mapping'
- },
- {
- 'name': 'flag-field',
- 'type': 'string',
- 'defaultValue': `'flags'`,
- 'desc': {
- 'zh-CN': '设置旗子信息数组对应的键名',
- 'en-US': 'Set the key name corresponding to the flag information array'
- },
- 'demoId': 'data-field-mapping'
- },
- {
- 'name': 'flag-name-field',
- 'type': 'string',
- 'defaultValue': `'name'`,
- 'desc': {
- 'zh-CN': '设置旗子标题对应的键名',
- 'en-US': 'Set the key name corresponding to the flag title'
- },
- 'demoId': 'data-field-mapping'
- },
- {
- 'name': 'flag-status-field',
- 'type': 'string',
- 'defaultValue': `'status'`,
- 'desc': {
- 'zh-CN': '设置旗子状态对应的键名',
- 'en-US': 'Set the key name corresponding to the flag state'
- },
- 'demoId': 'data-field-mapping'
- },
- {
- 'name': 'line-style',
- 'type': `'number' | 'string'`,
- 'defaultValue': '1',
- 'desc': {
- 'zh-CN': `线条颜色取值模式为数字时,只有1和2可选;如果为字符串则需传入 16 进制颜色值
- 设置为数字 1 时只有完成与未完成两种状态的线条颜色,完成状态的线条颜色与 milestones-status 定义的 completed 状态的颜色一致
- 设置为数字 2 时线条颜色根随节点状态颜色
- 当设置为字符串形式的 16 进制色值时,如:#1890FF 时,线条不区分状态,全部统一为所设置的颜色`,
- 'en-US': `When the line color value mode is numeric, only 1 and 2 can be selected; If it is a string, the hexadecimal color value needs to be passed in
- When set to the number 1, there are only two types of line colors: complete and incomplete. The color of the completed state line is consistent with the color of the completed state defined by milestone status
- When set to number 2, the root color of the line follows the node state color
- When set to a hexadecimal color value in string form, such as # 1890FF, the lines do not differentiate between states and are all unified to the set color`
- },
- 'demoId': 'line-style'
- },
- {
- 'name': 'milestones-status',
- 'type': 'IStatus',
- 'typeAnchorName': 'IStatus',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '定义状态与颜色对应关系,颜色取值须是 16 进制颜色值或组件库的主题变量',
- 'en-US':
- 'Define the correspondence between state and color, and the color value must be a hexadecimal color value or a theme variable from the component library'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'name-field',
- 'type': 'string',
- 'defaultValue': `'name'`,
- 'desc': {
- 'zh-CN': '设置节点名称对应的键名',
- 'en-US': 'Set the key name corresponding to the node name'
- },
- 'demoId': 'data-field-mapping'
- },
- {
- 'name': 'show-number',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '设置未完成状态的节点是否显示序号',
- 'en-US': 'Set whether nodes in incomplete status display serial numbers'
- },
- 'demoId': 'show-number'
- },
- {
- 'name': 'solid',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '在里程碑模式下,设置已经完成节点显示为实心,且光晕不透明',
- 'en-US': 'In milestone mode, set the completed node to be displayed as solid and the halo is opaque'
- },
- 'demoId': 'solid-style'
- },
- {
- 'name': 'space',
- 'type': 'number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置相邻节点的间距,即节点间线条的长度',
- 'en-US': 'Set the spacing between adjacent nodes, i.e. the length of lines between nodes'
- },
- 'demoId': 'line-style'
- },
- {
- 'name': 'start',
- 'type': 'number',
- 'defaultValue': '-1',
- 'desc': {
- 'zh-CN': '设置节点的序号起始值,从首个节点开始计算',
- 'en-US': 'Set the starting value of the nodes sequence number, starting from the first node'
- },
- 'demoId': 'show-number'
- },
- {
- 'name': 'status-field',
- 'type': 'string',
- 'defaultValue': `'status'`,
- 'desc': {
- 'zh-CN': '设置节点状态对应的键名',
- 'en-US': 'Set the key name corresponding to the node state'
- },
- 'demoId': 'data-field-mapping'
- },
- {
- 'name': 'time-field',
- 'type': 'string',
- 'defaultValue': `'time'`,
- 'desc': {
- 'zh-CN': '设置节点时间信息对应的键名',
- 'en-US': 'Set the key name corresponding to node time information'
- },
- 'demoId': 'data-field-mapping'
- }
- ],
- 'events': [
- {
- 'name': 'click',
- 'type': '(index: number, node: ICustomData) => void',
- 'typeAnchorName': 'ICustomData',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '节点的点击事件,参数(index:节点索引, node:节点数据信息)',
- 'en-US': 'Node click event (parameter) (index: node index, node: node data information)'
- },
- 'demoId': 'milestone-events'
- },
- {
- 'name': 'flagclick',
- 'type': '(index: number, node: ICustomData) => void',
- 'typeAnchorName': 'ICustomData',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '[使用flag-click代替, deprecated v3.5.0废弃,v3.17.0移除;移除原因:命名规范]',
- 'en-US':
- '[It is recommended that flag-click be used instead of flag-click, deprecated in v3.5.0 and removed in v3.17.0; Reason for removal: ]'
- },
- 'demoId': 'milestone-events'
- },
- {
- 'name': 'flag-click',
- 'type': '(index: number, node: ICustomData) => void',
- 'typeAnchorName': 'ICustomData',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '旗子的点击事件,参数(index:旗子索引, node:旗子数据信息)',
- 'en-US': 'Flag click event, parameters (index: flag index, node: data information of flag)'
- },
- 'demoId': 'milestone-events'
- }
- ],
- 'slots': [
- {
- 'name': 'bottom',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '节点下方内容', 'en-US': 'Content under a node' },
- 'demoId': 'custom-bottom-top'
- },
- {
- 'name': 'flag',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '旗帜内容', 'en-US': 'Flag Content' },
- 'demoId': 'custom-flag'
- },
- {
- 'name': 'icon',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '节点图标', 'en-US': 'Node icon' },
- 'demoId': 'custom-icon-slot'
- },
- {
- 'name': 'top',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '节点上方内容', 'en-US': 'Content above the node' },
- 'demoId': 'custom-bottom-top'
- }
- ]
- }
- ],
- types: [
- {
- name: 'IStatus',
- type: 'interface',
- code: `
-interface IStatus {
- completed?: string // 可通过completed-field自定义completed键名
- doing: string
- back: string
- end: string
- cancel: string
-}`
- },
- {
- name: 'ICustomData',
- type: 'interface',
- code: `
-interface ICustomData {
- name?: string
- time?: string
- status?: string
- flags?: string
- content?: string
- [propName: string]: string // 可自定义以上的默认属性
-}`
+ codeFiles: ['milestone-events.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/mind-map/webdoc/mind-map.js b/examples/sites/demos/pc/app/mind-map/webdoc/mind-map.js
index c25b79634..1b6276002 100644
--- a/examples/sites/demos/pc/app/mind-map/webdoc/mind-map.js
+++ b/examples/sites/demos/pc/app/mind-map/webdoc/mind-map.js
@@ -4,7 +4,10 @@ export default {
demos: [
{
demoId: 'basic-usage',
- name: { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
codeFiles: ['basic-usage.vue'],
desc: {
'zh-CN': '本示例介绍了脑图的基本使用方法',
@@ -13,7 +16,10 @@ export default {
},
{
demoId: 'export-data',
- name: { 'zh-CN': '导出数据', 'en-US': 'Export data' },
+ name: {
+ 'zh-CN': '导出数据',
+ 'en-US': 'Export data'
+ },
codeFiles: ['export-data.vue'],
desc: {
'zh-CN': '本demo讲解了如何导入导出脑图',
@@ -22,229 +28,15 @@ export default {
},
{
demoId: 'event',
- name: { 'zh-CN': '事件触发', 'en-US': 'Event' },
+ name: {
+ 'zh-CN': '事件触发',
+ 'en-US': 'Event'
+ },
codeFiles: ['event.vue'],
desc: {
'zh-CN': '本demo讲解了该组件的所有可触发事件',
'en-US': 'This demo explains all the triggering events of the build'
}
}
- ],
- apis: [
- {
- name: 'mind-map',
- type: 'component',
- props: [
- {
- name: 'modelValue',
- type: 'NodeObj',
- defaultValue: '{}',
- desc: {
- 'zh-CN': '默认节点数据',
- 'en-US': 'Default node data'
- },
- demoId: 'basic-usage'
- },
- {
- name: 'options',
- type: 'Options',
- defaultValue: '{contextMenu: false,toolBar: false,nodeMenu: false}',
- desc: {
- 'zh-CN': '配置项',
- 'en-US': 'options'
- }
- }
- ],
- events: [
- {
- name: 'operation',
- type: 'onOperation',
- 'desc': {
- 'zh-CN': '节点重新计算时, 例如将节点A拖拽到节点B, 使得节点A是节点B的子节点',
- 'en-US':
- 'When recalculating nodes, for example, dragging node A to node B so that node A is a child node of node B'
- }
- },
- {
- name: 'create',
- type: '(render:MindElixirInstance)=>void',
- 'desc': {
- 'zh-CN': 'mindmap创建时会触发该事件',
- 'en-US': 'This event will be triggered when creating mindmap'
- }
- },
- {
- name: 'selectNode',
- type: 'onSelectNode',
- 'desc': {
- 'zh-CN': '选择任意一个节点时, 会触发该事件',
- 'en-US': 'When selecting any node, this event will be triggered'
- }
- },
- {
- name: 'selectNewNode',
- type: 'onSelectNewNode',
- 'desc': {
- 'zh-CN': '创建新节点时',
- 'en-US': 'when create new node'
- }
- },
- {
- name: 'selectNodes',
- type: 'onSelectNodes',
- 'desc': {
- 'zh-CN': '选择多个节点的时候会触发该事件',
- 'en-US': 'When selecting multiple nodes, this event will be triggered'
- }
- },
- {
- name: 'unselectNode',
- type: 'onUnselectNode',
- 'desc': {
- 'zh-CN': '取消选择的时候会触发该事件',
- 'en-US': 'When deselecting, this event will be triggered'
- }
- },
- {
- name: 'unselectNodes',
- type: 'onUnselectNode',
- 'desc': {
- 'zh-CN': '取消选择多个节点时会触发该事件',
- 'en-US': 'This event will be triggered when multiple nodes are unselected'
- }
- },
- {
- name: 'expandNode',
- type: 'onExpandNode',
- 'desc': {
- 'zh-CN': '展开节点时会触发该事件',
- 'en-US': 'This event will be triggered when expanding a node'
- }
- },
- {
- name: 'beforeImport',
- type: '({render, data}: {render:MindElixirInstance, data: })=>void',
- 'desc': {
- 'zh-CN': 'v-model更新前会触发',
- 'en-US': 'Triggered before updating the v-model'
- }
- },
- {
- name: 'afterImport',
- type: '({render, data}: {render:MindElixirInstance, data: })=>void',
- 'desc': {
- 'zh-CN': 'v-model更新后会触发',
- 'en-US': 'After updating the v-model, it will trigger'
- }
- }
- ]
- }
- ],
- types: [
- {
- 'name': 'Options',
- type: 'interface',
- code: `
-interface Options {
- direction?: number
- locale?: string
- draggable?: boolean
- editable?: boolean
- contextMenu?: boolean
- contextMenuOption?: any
- toolBar?: boolean
- keypress?: boolean
- mouseSelectionButton?: 0 | 2
- before?: Before
- newTopicName?: string
- allowUndo?: boolean
- overflowHidden?: boolean
- mainLinkStyle?: number
- subLinkStyle?: number
- mobileMenu?: boolean
- theme?: Theme
- nodeMenu?: boolean
-}
-`
- },
- {
- name: 'onOperation',
- type: 'type',
- code: `
-type onOperation = ({render, info}: {render:MindElixirInstance, info: Operation}) => void
-`
- },
- {
- name: 'onSelectNode',
- type: 'type',
- code: `
-type onSelectNode = ({render,nodeObj}: {render:MindElixirInstance,nodeObj:NodeObj}, e?: MouseEvent) => void
-`
- },
- {
- name: 'onSelectNewNode',
- type: 'type',
- code: `
-type selectNewNode: ({render,nodeObj}: {render:MindElixirInstance,nodeObj:NodeObj}) => void
-`
- },
- {
- name: 'onSelectNodes',
- type: 'type',
- code: `
-type selectNodes: ({render,nodeObj}: {render:MindElixirInstance,nodeObj:NodeObj[]}) => void
-`
- },
- {
- name: 'onUnselectNode',
- type: 'type',
- code: `
-type unselectNodes: ({render}: {render: MindElixirInstance}) => void
-`
- },
- {
- name: 'onUnselectNodes',
- type: 'type',
- code: `
-type unselectNodes: ({render}: {render: MindElixirInstance}) => void
-`
- },
- {
- name: 'onExpandNode',
- type: 'type',
- code: `
-type expandNode: ({render,nodeObj}: {render:MindElixirInstance,nodeObj:NodeObj}) => void
-`
- },
- {
- name: 'NodeObj',
- type: 'interface',
- code: `
-export interface NodeObj {
- topic: string
- id: Uid
- style?: {
- fontSize?: string
- color?: string
- background?: string
- fontWeight?: string
- }
- children?: NodeObj[]
- tags?: string[]
- icons?: string[]
- hyperLink?: string
- expanded?: boolean
- direction?: number
- root?: boolean
- image?: {
- url: string
- width: number
- height: number
- }
- branchColor?: string
- parent?: NodeObj
-}
-`
- }
]
}
diff --git a/examples/sites/demos/pc/app/modal/basic-usage.spec.ts b/examples/sites/demos/pc/app/modal/basic-usage.spec.ts
index 3544e94a5..c1c0225e7 100644
--- a/examples/sites/demos/pc/app/modal/basic-usage.spec.ts
+++ b/examples/sites/demos/pc/app/modal/basic-usage.spec.ts
@@ -7,38 +7,38 @@ test('基本用法', async ({ page }) => {
const modal = page.locator('.tiny-modal.type__alert').nth(1)
const confirm = page.locator('.tiny-modal.type__confirm')
// 基本提示框
- await page.getByRole('button', { name: '基本提示框' }).click()
+ await page.getByRole('button', { name: /基本提示框/ }).click()
await expect(modal).toBeVisible()
await expect(modal).toHaveClass(/is__mask/)
- await page.getByRole('button', { name: '确认', exact: true }).click()
+ await page.getByRole('button', { name: /确定/, exact: true }).click()
await expect(modal).not.toBeVisible()
- await page.getByRole('button', { name: '基本提示框' }).click()
+ await page.getByRole('button', { name: /基本提示框/ }).click()
await page.locator('.tiny-modal__close-btn').click()
await expect(modal).not.toBeVisible()
// 成功提示框
- await page.getByRole('button', { name: '成功提示框' }).click()
+ await page.getByRole('button', { name: /成功提示框/ }).click()
await expect(modal).toHaveClass(/status__success/)
await expect(modal.locator('.tiny-modal__status-wrapper svg')).toHaveClass(/tiny-modal-svg__success/)
- await page.getByRole('button', { name: '确认', exact: true }).click()
+ await page.getByRole('button', { name: /确定/, exact: true }).click()
await expect(page.locator('.tiny-modal.type__alert.status__success')).not.toBeVisible()
// 失败提示框
- await page.getByRole('button', { name: '失败提示框' }).click()
+ await page.getByRole('button', { name: /失败提示框/ }).click()
await expect(modal).toHaveClass(/status__error/)
await expect(modal.locator('.tiny-modal__status-wrapper svg')).toHaveClass(/tiny-modal-svg__error/)
- await page.getByRole('button', { name: '确认', exact: true }).click()
+ await page.getByRole('button', { name: /确定/, exact: true }).click()
await expect(page.locator('.tiny-modal.type__alert.status__error')).not.toBeVisible()
// 确认提示框
- await page.getByRole('button', { name: '确认提示框' }).click()
+ await page.getByRole('button', { name: /确认提示框/ }).click()
await expect(confirm).toBeVisible()
- await page.getByRole('button', { name: '确认', exact: true }).click()
+ await page.getByRole('button', { name: /确定/, exact: true }).click()
await expect(confirm).not.toBeVisible()
- await page.getByRole('button', { name: '确认提示框' }).click()
- await page.getByRole('button', { name: '取消' }).click()
+ await page.getByRole('button', { name: /确认提示框/ }).click()
+ await page.getByRole('button', { name: /取消/ }).click()
await expect(confirm).not.toBeVisible()
- await page.getByRole('button', { name: '确认提示框' }).click()
+ await page.getByRole('button', { name: /确认提示框/ }).click()
await page.locator('.tiny-modal__close-btn').click()
await expect(confirm).not.toBeVisible()
})
diff --git a/examples/sites/demos/pc/app/modal/duration.vue b/examples/sites/demos/pc/app/modal/duration.vue
index 1c08d0178..8c669789c 100644
--- a/examples/sites/demos/pc/app/modal/duration.vue
+++ b/examples/sites/demos/pc/app/modal/duration.vue
@@ -26,7 +26,7 @@ export default {
},
errorClick() {
Modal.message({
- status: 'console.error();',
+ status: 'error',
message: `5000ms 后自动关闭提示框`,
duration: '5000'
})
diff --git a/examples/sites/demos/pc/app/modal/event.spec.ts b/examples/sites/demos/pc/app/modal/event.spec.ts
index dd6c7502d..8b2f47ea0 100644
--- a/examples/sites/demos/pc/app/modal/event.spec.ts
+++ b/examples/sites/demos/pc/app/modal/event.spec.ts
@@ -12,14 +12,14 @@ test('事件', async ({ page }) => {
await demo.getByRole('button', { name: '显示、关闭事件' }).click()
await expect(modal).toBeVisible()
await expect(messageModal.getByText('show 事件触发了')).toBeVisible()
- await modal.getByRole('button', { name: '确认' }).click()
+ await modal.getByRole('button', { name: '确定' }).click()
await expect(modal).not.toBeVisible()
await expect(messageModal.getByText('hide 事件触发了')).toBeVisible()
// 确认、取消事件
await demo.getByRole('button', { name: '确认、取消事件' }).click()
await expect(modal).toBeVisible()
- await modal.getByRole('button', { name: '确认' }).click()
+ await modal.getByRole('button', { name: '确定' }).click()
await expect(modal).not.toBeVisible()
await expect(messageModal.getByText('confirm 事件触发了')).toBeVisible()
await demo.getByRole('button', { name: '确认、取消事件' }).click()
diff --git a/examples/sites/demos/pc/app/modal/message.vue b/examples/sites/demos/pc/app/modal/message.vue
index 9308306ff..0a6e89792 100644
--- a/examples/sites/demos/pc/app/modal/message.vue
+++ b/examples/sites/demos/pc/app/modal/message.vue
@@ -4,7 +4,6 @@
diff --git a/examples/sites/demos/pc/app/modal/prop-slots.spec.ts b/examples/sites/demos/pc/app/modal/prop-slots.spec.ts
new file mode 100644
index 000000000..76a0d9c02
--- /dev/null
+++ b/examples/sites/demos/pc/app/modal/prop-slots.spec.ts
@@ -0,0 +1,10 @@
+import { test, expect } from '@playwright/test'
+
+test('调整窗口后显示的最小宽度', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('modal#prop-slots')
+ await page.getByRole('button', { name: '打开提示框' }).click()
+ await page.getByRole('button', { name: '点我确定' }).click()
+ await page.getByRole('button', { name: '打开提示框' }).click()
+ await page.getByRole('button', { name: '点我取消' }).click()
+})
diff --git a/examples/sites/demos/pc/app/modal/prop-slots.vue b/examples/sites/demos/pc/app/modal/prop-slots.vue
new file mode 100644
index 000000000..0390c81d0
--- /dev/null
+++ b/examples/sites/demos/pc/app/modal/prop-slots.vue
@@ -0,0 +1,43 @@
+
+ 打开提示框
+
+
+
diff --git a/examples/sites/demos/pc/app/modal/type.spec.ts b/examples/sites/demos/pc/app/modal/type.spec.ts
index ec6e9abff..59d2ec562 100644
--- a/examples/sites/demos/pc/app/modal/type.spec.ts
+++ b/examples/sites/demos/pc/app/modal/type.spec.ts
@@ -8,7 +8,7 @@ test('窗口类型', async ({ page }) => {
await page.getByRole('button', { name: 'alert 弹框' }).click()
await expect(alert).toBeVisible()
await expect(alert).toHaveClass(/type__alert/)
- await page.getByRole('button', { name: '确认', exact: true }).click()
+ await page.getByRole('button', { name: '确定', exact: true }).click()
const message = page.locator('.tiny-modal').filter({ hasText: 'message 提示框' })
await page.getByRole('button', { name: 'message 提示框' }).click()
diff --git a/examples/sites/demos/pc/app/modal/value.spec.ts b/examples/sites/demos/pc/app/modal/value.spec.ts
index e887fa3a0..b030c09fa 100644
--- a/examples/sites/demos/pc/app/modal/value.spec.ts
+++ b/examples/sites/demos/pc/app/modal/value.spec.ts
@@ -10,7 +10,7 @@ test('控制弹窗显示隐藏的绑定值', async ({ page }) => {
await expect(modal).toBeVisible()
await expect(modal.locator('.custom-content')).toHaveText('test')
await expect(modal.locator('.custom-content')).toHaveCSS('color', 'rgb(49, 104, 241)')
- await page.getByRole('button', { name: '确认' }).click()
+ await page.getByRole('button', { name: '确定' }).click()
await expect(modal).not.toHaveClass(/is__visible/)
await expect(modal).not.toBeVisible()
})
diff --git a/examples/sites/demos/pc/app/modal/webdoc/modal.js b/examples/sites/demos/pc/app/modal/webdoc/modal.js
index 411ec52d9..621870856 100644
--- a/examples/sites/demos/pc/app/modal/webdoc/modal.js
+++ b/examples/sites/demos/pc/app/modal/webdoc/modal.js
@@ -3,684 +3,364 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN':
'可通过Modal.alert
方法设置弹出框,Modal.confirm
方法设置确认弹出框。函数返回一个Promise
对象,其中属性vm
可用来关闭当前模态框。
',
'en-US':
'You can use the Modal.alert
method to set a pop-up box, and use the Modal.confirm
method to set a confirmation pop-up box. The function returns a Promise
object, where the property vm
can be used to close the current Modal.
'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'fullscreen',
- 'name': { 'zh-CN': '最大化显示', 'en-US': 'Maximized Display' },
- 'desc': {
+ demoId: 'fullscreen',
+ name: {
+ 'zh-CN': '最大化显示',
+ 'en-US': 'Maximized Display'
+ },
+ desc: {
'zh-CN': '可通过fullscreen
属性设置是否最大化显示。
',
'en-US': 'You can use the fullscreen
attribute to set whether to maximize the display.
'
},
- 'codeFiles': ['fullscreen.vue']
+ codeFiles: ['fullscreen.vue']
},
{
- 'demoId': 'esc-closable',
- 'name': { 'zh-CN': '按 Esc 键关闭弹出框', 'en-US': 'Press Esc To Close The Dialog Box.' },
- 'desc': {
+ demoId: 'esc-closable',
+ name: {
+ 'zh-CN': '按 Esc 键关闭弹出框',
+ 'en-US': 'Press Esc To Close The Dialog Box.'
+ },
+ desc: {
'zh-CN': '可通过esc-closable
属性设置是否允许按 Esc 键关闭窗口。
',
'en-US':
'You can use the esc-closable
attribute to set whether to close a window by pressing the Esc key.
'
},
- 'codeFiles': ['esc-closable.vue']
+ codeFiles: ['esc-closable.vue']
},
{
- 'demoId': 'duration',
- 'name': { 'zh-CN': '自动关闭延时', 'en-US': 'Automatic Shutdown Delay' },
- 'desc': {
+ demoId: 'duration',
+ name: {
+ 'zh-CN': '自动关闭延时',
+ 'en-US': 'Automatic Shutdown Delay'
+ },
+ desc: {
'zh-CN': "可通过duration
属性设置自动关闭的延迟时间,仅当type='message'
有效。
",
'en-US':
'You can use the duration
attribute to set the delay time for automatic closing. This parameter is valid only for type=message.
'
},
- 'codeFiles': ['duration.vue']
+ codeFiles: ['duration.vue']
},
{
- 'demoId': 'id',
- 'name': { 'zh-CN': '防止重复提示', 'en-US': 'Prevent Repeated Prompts' },
- 'desc': {
+ demoId: 'id',
+ name: {
+ 'zh-CN': '防止重复提示',
+ 'en-US': 'Prevent Repeated Prompts'
+ },
+ desc: {
'zh-CN': "可通过id
设置防止重复提示,仅当type='message'
有效。
",
'en-US':
'If you do not want to click the window repeatedly, you can set a unique id
to prevent repeated prompts. This parameter is valid only for type=message.
'
},
- 'codeFiles': ['id.vue']
+ codeFiles: ['id.vue']
},
{
- 'demoId': 'lock-scroll',
- 'name': { 'zh-CN': '锁住滚动条', 'en-US': 'Lock The Scroll Bar' },
- 'desc': {
+ demoId: 'lock-scroll',
+ name: {
+ 'zh-CN': '锁住滚动条',
+ 'en-US': 'Lock The Scroll Bar'
+ },
+ desc: {
'zh-CN': '可通过lock-scroll
属性设置是否锁住滚动条,不允许页面滚动。
',
'en-US': 'You can use the lock-scroll
attribute to set whether to lock the scroll bar.
'
},
- 'codeFiles': ['lock-scroll.vue']
+ codeFiles: ['lock-scroll.vue']
},
{
- 'demoId': 'lock-view',
- 'name': { 'zh-CN': '锁住页面', 'en-US': 'Lock The Page' },
- 'desc': {
+ demoId: 'lock-view',
+ name: {
+ 'zh-CN': '锁住页面',
+ 'en-US': 'Lock The Page'
+ },
+ desc: {
'zh-CN':
'可通过mask
属性设置是否显示遮罩层,lock-view
属性设置是否锁住页面,不允许窗口之外的任何操作。
',
'en-US':
'You can set whether to display the mask layer through themask
attribute, and whether to lock the page and not allow any operations outside the window through thelock-view
attribute'
},
- 'codeFiles': ['lock-view.vue']
+ codeFiles: ['lock-view.vue']
},
{
- 'demoId': 'mask-closable',
- 'name': { 'zh-CN': '点击遮罩层关闭窗口', 'en-US': 'Click The Mask Layer To Close The Window.' },
- 'desc': {
+ demoId: 'mask-closable',
+ name: {
+ 'zh-CN': '点击遮罩层关闭窗口',
+ 'en-US': 'Click The Mask Layer To Close The Window.'
+ },
+ desc: {
'zh-CN': '可通过mask-closable
属性设置是否允许点击遮罩层关闭窗口。
',
'en-US':
'You can use the mask-closable
attribute to set whether to allow clicking the mask layer to close the window.
'
},
- 'codeFiles': ['mask-closable.vue']
+ codeFiles: ['mask-closable.vue']
},
{
- 'demoId': 'message',
- 'name': { 'zh-CN': '自定义内容', 'en-US': 'Custom Content' },
- 'desc': {
+ demoId: 'message',
+ name: {
+ 'zh-CN': '自定义内容',
+ 'en-US': 'Custom Content'
+ },
+ desc: {
'zh-CN': '可通过message
属性设置窗口的内容。
',
'en-US': 'You can set the content of the window through the :message
attribute.
'
},
- 'codeFiles': ['message.vue']
+ codeFiles: ['message.vue']
},
{
- 'demoId': 'footer-btn-content',
- 'name': { 'zh-CN': '自定义底部按钮内容', 'en-US': 'Custom Bottom Button Content' },
- 'desc': {
+ demoId: 'footer-btn-content',
+ name: {
+ 'zh-CN': '自定义底部按钮内容',
+ 'en-US': 'Custom Bottom Button Content'
+ },
+ desc: {
'zh-CN':
'可通过confirm-content
属性设置确认按钮内容,cancel-content
属性设置取消按钮内容。
\n',
'en-US':
'
Set the content of the confirm button throughconfirm-content
, and set the content of the cancel button through:cancel-content
.
'
},
- 'codeFiles': ['footer-btn-content.vue']
+ codeFiles: ['footer-btn-content.vue']
},
{
- 'demoId': 'footer-btn-props',
- 'name': { 'zh-CN': '自定义底部按钮', 'en-US': 'Customize Bottom Button' },
- 'desc': {
+ demoId: 'footer-btn-props',
+ name: {
+ 'zh-CN': '自定义底部按钮',
+ 'en-US': 'Customize Bottom Button'
+ },
+ desc: {
'zh-CN':
'可通过confirm-btn-props
属性设置确认按钮,cancel-btn-props
属性设置取消按钮。
\n',
'en-US':
'
Set the confirmation button via :confirm-btn-props
and the cancel button via :cancel-btn-props
.
'
},
- 'codeFiles': ['footer-btn-props.vue']
+ codeFiles: ['footer-btn-props.vue']
},
{
- 'demoId': 'resize',
- 'name': { 'zh-CN': '调整窗口大小', 'en-US': 'Resize The Window' },
- 'desc': {
+ demoId: 'resize',
+ name: {
+ 'zh-CN': '调整窗口大小',
+ 'en-US': 'Resize The Window'
+ },
+ desc: {
'zh-CN':
'可通过width
属性设置窗口宽度,height
属性设置高度,resize
属性设置是否允许拖动调整窗口大小。
',
'en-US':
'Use width
to set the window width, height
to set the height, and resize
to set whether to allow dragging to resize the window.
'
},
- 'codeFiles': ['resize.vue']
+ codeFiles: ['resize.vue']
},
{
- 'demoId': 'min-width',
- 'name': {
+ demoId: 'min-width',
+ name: {
'zh-CN': '调整窗口后的最小宽度',
'en-US': 'The Minimum Width Of The Window Displayed After Adjusting Its Size'
},
- 'desc': {
+ desc: {
'zh-CN':
'可通过resize
属性设置可拖拽属性为true
后,min-width
属性设置拖拽后窗口的最小宽度。
',
'en-US':
'By setting theresize
drag property totrue
, the minimum width of the window after dragging can be set through themin-width
property.
'
},
- 'codeFiles': ['min-width.vue']
+ codeFiles: ['min-width.vue']
},
{
- 'demoId': 'min-height',
- 'name': {
+ demoId: 'min-height',
+ name: {
'zh-CN': '调整窗口后的最小高度',
'en-US': 'The Minimum Height Displayed By The Window After Adjusting Its Size'
},
- 'desc': {
+ desc: {
'zh-CN':
'可通过resize
属性设置可拖拽属性为true
后,min-height
属性设置拖拽后窗口的最小高度。
',
'en-US':
'By setting theresize
drag property totrue
, the minimum height of the window after dragging can be set through themin-height
property.
'
},
- 'codeFiles': ['min-height.vue']
+ codeFiles: ['min-height.vue']
},
{
- 'demoId': 'showFooter',
- 'name': { 'zh-CN': '不显示底部', 'en-US': 'Do Not Display Bottom' },
- 'desc': {
+ demoId: 'showFooter',
+ name: {
+ 'zh-CN': '不显示底部',
+ 'en-US': 'Do Not Display Bottom'
+ },
+ desc: {
'zh-CN': '可通过show-footer
属性设置是否显示底部。
',
'en-US': 'Set whether to display the bottom throughshow-root
.
'
},
- 'codeFiles': ['showFooter.vue']
+ codeFiles: ['showFooter.vue']
},
{
- 'demoId': 'showHeader',
- 'name': { 'zh-CN': '不显示头部', 'en-US': 'Do Not Display The Head' },
- 'desc': {
+ demoId: 'showHeader',
+ name: {
+ 'zh-CN': '不显示头部',
+ 'en-US': 'Do Not Display The Head'
+ },
+ desc: {
'zh-CN': '可通过show-header
属性设置是否显示头部。
',
'en-US': 'Set whether to display the header throughshow-header
.
'
},
- 'codeFiles': ['showHeader.vue']
+ codeFiles: ['showHeader.vue']
},
{
- 'demoId': 'status',
- 'name': { 'zh-CN': '消息状态', 'en-US': 'Position From The Top' },
- 'desc': {
+ demoId: 'status',
+ name: {
+ 'zh-CN': '消息状态',
+ 'en-US': 'Position From The Top'
+ },
+ desc: {
'zh-CN':
'可通过status
属性设置消息状态,可选值有info
、success
、warning
、error
、loading
。
',
'en-US':
'Set the message status throughstatus
, with optional values includinginfo
success
warning
error
loading
.
'
},
- 'codeFiles': ['status.vue']
+ codeFiles: ['status.vue']
},
{
- 'demoId': 'message-closable',
- 'name': { 'zh-CN': '关闭消息弹窗', 'en-US': 'Close Message Pop-Up Window' },
- 'desc': {
+ demoId: 'message-closable',
+ name: {
+ 'zh-CN': '关闭消息弹窗',
+ 'en-US': 'Close Message Pop-Up Window'
+ },
+ desc: {
'zh-CN': '可通过message-closable
属性设置消息可手动关闭。
',
'en-US': 'Messages can be closed manually by setting message-closable
.
'
},
- 'codeFiles': ['message-closable.vue']
+ codeFiles: ['message-closable.vue']
},
{
- 'demoId': 'title',
- 'name': { 'zh-CN': '标题', 'en-US': 'Title' },
- 'desc': {
+ demoId: 'title',
+ name: {
+ 'zh-CN': '标题',
+ 'en-US': 'Title'
+ },
+ desc: {
'zh-CN': '可通过title
属性设置窗口的标题。
',
'en-US': 'Set the title of the window viatitle
.
'
},
- 'codeFiles': ['title.vue']
+ codeFiles: ['title.vue']
},
{
- 'demoId': 'top',
- 'name': { 'zh-CN': '距离顶部的位置', 'en-US': 'Position from top' },
- 'desc': {
+ demoId: 'top',
+ name: {
+ 'zh-CN': '距离顶部的位置',
+ 'en-US': 'Position from top'
+ },
+ desc: {
'zh-CN': "可通过top
属性设置消息距离顶部的位置,仅当type='message'
有效。
",
'en-US':
"Set the position of the message from the top via top
, which is only valid when type='message'
.
"
},
- 'codeFiles': ['top.vue']
+ codeFiles: ['top.vue']
},
{
- 'demoId': 'type',
- 'name': { 'zh-CN': '窗口类型', 'en-US': 'Custom Window Type' },
- 'desc': {
+ demoId: 'type',
+ name: {
+ 'zh-CN': '窗口类型',
+ 'en-US': 'Custom Window Type'
+ },
+ desc: {
'zh-CN': '可通过type
属性设置窗口类型。
',
'en-US': 'Set the window type via :type
.
'
},
- 'codeFiles': ['type.vue']
+ codeFiles: ['type.vue']
},
{
- 'demoId': 'value',
- 'name': { 'zh-CN': '绑定值', 'en-US': 'Bind Value' },
- 'desc': {
+ demoId: 'value',
+ name: {
+ 'zh-CN': '绑定值',
+ 'en-US': 'Bind Value'
+ },
+ desc: {
'zh-CN': '可通过modalValue/v-model
属性设置绑定值,控制弹窗是否显示。
',
'en-US':
'Bind the value through modalValue/v-model
to control whether the pop-up window is displayed.
'
},
- 'codeFiles': ['value.vue']
+ codeFiles: ['value.vue']
},
{
- 'demoId': 'z-index',
- 'name': { 'zh-CN': '自定义堆叠顺序', 'en-US': 'Custom Stacking Order' },
- 'desc': {
+ demoId: 'z-index',
+ name: {
+ 'zh-CN': '自定义堆叠顺序',
+ 'en-US': 'Custom Stacking Order'
+ },
+ desc: {
'zh-CN': '可通过z-index
属性设置自定义堆叠顺序。
',
'en-US': 'Set a custom stacking order via z-index
.
'
},
- 'codeFiles': ['z-index.vue']
+ codeFiles: ['z-index.vue']
},
{
- 'demoId': 'is-form-reset',
- 'name': { 'zh-CN': '关闭弹窗,是否重置表单数据', 'en-US': 'Do Not Reset Data After Closing Pop Ups' },
- 'desc': {
+ demoId: 'is-form-reset',
+ name: {
+ 'zh-CN': '关闭弹窗,是否重置表单数据',
+ 'en-US': 'Do Not Reset Data After Closing Pop Ups'
+ },
+ desc: {
'zh-CN': '可通过is-form-reset
属性设置false
,关闭弹窗后不重置数据。
',
'en-US':
'By setting theis-form-reset
attribute tofalse
, the data will not be reset after closing the pop-up window.
'
},
- 'codeFiles': ['is-form-reset.vue']
+ codeFiles: ['is-form-reset.vue']
},
{
- 'demoId': 'footer-slot',
- 'name': { 'zh-CN': '底部插槽', 'en-US': 'Bottom Slot' },
- 'desc': {
+ demoId: 'footer-slot',
+ name: {
+ 'zh-CN': '底部插槽',
+ 'en-US': 'Bottom Slot'
+ },
+ desc: {
'zh-CN': '可通过#footer
插槽设置底部内容。
',
'en-US': 'The bottom content can be set through the #footer
slot.'
},
- 'codeFiles': ['footer-slot.vue']
+ codeFiles: ['footer-slot.vue']
},
{
- 'demoId': 'default-grid',
- 'name': { 'zh-CN': '嵌套表格', 'en-US': 'Nested Tables' },
- 'desc': {
+ demoId: 'default-grid',
+ name: {
+ 'zh-CN': '嵌套表格',
+ 'en-US': 'Nested Tables'
+ },
+ desc: {
'zh-CN': '
可通过#default
插槽设置嵌套表格组件。
',
'en-US': 'Table components can be nested via #default
slot.'
},
- 'codeFiles': ['default-grid.vue']
+ codeFiles: ['default-grid.vue']
},
{
- 'demoId': 'event',
- 'name': { 'zh-CN': '事件', 'en-US': 'event' },
- 'desc': {
- 'zh-CN': `
- 当窗口显示时会触发show
事件,关闭时会触发hide
事件。
- 当窗口缩放时会触发zoom
事件。
- 当点击确定按钮时会触发confirm
事件,点击取消按钮时触发cancel
事件。
- 当点击关闭按钮时会触发close
事件。
-
`,
+ demoId: 'event',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': 'event'
+ },
+ desc: {
+ 'zh-CN':
+ '\n 当窗口显示时会触发show
事件,关闭时会触发hide
事件。
\n 当窗口缩放时会触发zoom
事件。
\n 当点击确定按钮时会触发confirm
事件,点击取消按钮时触发cancel
事件。
\n 当点击关闭按钮时会触发close
事件。
\n
',
'en-US': ''
},
- 'codeFiles': ['event.vue']
- }
- ],
- apis: [
- {
- 'name': 'modal',
- 'type': 'component',
- 'props': [
- {
- 'name': 'cancel-btn-props',
- 'type': 'Button.props',
- 'typeAnchorName': 'button#API',
- 'defaultValue': '{}',
- 'desc': {
- 'zh-CN': '自定义取消按钮的 props ,可选值与 Button 组件一致',
- 'en-US':
- 'Customize the props of the cancel button. The optional values are consistent with the Button component'
- },
- 'demoId': 'footer-btn-props'
- },
- {
- 'name': 'cancel-content',
- 'type': 'string',
- 'defaultValue': "'取消'",
- 'desc': {
- 'zh-CN': '自定义取消按钮内容',
- 'en-US': 'Customize cancel button content'
- },
- 'demoId': 'footer-btn-content'
- },
- {
- 'name': 'confirm-btn-props',
- 'type': 'Button.props',
- 'typeAnchorName': 'button#API',
- 'defaultValue': '{}',
- 'desc': {
- 'zh-CN': '自定义确认按钮 props,可选值与 Button 组件一致',
- 'en-US':
- 'Customize the confirmation button props, the optional values are consistent with the Button component'
- },
- 'demoId': 'footer-btn-props'
- },
- {
- 'name': 'confirm-content',
- 'type': 'string',
- 'defaultValue': "'确认'",
- 'desc': {
- 'zh-CN': '自定义确认按钮内容',
- 'en-US': 'Customize confirmation button content'
- },
- 'demoId': 'footer-btn-content'
- },
- {
- 'name': 'duration',
- 'type': 'number | string',
- 'defaultValue': '3000',
- 'desc': {
- 'zh-CN': "自动关闭的延时,仅当 type 为 'message' 有效",
- 'en-US': "Delay for automatic shutdown, only valid when type is 'message'"
- },
- 'demoId': 'duration'
- },
- {
- 'name': 'esc-closable',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否允许按 Esc 键关闭窗口',
- 'en-US': 'Whether to allow pressing the Esc key to close a window'
- },
- 'demoId': 'esc-closable'
- },
- {
- 'name': 'fullscreen',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否最大化显示',
- 'en-US': 'Whether to maximize the display'
- },
- 'demoId': 'fullscreen'
- },
- {
- 'name': 'height',
- 'type': 'number | string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '窗口的高度',
- 'en-US': 'window height'
- },
- 'demoId': 'resize'
- },
- {
- 'name': 'id',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': "如果不想窗口重复点击,可以设置唯一的 id 防止重复提示,仅当 type 为 'message' 有效",
- 'en-US':
- "If you don't want the window to be clicked repeatedly, you can set a unique id to prevent repeated prompts. This is only valid when type is 'message'"
- },
- 'demoId': 'id'
- },
- {
- 'name': 'is-form-reset',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '关闭弹窗时,是否重置表单数据',
- 'en-US': 'Whether to reset the form data when closing the pop-up window'
- },
- 'demoId': 'is-form-reset'
- },
- {
- 'name': 'lock-scroll',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否锁住滚动条,不允许页面滚动',
- 'en-US': 'Whether to lock the scroll bar and not allow the page to scroll'
- },
- 'demoId': 'lock-scroll'
- },
- {
- 'name': 'lock-view',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否锁住页面,不允许窗口之外的任何操作',
- 'en-US': 'Whether to lock the page and not allow any operations outside the window'
- },
- 'demoId': 'lock-view'
- },
- {
- 'name': 'mask',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否显示遮罩层',
- 'en-US': 'Whether to display the mask layer'
- },
- 'demoId': 'lock-view1'
- },
- {
- 'name': 'mask-closable',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '是否允许点击遮罩层关闭窗口',
- 'en-US': 'Whether to allow clicking on the mask layer to close the window'
- },
- 'demoId': 'mask-closable'
- },
- {
- 'name': 'message',
- 'type': 'string | VNode | () => string | VNode',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '窗口的内容',
- 'en-US': 'Window contents'
- },
- 'demoId': 'message'
- },
- {
- 'name': 'message-closable',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': "'message' 类型弹窗是否显示关闭按钮",
- 'en-US': "Whether the 'message' type pop-up window displays a close button"
- },
- 'demoId': 'message-closable'
- },
- {
- 'name': 'min-height',
- 'type': 'number | string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '窗口的最小高度',
- 'en-US': 'Minimum height of window'
- },
- 'demoId': 'min-height'
- },
- {
- 'name': 'min-width',
- 'type': 'number | string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '窗口的最小宽度',
- 'en-US': 'The minimum width of the window'
- },
- 'demoId': 'min-width'
- },
- {
- 'name': 'modelValue / v-model',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否显示',
- 'en-US': 'Whether to display'
- },
- 'demoId': 'value'
- },
- {
- 'name': 'resize',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否允许拖动调整窗口大小',
- 'en-US': 'Whether to allow dragging to resize the window'
- },
- 'demoId': 'resize'
- },
- {
- 'name': 'show-footer',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否显示底部',
- 'en-US': 'Display bottom'
- },
- 'demoId': 'showFooter'
- },
- {
- 'name': 'show-header',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否显示头部',
- 'en-US': 'Display Header'
- },
- 'demoId': 'showHeader'
- },
- {
- 'name': 'status',
- 'type': 'IStatus',
- 'typeAnchorName': 'IStatus',
- 'defaultValue': "'info'",
- 'desc': {
- 'zh-CN': "消息状态,当 type 为 'alert'、'message'、'confirm' 时有效",
- 'en-US': "Message status, valid when type is 'alert', 'message', 'confirm'"
- },
- 'demoId': 'status'
- },
- {
- 'name': 'title',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '窗口的标题',
- 'en-US': 'Window title'
- },
- 'demoId': 'title'
- },
- {
- 'name': 'top',
- 'type': 'number | string',
- 'defaultValue': '15',
- 'desc': {
- 'zh-CN': "消息距离顶部的位置,仅当 type 为 'message' 时有效",
- 'en-US': "The position of the message from the top, only valid when type is 'message'"
- },
- 'demoId': 'top'
- },
- {
- 'name': 'type',
- 'type': "'alert' | 'confirm' | 'message'",
- 'defaultValue': "'alert'",
- 'desc': {
- 'zh-CN': '窗口类型',
- 'en-US': 'Window type'
- },
- 'demoId': 'type'
- },
- {
- 'name': 'width',
- 'type': 'number | string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '窗口的宽度',
- 'en-US': 'window width'
- },
- 'demoId': 'resize'
- },
- {
- 'name': 'z-index',
- 'type': 'number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义堆叠顺序(对于某些特殊场景,比如被遮挡时可能会用到)',
- 'en-US': 'Customize the stacking order (may be used in some special scenarios, such as when it is blocked)'
- },
- 'demoId': 'z-index'
- }
- ],
- 'events': [
- {
- 'name': 'cancel',
- 'type': '(params: IModalEventParam, event: Event) => void',
- 'typeAnchorName': 'IModalEventParam',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点击取消按钮时会触发该事件',
- 'en-US': 'This event is triggered when the Cancel button is clicked'
- },
- 'demoId': 'event'
- },
- {
- 'name': 'close',
- 'type': '(params: IModalEventParam, event: Event) => void',
- 'typeAnchorName': 'IModalEventParam',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点击关闭按钮时会触发该事件',
- 'en-US': 'This event is triggered when the close button is clicked'
- },
- 'demoId': 'event'
- },
- {
- 'name': 'confirm',
- 'type': '(params: IModalEventParam, event: Event) => void',
- 'typeAnchorName': 'IModalEventParam',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点击确定按钮时会触发该事件',
- 'en-US': 'This event is triggered when the OK button is clicked'
- },
- 'demoId': 'event'
- },
- {
- 'name': 'hide',
- 'type': '(params: IModalEventParam) => void',
- 'typeAnchorName': 'IModalEventParam',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '在窗口关闭时会触发该事件',
- 'en-US': 'This event is triggered when the window is closed'
- },
- 'demoId': 'hide-event'
- },
- {
- 'name': 'show',
- 'type': '(params: IModalEventParam) => void',
- 'typeAnchorName': 'IModalEventParam',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '在窗口显示时会触发该事件',
- 'en-US': 'This event is triggered when the window is displayed'
- },
- 'demoId': 'event'
- },
- {
- 'name': 'zoom',
- 'type': '(params: IModalEventParam, event: Event) => void',
- 'typeAnchorName': 'IModalEventParam',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '窗口缩放时会触发该事件',
- 'en-US': 'This event is triggered when a window is zoomed in or out'
- },
- 'demoId': 'event'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '默认插槽',
- 'en-US': 'Default slot'
- },
- 'demoId': 'default-grid'
- },
- {
- 'name': 'footer',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '窗口底部的模板',
- 'en-US': 'Template at the bottom of the window'
- },
- 'demoId': 'footer-slot'
- }
- ]
- }
- ],
- types: [
- {
- name: 'IModalEventParam',
- type: 'interface',
- code: `
-interface IModalEventParam {
- type: 'alert' | 'message' | 'confirm' // 弹窗类型
- $modal: ComponentPublicInstance // Modal组件实例
-}
-`
+ codeFiles: ['event.vue']
},
{
- name: 'IStatus',
- type: 'type',
- code: `
- type IStatus = 'info' | 'success' | 'warning' | 'error' | 'loading'
- `
+ demoId: 'prop-slots',
+ name: {
+ 'zh-CN': '函数插槽',
+ 'en-US': 'When used functionally, the slot can be set through the `slots` property'
+ },
+ desc: {
+ 'zh-CN': '在函数式使用时,可通过slots
属性设置插槽。
',
+ 'en-US': 'When used functionally, the slot can be set through the slots
property.'
+ },
+ codeFiles: ['prop-slots.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/nav-menu/allow-full-url-composition-api.vue b/examples/sites/demos/pc/app/nav-menu/allow-full-url-composition-api.vue
new file mode 100644
index 000000000..339f050af
--- /dev/null
+++ b/examples/sites/demos/pc/app/nav-menu/allow-full-url-composition-api.vue
@@ -0,0 +1,309 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/nav-menu/allow-full-url.spec.ts b/examples/sites/demos/pc/app/nav-menu/allow-full-url.spec.ts
new file mode 100644
index 000000000..42984ac9e
--- /dev/null
+++ b/examples/sites/demos/pc/app/nav-menu/allow-full-url.spec.ts
@@ -0,0 +1,12 @@
+import { test, expect } from '@playwright/test'
+
+test('支持完整URL', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('nav-menu#allow-full-url')
+ const preview = page.locator('#allow-full-url')
+ const popMenu = preview.locator('.popmenu')
+ await preview.getByText('指南').first().hover()
+ await expect(popMenu).toBeVisible()
+ const homePage = preview.getByText('首页')
+ await expect(homePage).toHaveAttribute('to', '/https://www.baidu.com/')
+})
diff --git a/examples/sites/demos/pc/app/nav-menu/allow-full-url.vue b/examples/sites/demos/pc/app/nav-menu/allow-full-url.vue
new file mode 100644
index 000000000..b36d22aea
--- /dev/null
+++ b/examples/sites/demos/pc/app/nav-menu/allow-full-url.vue
@@ -0,0 +1,317 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/nav-menu/parent-key-composition-api.vue b/examples/sites/demos/pc/app/nav-menu/parent-key-composition-api.vue
new file mode 100644
index 000000000..268905c38
--- /dev/null
+++ b/examples/sites/demos/pc/app/nav-menu/parent-key-composition-api.vue
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/nav-menu/parent-key.spec.ts b/examples/sites/demos/pc/app/nav-menu/parent-key.spec.ts
new file mode 100644
index 000000000..7d5145f2f
--- /dev/null
+++ b/examples/sites/demos/pc/app/nav-menu/parent-key.spec.ts
@@ -0,0 +1,12 @@
+import { test, expect } from '@playwright/test'
+
+test('支持完整URL', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('nav-menu#parent-key')
+ const preview = page.locator('#parent-key')
+ const popMenu = preview.locator('.popmenu')
+ const homePage = preview.getByText('首页')
+ await expect(homePage).toBeVisible()
+ await preview.getByText('指南').first().hover()
+ await expect(popMenu).toBeVisible()
+})
diff --git a/examples/sites/demos/pc/app/nav-menu/parent-key.vue b/examples/sites/demos/pc/app/nav-menu/parent-key.vue
new file mode 100644
index 000000000..f05c48f07
--- /dev/null
+++ b/examples/sites/demos/pc/app/nav-menu/parent-key.vue
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/nav-menu/webdoc/nav-menu.js b/examples/sites/demos/pc/app/nav-menu/webdoc/nav-menu.js
index 15f742ac1..28125b446 100644
--- a/examples/sites/demos/pc/app/nav-menu/webdoc/nav-menu.js
+++ b/examples/sites/demos/pc/app/nav-menu/webdoc/nav-menu.js
@@ -3,228 +3,132 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '通过 data
配置菜单数据。',
'en-US': 'The data
is used to configure menu data.'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'overflow',
- 'name': { 'zh-CN': '超出显示', 'en-US': 'Exceeding display' },
- 'desc': {
- 'zh-CN': `当一级菜单内容过多溢出时,通过 overflow
配置显示方式,共有 auto
、retract
、fixed
、hidden
4种方式,默认为 auto
。
- overflow 选项说明
\n
- auto:菜单栏右侧显示 更多
菜单,鼠标悬停该菜单时,将显示剩余未展示的菜单;
- fixed:菜单栏左侧显示 三明治折叠/展开
图标,鼠标悬停该图标时,将显示所有菜单;
- retract:菜单栏不显示任何菜单,只显示 三明治折叠/展开
图标,鼠标悬停该图标时,将显示所有菜单;
- hidden:剩余未展示的菜单隐藏不显示。
`,
- 'en-US': `When there is too much content in the first level menu that overflows, configure the display mode throughoverflow
. There are four modes:auto
,retract
,fixed
, andhidden
. The default isauto
.
- Overview Options Description
\n
- auto: TheMore
menu is displayed on the right side of the menu bar. When the mouse hovers over this menu, the remaining undisclosed menus will be displayed< br/>
- fixed: Thesandwich fold/expand
icon is displayed on the left side of the menu bar. When the mouse hovers over this icon, all menus will be displayed< br/>
- retract: The menu bar does not display any menus, only displays thesandwich fold/expand
icon. When the mouse hovers over this icon, all menus will be displayed< br/>
- hidden: The remaining undisclosed menus are hidden and not displayed.
`
+ demoId: 'overflow',
+ name: {
+ 'zh-CN': '超出显示',
+ 'en-US': 'Exceeding display'
},
- 'codeFiles': ['overflow.vue']
+ desc: {
+ 'zh-CN':
+ '当一级菜单内容过多溢出时,通过 overflow
配置显示方式,共有 auto
、retract
、fixed
、hidden
4种方式,默认为 auto
。\n overflow 选项说明
\n\n auto:菜单栏右侧显示 更多
菜单,鼠标悬停该菜单时,将显示剩余未展示的菜单;
\n fixed:菜单栏左侧显示 三明治折叠/展开
图标,鼠标悬停该图标时,将显示所有菜单;
\n retract:菜单栏不显示任何菜单,只显示 三明治折叠/展开
图标,鼠标悬停该图标时,将显示所有菜单;
\n hidden:剩余未展示的菜单隐藏不显示。
',
+ 'en-US':
+ 'When there is too much content in the first level menu that overflows, configure the display mode throughoverflow
. There are four modes:auto
,retract
,fixed
, andhidden
. The default isauto
.\n Overview Options Description
\n\n auto: TheMore
menu is displayed on the right side of the menu bar. When the mouse hovers over this menu, the remaining undisclosed menus will be displayed< br/>\n fixed: Thesandwich fold/expand
icon is displayed on the left side of the menu bar. When the mouse hovers over this icon, all menus will be displayed< br/>\n retract: The menu bar does not display any menus, only displays thesandwich fold/expand
icon. When the mouse hovers over this icon, all menus will be displayed< br/>\n hidden: The remaining undisclosed menus are hidden and not displayed.
'
+ },
+ codeFiles: ['overflow.vue']
},
{
- 'demoId': 'slot-toolbar',
- 'name': { 'zh-CN': '定义工具栏', 'en-US': 'Custom Toolbar' },
- 'desc': {
+ demoId: 'slot-toolbar',
+ name: {
+ 'zh-CN': '定义工具栏',
+ 'en-US': 'Custom Toolbar'
+ },
+ desc: {
'zh-CN': '通过 toolbar
插槽自定义工具栏。',
'en-US': 'Customize the toolbar through thetoolbar
slot.'
},
- 'codeFiles': ['slot-toolbar.vue']
+ codeFiles: ['slot-toolbar.vue']
},
{
- 'demoId': 'slot-logo',
- 'name': { 'zh-CN': '定义Logo', 'en-US': 'Custom Logo' },
- 'desc': {
+ demoId: 'slot-logo',
+ name: {
+ 'zh-CN': '定义Logo',
+ 'en-US': 'Custom Logo'
+ },
+ desc: {
'zh-CN': '通过 logo
插槽自定义 Logo 。',
'en-US': 'Customize the logo through thelogo
slot.'
},
- 'codeFiles': ['slot-logo.vue']
+ codeFiles: ['slot-logo.vue']
},
{
- 'demoId': 'before-skip',
- 'name': { 'zh-CN': '跳转前处理', 'en-US': 'Pre jump processing' },
- 'desc': {
+ demoId: 'before-skip',
+ name: {
+ 'zh-CN': '跳转前处理',
+ 'en-US': 'Pre jump processing'
+ },
+ desc: {
'zh-CN':
'通过 before-skip
钩子函数处理菜单点击跳转前的相关逻辑,返回 false
则无法跳转。',
'en-US':
'By using thebefore-skip
hook function to handle the relevant logic before clicking and jumping to the menu, iffalse
is returned, the jump cannot be made.'
},
- 'codeFiles': ['before-skip.vue']
+ codeFiles: ['before-skip.vue']
},
{
- 'demoId': 'before-skip-prevent',
- 'name': {
+ demoId: 'before-skip-prevent',
+ name: {
'zh-CN': '默认服务的跳转前处理',
'en-US': 'Pre jump processing for default services'
},
- 'desc': {
+ desc: {
'zh-CN':
'若使用默认服务 /workspace/current
获取菜单数据 response.data.leftMenuNode.children
,则在使用 before-skip
时,需配合 prevent
为 true
来阻止默认的跳转行为。',
'en-US':
'If the default service/workspace/current
is used to obtain menu dataresponse. data. leftMenuNode. children
, then when usingbefore-skip
, it is necessary to cooperate withprevent
to prevent default jump behavior.'
},
- 'codeFiles': ['before-skip-prevent.vue']
+ codeFiles: ['before-skip-prevent.vue']
},
{
- 'demoId': 'custom-service',
- 'name': { 'zh-CN': '自定义服务', 'en-US': 'Custom Service' },
- 'desc': {
+ demoId: 'custom-service',
+ name: {
+ 'zh-CN': '自定义服务',
+ 'en-US': 'Custom Service'
+ },
+ desc: {
'zh-CN':
'通过 fetch-menu-data
自定义菜单服务,若数据中字段并非默认的 title
和 url
,则通过 fields
对数据中的字段进行映射。',
'en-US':
'By customizing the menu service throughfetch-menu-data
, if the fields in the data are not the defaulttitle
and URL
, the fields in the data can be mapped throughfields
.'
},
- 'codeFiles': ['custom-service.vue']
+ codeFiles: ['custom-service.vue']
},
{
- 'demoId': 'crm-demo',
- 'name': { 'zh-CN': '自定义样式', 'en-US': 'Custom Style' },
- 'desc': {
+ demoId: 'parent-key',
+ name: {
+ 'zh-CN': '转换树结构数据',
+ 'en-US': 'Transform Tree Structure Data'
+ },
+ desc: {
+ 'zh-CN': '通过 parent-key
标识的普通数组转换树结构数据。',
+ 'en-US': 'Converting tree structure data of a common array identified by parent-key
. '
+ },
+ codeFiles: ['parent-key.vue']
+ },
+ {
+ demoId: 'allow-full-url',
+ name: {
+ 'zh-CN': '支持完整URL',
+ 'en-US': 'Support complete URL'
+ },
+ desc: {
+ 'zh-CN': '通过 allow-full-url
支持数据中包含完整 URL。',
+ 'en-US': 'Use allow-full-url
to support the inclusion of a complete URL in the data.'
+ },
+ codeFiles: ['allow-full-url.vue']
+ },
+ {
+ demoId: 'crm-demo',
+ name: {
+ 'zh-CN': '自定义样式',
+ 'en-US': 'Custom Style'
+ },
+ desc: {
'zh-CN': '通过修改 css
变量名自定义导航菜单样式。',
'en-US': 'Customizing the NavMenu style by changing the CSS
variable name. '
},
- 'codeFiles': ['crm-demo.vue']
- }
- ],
- apis: [
- {
- 'name': 'nav-menu',
- 'type': 'component',
- 'props': [
- {
- 'name': 'before-skip',
- 'type': '(item: IMenuItem) => boolean',
- 'typeAnchorName': 'IMenuItem',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点击菜单跳转前的钩子函数,返回 false 将无法跳转',
- 'en-US':
- 'Click the hook function before menu redirection. If false is returned, menu redirection cannot be performed'
- },
- 'demoId': 'before-skip'
- },
- {
- 'name': 'data',
- 'type': 'IDataItem[]',
- 'typeAnchorName': 'IDataItem',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置导航菜单的数据', 'en-US': 'Set the navigation menu data' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'fetch-menu-data',
- 'type': '() => IDataItem[]',
- 'typeAnchorName': 'IMenuItem',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义菜单数据加载服务,返回一个Promise对象',
- 'en-US': 'Customize the menu data loading service. A Promise object is returned'
- },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'fields',
- 'type': 'IFields',
- 'typeAnchorName': 'IFields',
- 'defaultValue': '{ textField: "title", urlField: "url", key: "id" }',
- 'desc': { 'zh-CN': '自定义菜单数据的映射', 'en-US': 'User-defined menu data mapping' },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'overflow',
- 'type': 'IOverflow',
- 'typeAnchorName': 'IOverflow',
- 'defaultValue': 'auto',
- 'desc': {
- 'zh-CN': '设置一级菜单无法在当前菜单容器里显示完全时的展示方式',
- 'en-US':
- 'Set the display method when the first level menu cannot be fully displayed in the current menu container'
- },
- 'demoId': 'overflow'
- },
- {
- 'name': 'prevent',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '若使用组件的默认服务获取菜单数据,并且要阻止默认的跳转行为,需要 before-skip 和此属性一起使用',
- 'en-US':
- 'If you use the default service of the component to obtain menu data and want to prevent default jump behavior, you need to use before-skip in conjunction with this attribute'
- },
- 'demoId': 'before-skip-prevent'
- }
- ],
- 'events': [],
- 'slots': [
- {
- 'name': 'logo',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '菜单栏 Logo 插槽', 'en-US': 'Menu Bar Logo Slot' },
- 'demoId': 'slot-logo'
- },
- {
- 'name': 'toolbar',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义右上角部分 toolbar 插槽',
- 'en-US': 'Customize the toolbar slot in the upper right corner'
- },
- 'demoId': 'slot-toolbar'
- }
- ]
- }
- ],
- types: [
- {
- name: 'IMenuItem',
- type: 'interface',
- code: `
-interface IMenuItem {
- id: string
- isFullUrl: boolean
- pid: string
- route: string
- target: string
- title: string
- url: string
-}`
- },
- {
- name: 'IDataItem',
- type: 'interface',
- code: `
-interface IDataItem {
- title: string
- url: string
- children?: IDataItem[]
-}`
- },
- {
- name: 'IFields',
- type: 'interface',
- code: `
-interface IFields {
- textField: string
- urlField: string
- key?: string
-}`
- },
- {
- name: 'IOverflow',
- type: 'type',
- code: `
-type IOverflow = 'auto' | 'retract' | 'fixed' | 'hidden'
-`
+ codeFiles: ['crm-demo.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/notify/webdoc/notify.js b/examples/sites/demos/pc/app/notify/webdoc/notify.js
index c9380abfe..57992f967 100644
--- a/examples/sites/demos/pc/app/notify/webdoc/notify.js
+++ b/examples/sites/demos/pc/app/notify/webdoc/notify.js
@@ -3,273 +3,170 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '通过函数调用的方式使用组件。', 'en-US': 'Components are used by means of function calls' },
- 'codeFiles': ['basic-usage.vue']
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '通过函数调用的方式使用组件。',
+ 'en-US': 'Components are used by means of function calls'
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'type',
- 'name': { 'zh-CN': '消息类型', 'en-US': 'Message Type' },
- 'desc': {
+ demoId: 'type',
+ name: {
+ 'zh-CN': '消息类型',
+ 'en-US': 'Message Type'
+ },
+ desc: {
'zh-CN':
'可通过 type
设置不同的类型。可选值:success、warning、info、error,默认值:info 。
\n',
'en-US':
'You can set different types by type
. The options are success, warning, info, and error. The default value is info.
\n'
},
- 'codeFiles': ['type.vue']
+ codeFiles: ['type.vue']
},
{
- 'demoId': 'duration',
- 'name': { 'zh-CN': '自动关闭延时', 'en-US': 'Automatic shutdown delay' },
- 'desc': {
+ demoId: 'duration',
+ name: {
+ 'zh-CN': '自动关闭延时',
+ 'en-US': 'Automatic shutdown delay'
+ },
+ desc: {
'zh-CN': '可通过 duration
属性设置自动关闭的延迟时间,默认值:4500ms 。
\n',
'en-US':
'You can set the delay for automatic shutdown through the duration
attribute. The default value is 4500 ms.
\n'
},
- 'codeFiles': ['duration.vue']
+ codeFiles: ['duration.vue']
},
{
- 'demoId': 'position',
- 'name': { 'zh-CN': '显示位置', 'en-US': 'Display position' },
- 'desc': {
+ demoId: 'position',
+ name: {
+ 'zh-CN': '显示位置',
+ 'en-US': 'Display position'
+ },
+ desc: {
'zh-CN': '可通过 position
属性设置通知框显示位置,默认值:bottom-right 。
\n',
'en-US':
'You can set the position of the notification box through the position
attribute. The default value is bottom-right.
\n'
},
- 'codeFiles': ['position.vue']
+ codeFiles: ['position.vue']
},
{
- 'demoId': 'title',
- 'name': { 'zh-CN': '标题', 'en-US': 'Title' },
- 'desc': {
+ demoId: 'title',
+ name: {
+ 'zh-CN': '标题',
+ 'en-US': 'Title'
+ },
+ desc: {
'zh-CN': '可通过 title
属性设置通知框标题。
\n',
'en-US': 'You can set the title of the notification box through the title
attribute.
\n'
},
- 'codeFiles': ['title.vue']
+ codeFiles: ['title.vue']
},
{
- 'demoId': 'message',
- 'name': { 'zh-CN': '内容自定义', 'en-US': 'Custom Content' },
- 'desc': {
+ demoId: 'message',
+ name: {
+ 'zh-CN': '内容自定义',
+ 'en-US': 'Custom Content'
+ },
+ desc: {
'zh-CN': '可通过 message
属性设置通知框的内容。
\n',
'en-US': 'You can set the content of the notification box through the message
attribute.
\n'
},
- 'codeFiles': ['message.vue']
+ codeFiles: ['message.vue']
},
{
- 'demoId': 'showClose',
- 'name': { 'zh-CN': '不显示关闭按钮', 'en-US': 'The close button is not displayed.' },
- 'desc': {
+ demoId: 'showClose',
+ name: {
+ 'zh-CN': '不显示关闭按钮',
+ 'en-US': 'The close button is not displayed.'
+ },
+ desc: {
'zh-CN': ' showClose
属性设置通知框是否显示关闭按钮,默认值:true
。
\n',
'en-US':
'The showClose property sets whether the notification box displays the close button. The default value is true.
\n'
},
- 'codeFiles': ['showClose.vue']
+ codeFiles: ['showClose.vue']
},
{
- 'demoId': 'showIcon',
- 'name': { 'zh-CN': '不显示类型图标', 'en-US': 'The type icon is not displayed.' },
- 'desc': {
+ demoId: 'showIcon',
+ name: {
+ 'zh-CN': '不显示类型图标',
+ 'en-US': 'The type icon is not displayed.'
+ },
+ desc: {
'zh-CN': '可通过 showIcon
属性设置通知框是否显示类型图标,默认值:true 。
\n',
'en-US':
'You can use the showIcon
attribute to set whether to display the type icon in the notification box. The default value is true.
\n'
},
- 'codeFiles': ['showIcon.vue']
+ codeFiles: ['showIcon.vue']
},
{
- 'demoId': 'closeIcon',
- 'name': { 'zh-CN': '自定义关闭图标', 'en-US': 'Custom Close Icon' },
- 'desc': {
+ demoId: 'closeIcon',
+ name: {
+ 'zh-CN': '自定义关闭图标',
+ 'en-US': 'Custom Close Icon'
+ },
+ desc: {
'zh-CN': '可通过 closeIcon
属性设置通知框关闭图标,默认值:IconClose 。
\n',
'en-US':
'You can set the icon for closing the notification box through the closeIcon
attribute. The default value is IconClose.
\n'
},
- 'codeFiles': ['closeIcon.vue']
+ codeFiles: ['closeIcon.vue']
},
{
- 'demoId': 'statusIcon',
- 'name': { 'zh-CN': '自定义类型图标', 'en-US': 'Custom type icon' },
- 'desc': {
+ demoId: 'statusIcon',
+ name: {
+ 'zh-CN': '自定义类型图标',
+ 'en-US': 'Custom type icon'
+ },
+ desc: {
'zh-CN': '可通过 statusIcon
属性设置通知框类型图标,默认值:IconInfoSolid 。
\n',
'en-US':
'You can set the notification box type icon through the statusIcon
attribute. The default value is IconInfoSolid.
\n'
},
- 'codeFiles': ['statusIcon.vue']
+ codeFiles: ['statusIcon.vue']
},
{
- 'demoId': 'debounceDelay',
- 'name': { 'zh-CN': '防抖', 'en-US': 'Anti-shake' },
- 'desc': {
+ demoId: 'debounceDelay',
+ name: {
+ 'zh-CN': '防抖',
+ 'en-US': 'Anti-shake'
+ },
+ desc: {
'zh-CN': '可通过 debounceDelay
设置防抖时间。',
'en-US': '
You can use debounceDelay
to set the image stabilization time.'
},
- 'codeFiles': ['debounceDelay.vue']
+ codeFiles: ['debounceDelay.vue']
},
{
- 'demoId': 'verticalOffset',
- 'name': { 'zh-CN': '垂直偏移量', 'en-US': 'Vertical Offset' },
- 'desc': {
+ demoId: 'verticalOffset',
+ name: {
+ 'zh-CN': '垂直偏移量',
+ 'en-US': 'Vertical Offset'
+ },
+ desc: {
'zh-CN': '
可通过 verticalOffset
设置垂直方向偏离距离。',
'en-US': '
The vertical deviation distance can be set by using verticalOffset
.'
},
- 'codeFiles': ['verticalOffset.vue']
+ codeFiles: ['verticalOffset.vue']
},
{
- 'demoId': 'notify-events',
- 'name': { 'zh-CN': '事件', 'en-US': 'Event' },
- 'desc': {
- 'zh-CN': `
-
可通过 beforeClose
属性设置通知框关闭前的事件。
- 可通过 onClose
属性设置通知点击关闭按钮时触发事件。
- `,
- 'en-US': `
-
The property beforeClose
sets the event before the notification box closes.
- can be set through the onClose
property to notify the event that is triggered when the close button is clicked.
- `
+ demoId: 'notify-events',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': 'Event'
},
- 'codeFiles': ['notify-events.vue']
- }
- ],
- apis: [
- {
- 'name': 'notify',
- 'type': 'component',
- 'props': [
- {
- 'name': 'type',
- 'type': `'info' | 'success' | 'warning' | 'error'`,
- 'defaultValue': `'info'`,
- 'desc': {
- 'zh-CN': '通知消息类型',
- 'en-US': 'Notification message type'
- },
- 'demoId': 'type'
- },
- {
- 'name': 'title',
- 'typeAnchorName': 'INotifyTitle',
- 'type': 'INotifyTitle',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '通知消息标题,可用 jsx 定制',
- 'en-US': 'Notification message title, which can be customized by JSX.'
- },
- 'demoId': 'title'
- },
- {
- 'name': 'message',
- 'typeAnchorName': 'INotifyMessage',
- 'type': 'INotifyMessage',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '通知消息文本,可用 jsx 定制',
- 'en-US': 'Notification message text, which can be customized using JSX.'
- },
- 'demoId': 'message'
- },
- {
- 'name': 'position',
- 'type': `'top-right' | 'bottom-right'`,
- 'defaultValue': `'bottom-right'`,
- 'desc': {
- 'zh-CN': '通知显示位置',
- 'en-US': 'Notification display position.'
- },
- 'demoId': 'position'
- },
- {
- 'name': 'duration',
- 'type': 'number',
- 'defaultValue': '4500',
- 'desc': { 'zh-CN': '自动关闭延时毫秒数', 'en-US': 'Automatic shutdown delay in milliseconds' },
- 'demoId': 'duration'
- },
- {
- 'name': 'customClass',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '自定义样式类', 'en-US': 'Custom style class' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'showClose',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': { 'zh-CN': '是否显示关闭按钮', 'en-US': 'Whether to display the close button' },
- 'demoId': 'showClose'
- },
- {
- 'name': 'showIcon',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': { 'zh-CN': '是否显示类型图标', 'en-US': 'Display Type Icon' },
- 'demoId': 'showIcon'
- },
- {
- 'name': 'closeIcon',
- 'type': 'Component',
- 'defaultValue': 'IconClose',
- 'desc': { 'zh-CN': '关闭图标组件对象', 'en-US': 'Close icon component object' },
- 'demoId': 'closeIcon'
- },
- {
- 'name': 'statusIcon',
- 'type': 'Component',
- 'defaultValue': 'IconInfoSolid',
- 'desc': { 'zh-CN': '类型图标组件对象', 'en-US': 'Type icon component object' },
- 'demoId': 'statusIcon'
- },
- {
- 'name': 'debounceDelay',
- 'type': 'number',
- 'defaultValue': '0',
- 'desc': { 'zh-CN': '启用防抖', 'en-US': 'Enable image stabilization' },
- 'demoId': 'debounceDelay'
- },
- {
- 'name': 'verticalOffset',
- 'type': 'number | string',
- 'defaultValue': '16',
- 'desc': { 'zh-CN': '设置垂直方向偏离距离,单位 px', 'en-US': '' },
- 'demoId': 'verticalOffset'
- }
- ],
- 'events': [
- {
- 'name': 'beforeClose',
- 'type': '() => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '关闭前回调方法,返回 false 可阻止关闭',
- 'en-US': 'Callback method before closing. If false is returned, closing is prevented.'
- },
- 'demoId': 'notify-events'
- },
- {
- 'name': 'onClose',
- 'type': '() => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '关闭 notify 时触发的事件',
- 'en-US': 'Event triggered when the notify function is disabled'
- },
- 'demoId': 'notify-events'
- }
- ],
- 'slots': []
- }
- ],
- types: [
- {
- name: 'INotifyTitle',
- type: 'type',
- code: `type INotifyTitle = string | (h: Vue.h, params: { titleClass: string, vm }) => JSX.Element`
- },
- {
- name: 'INotifyMessage',
- type: 'type',
- code: `type INotifyMessage = string | (h: Vue.h, params: { messageClass: string, vm }) => JSX.Element`
+ desc: {
+ 'zh-CN':
+ '\n
可通过 beforeClose
属性设置通知框关闭前的事件。\n 可通过 onClose
属性设置通知点击关闭按钮时触发事件。\n ',
+ 'en-US':
+ '\n
The property beforeClose
sets the event before the notification box closes. \n can be set through the onClose
property to notify the event that is triggered when the close button is clicked. \n '
+ },
+ codeFiles: ['notify-events.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/numeric/controls-composition-api.vue b/examples/sites/demos/pc/app/numeric/controls-composition-api.vue
index 11b06b1b7..64e0ff147 100644
--- a/examples/sites/demos/pc/app/numeric/controls-composition-api.vue
+++ b/examples/sites/demos/pc/app/numeric/controls-composition-api.vue
@@ -1,7 +1,7 @@
1. 隐藏加减按钮
-
+
2. 加减按钮全置于右侧
diff --git a/examples/sites/demos/pc/app/numeric/controls.vue b/examples/sites/demos/pc/app/numeric/controls.vue
index 8bf879805..1b4e08143 100644
--- a/examples/sites/demos/pc/app/numeric/controls.vue
+++ b/examples/sites/demos/pc/app/numeric/controls.vue
@@ -1,7 +1,7 @@
1. 隐藏加减按钮
-
+
2. 加减按钮全置于右侧
diff --git a/examples/sites/demos/pc/app/numeric/filter-mode-change-composition-api.vue b/examples/sites/demos/pc/app/numeric/filter-mode-change-composition-api.vue
new file mode 100644
index 000000000..a54644436
--- /dev/null
+++ b/examples/sites/demos/pc/app/numeric/filter-mode-change-composition-api.vue
@@ -0,0 +1,25 @@
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/numeric/filter-mode-change.vue b/examples/sites/demos/pc/app/numeric/filter-mode-change.vue
new file mode 100644
index 000000000..604b084de
--- /dev/null
+++ b/examples/sites/demos/pc/app/numeric/filter-mode-change.vue
@@ -0,0 +1,34 @@
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/numeric/filter-mode-composition-api.vue b/examples/sites/demos/pc/app/numeric/filter-mode-composition-api.vue
new file mode 100644
index 000000000..352896a5c
--- /dev/null
+++ b/examples/sites/demos/pc/app/numeric/filter-mode-composition-api.vue
@@ -0,0 +1,10 @@
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/numeric/filter-mode.vue b/examples/sites/demos/pc/app/numeric/filter-mode.vue
new file mode 100644
index 000000000..83fff389d
--- /dev/null
+++ b/examples/sites/demos/pc/app/numeric/filter-mode.vue
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/numeric/precision-composition-api.vue b/examples/sites/demos/pc/app/numeric/precision-composition-api.vue
index f2b78cf3d..57c4e71b0 100644
--- a/examples/sites/demos/pc/app/numeric/precision-composition-api.vue
+++ b/examples/sites/demos/pc/app/numeric/precision-composition-api.vue
@@ -1,11 +1,28 @@
-
+ 1、数值精度
+
+ 2、数值格式
+
diff --git a/examples/sites/demos/pc/app/numeric/precision.vue b/examples/sites/demos/pc/app/numeric/precision.vue
index cd4b22ea7..a80a58176 100644
--- a/examples/sites/demos/pc/app/numeric/precision.vue
+++ b/examples/sites/demos/pc/app/numeric/precision.vue
@@ -1,5 +1,10 @@
-
+
+ 1、数值精度
+
+ 2、数值格式
+
+
diff --git a/examples/sites/demos/pc/app/popconfirm/basic-usage.vue b/examples/sites/demos/pc/app/popconfirm/basic-usage.vue
index aae429004..36fbd963e 100644
--- a/examples/sites/demos/pc/app/popconfirm/basic-usage.vue
+++ b/examples/sites/demos/pc/app/popconfirm/basic-usage.vue
@@ -1,6 +1,6 @@
-
+
悬浮我提示
@@ -19,7 +19,7 @@ export default {
data() {
return {
title: '这是气泡标题',
- content: '这是气泡确认框提示内容文本描述,这是两行内容的展示样式,文本内容很长很长。'
+ message: '这是气泡确认框提示内容文本描述,这是两行内容的展示样式,文本内容很长很长。'
}
}
}
diff --git a/examples/sites/demos/pc/app/popconfirm/cancel-button-composition-api.vue b/examples/sites/demos/pc/app/popconfirm/cancel-button-composition-api.vue
index 2ccad0497..4f11d48b8 100644
--- a/examples/sites/demos/pc/app/popconfirm/cancel-button-composition-api.vue
+++ b/examples/sites/demos/pc/app/popconfirm/cancel-button-composition-api.vue
@@ -1,6 +1,6 @@
-
+
悬浮我提示
@@ -13,5 +13,5 @@ import { ref } from 'vue'
import { Popconfirm as TinyPopconfirm, Button as TinyButton } from '@opentiny/vue'
const title = ref('这是气泡标题')
-const content = ref('这是气泡提示框内容。')
+const message = ref('这是气泡提示框内容。')
diff --git a/examples/sites/demos/pc/app/popconfirm/cancel-button.vue b/examples/sites/demos/pc/app/popconfirm/cancel-button.vue
index 2d0c7ba9c..b067bbfb5 100644
--- a/examples/sites/demos/pc/app/popconfirm/cancel-button.vue
+++ b/examples/sites/demos/pc/app/popconfirm/cancel-button.vue
@@ -1,6 +1,6 @@
-
+
悬浮我提示
@@ -19,7 +19,7 @@ export default {
data() {
return {
title: '这是气泡标题',
- content: '这是气泡提示框内容。'
+ message: '这是气泡提示框内容。'
}
}
}
diff --git a/examples/sites/demos/pc/app/popconfirm/custom-class-composition-api.vue b/examples/sites/demos/pc/app/popconfirm/custom-class-composition-api.vue
index f22614263..085bb7a3a 100644
--- a/examples/sites/demos/pc/app/popconfirm/custom-class-composition-api.vue
+++ b/examples/sites/demos/pc/app/popconfirm/custom-class-composition-api.vue
@@ -1,6 +1,6 @@
-
+
悬浮我提示
@@ -13,7 +13,7 @@ import { ref } from 'vue'
import { Popconfirm as TinyPopconfirm, Button as TinyButton } from '@opentiny/vue'
const title = ref('这是气泡标题')
-const content = ref('这是气泡确认框提示内容文本描述,这是两行内容的展示样式,文本内容很长很长。')
+const message = ref('这是气泡确认框提示内容文本描述,这是两行内容的展示样式,文本内容很长很长。')
diff --git a/examples/sites/demos/pc/app/query-builder/display-only-field.vue b/examples/sites/demos/pc/app/query-builder/display-only-field.vue
new file mode 100644
index 000000000..69d22c10a
--- /dev/null
+++ b/examples/sites/demos/pc/app/query-builder/display-only-field.vue
@@ -0,0 +1,1396 @@
+
+
+
+
+
+ {{ item[0] }}
+
+ {{ item[1] }}
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/query-builder/max-height.vue b/examples/sites/demos/pc/app/query-builder/max-height.vue
new file mode 100644
index 000000000..a39e35fce
--- /dev/null
+++ b/examples/sites/demos/pc/app/query-builder/max-height.vue
@@ -0,0 +1,1362 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/query-builder/sub-component-param.vue b/examples/sites/demos/pc/app/query-builder/sub-component-param.vue
new file mode 100644
index 000000000..d1613559f
--- /dev/null
+++ b/examples/sites/demos/pc/app/query-builder/sub-component-param.vue
@@ -0,0 +1,274 @@
+
+
+
+
+
+ {{ item[0] }}
+
+ {{ item[1] }}
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/query-builder/tree-field.vue b/examples/sites/demos/pc/app/query-builder/tree-field.vue
new file mode 100644
index 000000000..146b87bfe
--- /dev/null
+++ b/examples/sites/demos/pc/app/query-builder/tree-field.vue
@@ -0,0 +1,252 @@
+
+
+
+
+
+ {{ item[0] }}
+
+ {{ item[1] }}
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/query-builder/webdoc/query-builder.cn.md b/examples/sites/demos/pc/app/query-builder/webdoc/query-builder.cn.md
new file mode 100644
index 000000000..6b7b096c3
--- /dev/null
+++ b/examples/sites/demos/pc/app/query-builder/webdoc/query-builder.cn.md
@@ -0,0 +1,5 @@
+---
+title: QueryBuilder 查询生成器
+---
+
+# QueryBuilder 查询生成器
diff --git a/examples/sites/demos/pc/app/query-builder/webdoc/query-builder.en.md b/examples/sites/demos/pc/app/query-builder/webdoc/query-builder.en.md
new file mode 100644
index 000000000..6826e63bc
--- /dev/null
+++ b/examples/sites/demos/pc/app/query-builder/webdoc/query-builder.en.md
@@ -0,0 +1,5 @@
+---
+title: QueryBuilder
+---
+
+# QueryBuilder
diff --git a/examples/sites/demos/pc/app/query-builder/webdoc/query-builder.js b/examples/sites/demos/pc/app/query-builder/webdoc/query-builder.js
new file mode 100644
index 000000000..af5dc3ae5
--- /dev/null
+++ b/examples/sites/demos/pc/app/query-builder/webdoc/query-builder.js
@@ -0,0 +1,69 @@
+export default {
+ column: '2',
+ owner: '',
+ demos: [
+ {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN':
+ "\n \n config 属性说明
\n autoSelectField
:范围域是否会默认选择,勾选则默认为第一个选项;反之则默认为-----
\n autoSelectOperator
:运算符是否会默认选择,勾选则默认选择第一个选项,反之则默认为-----
\n disabled
:禁用所有规则
\n parsenumbers
:数字会被转化为 Number 类型,而非 String 类型
\n showCloneButtons
:展示复制按钮,即整条规则可以被复制
\n showCombinatorsBetweenRules
:组合子数组统一修改,且不再展示在连线上,以下拉选择形式出现
\n showLockButtons
:展示锁定按钮,即整条规则可以被锁定
\n showNotToggle
:展示 not 条件切换框
\n displayOnlyField
:是否仅展示字段选择器
\n
\n 二、fields 数据配置
\n \n fields中的数据(只用于说明各字段含义,无业务特定性)
\n {
\n name: 'isMusician', //name:格式化数据中的值(形参)
\n label: 'Is a musician', //label:范围域在规则生成器中对外展示名称
\n valueEditorType: 'checkbox', //placeholder:值域的默认缺省值
\n operators: [ //运算符自定义,name为格式化数据中的值,label为范围域对外展示的名称
\n {
\n name: '=',
\n label: '='
\n }
\n ],
\n bindProps: { // 通过bindProps参数可对某一类组件进行参数控制
\n input:{
\n clearable:true
\n },
\n select:{
\n filterable:true
\n }
\n },
\n defaultValue: false, //defaultOperator:运算符的默认缺省选择
\n validator: (r) => !!r.value //validator:校验规则(该功能点还在迭代开发中……)
\n inputType: 'number', //值域的数值类型
\n valueEditorType: 'radio' //值域编辑器的类型
\n defaultValue: false, //值域的默认值
\n values: [ //值域的可选域配置(下拉)
\n {
\n label: 'Percussion instruments',
\n options: [
\n {
\n name: 'Clapstick',
\n label: 'Clapstick'
\n }
\n ]
\n }
\n ],
\n values: [ //值域的可选域配置(单选)
\n {
\n name: 'M',
\n label: 'Male'
\n },
\n {
\n name: 'F',
\n label: 'Female'
\n },
\n {
\n name: 'O',
\n label: 'Other'
\n }
\n ],
\n valueSources: ['field', 'value'], //值域类型可选择
\n comparator: 'groupNumber', //分组时的比较器
\n groupNumber: 'group1', //分组的组别
\n },
\n // 组合子数组配置,label为展示字符,name为数据值
\n combinators: [
\n {
\n name: 'and',
\n label: '且'
\n },
\n {
\n name: 'or',
\n label: '或'
\n }
\n ]
\n
\n ",
+ 'en-US': ''
+ },
+ codeFiles: ['basic-usage.vue']
+ },
+ {
+ demoId: 'display-only-field',
+ name: {
+ 'zh-CN': '简易模式',
+ 'en-US': 'Basic'
+ },
+ desc: {
+ 'zh-CN': 'config 配置添加 displayOnlyField 属性,开启简易模式仅展示字段选择器功能',
+ 'en-US': ' '
+ },
+ codeFiles: ['display-only-field.vue']
+ },
+ {
+ demoId: 'tree-field',
+ name: {
+ 'zh-CN': '树型字段选择器',
+ 'en-US': 'Basic'
+ },
+ desc: {
+ 'zh-CN': 'fields 数组配置项中存在 children 子数据项,则开启树型字段选择器功能,配置示例如下',
+ 'en-US': ' '
+ },
+ codeFiles: ['tree-field.vue']
+ },
+ {
+ demoId: 'max-height',
+ name: {
+ 'zh-CN': '最大高度设置',
+ 'en-US': 'Basic'
+ },
+ desc: {
+ 'zh-CN':
+ '添加 max-height 属性设置组件最大高度,超出内容显示滚动条,属性值支持 数值 和 数值+单位,如 500、500px、50rem 等。',
+ 'en-US': ' '
+ },
+ codeFiles: ['max-height.vue']
+ },
+ {
+ demoId: 'sub-component-param',
+ name: {
+ 'zh-CN': '子组件传参',
+ 'en-US': 'Basic'
+ },
+ desc: {
+ 'zh-CN':
+ 'config 配置添加 bindProps 属性可控制某一类组件的参数,中间操作符类组件暂不支持传参,具体配置见以下说明:
\n \n bindProps 属性说明
\n leftSelect:左侧 Select 参数,统一控制左侧所有 Select
\n select:右侧 Select 参数
\n input:输入框参数,包括 textarea
\n numeric:计数器
\n date:日期选择器
\n time:时间选择器
\n radio:单选框
\n checkbox:多选框
\n
\n ',
+ 'en-US': ' '
+ },
+ codeFiles: ['sub-component-param.vue']
+ }
+ ]
+}
diff --git a/examples/sites/demos/pc/app/radio/display-only-composition-api.vue b/examples/sites/demos/pc/app/radio/display-only-composition-api.vue
new file mode 100644
index 000000000..fc27975dc
--- /dev/null
+++ b/examples/sites/demos/pc/app/radio/display-only-composition-api.vue
@@ -0,0 +1,23 @@
+
+
+ 单选组实现只读:
+
+
+
+ 每个单选项实现只读:
+ 选项一
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/radio/display-only.spec.ts b/examples/sites/demos/pc/app/radio/display-only.spec.ts
new file mode 100644
index 000000000..254f6dca0
--- /dev/null
+++ b/examples/sites/demos/pc/app/radio/display-only.spec.ts
@@ -0,0 +1,11 @@
+import { test, expect } from '@playwright/test'
+
+test('只读状态', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('radio#display-only')
+
+ const demo = page.locator('#active-color')
+ const radioInput = demo.locator('.tiny-radio__input')
+
+ await expect(radioInput).not.toBeVisible()
+})
diff --git a/examples/sites/demos/pc/app/radio/display-only.vue b/examples/sites/demos/pc/app/radio/display-only.vue
new file mode 100644
index 000000000..6188ceb05
--- /dev/null
+++ b/examples/sites/demos/pc/app/radio/display-only.vue
@@ -0,0 +1,32 @@
+
+
+ 单选组实现只读:
+
+
+
+ 每个单选项实现只读:
+ 选项一
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/radio/webdoc/radio.js b/examples/sites/demos/pc/app/radio/webdoc/radio.js
index 2e478f3b5..12fb0ed54 100644
--- a/examples/sites/demos/pc/app/radio/webdoc/radio.js
+++ b/examples/sites/demos/pc/app/radio/webdoc/radio.js
@@ -3,403 +3,163 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '通过 v-model
绑定变量,变量值对应 label
属性的值。
\n',
'en-US':
'Bind variables through v-model
, and the variable value corresponds to the value of the label
attribute.
\n'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'radio-group',
- 'name': { 'zh-CN': '单选框组', 'en-US': 'Radio group' },
- 'desc': {
+ demoId: 'radio-group',
+ name: {
+ 'zh-CN': '单选框组',
+ 'en-US': 'Radio group'
+ },
+ desc: {
'zh-CN':
' radio-group
可以将 radio
或者 radio-button
组合起来,通过 v-modal
绑定选中的值。
\n',
'en-US': 'You can set the border
attribute to add a border to an option button.
\n'
},
- 'codeFiles': ['radio-group.vue']
+ codeFiles: ['radio-group.vue']
},
{
- 'demoId': 'group-options',
- 'name': { 'zh-CN': '单选组', 'en-US': 'Profile Radio Group' },
- 'desc': {
+ demoId: 'group-options',
+ name: {
+ 'zh-CN': '单选组',
+ 'en-US': 'Profile Radio Group'
+ },
+ desc: {
'zh-CN':
'通过 options
配置式渲染单选组。另外还提供 type
属性,配合 options
属性一起使用,默认值为 radio
。可以配置为 button
,配置后单选组将以按钮的形式展示。
\n',
'en-US':
'Rendaer radio groups with options
profile. In addition, the type
attribute is provided, which is used together with the options
attribute. The default value is radio
. The option gooup is displayed as a button
.
\n'
},
- 'codeFiles': ['group-options.vue']
+ codeFiles: ['group-options.vue']
},
{
- 'demoId': 'with-border',
- 'name': { 'zh-CN': '带有边框', 'en-US': 'With borders' },
- 'desc': {
+ demoId: 'with-border',
+ name: {
+ 'zh-CN': '带有边框',
+ 'en-US': 'With borders'
+ },
+ desc: {
'zh-CN': '可通过设置 border
属性,给单选框增加边框。
\n',
'en-US': 'You can set the border
attribute to add a border to an option button.
\n'
},
- 'codeFiles': ['with-border.vue']
+ codeFiles: ['with-border.vue']
},
{
- 'demoId': 'dynamic-disable',
- 'name': { 'zh-CN': '禁用状态', 'en-US': 'Disabled' },
- 'desc': {
+ demoId: 'dynamic-disable',
+ name: {
+ 'zh-CN': '禁用状态',
+ 'en-US': 'Disabled'
+ },
+ desc: {
'zh-CN': '通过 disabled
设置是否禁用单选框 。
\n',
'en-US':
'Set the disabled
attribute to enable the disabled state. The default value is false.
\n'
},
- 'codeFiles': ['dynamic-disable.vue']
+ codeFiles: ['dynamic-disable.vue']
},
{
- 'demoId': 'vertical',
- 'name': { 'zh-CN': '垂直布局', 'en-US': 'vertical layout' },
- 'desc': {
+ demoId: 'vertical',
+ name: {
+ 'zh-CN': '垂直布局',
+ 'en-US': 'vertical layout'
+ },
+ desc: {
'zh-CN': '可在 radio-group
组件上设置 vertical
属性,使单选框垂直布局。
\n',
'en-US':
'You can set the vertical
attribute on the radio-group
component to enable the vertical layout of the option buttons.
\n'
},
- 'codeFiles': ['vertical.vue']
+ codeFiles: ['vertical.vue']
},
{
- 'demoId': 'active-color',
- 'name': { 'zh-CN': '自定义颜色', 'en-US': 'Custom color' },
- 'desc': {
+ demoId: 'active-color',
+ name: {
+ 'zh-CN': '自定义颜色',
+ 'en-US': 'Custom color'
+ },
+ desc: {
'zh-CN':
'通过 text-color
设置单选按钮组激活时的文本颜色,通过 fill
设置填充色和边框色。
\n',
'en-US':
'Set the text color when the radio button group is activated through text color
, and set the fill color and border color through fill
.\n'
},
- 'codeFiles': ['active-color.vue']
+ codeFiles: ['active-color.vue']
},
{
- 'demoId': 'radio-text',
- 'name': { 'zh-CN': '文字内容', 'en-US': 'Text Content' },
- 'desc': {
+ demoId: 'radio-text',
+ name: {
+ 'zh-CN': '文字内容',
+ 'en-US': 'Text Content'
+ },
+ desc: {
'zh-CN':
'通过 text
属性或者默认插槽设置文字内容,插槽优先级大于 text
属性。若两者都没有,则使用 label
值作为文字内容。
\n',
'en-US':
'text attribute or default slot, the slot priority is greater than the text
attribute. If neither is present, use the label
value as the text content. \n'
},
- 'codeFiles': ['radio-text.vue']
+ codeFiles: ['radio-text.vue']
},
{
- 'demoId': 'radio-size',
- 'name': { 'zh-CN': '尺寸', 'en-US': 'Size Settings' },
- 'desc': {
+ demoId: 'radio-size',
+ name: {
+ 'zh-CN': '尺寸',
+ 'en-US': 'Size Settings'
+ },
+ desc: {
'zh-CN':
'可对按钮形式的 radio
或带有边框的 radio
设置 size
属性,以改变其尺寸,可选值有: medium
、small
、mini
。
\n',
'en-US':
'You can set the size
attribute for a radio with a button or a radio with a border to change its size. The options include medium, small, and mini.
\n'
},
- 'codeFiles': ['radio-size.vue']
+ codeFiles: ['radio-size.vue']
},
{
- 'demoId': 'default-slot',
- 'name': { 'zh-CN': '默认插槽', 'en-US': 'Default slot' },
- 'desc': {
+ demoId: 'default-slot',
+ name: {
+ 'zh-CN': '默认插槽',
+ 'en-US': 'Default slot'
+ },
+ desc: {
'zh-CN': '通过 default
默认插槽自定义描述内容。
\n',
'en-US': 'by default
default slot list.
\n'
},
- 'codeFiles': ['default-slot.vue']
+ codeFiles: ['default-slot.vue']
},
{
- 'demoId': 'radio-events',
- 'name': { 'zh-CN': '单选框事件', 'en-US': 'Option button event' },
- 'desc': {
+ demoId: 'radio-events',
+ name: {
+ 'zh-CN': '单选框事件',
+ 'en-US': 'Option button event'
+ },
+ desc: {
'zh-CN':
'可在 radio
、 radio-group
组件上监听 change
事件,当绑定值变化时触发。
\n',
'en-US':
'You can set the change
event on the Radio and radio-group
components. The event is triggered when the bound value changes. The callback function is the selected radio label value.
\n'
},
- 'codeFiles': ['radio-events.vue']
- }
- ],
- apis: [
- {
- 'name': 'radio',
- 'type': 'component',
- 'props': [
- {
- 'name': 'border',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否显示边框',
- 'en-US': 'Display Border'
- },
- 'demoId': 'with-border'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否禁用',
- 'en-US': 'Disable'
- },
- 'demoId': 'dynamic-disable'
- },
- {
- 'name': 'label',
- 'type': 'boolean | number | string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': 'radio 选中时的值',
- 'en-US': 'Value when radio is selected'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'modelValue / v-model',
- 'type': 'boolean | number | string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '绑定值',
- 'en-US': 'Bound Value'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'name',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '原生 name 属性',
- 'en-US': 'Native name attribute'
- },
- 'demoId': ''
- },
- {
- 'name': 'size',
- 'type': "'medium' | small' | 'mini'",
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': 'radio 的尺寸,仅在 border 为真时有效',
- 'en-US': 'radio size. This parameter is valid only when border is set to true'
- },
- 'demoId': 'radio-size'
- },
- {
- 'name': 'text',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '单选框文本内容',
- 'en-US': 'Radio Box Text Content'
- },
- 'demoId': 'radio-text'
- }
- ],
- 'events': [
- {
- 'name': 'change',
- 'type': '(value: boolean | number | string) => void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '绑定值变化时触发的事件',
- 'en-US': 'Event triggered when the binding value changes'
- },
- 'demoId': 'radio-events'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': 'radio 的默认插槽',
- 'en-US': 'Radio default slot'
- },
- 'demoId': 'default-slot'
- }
- ]
+ codeFiles: ['radio-events.vue']
},
{
- 'name': 'radio-group',
- 'type': 'component',
- 'props': [
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否禁用单选组',
- 'en-US': 'Disable radio group'
- },
- 'demoId': 'dynamic-disable'
- },
- {
- 'name': 'fill',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '按钮形式单选选中时的背景颜色',
- 'en-US': 'Set the background color for button form when radio selected'
- },
- 'demoId': 'active-color'
- },
- {
- 'name': 'modelValue / v-model',
- 'type': 'string[] | number[]',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '单选组绑定值',
- 'en-US': 'Radio group binding value'
- },
- 'demoId': 'radio-group'
- },
- {
- 'name': 'options',
- 'type': 'IRadioGroupOptions[]',
- 'typeAnchorName': 'IRadioGroupOptions',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '配置式单选组设置列表',
- 'en-US': 'Configuration based radio group settings list'
- },
- 'demoId': 'group-options'
- },
- {
- 'name': 'size',
- 'type': "'medium' | small' | 'mini'",
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '单选组尺寸',
- 'en-US': 'Radio Group Size'
- },
- 'demoId': 'radio-size'
- },
- {
- 'name': 'text-color',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '按钮形式单选激活时的文本颜色',
- 'en-US': 'Set the text color for button format radio active'
- },
- 'demoId': 'active-color'
- },
- {
- 'name': 'type',
- 'type': "'radio' | 'button'",
- 'defaultValue': "'radio'",
- 'desc': {
- 'zh-CN': '配置式单选组的展示形式',
- 'en-US': 'Set the display format of configurable radio groups'
- },
- 'demoId': 'group-options'
- },
- {
- 'name': 'vertical',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '垂直显示单选组',
- 'en-US': 'Vertical display of radio groups'
- },
- 'demoId': 'vertical'
- }
- ],
- 'events': [
- {
- 'name': 'change',
- 'type': '(value: number[] | string[]) => void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '绑定值变化时触发的事件',
- 'en-US': 'Event triggered when the binding value changes'
- },
- 'demoId': 'radio-events'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': 'radio-group 的默认插槽',
- 'en-US': 'Radio group default slot'
- },
- 'demoId': 'radio-group'
- }
- ]
- },
- {
- 'name': 'radio-button',
- 'type': 'component',
- 'props': [
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否禁用',
- 'en-US': 'Is disabled'
- },
- 'demoId': 'dynamic-disable'
- },
- {
- 'name': 'label',
- 'type': 'boolean | number | string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': 'Radio 的 value',
- 'en-US': 'Radio value'
- },
- 'demoId': 'radio-group'
- },
- {
- 'name': 'name',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '原生name属性',
- 'en-US': 'Native name attribute'
- },
- 'demoId': ''
- },
- {
- 'name': 'text',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '单选框文本内容',
- 'en-US': 'Radio Box Text Content'
- },
- 'demoId': 'radio-text'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '默认插槽',
- 'en-US': 'Default slot'
- },
- 'demoId': 'default-slot'
- }
- ]
- }
- ],
- types: [
- {
- name: 'IRadioGroupOptions',
- type: 'interface',
- code: `
-interface IRadioGroupOptions {
- label: string // 选中时对应的值
- text?: number // 描述文本
- events?: {
- click?: (e: Event) => void // 点击事件
- change?: (e: Event) => void // change事件
- }
-}`
+ demoId: 'display-only',
+ name: {
+ 'zh-CN': '只读',
+ 'en-US': 'Display only'
+ },
+ desc: {
+ 'zh-CN':
+ '通过给 radio
或者 radio-group
组件添加 display-only
属性实现只读态。
',
+ 'en-US': ''
+ },
+ codeFiles: ['display-only.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/rate/webdoc/rate.js b/examples/sites/demos/pc/app/rate/webdoc/rate.js
index a2e69e200..4d352b24d 100644
--- a/examples/sites/demos/pc/app/rate/webdoc/rate.js
+++ b/examples/sites/demos/pc/app/rate/webdoc/rate.js
@@ -3,370 +3,215 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '', 'en-US': '' },
- 'codeFiles': ['basic-usage.vue']
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '',
+ 'en-US': ''
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'custom-3-threshold-colors',
- 'name': { 'zh-CN': '分段颜色', 'en-US': 'Segment color' },
- 'desc': {
+ demoId: 'custom-3-threshold-colors',
+ name: {
+ 'zh-CN': '分段颜色',
+ 'en-US': 'Segment color'
+ },
+ desc: {
'zh-CN': '可通过 colors
定义 3 分段颜色。
\n',
'en-US': 'You can use colors
to define three-segment colors.
\n'
},
- 'codeFiles': ['custom-3-threshold-colors.vue']
+ codeFiles: ['custom-3-threshold-colors.vue']
},
{
- 'demoId': 'disabled-not-selected-color',
- 'name': { 'zh-CN': '禁用时未选中图标颜色', 'en-US': 'Unselected icon color when customized is disabled' },
- 'desc': {
+ demoId: 'disabled-not-selected-color',
+ name: {
+ 'zh-CN': '禁用时未选中图标颜色',
+ 'en-US': 'Unselected icon color when customized is disabled'
+ },
+ desc: {
'zh-CN': '可通过 disabled-void-color
自定义禁用时未选中图标颜色。
\n',
'en-US': 'You can use disabled-void-color
to customize the color of the unselected icon.
\n'
},
- 'codeFiles': ['disabled-not-selected-color.vue']
+ codeFiles: ['disabled-not-selected-color.vue']
},
{
- 'demoId': 'disabled-not-selected-class',
- 'name': {
+ demoId: 'disabled-not-selected-class',
+ name: {
'zh-CN': '禁用时未选中图标类名',
'en-US': 'Icon class name that is not selected when user-defined is disabled'
},
- 'desc': {
+ desc: {
'zh-CN': '可通过 disabled-void-icon-class
自定义禁用时未选中图标类名。
\n',
'en-US':
'You can use disabled-void-icon-class
to customize the class name of the icon that is not selected during disabling.
\n'
},
- 'codeFiles': ['disabled-not-selected-class.vue']
+ codeFiles: ['disabled-not-selected-class.vue']
},
{
- 'demoId': 'custom-3-threshold-icon',
- 'name': { 'zh-CN': '分段图标类名', 'en-US': 'Segment icon class name' },
- 'desc': {
+ demoId: 'custom-3-threshold-icon',
+ name: {
+ 'zh-CN': '分段图标类名',
+ 'en-US': 'Segment icon class name'
+ },
+ desc: {
'zh-CN': '可通过 icon-classes
自定义 3 分段图标。
\n',
'en-US': 'You can use icon-classes
to customize the 3-part icon.
\n'
},
- 'codeFiles': ['custom-3-threshold-icon.vue']
+ codeFiles: ['custom-3-threshold-icon.vue']
},
{
- 'demoId': 'texts-and-text-color',
- 'name': { 'zh-CN': '辅助文字及颜色', 'en-US': 'Auxiliary Text and Color' },
- 'desc': {
+ demoId: 'texts-and-text-color',
+ name: {
+ 'zh-CN': '辅助文字及颜色',
+ 'en-US': 'Auxiliary Text and Color'
+ },
+ desc: {
'zh-CN':
'可通过 texts show-text text-color
三个属性分别设置辅助文字内容、是否显示辅助文字及辅助文字颜色。
\n',
'en-US':
'You can set the auxiliary text content, whether to display the auxiliary text, and the auxiliary text color through the texts show-text text-color
attributes.
\n'
},
- 'codeFiles': ['texts-and-text-color.vue']
+ codeFiles: ['texts-and-text-color.vue']
},
{
- 'demoId': 'size-and-space',
- 'name': { 'zh-CN': '大小及占位宽度', 'en-US': 'Size and Placeholder Width' },
- 'desc': {
+ demoId: 'size-and-space',
+ name: {
+ 'zh-CN': '大小及占位宽度',
+ 'en-US': 'Size and Placeholder Width'
+ },
+ desc: {
'zh-CN': '可通过 size space
分别大小和占位宽度。
\n',
'en-US': 'You can use size space
to separate the size and placeholder width.
\n'
},
- 'codeFiles': ['size-and-space.vue']
+ codeFiles: ['size-and-space.vue']
},
{
- 'demoId': 'not-selected-color',
- 'name': { 'zh-CN': '未选中图标颜色', 'en-US': 'The color of unselected icons' },
- 'desc': {
+ demoId: 'not-selected-color',
+ name: {
+ 'zh-CN': '未选中图标颜色',
+ 'en-US': 'The color of unselected icons'
+ },
+ desc: {
'zh-CN': '可通过 void-color
定义未选中图标颜色。
\n',
'en-US': 'You can use void-color
to define the color of an unselected icon.
\n'
},
- 'codeFiles': ['not-selected-color.vue']
+ codeFiles: ['not-selected-color.vue']
},
{
- 'demoId': 'not-selected-class',
- 'name': { 'zh-CN': '未选中图标类名', 'en-US': 'Customized unselected icon name' },
- 'desc': {
+ demoId: 'not-selected-class',
+ name: {
+ 'zh-CN': '未选中图标类名',
+ 'en-US': 'Customized unselected icon name'
+ },
+ desc: {
'zh-CN': '可通过 void-icon-class
定义未选中图标类名。
\n',
'en-US': 'You can use void-icon-class
to define the unselected icon class name.
\n'
},
- 'codeFiles': ['not-selected-class.vue']
+ codeFiles: ['not-selected-class.vue']
},
{
- 'demoId': 'text-on-bottom',
- 'name': { 'zh-CN': '图标下文字提示', 'en-US': 'Text prompt under the icon' },
- 'desc': {
+ demoId: 'text-on-bottom',
+ name: {
+ 'zh-CN': '图标下文字提示',
+ 'en-US': 'Text prompt under the icon'
+ },
+ desc: {
'zh-CN': '可通过 text-on-bottom
定义是否在图标下显示文字提示。
\n',
'en-US':
'You can use text-on-bottom
to define whether to display text prompts under icons.
\n'
},
- 'codeFiles': ['text-on-bottom.vue']
+ codeFiles: ['text-on-bottom.vue']
},
{
- 'demoId': 'allow-half',
- 'name': { 'zh-CN': '半选', 'en-US': 'Half Selection' },
- 'desc': {
+ demoId: 'allow-half',
+ name: {
+ 'zh-CN': '半选',
+ 'en-US': 'Half Selection'
+ },
+ desc: {
'zh-CN': '可通过 allow-half
定义是否支持半选。
\n',
'en-US': 'You can use allow-half
to define whether half selection is supported.
\n'
},
- 'codeFiles': ['allow-half.vue']
+ codeFiles: ['allow-half.vue']
},
{
- 'demoId': 'dynamic-disable',
- 'name': { 'zh-CN': '禁用', 'en-US': 'Disabled' },
- 'desc': {
+ demoId: 'dynamic-disable',
+ name: {
+ 'zh-CN': '禁用',
+ 'en-US': 'Disabled'
+ },
+ desc: {
'zh-CN': '可通过 disabled
定义是否禁用。
\n',
'en-US': 'You can use disabled
to define whether to disable the function.
\n'
},
- 'codeFiles': ['dynamic-disable.vue']
+ codeFiles: ['dynamic-disable.vue']
},
{
- 'demoId': 'show-score',
- 'name': { 'zh-CN': '分数显示', 'en-US': 'Score Display' },
- 'desc': {
+ demoId: 'show-score',
+ name: {
+ 'zh-CN': '分数显示',
+ 'en-US': 'Score Display'
+ },
+ desc: {
'zh-CN': '可通过 show-score score-template
分别定义是否显示分数和显示的模板。
\n',
'en-US':
'You can use show-score score-template
to define whether to display scores and the display template.
\n'
},
- 'codeFiles': ['show-score.vue']
+ codeFiles: ['show-score.vue']
},
{
- 'demoId': 'radio-rate',
- 'name': { 'zh-CN': '单选模式', 'en-US': 'Single Choice Mode' },
- 'desc': {
+ demoId: 'radio-rate',
+ name: {
+ 'zh-CN': '单选模式',
+ 'en-US': 'Single Choice Mode'
+ },
+ desc: {
'zh-CN': '可通过 radio
设置单选模式。
\n',
'en-US': 'You can use radio
to set the single-choice mode.
\n'
},
- 'codeFiles': ['radio-rate.vue']
+ codeFiles: ['radio-rate.vue']
},
{
- 'demoId': 'max-score',
- 'name': { 'zh-CN': '最大分值', 'en-US': 'Maximum Score' },
- 'desc': {
+ demoId: 'max-score',
+ name: {
+ 'zh-CN': '最大分值',
+ 'en-US': 'Maximum Score'
+ },
+ desc: {
'zh-CN': '可通过 max
设置最大分值。
\n',
'en-US': 'You can use max
to set the maximum score.
\n'
},
- 'codeFiles': ['max-score.vue']
+ codeFiles: ['max-score.vue']
},
{
- 'demoId': 'threshold-value',
- 'name': { 'zh-CN': '界限值', 'en-US': 'Boundaries' },
- 'desc': {
+ demoId: 'threshold-value',
+ name: {
+ 'zh-CN': '界限值',
+ 'en-US': 'Boundaries'
+ },
+ desc: {
'zh-CN':
'可通过 low-threshold high-threshold
分别设置下限值和上限值,通过colors
配置显示星的颜色。
',
'en-US':
'You can set the lower limit and upper limit by using low-threshold high-threshold
, and set the color of the displayed star by using colors
\n'
},
- 'codeFiles': ['threshold-value.vue']
+ codeFiles: ['threshold-value.vue']
},
{
- 'demoId': 'rate-events',
- 'name': { 'zh-CN': '事件', 'en-US': 'Event' },
- 'desc': {
+ demoId: 'rate-events',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': 'Event'
+ },
+ desc: {
'zh-CN': '监听 change
事件触发处理方法。
\n',
'en-US': 'Listen to the change
event triggering method.
\n'
},
- 'codeFiles': ['rate-events.vue']
- }
- ],
- apis: [
- {
- 'name': 'rate',
- 'type': 'component',
- 'props': [
- {
- 'name': 'max',
- 'type': 'number',
- 'defaultValue': '5',
- 'desc': { 'zh-CN': '最大分值', 'en-US': 'Maximum score' },
- 'demoId': 'max-score'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否为只读', 'en-US': 'Read-only' },
- 'demoId': 'dynamic-disable'
- },
- {
- 'name': 'allow-half',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否允许半选', 'en-US': 'Whether to allow half selection' },
- 'demoId': 'allow-half'
- },
- {
- 'name': 'colors',
- 'type': '[string, string, string]',
- 'defaultValue': "['#FADB14', '#FADB14', '#FADB14']",
- 'desc': {
- 'zh-CN': 'icon 的颜色数组,为 Threshold 三个分段所对应的颜色',
- 'en-US': 'icon color array, which is the color corresponding to the Threshold three segments.'
- },
- 'demoId': 'custom-3-threshold-colors'
- },
- {
- 'name': 'disabled-void-color',
- 'type': 'string',
- 'defaultValue': "'#D9D9D9'",
- 'desc': { 'zh-CN': '禁用状态下未选中 icon 的颜色', 'en-US': 'Color of unselected icons in disabled state' },
- 'demoId': 'disabled-not-selected-color'
- },
- {
- 'name': 'disabled-void-icon-class',
- 'typeAnchorName': 'IRateIconName',
- 'type': 'IRateIconName',
- 'defaultValue': "'icon-starActive'",
- 'desc': {
- 'zh-CN': '只读状态下未选中的图标样式名',
- 'en-US': 'Icon style name that is not selected in read-only state.'
- },
- 'demoId': 'disabled-not-selected-class'
- },
- {
- 'name': 'high-threshold',
- 'type': 'number',
- 'defaultValue': '4',
- 'desc': {
- 'zh-CN': '高分和中等分数的界限值,值本身被划分在高分中',
- 'en-US':
- 'The threshold between the high score and the medium score. The value is divided into the high score.'
- },
- 'demoId': 'threshold-value'
- },
- {
- 'name': 'icon-classes',
- 'typeAnchorName': 'IRateIconName',
- 'type': '[IRateIconName, IRateIconName, IRateIconName]',
- 'defaultValue': "['icon-starActive', 'icon-starActive', 'icon-starActive']",
- 'desc': {
- 'zh-CN': '三个分段对应的图标样式名',
- 'en-US': 'Icon style name corresponding to the three segments'
- },
- 'demoId': 'custom-3-threshold-icon'
- },
- {
- 'name': 'low-threshold',
- 'type': 'number',
- 'defaultValue': '2',
- 'desc': {
- 'zh-CN': '低分和中等分数的界限值,值本身被划分在低分中',
- 'en-US':
- 'The threshold value of the low score and the medium score. The value is divided into the low score.'
- },
- 'demoId': 'threshold-value'
- },
- {
- 'name': 'score-template',
- 'type': 'string',
- 'defaultValue': "'{value}'",
- 'desc': { 'zh-CN': '分数显示模板,用“{value}”代表分数', 'en-US': 'Score display template' },
- 'demoId': 'show-score'
- },
- {
- 'name': 'show-score',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否显示当前分数,show-score 和 show-text 不能同时为真',
- 'en-US':
- 'Whether to display the current score. The values of show-score and show-text cannot be true at the same time.'
- },
- 'demoId': 'show-score'
- },
- {
- 'name': 'show-text',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否显示辅助文字,若为真,则会从 texts 数组中选取当前分数对应的文字内容',
- 'en-US':
- 'Indicates whether to display auxiliary text. If yes, the text corresponding to the current score is selected from the texts array.'
- },
- 'demoId': 'texts-and-text-color'
- },
- {
- 'name': 'text-color',
- 'type': 'string',
- 'defaultValue': "'#666666'",
- 'desc': { 'zh-CN': '辅助文字的颜色', 'en-US': 'Color of auxiliary text' },
- 'demoId': 'texts-and-text-color'
- },
- {
- 'name': 'texts',
- 'type': 'string[]',
- 'defaultValue': "['很差', '差', '一般', '好', '很好']",
- 'desc': { 'zh-CN': '辅助文字数组,文字的数量应该与max属性一致', 'en-US': 'Auxiliary text array' },
- 'demoId': 'texts-and-text-color'
- },
- {
- 'name': 'void-color',
- 'type': 'string',
- 'defaultValue': "'#BFBFBF'",
- 'desc': { 'zh-CN': '未选中 icon 的颜色', 'en-US': 'Color of unselected icons' },
- 'demoId': 'not-selected-color'
- },
- {
- 'name': 'void-icon-class',
- 'type': 'IRateIconName',
- 'typeAnchorName': 'IRateIconName',
- 'defaultValue': "'icon-starDisable'",
- 'desc': {
- 'zh-CN': '未选中 icon 的图标样式名',
- 'en-US': 'Class name of unselected icons.'
- },
- 'demoId': 'not-selected-class'
- },
- {
- 'name': 'radio',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '评分其他形态单选', 'en-US': 'Single choice for scoring other forms' },
- 'demoId': 'radio-rate'
- },
- {
- 'name': 'size',
- 'type': 'string',
- 'defaultValue': "'18px'",
- 'desc': { 'zh-CN': '图标字体大小', 'en-US': 'Icon font size' },
- 'demoId': 'size-and-space'
- },
- {
- 'name': 'space',
- 'type': 'string',
- 'defaultValue': "'24px'",
- 'desc': { 'zh-CN': '每个图标所占宽度', 'en-US': 'Width of each icon' },
- 'demoId': 'size-and-space'
- },
- {
- 'name': 'text-on-bottom',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否在图标下显示对应的文字',
- 'en-US': 'Whether to display the corresponding text under the icon'
- },
- 'demoId': 'text-on-bottom'
- },
- {
- 'name': 'modelValue / v-model',
- 'type': 'number',
- 'defaultValue': '0',
- 'desc': { 'zh-CN': '绑定值', 'en-US': 'Bound Value' },
- 'demoId': 'basic-usage'
- }
- ],
- 'events': [
- {
- 'name': 'change',
- 'type': '(value: number) => void',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '分值改变时触发', 'en-US': 'This event is triggered when the score changes.' },
- 'demoId': 'rate-events'
- }
- ],
- 'slots': []
- }
- ],
- types: [
- {
- name: 'IRateIconName',
- type: 'type',
- code: `type IRateIconName = 'icon-starDisable' | 'icon-starActive' | 'icon-frown' | 'icon-meh' | 'icon-smile'`
+ codeFiles: ['rate-events.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/rich-text-editor/webdoc/rich-text-editor.js b/examples/sites/demos/pc/app/rich-text-editor/webdoc/rich-text-editor.js
index 9b2f0b348..ef15014e0 100644
--- a/examples/sites/demos/pc/app/rich-text-editor/webdoc/rich-text-editor.js
+++ b/examples/sites/demos/pc/app/rich-text-editor/webdoc/rich-text-editor.js
@@ -6,175 +6,64 @@ export default {
},
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['basic-usage.vue']
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'custom-bar-usage',
- 'name': { 'zh-CN': '自定义工具栏用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['custom-bar-usage.vue']
+ demoId: 'custom-bar-usage',
+ name: {
+ 'zh-CN': '自定义工具栏用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['custom-bar-usage.vue']
},
{
- 'demoId': 'event-usage',
- 'name': { 'zh-CN': '事件用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['event-usage.vue']
+ demoId: 'event-usage',
+ name: {
+ 'zh-CN': '事件用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['event-usage.vue']
},
{
- 'demoId': 'options-usage',
- 'name': { 'zh-CN': 'options选项用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['options-usage.vue']
+ demoId: 'options-usage',
+ name: {
+ 'zh-CN': 'options选项用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['options-usage.vue']
},
{
- 'demoId': 'placeholder-usage',
- 'name': { 'zh-CN': 'placeholder选项用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['placeholder-usage.vue']
- }
- ],
- apis: [
- {
- 'name': 'rich-text-editor',
- 'type': 'component',
- 'props': [
- {
- 'name': 'modelValue',
- 'type': 'string',
- 'defaultValue': '',
- desc: {
- 'zh-CN': '默认富文本内容',
- 'en-US': 'default rich text content'
- },
- demoId: 'basic-usage'
- },
- {
- 'name': 'customToolBar',
- 'type': 'Array',
- 'defaultValue': '[]',
- desc: {
- 'zh-CN':
- "传入需要展示的工具栏按钮配置,设置时,显示全量的工具栏。可配置的项目有:'bold','italic', 'underline', 'strike', 'quote', 'code', 'codeBlock', 'unorderedlist', 'orderedlist', 'taskList', 'subscript', 'superscript', 'undo', 'redo', 'left', 'center', 'right', 'h-box', 'font-size', 'line-height', 'highlight', 'color', 'backgroundColor', 'formatClear', 'link', 'unlink', 'img', 'table'",
- 'en-US': 'Pass in the toolbar button configuration that needs to be displayed, and customize the use'
- },
- demoId: 'basic-usage'
- },
- {
- 'name': 'placeholder',
- 'type': 'Stirng',
- 'defaultValue': '',
- desc: {
- 'zh-CN': '占位符,在v-model为空时展示',
- 'en-US': 'Placeholder, displayed when v-model is empty'
- },
- demoId: 'basic-usage'
- },
- {
- 'name': 'options',
- 'type': 'Object',
- 'defaultValue': '{}',
- desc: {
- 'zh-CN': '参见tiptap扩展说明,会覆盖useEditor配置项',
- 'en-US': 'See tiptap extension notes to overwrite the useEditor configuration item'
- },
- demoId: 'basic-usage'
- }
- ],
- 'events': [
- {
- 'name': 'update',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当编辑器状态改变完成后,将会触发该事件',
- 'en-US': 'When the content is updated.'
- },
- 'demoId': 'base'
- },
- {
- 'name': 'beforeCreate',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当编辑器视图创造之前,将会触发该事件',
- 'en-US': 'Before view creation.'
- },
- 'demoId': 'base'
- },
- {
- 'name': 'create',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当编辑器已经挂载好,将会触发该事件',
- 'en-US': 'The editor is mounted.'
- },
- 'demoId': 'base'
- },
- {
- 'name': 'focus',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当编辑器获得焦点,将会触发该事件',
- 'en-US': 'The editor gets focus.'
- },
- 'demoId': 'base'
- },
- {
- 'name': 'blur',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当编辑器失去焦点,将会触发该事件',
- 'en-US': 'The editor loses focus.'
- },
- 'demoId': 'base'
- },
- {
- 'name': 'selectionUpdate',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当编辑器选区改变,将会触发该事件',
- 'en-US': 'The selection has changed.'
- },
- 'demoId': 'base'
- },
- {
- 'name': 'transaction',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当编辑器状态改变,将会触发该事件。',
- 'en-US': 'The editor state has changed.'
- },
- 'demoId': 'base'
- },
- {
- 'name': 'destroy',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当编辑器编辑器销毁了,将会触发该事件',
- 'en-US': 'The editor is being destroyed.'
- },
- 'demoId': 'base'
- }
- ],
- 'methods': [],
- 'slots': [
- {
- 'name': 'toolBar',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': 'toolBar添加按钮,会传出editor实例,详情见tiptap', 'en-US': 'toolBar Add Button' },
- 'demoId': 'custom-search-types'
- }
- ]
+ demoId: 'placeholder-usage',
+ name: {
+ 'zh-CN': 'placeholder选项用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['placeholder-usage.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/roles/webdoc/roles.js b/examples/sites/demos/pc/app/roles/webdoc/roles.js
index a98387a5f..1e26d1e5a 100644
--- a/examples/sites/demos/pc/app/roles/webdoc/roles.js
+++ b/examples/sites/demos/pc/app/roles/webdoc/roles.js
@@ -3,58 +3,32 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'base',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'base',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN':
'\n注意 Roles 组件请求的是 mock 数据,开发时请用真实服务。\n通过 change(userId)
可以监听切换事件,入参是切换后的用户ID。
\n
\n',
'en-US':
'\n Note that the Roles component requests mock data. Use real services during development. \n The change(userId)
interface is used to listen to the switchover event. The input parameter is the user ID after the switchover.
\n
\n'
},
- 'codeFiles': ['base.vue']
+ codeFiles: ['base.vue']
},
{
- 'demoId': 'fetch-role',
- 'name': { 'zh-CN': '自定义查询服务', 'en-US': 'Customized Query Service' },
- 'desc': {
+ demoId: 'fetch-role',
+ name: {
+ 'zh-CN': '自定义查询服务',
+ 'en-US': 'Customized Query Service'
+ },
+ desc: {
'zh-CN':
'\n注意 Roles 组件请求的是 mock 数据,开发时请用真实服务。\n通过 fetch-role
自定义查询服务。
\n
\n',
'en-US':
'\n Note that the Roles component requests mock data. Use real services during development. \n Use fetch-role
to customize the query service.
\n
\n'
},
- 'codeFiles': ['fetch-role.vue']
- }
- ],
- apis: [
- {
- 'name': 'roles',
- 'type': 'component',
- 'props': [
- {
- 'name': 'fetch-role',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义接口,返回一个Promise对象,未使用框架服务时必填。',
- 'en-US':
- 'Customized interface. A Promise object is returned. This parameter is mandatory when the framework service is not used.'
- },
- 'demoId': 'fetch-role'
- }
- ],
- 'events': [
- {
- 'name': 'change',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '选中值发生变化时触发',
- 'en-US': 'This event is triggered when the selected value changes.'
- },
- 'demoId': 'base'
- }
- ],
- 'slots': []
+ codeFiles: ['fetch-role.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/scroll-text/webdoc/scroll-text.js b/examples/sites/demos/pc/app/scroll-text/webdoc/scroll-text.js
index 478e3b16e..d2ad84f6b 100644
--- a/examples/sites/demos/pc/app/scroll-text/webdoc/scroll-text.js
+++ b/examples/sites/demos/pc/app/scroll-text/webdoc/scroll-text.js
@@ -3,114 +3,77 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '可通过 text 自定义文本内容。',
'en-US': 'You can use text
to customize the text content. '
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'scroll-direction',
- 'name': { 'zh-CN': '文字滚动方向', 'en-US': 'Text scrolling direction' },
- 'desc': {
+ demoId: 'scroll-direction',
+ name: {
+ 'zh-CN': '文字滚动方向',
+ 'en-US': 'Text scrolling direction'
+ },
+ desc: {
'zh-CN': '可通过 direction
设置文字滚动方向。
\n',
'en-US': 'You can use direction
to set the text scrolling direction.
\n'
},
- 'codeFiles': ['scroll-direction.vue']
+ codeFiles: ['scroll-direction.vue']
},
{
- 'demoId': 'hover-stop',
- 'name': { 'zh-CN': '鼠标悬停时文本停止滚动', 'en-US': 'The text stops scrolling when the mouse is hovered.' },
- 'desc': {
+ demoId: 'hover-stop',
+ name: {
+ 'zh-CN': '鼠标悬停时文本停止滚动',
+ 'en-US': 'The text stops scrolling when the mouse is hovered.'
+ },
+ desc: {
'zh-CN': '可通过 hover-stop
设鼠标悬停时文本是否停止滚动。
\n',
'en-US':
'You can use hover-stop
to set whether the text stops scrolling when the mouse is hovered.
\n'
},
- 'codeFiles': ['hover-stop.vue']
+ codeFiles: ['hover-stop.vue']
},
{
- 'demoId': 'scroll-time',
- 'name': { 'zh-CN': '滚动时间间隔', 'en-US': 'Scrolling Interval' },
- 'desc': {
+ demoId: 'scroll-time',
+ name: {
+ 'zh-CN': '滚动时间间隔',
+ 'en-US': 'Scrolling Interval'
+ },
+ desc: {
'zh-CN': '可通过 time
设置滚动时间间隔。
\n',
'en-US': 'You can use time
to set the scrolling interval.
\n'
},
- 'codeFiles': ['scroll-time.vue']
+ codeFiles: ['scroll-time.vue']
},
{
- 'demoId': 'custom-text-style',
- 'name': { 'zh-CN': '自定义文本样式', 'en-US': 'Custom Text Style' },
- 'desc': {
+ demoId: 'custom-text-style',
+ name: {
+ 'zh-CN': '自定义文本样式',
+ 'en-US': 'Custom Text Style'
+ },
+ desc: {
'zh-CN': '可通过 class
自定义文本样式。
\n',
'en-US': 'You can use class
to customize the text style.
\n'
},
- 'codeFiles': ['custom-text-style.vue']
+ codeFiles: ['custom-text-style.vue']
},
{
- 'demoId': 'slots',
- 'name': { 'zh-CN': '插槽', 'en-US': 'Solt' },
- 'desc': {
+ demoId: 'slots',
+ name: {
+ 'zh-CN': '插槽',
+ 'en-US': 'Solt'
+ },
+ desc: {
'zh-CN': '可通过 solt 插槽自定义文本内容。
\n',
'en-US': 'You can customize the text content through the solt slot.
\n'
},
- 'codeFiles': ['slots.vue']
- }
- ],
- apis: [
- {
- 'name': 'scroll-text',
- 'type': 'component',
- 'props': [
- {
- 'name': 'direction',
- 'type': `'up' | 'left' | 'down' | 'right'`,
- 'defaultValue': `'left'`,
- 'desc': {
- 'zh-CN': '滚动的方向',
- 'en-US': 'Scrolling direction'
- },
- 'demoId': 'scroll-direction'
- },
- {
- 'name': 'hover-stop',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': 'hover 滚动是否停止',
- 'en-US': 'Whether to stop scrolling.'
- },
- 'demoId': 'hover-stop'
- },
- {
- 'name': 'time',
- 'type': 'number',
- 'defaultValue': '5',
- 'desc': {
- 'zh-CN': '整个滚动过程所用的时间',
- 'en-US': 'Time taken for scrolling'
- },
- 'demoId': 'scroll-time'
- },
- {
- 'name': 'text',
- 'type': 'string',
- 'defaultValue': `'ScrollText'`,
- 'desc': { 'zh-CN': '滚动的文本内容', 'en-US': 'Scrolled text content' },
- 'demoId': 'basic-usage'
- }
- ],
- 'events': [],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '默认插槽,滚动的内容的插槽', 'en-US': 'Default slot, the slot for scrolling content' },
- 'demoId': 'custom-scroll-text'
- }
- ]
+ codeFiles: ['slots.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/search/size-composition-api.vue b/examples/sites/demos/pc/app/search/size-composition-api.vue
new file mode 100644
index 000000000..fac268ae4
--- /dev/null
+++ b/examples/sites/demos/pc/app/search/size-composition-api.vue
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/search/size.spec.ts b/examples/sites/demos/pc/app/search/size.spec.ts
new file mode 100644
index 000000000..dc62123f5
--- /dev/null
+++ b/examples/sites/demos/pc/app/search/size.spec.ts
@@ -0,0 +1,10 @@
+import { expect, test } from '@playwright/test'
+
+test('尺寸', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('search#size')
+
+ const search = page.locator('.tiny-search')
+
+ await expect(search).toHaveCount(0)
+})
diff --git a/examples/sites/demos/pc/app/search/size.vue b/examples/sites/demos/pc/app/search/size.vue
new file mode 100644
index 000000000..ae4573065
--- /dev/null
+++ b/examples/sites/demos/pc/app/search/size.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/search/webdoc/search.js b/examples/sites/demos/pc/app/search/webdoc/search.js
index 370fffc75..961d860d0 100644
--- a/examples/sites/demos/pc/app/search/webdoc/search.js
+++ b/examples/sites/demos/pc/app/search/webdoc/search.js
@@ -3,276 +3,116 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '通过 v-model
设置双向绑定搜索值, placeholder
设置默认占位符文本。',
'en-US':
'Set bidirectional binding search values through v-model
, and set default placeholder text through placeholder
.'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'clearable',
- 'name': { 'zh-CN': '可清除', 'en-US': 'Can be cleared' },
- 'desc': {
+ demoId: 'clearable',
+ name: {
+ 'zh-CN': '可清除',
+ 'en-US': 'Can be cleared'
+ },
+ desc: {
'zh-CN': '通过 clearable
设置显示清空图标按钮。',
'en-US': 'Set the display clear icon button through clear
.'
},
- 'codeFiles': ['clearable.vue']
+ codeFiles: ['clearable.vue']
},
{
- 'demoId': 'mini-mode',
- 'name': { 'zh-CN': '迷你模式', 'en-US': 'Mini mode' },
- 'desc': {
+ demoId: 'mini-mode',
+ name: {
+ 'zh-CN': '迷你模式',
+ 'en-US': 'Mini mode'
+ },
+ desc: {
'zh-CN': '通过 mini
设置为 mini 模式。',
'en-US': 'Set to mini mode through mini
.'
},
- 'codeFiles': ['mini-mode.vue']
+ codeFiles: ['mini-mode.vue']
},
{
- 'demoId': 'search-types',
- 'name': { 'zh-CN': '搜索类型', 'en-US': 'Search Type' },
- 'desc': {
+ demoId: 'search-types',
+ name: {
+ 'zh-CN': '搜索类型',
+ 'en-US': 'Search Type'
+ },
+ desc: {
'zh-CN': '通过 search-types
设置可选的搜索类型, type-value
设置搜索类型的默认值。',
'en-US':
'Set optional search types by search-types
, and set default values for search types by type-value
.'
},
- 'codeFiles': ['search-types.vue']
+ codeFiles: ['search-types.vue']
},
{
- 'demoId': 'transparent-mode',
- 'name': { 'zh-CN': '透明模式', 'en-US': 'Transparent mode' },
- 'desc': {
+ demoId: 'transparent-mode',
+ name: {
+ 'zh-CN': '透明模式',
+ 'en-US': 'Transparent mode'
+ },
+ desc: {
'zh-CN': '通过 transparent
设置为透明模式(注: mini
模式下有效)。',
'en-US': 'Set to transparent mode through transparent
(note: valid in mini
mode).'
},
- 'codeFiles': ['transparent-mode.vue']
+ codeFiles: ['transparent-mode.vue']
},
{
- 'demoId': 'custom-search-types',
- 'name': {
+ demoId: 'custom-search-types',
+ name: {
'zh-CN': '定义搜索类型下拉项',
'en-US': 'Custom Search Type Dropdown'
},
- 'desc': {
+ desc: {
'zh-CN': '通过 poplist
插槽自定义搜索类型弹出的内容。',
'en-US': 'Customize the search type pop-up content through the popup
slot.'
},
- 'codeFiles': ['custom-search-types.vue']
+ codeFiles: ['custom-search-types.vue']
},
{
- 'demoId': 'show-selected-types',
- 'name': { 'zh-CN': '定义默认搜索类型', 'en-US': 'Customize default search type' },
- 'desc': {
+ demoId: 'show-selected-types',
+ name: {
+ 'zh-CN': '定义默认搜索类型',
+ 'en-US': 'Customize default search type'
+ },
+ desc: {
'zh-CN': '通过 text
插槽自定义默认搜索类型的内容。',
'en-US': 'Customize the content of the default search type through the text
slot.'
},
- 'codeFiles': ['show-selected-types.vue']
+ codeFiles: ['show-selected-types.vue']
},
{
- 'demoId': 'slot-prefix',
- 'name': { 'zh-CN': '左侧插槽', 'en-US': 'Left slot' },
- 'desc': {
+ demoId: 'slot-prefix',
+ name: {
+ 'zh-CN': '左侧插槽',
+ 'en-US': 'Left slot'
+ },
+ desc: {
'zh-CN': '通过 prefix
插槽自定义左侧内容。',
'en-US': 'Customize the left content through the prefix
slot.'
},
- 'codeFiles': ['slot-prefix.vue']
+ codeFiles: ['slot-prefix.vue']
},
{
- 'demoId': 'events',
- 'name': { 'zh-CN': '事件', 'en-US': 'Search event' },
- 'desc': {
- 'zh-CN': `通过 is-enter-search
设置回车触发搜索事件, search
监听搜索事件;
- 通过 change
监听输入框失焦时搜索值改变事件, input
监听搜索值实时改变事件;
- 通过 select
监听搜索类型选中事件。`,
- 'en-US': `Set a carriage return to trigger a search event by is enter search
, and listen for search events by search
- By change
listening for search value change events when the input box is out of focus, and input
listening for real-time search value change events
- Listen for search type selection events through select
.`
+ demoId: 'events',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': 'Search event'
},
- 'codeFiles': ['events.vue']
- }
- ],
- apis: [
- {
- 'name': 'search',
- 'type': 'component',
- 'props': [
- {
- 'name': 'clearable',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否显示清空图标按钮',
- 'en-US': 'Is the clear icon button displayed'
- },
- 'demoId': 'clearable'
- },
- {
- 'name': 'is-enter-search',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否在按下键盘 Enter 键时触发 search 事件',
- 'en-US': 'Whether to trigger the search event when pressing the Enter key on the keyboard'
- },
- 'demoId': 'events'
- },
- {
- 'name': 'mini',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否为迷你模式,配置为 true 时,默认显示为一个带图标的圆形按钮,点击后展开',
- 'en-US':
- 'Is it mini mode? When configured to true, it will default to a circular button with an icon, which will expand after clicking'
- },
- 'demoId': 'mini-mode'
- },
- {
- 'name': 'placeholder',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '搜索输入框内的提示占位文本',
- 'en-US': 'Search for prompt placeholder text in the input box'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'search-types',
- 'type': 'ITypeValue[]',
- 'typeAnchorName': 'ITypeValue',
- 'defaultValue': '[]',
- 'desc': {
- 'zh-CN': '搜索类型的选项列表',
- 'en-US': 'List of options for search types'
- },
- 'demoId': 'search-types'
- },
- {
- 'name': 'transparent',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否为透明模式,此模式一般用在带有背景的场景',
- 'en-US': 'Is it transparent mode? This mode is generally used in scenes with a background'
- },
- 'demoId': 'transparent-mode'
- },
- {
- 'name': 'type-value',
- 'type': 'ITypeValue',
- 'typeAnchorName': 'ITypeValue',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '搜索类型的默认值。默认为搜索类型的第一项【3.11.0新增】',
- 'en-US':
- 'The default value for the search type. Default to the first item of the search type [added on 3.11.0]'
- },
- 'demoId': 'search-types'
- },
- {
- 'name': 'v-model',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '绑定搜索值', 'en-US': 'Bind search values' },
- 'demoId': 'basic-usage'
- }
- ],
- 'events': [
- {
- 'name': 'change',
- 'type': '(value: ITypeValue, input: string) => void',
- 'typeAnchorName': 'ITypeValue',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '输入完成时触发的回调函数; value 为搜索类型,input 为当前输入值',
- 'en-US':
- 'The callback function triggered upon input completion; value is the search type, input is the current input value'
- },
- 'demoId': 'events'
- },
- {
- 'name': 'clear',
- 'type': '() => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '清空值触发的回调函数',
- 'en-US': 'Callback function triggered by clearing values'
- },
- 'demoId': 'events'
- },
- {
- 'name': 'input',
- 'type': '(input: string, value: ITypeValue) => void',
- 'typeAnchorName': 'ITypeValue',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '输入实时触发的回调函数; input 为当前输入值,value 为搜索类型【3.9.1新增】',
- 'en-US':
- 'Input a real-time triggered callback function; input is the current input value, value is the search type [3.9.1 added]'
- },
- 'demoId': 'events'
- },
- {
- 'name': 'search',
- 'type': '(value: ITypeValue, input: string) => void',
- 'typeAnchorName': 'ITypeValue',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '展开模式下,点击搜索按钮时触发的回调函数; value 为搜索类型,input 为当前输入值',
- 'en-US':
- 'The callback function triggered when clicking the search button in expansion mode; value is the search type, input is the current input value'
- },
- 'demoId': 'events'
- },
- {
- 'name': 'select',
- 'type': '(value: ITypeValue) => void',
- 'typeAnchorName': 'ITypeValue',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '切换类型时触发的回调函数; value 为搜索类型',
- 'en-US': 'The callback function triggered when switching types; value is a search type'
- },
- 'demoId': 'events'
- }
- ],
- 'slots': [
- {
- 'name': 'poplist',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '搜索的弹出列表插槽', 'en-US': 'Slot in the search pop-up list' },
- 'demoId': 'custom-search-types'
- },
- {
- 'name': 'prefix',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '左侧插槽', 'en-US': 'Left slot' },
- 'demoId': 'slot-prefix'
- },
- {
- 'name': 'text',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '默认搜索类型插槽', 'en-US': 'Default search type slot' },
- 'demoId': 'show-selected-types'
- }
- ]
- }
- ],
- types: [
- {
- name: 'ITypeValue',
- type: 'interface',
- code: `
-interface ITypeValue {
- text: string
- value: number
-}`
+ desc: {
+ 'zh-CN':
+ '通过 is-enter-search
设置回车触发搜索事件, search
监听搜索事件;
\n 通过 change
监听输入框失焦时搜索值改变事件, input
监听搜索值实时改变事件;
\n 通过 select
监听搜索类型选中事件。',
+ 'en-US':
+ 'Set a carriage return to trigger a search event by is enter search
, and listen for search events by search
\n By change
listening for search value change events when the input box is out of focus, and input
listening for real-time search value change events
\n Listen for search type selection events through select
.'
+ },
+ codeFiles: ['events.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/select/allow-create-composition-api.vue b/examples/sites/demos/pc/app/select/allow-create-composition-api.vue
index d80dfb754..7a4f2863e 100644
--- a/examples/sites/demos/pc/app/select/allow-create-composition-api.vue
+++ b/examples/sites/demos/pc/app/select/allow-create-composition-api.vue
@@ -1,19 +1,65 @@
- 场景1:allow-create + filterable,点击创建条目
+ 场景1:allow-create + filterable,点击创建条目
+
- 场景2:allow-create + filterable + default-first-option,Enter 键创建条目
+
+
+ 场景2:allow-create + filterable + default-first-option,Enter 键创建条目
+
+
+
+ 场景3:下拉框显示新增按钮
+
+
+
+
+
+
+
+ label
+
+
+
+
+
+
+ value
+
+
+
+
+
+
+ 取消
+ 确定
+
+
diff --git a/examples/sites/demos/pc/app/select/allow-create.spec.ts b/examples/sites/demos/pc/app/select/allow-create.spec.ts
index 038d3bf64..ec6dc36d4 100644
--- a/examples/sites/demos/pc/app/select/allow-create.spec.ts
+++ b/examples/sites/demos/pc/app/select/allow-create.spec.ts
@@ -6,8 +6,9 @@ test('点击选中', async ({ page }) => {
await page.goto('select#allow-create')
const wrap = page.locator('#allow-create')
- const dropdown = page.locator('.tiny-select-dropdown')
- const input = wrap.locator('.tiny-input__inner').first()
+ const select = wrap.locator('.tiny-select').nth(0)
+ const dropdown = page.locator('body > .tiny-select-dropdown')
+ const input = select.locator('.tiny-input__inner')
await input.click()
await input.fill('测试allow-create')
@@ -29,8 +30,9 @@ test('enter 选中', async ({ page }) => {
await page.goto('select#allow-create')
const wrap = page.locator('#allow-create')
- const dropdown = page.locator('.tiny-select-dropdown').nth(1)
- const input = wrap.locator('.tiny-input__inner').nth(1)
+ const select = wrap.locator('.tiny-select').nth(1)
+ const dropdown = page.locator('body > .tiny-select-dropdown')
+ const input = select.locator('.tiny-input__inner')
await input.click()
await input.press('a')
diff --git a/examples/sites/demos/pc/app/select/allow-create.vue b/examples/sites/demos/pc/app/select/allow-create.vue
index 63e689192..1f420641e 100644
--- a/examples/sites/demos/pc/app/select/allow-create.vue
+++ b/examples/sites/demos/pc/app/select/allow-create.vue
@@ -1,23 +1,65 @@
- 场景1:allow-create + filterable,点击创建条目
+ 场景1:allow-create + filterable,点击创建条目
+
- 场景2:allow-create + filterable + default-first-option,Enter 键创建条目
+
+
+ 场景2:allow-create + filterable + default-first-option,Enter 键创建条目
+
+
+
+ 场景3:下拉框显示新增按钮
+
+
+
+
+
+
+
+ label
+
+
+
+
+
+
+ value
+
+
+
+
+
+
+ 取消
+ 确定
+
+
diff --git a/examples/sites/demos/pc/app/select/disabled.spec.ts b/examples/sites/demos/pc/app/select/disabled.spec.ts
index 77f9c079e..6d65657ac 100644
--- a/examples/sites/demos/pc/app/select/disabled.spec.ts
+++ b/examples/sites/demos/pc/app/select/disabled.spec.ts
@@ -1,6 +1,7 @@
import { test, expect } from '@playwright/test'
test('下拉禁用', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#disabled')
const wrap = page.locator('#disabled')
const input = wrap.locator('.tiny-input__inner').first()
@@ -10,6 +11,7 @@ test('下拉禁用', async ({ page }) => {
})
test('多选某项禁用', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#disabled')
const wrap = page.locator('#disabled')
const select = wrap.locator('.tiny-select').nth(1)
@@ -30,6 +32,7 @@ test('多选某项禁用', async ({ page }) => {
})
test('单选某项禁用', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#disabled')
const wrap = page.locator('#disabled')
const select = wrap.locator('.tiny-select').nth(2)
@@ -51,6 +54,7 @@ test('单选某项禁用', async ({ page }) => {
})
test('多选,禁用项默认选中', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#disabled')
const wrap = page.locator('#disabled')
const select = wrap.locator('.tiny-select').nth(3)
diff --git a/examples/sites/demos/pc/app/select/disabled.vue b/examples/sites/demos/pc/app/select/disabled.vue
index 3e6dc77e5..3822862da 100644
--- a/examples/sites/demos/pc/app/select/disabled.vue
+++ b/examples/sites/demos/pc/app/select/disabled.vue
@@ -1,10 +1,15 @@
- 场景1: 下拉禁用
+
+ 场景1: 下拉禁用
+
- 场景2:多选 + 下拉某项禁用
+
+
+ 场景2:多选 + 下拉某项禁用
+
- 场景3:单选 + 下拉某项禁用
+
+
+ 场景3:单选 + 下拉某项禁用
+
- 场景4:多选 + 禁用项默认选中
+
+
+ 场景4:多选 + 禁用项默认选中
+
+
+
+ 场景5:多选 hover-expand 模式下禁用
+
+
+
+
+
@@ -54,7 +80,7 @@ export default {
{ value: '选项1', label: '黄金糕' },
{ value: '选项2', label: '双皮奶' },
{ value: '选项3', label: '蚵仔煎' },
- { value: '选项4', label: '龙须面' },
+ { value: '选项4', label: '龙须面龙须面超长超长超长超长超长超长超长超长超长' },
{ value: '选项5', label: '北京烤鸭' }
],
options2: [
@@ -67,7 +93,8 @@ export default {
value1: '',
value2: [],
value3: '',
- value4: ['选项2', '选项3']
+ value4: ['选项2', '选项3'],
+ value5: ['选项1', '选项2', '选项3', '选项4', '选项5']
}
}
}
@@ -77,8 +104,4 @@ export default {
.tiny-select {
width: 280px;
}
-p {
- font-size: 14px;
- line-height: 1.5;
-}
diff --git a/examples/sites/demos/pc/app/select/events-composition-api.vue b/examples/sites/demos/pc/app/select/events-composition-api.vue
index de73a2efa..55d82ada8 100644
--- a/examples/sites/demos/pc/app/select/events-composition-api.vue
+++ b/examples/sites/demos/pc/app/select/events-composition-api.vue
@@ -9,6 +9,7 @@
@focus="focus"
@visible-change="visibleChange"
@clear="clear"
+ @dropdown-click="dropdownClick"
>
@@ -23,6 +24,7 @@
@focus="focus"
@visible-change="visibleChange"
@remove-tag="removeTag"
+ @dropdown-click="dropdownClick"
>
@@ -85,6 +87,13 @@ const visibleChange = () => {
status: 'info'
})
}
+
+const dropdownClick = () => {
+ Modal.message({
+ message: '触发 dropdown-click 事件',
+ status: 'info'
+ })
+}
diff --git a/examples/sites/demos/pc/app/select/extra-query-params.vue b/examples/sites/demos/pc/app/select/extra-query-params.vue
new file mode 100644
index 000000000..6c307eaf6
--- /dev/null
+++ b/examples/sites/demos/pc/app/select/extra-query-params.vue
@@ -0,0 +1,157 @@
+
+
+ 父选项:
+
+
+
+
+ 子选项:
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/select/filter-method.spec.ts b/examples/sites/demos/pc/app/select/filter-method.spec.ts
index 43ab488db..1fe524a3c 100644
--- a/examples/sites/demos/pc/app/select/filter-method.spec.ts
+++ b/examples/sites/demos/pc/app/select/filter-method.spec.ts
@@ -1,6 +1,7 @@
import { expect, test } from '@playwright/test'
test('默认搜索', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#filter-method')
const wrap = page.locator('#filter-method')
const select = wrap.locator('.tiny-select').first()
@@ -44,6 +45,7 @@ test('默认搜索', async ({ page }) => {
})
test('自定义过滤', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#filter-method')
const wrap = page.locator('#filter-method')
const select = wrap.locator('.tiny-select').nth(1)
diff --git a/examples/sites/demos/pc/app/select/filter-mode-composition-api.vue b/examples/sites/demos/pc/app/select/filter-mode-composition-api.vue
new file mode 100644
index 000000000..d1a38ff93
--- /dev/null
+++ b/examples/sites/demos/pc/app/select/filter-mode-composition-api.vue
@@ -0,0 +1,52 @@
+
+
+ 场景1:过滤器模式(默认)
+
+
+
+
+
+
+
+ 场景2:过滤器模式(透明)
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/select/filter-mode.vue b/examples/sites/demos/pc/app/select/filter-mode.vue
new file mode 100644
index 000000000..85b8e5c21
--- /dev/null
+++ b/examples/sites/demos/pc/app/select/filter-mode.vue
@@ -0,0 +1,61 @@
+
+
+ 场景1:过滤器模式(默认)
+
+
+
+
+
+
+
+ 场景2:过滤器模式(透明)
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/select/hide-drop.spec.ts b/examples/sites/demos/pc/app/select/hide-drop.spec.ts
index ee2213652..c7acd415a 100644
--- a/examples/sites/demos/pc/app/select/hide-drop.spec.ts
+++ b/examples/sites/demos/pc/app/select/hide-drop.spec.ts
@@ -1,6 +1,7 @@
import { test, expect } from '@playwright/test'
test('hidedrop', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#hide-drop')
const wrap = page.locator('#hide-drop')
const select = wrap.locator('.tiny-select')
diff --git a/examples/sites/demos/pc/app/select/input-box-type.spec.ts b/examples/sites/demos/pc/app/select/input-box-type.spec.ts
index 3d674ccae..a40131e32 100644
--- a/examples/sites/demos/pc/app/select/input-box-type.spec.ts
+++ b/examples/sites/demos/pc/app/select/input-box-type.spec.ts
@@ -1,6 +1,7 @@
import { test, expect } from '@playwright/test'
test('下划线默认', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#input-box-type')
const wrap = page.locator('#input-box-type')
const select = wrap.locator('.tiny-select').nth(0)
@@ -22,6 +23,7 @@ test('下划线默认', async ({ page }) => {
})
test('下划线禁用', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#input-box-type')
const wrap = page.locator('#input-box-type')
const select = wrap.locator('.tiny-select').nth(1)
@@ -44,6 +46,7 @@ test('下划线禁用', async ({ page }) => {
})
test('下划线多选', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#input-box-type')
const wrap = page.locator('#input-box-type')
const select = wrap.locator('.tiny-select').nth(2)
diff --git a/examples/sites/demos/pc/app/select/is-drop-inherit-width.spec.ts b/examples/sites/demos/pc/app/select/is-drop-inherit-width.spec.ts
index 46f4a83ee..f518461ce 100644
--- a/examples/sites/demos/pc/app/select/is-drop-inherit-width.spec.ts
+++ b/examples/sites/demos/pc/app/select/is-drop-inherit-width.spec.ts
@@ -1,6 +1,7 @@
import { expect, test } from '@playwright/test'
test('默认下拉弹框宽度由内容撑开', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#is-drop-inherit-width')
const wrap = page.locator('#is-drop-inherit-width')
@@ -18,6 +19,7 @@ test('默认下拉弹框宽度由内容撑开', async ({ page }) => {
})
test('下拉弹框宽度与输入框一致', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#is-drop-inherit-width')
const wrap = page.locator('#is-drop-inherit-width')
const select = wrap.locator('.tiny-select').nth(1)
diff --git a/examples/sites/demos/pc/app/select/manual-focus-blur-composition-api.vue b/examples/sites/demos/pc/app/select/manual-focus-blur-composition-api.vue
index 4cb65bb5c..fc96402d5 100644
--- a/examples/sites/demos/pc/app/select/manual-focus-blur-composition-api.vue
+++ b/examples/sites/demos/pc/app/select/manual-focus-blur-composition-api.vue
@@ -1,12 +1,37 @@
-
- 点击获取焦点
- 点击失去焦点
+
+ 场景1:默认 focus() 后仅聚焦,不下拉
+
+ 点击获取焦点
+ 点击失去焦点
+
+
+
+
+
+
+
+ 场景2:配置 filterable,focus() 后聚焦并自动下拉
+
+ 点击获取焦点
+ 点击失去焦点
+
+
+
+
+
+
+
+ 场景2:配置 automaticDropdown,focus() 后聚焦并自动下拉
+
+ 点击获取焦点
+ 点击失去焦点
+
+
+
+
-
-
-
@@ -21,15 +46,34 @@ const options = ref([
{ value: '选项4', label: '龙须面' },
{ value: '选项5', label: '北京烤鸭' }
])
-const value = ref('')
-const dropRef = ref()
-const handleFocus = () => {
- dropRef.value.focus()
+const value = ref('')
+const drop1 = ref(null)
+const drop2 = ref(null)
+const drop3 = ref(null)
+
+const handleFocus1 = () => {
+ drop1.value.focus()
}
-const handleBlur = () => {
- dropRef.value.blur()
+const handleBlur1 = () => {
+ drop1.value.blur()
+}
+
+const handleFocus2 = () => {
+ drop2.value.focus()
+}
+
+const handleBlur2 = () => {
+ drop2.value.blur()
+}
+
+const handleFocus3 = () => {
+ drop3.value.focus()
+}
+
+const handleBlur3 = () => {
+ drop3.value.blur()
}
@@ -41,8 +85,4 @@ const handleBlur = () => {
max-width: unset;
margin-bottom: 10px;
}
-p {
- font-size: 14px;
- line-height: 1.5;
-}
diff --git a/examples/sites/demos/pc/app/select/manual-focus-blur.spec.ts b/examples/sites/demos/pc/app/select/manual-focus-blur.spec.ts
index 3b24b940f..218bf3c37 100644
--- a/examples/sites/demos/pc/app/select/manual-focus-blur.spec.ts
+++ b/examples/sites/demos/pc/app/select/manual-focus-blur.spec.ts
@@ -1,10 +1,11 @@
import { test, expect } from '@playwright/test'
-test('手动聚焦失焦', async ({ page }) => {
+test('可搜索+手动聚焦失焦', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#manual-focus-blur')
const wrap = page.locator('#manual-focus-blur')
const dropdown = page.locator('body > .tiny-select-dropdown')
- const button = wrap.locator('.tiny-button')
+ const button = wrap.locator('.demo2 .tiny-button')
await page.waitForTimeout(2000)
// 手动聚焦下拉
diff --git a/examples/sites/demos/pc/app/select/manual-focus-blur.vue b/examples/sites/demos/pc/app/select/manual-focus-blur.vue
index 86e022875..95149a773 100644
--- a/examples/sites/demos/pc/app/select/manual-focus-blur.vue
+++ b/examples/sites/demos/pc/app/select/manual-focus-blur.vue
@@ -1,12 +1,37 @@
-
- 点击获取焦点
- 点击失去焦点
+
+ 场景1:默认 focus() 后仅聚焦,不下拉
+
+ 点击获取焦点
+ 点击失去焦点
+
+
+
+
+
+
+
+ 场景2:配置 filterable,focus() 后聚焦并自动下拉
+
+ 点击获取焦点
+ 点击失去焦点
+
+
+
+
+
+
+
+ 场景2:配置 automaticDropdown,focus() 后聚焦并自动下拉
+
+ 点击获取焦点
+ 点击失去焦点
+
+
+
+
-
-
-
@@ -32,11 +57,23 @@ export default {
}
},
methods: {
- handleFocus() {
- this.$refs.drop.focus()
+ handleFocus1() {
+ this.$refs.drop1.focus()
},
- handleBlur() {
- this.$refs.drop.blur()
+ handleBlur1() {
+ this.$refs.drop1.blur()
+ },
+ handleFocus2() {
+ this.$refs.drop2.focus()
+ },
+ handleBlur2() {
+ this.$refs.drop2.blur()
+ },
+ handleFocus3() {
+ this.$refs.drop3.focus()
+ },
+ handleBlur3() {
+ this.$refs.drop3.blur()
}
}
}
@@ -50,8 +87,4 @@ export default {
max-width: unset;
margin-bottom: 10px;
}
-p {
- font-size: 14px;
- line-height: 1.5;
-}
diff --git a/examples/sites/demos/pc/app/select/map-field.spec.ts b/examples/sites/demos/pc/app/select/map-field.spec.ts
index 3168ce4be..d0d8ccba5 100644
--- a/examples/sites/demos/pc/app/select/map-field.spec.ts
+++ b/examples/sites/demos/pc/app/select/map-field.spec.ts
@@ -1,6 +1,7 @@
import { expect, test } from '@playwright/test'
test('配置式配置映射字段', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#map-field')
const wrap = page.locator('#map-field')
const select = wrap.locator('.tiny-select').nth(0)
@@ -20,6 +21,7 @@ test('配置式配置映射字段', async ({ page }) => {
})
test('嵌套表格配置映射字段', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#map-field')
const wrap = page.locator('#map-field')
const select = wrap.locator('.tiny-select').nth(1)
diff --git a/examples/sites/demos/pc/app/select/memoize-usage.spec.ts b/examples/sites/demos/pc/app/select/memoize-usage.spec.ts
index 0c864ef00..655c32d89 100644
--- a/examples/sites/demos/pc/app/select/memoize-usage.spec.ts
+++ b/examples/sites/demos/pc/app/select/memoize-usage.spec.ts
@@ -1,6 +1,7 @@
import { expect, test } from '@playwright/test'
test('手动缓存', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#memoize-usage')
const wrap = page.locator('#memoize-usage')
const select = wrap.locator('.tiny-select')
diff --git a/examples/sites/demos/pc/app/select/multiple-composition-api.vue b/examples/sites/demos/pc/app/select/multiple-composition-api.vue
index 04f279f60..bd921aaf1 100644
--- a/examples/sites/demos/pc/app/select/multiple-composition-api.vue
+++ b/examples/sites/demos/pc/app/select/multiple-composition-api.vue
@@ -1,14 +1,63 @@
-
-
-
+
+
+ 场景1:多选
+
+
+
+
+
+
+
+ 场景2:必选
+
+
+
+
+
+
+
+
+ 场景3:配置式必选
+
+
+
+
+
+ 场景4:多选个数限制
+
+
+
+
+
+
+
+ 场景5:自定义图标 + 自定义样式
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/select/multiple-limit.spec.ts b/examples/sites/demos/pc/app/select/multiple-limit.spec.ts
deleted file mode 100644
index 63be896dd..000000000
--- a/examples/sites/demos/pc/app/select/multiple-limit.spec.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { test, expect } from '@playwright/test'
-
-test('multiple-limit', async ({ page }) => {
- await page.goto('select#multiple-limit')
- const wrap = page.locator('#multiple-limit')
- const select = wrap.locator('.tiny-select')
- const dropdown = page.locator('body > .tiny-select-dropdown')
- const option = dropdown.locator('.tiny-option')
- const tag = select.locator('.tiny-tag')
-
- await select.click()
- await option.nth(0).click()
- await option.nth(1).click()
- await expect(tag).toHaveCount(2)
- await expect(option.filter({ hasText: '全部' })).toHaveCount(0)
-
- const list = await option.all()
- list.forEach(async (item, index) => {
- if (index <= 1) {
- await expect(item).toHaveClass(/selected/)
- } else {
- await expect(item).toHaveClass(/is-disabled/)
- }
- })
-})
diff --git a/examples/sites/demos/pc/app/select/multiple-limit.vue b/examples/sites/demos/pc/app/select/multiple-limit.vue
deleted file mode 100644
index 6a7ba39df..000000000
--- a/examples/sites/demos/pc/app/select/multiple-limit.vue
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/examples/sites/demos/pc/app/select/multiple-mix-composition-api.vue b/examples/sites/demos/pc/app/select/multiple-mix-composition-api.vue
new file mode 100644
index 000000000..7f871edec
--- /dev/null
+++ b/examples/sites/demos/pc/app/select/multiple-mix-composition-api.vue
@@ -0,0 +1,147 @@
+
+
+ display-only/{{ displayOnly }}
+ 边框为表单范围
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/select/multiple-mix.vue b/examples/sites/demos/pc/app/select/multiple-mix.vue
new file mode 100644
index 000000000..bc6289128
--- /dev/null
+++ b/examples/sites/demos/pc/app/select/multiple-mix.vue
@@ -0,0 +1,152 @@
+
+
+ display-only/{{ displayOnly }}
+ 边框为表单范围
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/select/multiple.spec.ts b/examples/sites/demos/pc/app/select/multiple.spec.ts
index 69bdbffd7..e996c29be 100644
--- a/examples/sites/demos/pc/app/select/multiple.spec.ts
+++ b/examples/sites/demos/pc/app/select/multiple.spec.ts
@@ -1,9 +1,10 @@
import { expect, test } from '@playwright/test'
-test('test', async ({ page }) => {
+test('多选时取远端数据与当前已选数据的并集', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#multiple')
const wrap = page.locator('#multiple')
- const select = wrap.locator('.tiny-select')
+ const select = wrap.locator('.tiny-select').nth(0)
const dropdown = page.locator('body > .tiny-select-dropdown')
const option = dropdown.locator('.tiny-option')
const tag = select.locator('.tiny-tag')
@@ -21,3 +22,28 @@ test('test', async ({ page }) => {
await tag.filter({ hasText: '双皮奶' }).locator('.tiny-tag__close').click()
await expect(tag).toHaveCount(1)
})
+
+test('multiple-limit', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('select#multiple')
+ const wrap = page.locator('#multiple')
+ const select = wrap.locator('.tiny-select').nth(3)
+ const dropdown = page.locator('body > .tiny-select-dropdown')
+ const option = dropdown.locator('.tiny-option')
+ const tag = select.locator('.tiny-tag')
+
+ await select.click()
+ await option.nth(0).click()
+ await option.nth(1).click()
+ await expect(tag).toHaveCount(2)
+ await expect(option.filter({ hasText: '全部' })).toHaveCount(0)
+
+ const list = await option.all()
+ list.forEach(async (item, index) => {
+ if (index <= 1) {
+ await expect(item).toHaveClass(/selected/)
+ } else {
+ await expect(item).toHaveClass(/is-disabled/)
+ }
+ })
+})
diff --git a/examples/sites/demos/pc/app/select/multiple.vue b/examples/sites/demos/pc/app/select/multiple.vue
index 50b55a072..c3f14ad17 100644
--- a/examples/sites/demos/pc/app/select/multiple.vue
+++ b/examples/sites/demos/pc/app/select/multiple.vue
@@ -1,11 +1,60 @@
-
-
-
+
+
+ 场景1:多选
+
+
+
+
+
+
+
+ 场景2:必选
+
+
+
+
+
+
+
+
+ 场景3:配置式必选
+
+
+
+
+
+ 场景4:多选个数限制
+
+
+
+
+
+
+
+ 场景5:自定义图标 + 自定义样式
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/select/nest-grid-init-query.vue b/examples/sites/demos/pc/app/select/nest-grid-init-query.vue
new file mode 100644
index 000000000..434f464f9
--- /dev/null
+++ b/examples/sites/demos/pc/app/select/nest-grid-init-query.vue
@@ -0,0 +1,129 @@
+
+
+ 场景1:下拉表格远程搜索初始化查询(单选)
+
+
+
+
+ 场景2:下拉表格远程搜索初始化查询(多选)
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/select/nest-grid-remote-multi.spec.ts b/examples/sites/demos/pc/app/select/nest-grid-remote-multi.spec.ts
index 0a542b106..d8755b225 100644
--- a/examples/sites/demos/pc/app/select/nest-grid-remote-multi.spec.ts
+++ b/examples/sites/demos/pc/app/select/nest-grid-remote-multi.spec.ts
@@ -1,6 +1,7 @@
import { expect, test } from '@playwright/test'
test('下拉表格远程搜索基础用法', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#nest-grid-remote-multi')
const wrap = page.locator('#nest-grid-remote-multi')
const select = wrap.locator('.tiny-select').nth(0)
@@ -32,6 +33,7 @@ test('下拉表格远程搜索基础用法', async ({ page }) => {
})
test('下拉表格远程搜索 + 自动搜索 + 显示按钮', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#nest-grid-remote-multi')
const wrap = page.locator('#nest-grid-remote-multi')
diff --git a/examples/sites/demos/pc/app/select/nest-grid-remote-single.spec.ts b/examples/sites/demos/pc/app/select/nest-grid-remote-single.spec.ts
index 61824fbfc..3fe739e7f 100644
--- a/examples/sites/demos/pc/app/select/nest-grid-remote-single.spec.ts
+++ b/examples/sites/demos/pc/app/select/nest-grid-remote-single.spec.ts
@@ -1,6 +1,7 @@
import { expect, test } from '@playwright/test'
test('下拉表格远程搜索基础用法', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#nest-grid-remote-single')
const wrap = page.locator('#nest-grid-remote-single')
@@ -32,6 +33,7 @@ test('下拉表格远程搜索基础用法', async ({ page }) => {
})
test('下拉表格远程搜索 + 自动搜索 + 显示按钮', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#nest-grid-remote-single')
const wrap = page.locator('#nest-grid-remote-single')
diff --git a/examples/sites/demos/pc/app/select/nest-grid.spec.ts b/examples/sites/demos/pc/app/select/nest-grid.spec.ts
index ec4d9f0e3..668bb5622 100644
--- a/examples/sites/demos/pc/app/select/nest-grid.spec.ts
+++ b/examples/sites/demos/pc/app/select/nest-grid.spec.ts
@@ -1,6 +1,7 @@
import { test, expect } from '@playwright/test'
test('嵌套表格(单选)', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#nest-grid')
const wrap = page.locator('#nest-grid')
@@ -24,6 +25,7 @@ test('嵌套表格(单选)', async ({ page }) => {
})
test('嵌套表格(多选)', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#nest-grid')
const wrap = page.locator('#nest-grid')
@@ -62,6 +64,7 @@ test('嵌套表格(多选)', async ({ page }) => {
})
test('嵌套表格 + 可搜索 + 可清除', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#nest-grid')
const wrap = page.locator('#nest-grid')
diff --git a/examples/sites/demos/pc/app/select/nest-radio-grid-much-data.spec.ts b/examples/sites/demos/pc/app/select/nest-radio-grid-much-data.spec.ts
index e1f9e5aab..0a2d55615 100644
--- a/examples/sites/demos/pc/app/select/nest-radio-grid-much-data.spec.ts
+++ b/examples/sites/demos/pc/app/select/nest-radio-grid-much-data.spec.ts
@@ -1,6 +1,7 @@
import { expect, test } from '@playwright/test'
test('下拉表格大数据', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#nest-radio-grid-much-data')
const wrap = page.locator('#nest-radio-grid-much-data')
diff --git a/examples/sites/demos/pc/app/select/nest-tree.spec.ts b/examples/sites/demos/pc/app/select/nest-tree.spec.ts
index 519b1b1e8..84cb59776 100644
--- a/examples/sites/demos/pc/app/select/nest-tree.spec.ts
+++ b/examples/sites/demos/pc/app/select/nest-tree.spec.ts
@@ -1,6 +1,7 @@
import { test, expect } from '@playwright/test'
test('下拉树单选', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#nest-tree')
const wrap = page.locator('#nest-tree')
@@ -24,6 +25,7 @@ test('下拉树单选', async ({ page }) => {
})
test('下拉树多选', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#nest-tree')
const wrap = page.locator('#nest-tree')
@@ -51,6 +53,7 @@ test('下拉树多选', async ({ page }) => {
})
test('下拉树可搜索', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#nest-tree')
const wrap = page.locator('#nest-tree')
diff --git a/examples/sites/demos/pc/app/select/nest-tree.vue b/examples/sites/demos/pc/app/select/nest-tree.vue
index 2a43a70a6..411d53f37 100644
--- a/examples/sites/demos/pc/app/select/nest-tree.vue
+++ b/examples/sites/demos/pc/app/select/nest-tree.vue
@@ -1,6 +1,7 @@
-
- 场景1:下拉树单选
+
+ 场景1:下拉树(单选)
+
- 场景2:下拉树多选
+
+
+ 场景2:下拉树(多选)
+
- 场景3:下拉树可搜索
+
+
+ 场景3:下拉树可搜索
+
+
+
+ 场景4:下拉树懒加载(单选)
+
+
+
+
+ 场景5:下拉树懒加载(多选)
+
+
@@ -41,8 +73,10 @@ export default {
data() {
return {
treeValue1: 10,
- treeValue2: [9, 6],
+ treeValue2: [1, 9],
treeValue3: '',
+ treeValue4: 3,
+ treeValue5: [1],
treeOp: {
data: [
{
@@ -80,6 +114,36 @@ export default {
]
}
]
+ },
+ treeOpLazy: {
+ lazy: true,
+ load(node, resolve) {
+ if (node.level === 0) {
+ return resolve([
+ {
+ id: 3,
+ label: '一级 3'
+ }
+ ])
+ }
+ if (node.level > 1) return resolve([])
+
+ setTimeout(() => {
+ const data = [
+ {
+ id: 1,
+ label: '一级 1'
+ },
+ {
+ id: 2,
+ label: '一级 2',
+ isLeaf: true
+ }
+ ]
+
+ resolve(data)
+ }, 500)
+ }
}
}
},
@@ -94,7 +158,7 @@ export default {
diff --git a/examples/sites/demos/pc/app/select/no-data-text.spec.ts b/examples/sites/demos/pc/app/select/no-data-text.spec.ts
index d5c6a8912..a21118912 100644
--- a/examples/sites/demos/pc/app/select/no-data-text.spec.ts
+++ b/examples/sites/demos/pc/app/select/no-data-text.spec.ts
@@ -1,6 +1,7 @@
import { test, expect } from '@playwright/test'
test('默认空数据文本', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#no-data-text')
const wrap = page.locator('#no-data-text')
@@ -13,6 +14,7 @@ test('默认空数据文本', async ({ page }) => {
})
test('自定义空数据文本', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#no-data-text')
const wrap = page.locator('#no-data-text')
@@ -25,6 +27,7 @@ test('自定义空数据文本', async ({ page }) => {
})
test('显示空数据图片', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#no-data-text')
const wrap = page.locator('#no-data-text')
const select = wrap.locator('.tiny-select').nth(2)
diff --git a/examples/sites/demos/pc/app/select/optimization.spec.ts b/examples/sites/demos/pc/app/select/optimization.spec.ts
index 34e55777c..bbca2b321 100644
--- a/examples/sites/demos/pc/app/select/optimization.spec.ts
+++ b/examples/sites/demos/pc/app/select/optimization.spec.ts
@@ -1,6 +1,7 @@
import { test, expect } from '@playwright/test'
test('单选虚拟滚动', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#optimization')
const wrap = page.locator('#optimization')
@@ -22,6 +23,7 @@ test('单选虚拟滚动', async ({ page }) => {
})
test('多选虚拟滚动', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#optimization')
const wrap = page.locator('#optimization')
const select = wrap.locator('.tiny-select').nth(1)
diff --git a/examples/sites/demos/pc/app/select/option-group-composition-api.vue b/examples/sites/demos/pc/app/select/option-group-composition-api.vue
index 13956994d..63ff9d98d 100644
--- a/examples/sites/demos/pc/app/select/option-group-composition-api.vue
+++ b/examples/sites/demos/pc/app/select/option-group-composition-api.vue
@@ -1,7 +1,8 @@
- 场景1:分组 + 多选 + 面板可搜索
-
+ 场景1:分组 + 多选 + 面板可搜索
+
+
- 场景2:分组
-
+
+
+ 场景2:单选分组
+
+
+
+
+
+
+
+
+ 场景3:分组 + 多选
+
+
+
+
+
+
+
+
+ 场景4:分组 + 多选 + 可搜索
+
+
diff --git a/examples/sites/demos/pc/app/select/option-group.spec.ts b/examples/sites/demos/pc/app/select/option-group.spec.ts
index 421a8da8b..6ce54e611 100644
--- a/examples/sites/demos/pc/app/select/option-group.spec.ts
+++ b/examples/sites/demos/pc/app/select/option-group.spec.ts
@@ -1,6 +1,7 @@
import { test, expect } from '@playwright/test'
test('option-group', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#option-group')
const wrap = page.locator('#option-group')
diff --git a/examples/sites/demos/pc/app/select/option-group.vue b/examples/sites/demos/pc/app/select/option-group.vue
index de1b61038..3cf0c9127 100644
--- a/examples/sites/demos/pc/app/select/option-group.vue
+++ b/examples/sites/demos/pc/app/select/option-group.vue
@@ -1,7 +1,8 @@
- 场景1:分组 + 多选 + 面板可搜索
-
+ 场景1:分组 + 多选 + 面板可搜索
+
+
- 场景2:分组
-
+
+
+ 场景2:单选分组
+
+
+
+
+
+
+
+
+ 场景3:分组 + 多选
+
+
+
+
+
+
+
+
+ 场景4:分组 + 多选 + 可搜索
+
+
diff --git a/examples/sites/demos/pc/app/select/popup-style-position.spec.ts b/examples/sites/demos/pc/app/select/popup-style-position.spec.ts
index 83f3f1ccf..cad4b0ce2 100644
--- a/examples/sites/demos/pc/app/select/popup-style-position.spec.ts
+++ b/examples/sites/demos/pc/app/select/popup-style-position.spec.ts
@@ -1,6 +1,7 @@
import { test, expect } from '@playwright/test'
test('popup-style-position', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#popup-style-position')
const wrap = page.locator('#popup-style-position')
diff --git a/examples/sites/demos/pc/app/select/remote-method-composition-api.vue b/examples/sites/demos/pc/app/select/remote-method-composition-api.vue
index b97e5ed83..218b9706a 100644
--- a/examples/sites/demos/pc/app/select/remote-method-composition-api.vue
+++ b/examples/sites/demos/pc/app/select/remote-method-composition-api.vue
@@ -1,6 +1,7 @@
- 场景1:远程搜索单选
+ 场景1:远程搜索单选
+
- 场景2:远程搜索多选 + 保留搜索关键字
+
+
+ 场景2:远程搜索多选 + 保留搜索关键字
+
- 场景3:获焦时触发远程搜索
+
+
+ 场景3:获焦时触发远程搜索
+
+
+
+ 场景4:失焦清空查询数据,显示下拉图标
+
+
+
+
+
+
+ 场景5:聚焦时触发搜索,失焦清空查询数据,显示下拉图标
+
+
+
+
+
+
+
+ 场景6:远程搜索配置 trim 属性去除绑定值空格
+
+ trim 为:{{ trim }}
+ 改变成有空格的值
+ 重置绑定值
+
+
+
+
+
@@ -164,8 +280,4 @@ onMounted(() => {
.tiny-select {
width: 280px;
}
-p {
- font-size: 14px;
- line-height: 1.5;
-}
diff --git a/examples/sites/demos/pc/app/select/remote-method.spec.ts b/examples/sites/demos/pc/app/select/remote-method.spec.ts
index 9a6831fbd..4cb249a92 100644
--- a/examples/sites/demos/pc/app/select/remote-method.spec.ts
+++ b/examples/sites/demos/pc/app/select/remote-method.spec.ts
@@ -1,6 +1,7 @@
import { expect, test } from '@playwright/test'
test('远程搜索单选', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#remote-method')
const wrap = page.locator('#remote-method')
@@ -11,7 +12,7 @@ test('远程搜索单选', async ({ page }) => {
await input.focus()
await expect(option).toHaveCount(0)
- await expect(dropdown.locator('.tiny-select-dropdown__empty')).toBeVisible()
+ await expect(dropdown).toBeHidden()
await input.fill('al')
await input.press('Enter')
@@ -22,6 +23,7 @@ test('远程搜索单选', async ({ page }) => {
})
test('远程搜索多选 + 保留搜索关键字', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#remote-method')
const wrap = page.locator('#remote-method')
@@ -50,6 +52,7 @@ test('远程搜索多选 + 保留搜索关键字', async ({ page }) => {
})
test('获焦时触发远程搜索', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#remote-method')
const wrap = page.locator('#remote-method')
diff --git a/examples/sites/demos/pc/app/select/remote-method.vue b/examples/sites/demos/pc/app/select/remote-method.vue
index 5e17e60b1..a1cdda327 100644
--- a/examples/sites/demos/pc/app/select/remote-method.vue
+++ b/examples/sites/demos/pc/app/select/remote-method.vue
@@ -1,6 +1,7 @@
- 场景1:远程搜索单选
+ 场景1:远程搜索(单选)
+
- 场景2:远程搜索多选 + 保留搜索关键字
+
+
+ 场景2:远程搜索多选 + 保留搜索关键字
+
- 场景3:获焦时触发远程搜索
+
+
+ 场景3:获焦时触发远程搜索
+
+
+
+ 场景4:失焦清空查询数据,显示下拉图标
+
+
+
+
+
+
+ 场景5:聚焦时触发搜索,失焦清空查询数据,显示下拉图标
+
+
+
+
+
+
+
+ 场景6:远程搜索配置 trim 属性去除绑定值空格
+
+ trim 为:{{ trim }}
+ 改变成有空格的值
+ 重置绑定值
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/select/slot-label.vue b/examples/sites/demos/pc/app/select/slot-label.vue
new file mode 100644
index 000000000..e69b1ac67
--- /dev/null
+++ b/examples/sites/demos/pc/app/select/slot-label.vue
@@ -0,0 +1,85 @@
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/select/slot-prefix.spec.ts b/examples/sites/demos/pc/app/select/slot-prefix.spec.ts
index 67c022445..1442669b9 100644
--- a/examples/sites/demos/pc/app/select/slot-prefix.spec.ts
+++ b/examples/sites/demos/pc/app/select/slot-prefix.spec.ts
@@ -1,6 +1,7 @@
import { test, expect } from '@playwright/test'
test('输入框前缀插槽', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#slot-prefix')
const wrap = page.locator('#slot-prefix')
diff --git a/examples/sites/demos/pc/app/select/slot-reference.spec.ts b/examples/sites/demos/pc/app/select/slot-reference.spec.ts
index aa211c4be..b177190e1 100644
--- a/examples/sites/demos/pc/app/select/slot-reference.spec.ts
+++ b/examples/sites/demos/pc/app/select/slot-reference.spec.ts
@@ -1,11 +1,12 @@
import { expect, test } from '@playwright/test'
test('custom-reference', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#slot-reference')
const wrap = page.locator('#slot-reference')
const select = wrap.locator('.tiny-select')
- const dropdown = page.locator('body > .tiny-select-dropdown')
+ const dropdown = page.locator('.tiny-select-dropdown')
const option = dropdown.locator('.tiny-option')
const reference = select.locator('.custom-reference')
diff --git a/examples/sites/demos/pc/app/select/tag-type.spec.ts b/examples/sites/demos/pc/app/select/tag-type.spec.ts
index b138070f7..15c5c0f03 100644
--- a/examples/sites/demos/pc/app/select/tag-type.spec.ts
+++ b/examples/sites/demos/pc/app/select/tag-type.spec.ts
@@ -1,6 +1,7 @@
import { test, expect } from '@playwright/test'
test('标签类型', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('select#tag-type')
const wrap = page.locator('#tag-type')
diff --git a/examples/sites/demos/pc/app/select/webdoc/select.js b/examples/sites/demos/pc/app/select/webdoc/select.js
index e3f89480b..b222f02f0 100644
--- a/examples/sites/demos/pc/app/select/webdoc/select.js
+++ b/examples/sites/demos/pc/app/select/webdoc/select.js
@@ -3,1202 +3,619 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN':
'通过 v-model
设置被选中的 tiny-option
的 value
属性值。
\n',
'en-US':
'Set the value
attribute value of the selected tiny-option
by v-model
.
\n'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'multiple',
- 'name': { 'zh-CN': '多选', 'en-US': 'Multiple' },
- 'desc': {
+ demoId: 'multiple',
+ name: {
+ 'zh-CN': '多选',
+ 'en-US': 'Multiple'
+ },
+ desc: {
'zh-CN':
- '通过 multiple
属性启用多选功能,此时 v-model
的值为当前选中值所组成的数组。默认选中值会以标签(Tag 组件)展示。
\n',
+ '通过 multiple
属性启用多选功能,此时 v-model
的值为当前选中值所组成的数组。默认选中值会以标签(Tag 组件)展示。
\n通过 multiple-limit
属性限制最多可选择的个数,默认为 0 不限制。
\n多选时,通过给 option 标签配置 required
或者在 options 配置项中添加 required
属性,来设置必选选项。
\n通过 dropdown-icon
属性可自定义下拉图标,drop-style
属性可自定义下拉选项样式。
',
'en-US':
- '
Enable the multi-selection function through the multiple
attribute, where the value of the v-model
is an array composed of the currently selected values. The default selected value will be displayed as a tag component.
\n'
+ 'Enable the multi-selection function through the multiple
attribute, where the value of the v-model
is an array composed of the currently selected values. The default selected value will be displayed as a tag component.
\nLimit the maximum number of choices through the multiple-limit
attribute, with a default value of 0 and no limit.
\nIf you select multiple options, you can configure the required
attribute for the option tag or add the required
attribute to the options configuration item to set the mandatory options.
You can use the dropdown-icon
attribute to customize the drop-down icon, and the drop-style
attribute to customize the drop-down option style.
'
},
- 'codeFiles': ['multiple.vue']
+ codeFiles: ['multiple.vue']
},
{
- 'demoId': 'multiple-limit',
- 'name': { 'zh-CN': '选择个数限制', 'en-US': 'Select number limit' },
- 'desc': {
- 'zh-CN': '
通过 multiple-limit
属性限制最多可选择的个数,默认为 0 不限制。
\n',
- 'en-US':
- 'Limit the maximum number of choices through the multiple-limit
attribute, with a default value of 0 and no limit.
\n'
+ demoId: 'collapse-tags',
+ name: {
+ 'zh-CN': '折叠标签',
+ 'en-US': 'Collapse tags'
},
- 'codeFiles': ['multiple-limit.vue']
- },
- {
- 'demoId': 'collapse-tags',
- 'name': { 'zh-CN': '折叠标签', 'en-US': 'Collapse tags' },
- 'desc': {
- 'zh-CN': '通过 collapse-tags
属性设置选中多个选项时,多个标签缩略展示。
\n',
+ desc: {
+ 'zh-CN':
+ '通过 collapse-tags
属性设置选中多个选项时,多个标签缩略展示。多选时通过设置 hover-expand
为 true
,默认折叠标签, hover 时展示所有标签。标签内容超长时超出省略,hover 标签时展示 tooltip。
\n',
'en-US':
'When multiple options are selected through the collapse-tags
attribute settings, multiple tags will be abbreviated and displayed.
\n'
},
- 'codeFiles': ['collapse-tags.vue']
+ codeFiles: ['collapse-tags.vue']
},
{
- 'demoId': 'tag-type',
- 'name': { 'zh-CN': '标签类型', 'en-US': 'Tag type' },
- 'desc': {
+ demoId: 'multiple-mix',
+ name: {
+ 'zh-CN': '仅显示',
+ 'en-US': 'Display only'
+ },
+ desc: {
+ 'zh-CN':
+ 'Form 表单内 Select 组件不同尺寸设置 hover-expand
和 display-only
属性的综合应用。
\n',
+ 'en-US':
+ 'Comprehensive application of the hover-expand
and display-only
attributes of the Select component in the form.
\n'
+ },
+ codeFiles: ['multiple-mix.vue']
+ },
+ {
+ demoId: 'tag-type',
+ name: {
+ 'zh-CN': '标签类型',
+ 'en-US': 'Tag type'
+ },
+ desc: {
'zh-CN':
'通过 tag-type
属性设置标签类型,同 Tag 组件的 type 属性。可选值:success / info / warning / danger 。
\n',
'en-US':
'Set the label type through the tag-type
attribute, which is the same as the type attribute of the Tag component. Optional values: success/info/warning/danger.
\n'
},
- 'codeFiles': ['tag-type.vue']
+ codeFiles: ['tag-type.vue']
},
{
- 'demoId': 'size',
- 'name': { 'zh-CN': '尺寸', 'en-US': 'Size' },
- 'desc': {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '尺寸',
+ 'en-US': 'Size'
+ },
+ desc: {
'zh-CN': '通过 size
属性设置输入框尺寸,可选值:medium / small / mini 。
',
'en-US':
'Set the input box size through the size
attribute, with optional values of medium / small / mini.
'
},
- 'codeFiles': ['size.vue']
+ codeFiles: ['size.vue']
},
{
- 'demoId': 'disabled',
- 'name': { 'zh-CN': '禁用', 'en-US': 'Disabled' },
- 'desc': {
+ demoId: 'disabled',
+ name: {
+ 'zh-CN': '禁用',
+ 'en-US': 'Disabled'
+ },
+ desc: {
'zh-CN': '通过 disabled
属性设置下拉或者下拉项的禁用状态。
\n',
'en-US':
'Set the disabled status of the dropdown or dropdown item through the disabled
attribute.
\n'
},
- 'codeFiles': ['disabled.vue']
+ codeFiles: ['disabled.vue']
},
{
- 'demoId': 'clearable',
- 'name': { 'zh-CN': '可清除', 'en-US': 'Clearable' },
- 'desc': {
+ demoId: 'clearable',
+ name: {
+ 'zh-CN': '可清除',
+ 'en-US': 'Clearable'
+ },
+ desc: {
'zh-CN': '通过 clearable
属性启用一键清除选中值的功能。仅适用于单选。
\n',
'en-US':
'Enable the function of clearing selected values with one click through theclearable
attribute. Only applicable for single selection.
\n'
},
- 'codeFiles': ['clearable.vue']
+ codeFiles: ['clearable.vue']
},
{
- 'demoId': 'filter-method',
- 'name': { 'zh-CN': '可搜索', 'en-US': 'Filterable' },
- 'desc': {
+ demoId: 'filter-method',
+ name: {
+ 'zh-CN': '可搜索',
+ 'en-US': 'Filterable'
+ },
+ desc: {
'zh-CN':
'通过 filterable
属性启用搜索功能。filter-method
自定义过滤方法。 no-match-text
属性自定义与搜索条件无匹配项时显示的文字。
\n',
'en-US':
'Enable search functionality through the filterable
attribute filter-method
customize the filtering method no-match-text
the text displayed when there is no match between attribute customization and search criteria.
\n'
},
- 'codeFiles': ['filter-method.vue']
+ codeFiles: ['filter-method.vue']
},
{
- 'demoId': 'remote-method',
- 'name': { 'zh-CN': '远程搜索', 'en-US': 'Remote search' },
- 'desc': {
- 'zh-CN':
- '通过 filterable
和 remote
和 remote-method
这三个属性同时使用设置远程搜索。通过 reserve-keyword
属性设置多选可搜索时,可以在选中一个选项后保留当前的搜索关键词。
\n',
- 'en-US':
- 'Set remote search through the use of three attributes:filterable
,remote
, and remote-method
. When setting multiple searchable options through the reserve-keyword
attribute, the current search keyword can be retained after selecting an option.
'
+ demoId: 'remote-method',
+ name: {
+ 'zh-CN': '远程搜索',
+ 'en-US': 'Remote search'
},
- 'codeFiles': ['remote-method.vue']
+ desc: {
+ 'zh-CN':
+ '通过 filterable
和 remote
和 remote-method
这三个属性同时使用设置远程搜索。通过 reserve-keyword
属性设置多选可搜索时,可以在选中一个选项后保留当前的搜索关键词。
\n通过 trim
属性去除双向数据绑定值空格。
',
+ 'en-US':
+ 'Set remote search through the use of three attributes:filterable
,remote
, and remote-method
. When setting multiple searchable options through the reserve-keyword
attribute, the current search keyword can be retained after selecting an option.
\n Removes spaces from bidirectional data binding values through the trim
attribute.
'
+ },
+ codeFiles: ['remote-method.vue']
},
{
- 'demoId': 'searchable',
- 'name': { 'zh-CN': '下拉面板可搜索', 'en-US': 'Panel search' },
- 'desc': {
+ demoId: 'searchable',
+ name: {
+ 'zh-CN': '下拉面板可搜索',
+ 'en-US': 'Panel search'
+ },
+ desc: {
'zh-CN': '通过 searchable
属性设置下拉面板显示搜索框,默认不显示。
\n',
'en-US':
'The search box is displayed through the searchable
attribute setting drop-down panel, which is not displayed by default.
\n'
},
- 'codeFiles': ['searchable.vue']
+ codeFiles: ['searchable.vue']
},
{
- 'demoId': 'allow-create',
- 'name': { 'zh-CN': '创建条目', 'en-US': 'Create Entry' },
- 'desc': {
+ demoId: 'allow-create',
+ name: {
+ 'zh-CN': '创建条目',
+ 'en-US': 'Create Entry'
+ },
+ desc: {
'zh-CN':
- '通过 allow-create
和 filterable
属性,设置当搜索字段不在已有选项中时,可创建为新的条目。结合 default-first-option
属性,可以按 Enter 键选中第一个匹配项。
\n',
+ '通过 allow-create
和 filterable
属性,设置当搜索字段不在已有选项中时,可创建为新的条目。结合 default-first-option
属性,可以按 Enter 键选中第一个匹配项。
\n设置 top-create
属性后,Select 下拉框中会显示新增按钮,点击按钮会抛出一个 top-create-click
事件,可以在事件中自定义一些行为。
',
'en-US':
'By using the allow-create
and filterable
attributes, the search field can be created as a new entry when it is not in an existing option. By combining the default-first-option
attribute, you can press the Enter key to select the first matching option.
\n'
},
- 'codeFiles': ['allow-create.vue']
+ codeFiles: ['allow-create.vue']
},
{
- 'demoId': 'map-field',
- 'name': { 'zh-CN': '映射字段', 'en-US': 'Map Fields' },
- 'desc': {
+ demoId: 'map-field',
+ name: {
+ 'zh-CN': '映射字段',
+ 'en-US': 'Map Fields'
+ },
+ desc: {
'zh-CN': '通过 text-field
设置显示文本字段,value-field
设置绑定值字段。',
'en-US':
'Set the display text field by text-field
, and set the binding value field by value-field
.
\n'
},
- 'codeFiles': ['map-field.vue']
+ codeFiles: ['map-field.vue']
},
{
- 'demoId': 'popup-style-position',
- 'name': { 'zh-CN': '弹框样式与定位', 'en-US': 'Bullet Box Style and Positioning' },
- 'desc': {
+ demoId: 'popup-style-position',
+ name: {
+ 'zh-CN': '弹框样式与定位',
+ 'en-US': 'Bullet Box Style and Positioning'
+ },
+ desc: {
'zh-CN':
'通过 popper-class
属性设置下拉弹框的类名,可自定义样式。placement
设置弹出位置。popper-append-to-body
设置是否将弹框 dom 元素插入至 body 元素,默认为 true。
\n',
'en-US':
'You can customize the style by setting the class name of the dropdown pop-up box through the popper-class
attribute placement
set the pop-up position popper-append-to-body
set whether to insert the pop-up dom element into the body element, default to true.
\n'
},
- 'codeFiles': ['popup-style-position.vue']
+ codeFiles: ['popup-style-position.vue']
},
{
- 'demoId': 'input-box-type',
- 'name': { 'zh-CN': '输入框类型', 'en-US': 'Input box type' },
- 'desc': {
+ demoId: 'input-box-type',
+ name: {
+ 'zh-CN': '输入框类型',
+ 'en-US': 'Input box type'
+ },
+ desc: {
'zh-CN': '通过 input-box-type
属性设置输入框类型。可选值:input / underline。
\n',
'en-US':
'The Set the input box type through the input-box-type
attribute. Optional values: input / underline.
\n'
},
- 'codeFiles': ['input-box-type.vue']
+ codeFiles: ['input-box-type.vue']
},
{
- 'demoId': 'show-alloption',
- 'name': { 'zh-CN': '不展示全选', 'en-US': 'Hide Select All' },
- 'desc': {
+ demoId: 'show-alloption',
+ name: {
+ 'zh-CN': '不展示全选',
+ 'en-US': 'Hide Select All'
+ },
+ desc: {
'zh-CN': '通过 show-alloption
属性设置多选时不展示 全选
选项,默认展示 。
\n',
'en-US':
'By setting the show-allocation
attribute, do not display the select all
option when multiple selections are made, and display by default.
\n'
},
- 'codeFiles': ['show-alloption.vue']
+ codeFiles: ['show-alloption.vue']
},
{
- 'demoId': 'clear-no-match-value',
- 'name': { 'zh-CN': '自动清除不匹配的值', 'en-US': 'Clear mismatch value' },
- 'desc': {
+ demoId: 'clear-no-match-value',
+ name: {
+ 'zh-CN': '自动清除不匹配的值',
+ 'en-US': 'Clear mismatch value'
+ },
+ desc: {
'zh-CN':
'通过 clear-no-match-value
属性设置 v-model 的值在 options 中无法找到匹配项的值会被自动清除,默认不清除。
\n',
'en-US':
'By setting the value of the v-model through the clear-no-match-value
attribute, if a matching value cannot be found in the options, it will be automatically cleared and will not be cleared by default.
\n'
},
- 'codeFiles': ['clear-no-match-value.vue']
+ codeFiles: ['clear-no-match-value.vue']
},
{
- 'demoId': 'optimization',
- 'name': { 'zh-CN': '虚拟滚动', 'en-US': 'Virtual scrolling' },
- 'desc': {
+ demoId: 'optimization',
+ name: {
+ 'zh-CN': '虚拟滚动',
+ 'en-US': 'Virtual scrolling'
+ },
+ desc: {
'zh-CN':
'通过 optimization
开启大数据虚拟滚动功能。仅配置式(使用 options 属性)时支持。\n多选模式下,最大选中项数 multiple-limit
默认值为 20,如果选中项比较多,建议开启 collapse-tags
进行折叠显示。
\n',
'en-US':
'Enable the big data virtual scrolling function through optimization
. Supported only when configuring (using the options attribute). In n multiple selection mode, the maximum number of selected items is multiple-limit
with a default value of 20. If there are many selected items, it is recommended to turn on collapse-tags
for collapsed display.
\n'
},
- 'codeFiles': ['optimization.vue']
+ codeFiles: ['optimization.vue']
},
{
- 'demoId': 'option-group',
- 'name': { 'zh-CN': '分组', 'en-US': 'Group' },
- 'desc': {
+ demoId: 'option-group',
+ name: {
+ 'zh-CN': '分组',
+ 'en-US': 'Group'
+ },
+ desc: {
'zh-CN':
'使用 tiny-option-group
组件对备选项进行分组。通过 label
属性设置分组名,disabled
属性设置该分组下所有选项为禁用。
\n',
'en-US':
'Use the tiny-option-group
component to group alternative options. Set the group name through the label
attribute, and set all options under the group to disabled through the disabled
attribute.
\n'
},
- 'codeFiles': ['option-group.vue']
+ codeFiles: ['option-group.vue']
},
{
- 'demoId': 'copy-single',
- 'name': { 'zh-CN': '单选可复制', 'en-US': 'Single choice replicable' },
- 'desc': {
+ demoId: 'copy-single',
+ name: {
+ 'zh-CN': '单选可复制',
+ 'en-US': 'Single choice replicable'
+ },
+ desc: {
'zh-CN': '通过 allow-copy
属性设置单选可搜索时,鼠标可滑动选中并复制输入框的内容。
\n',
'en-US':
'When setting radio searchable through the allow-copy
attribute, the mouse can slide to select and copy the content of the input box.
\n'
},
- 'codeFiles': ['copy-single.vue']
+ codeFiles: ['copy-single.vue']
},
{
- 'demoId': 'copy-multi',
- 'name': { 'zh-CN': '多选可复制', 'en-US': 'Multiple choices can be copied' },
- 'desc': {
+ demoId: 'copy-multi',
+ name: {
+ 'zh-CN': '多选可复制',
+ 'en-US': 'Multiple choices can be copied'
+ },
+ desc: {
'zh-CN':
'通过 tag-selectable
属性设置输入框中标签可通过鼠标选择,然后按 Ctrl + C 或右键进行复制。copyable
属性设置启用一键复制所有标签的文本内容并以逗号分隔。
\n',
'en-US':
'By setting the tag-selectable
attribute in the input box, the label can be selected with the mouse, and then copied by pressing Ctrl+C or right-click copyable
attribute settings enable one click copying of all label text content separated by commas.
\n'
},
- 'codeFiles': ['copy-multi.vue']
+ codeFiles: ['copy-multi.vue']
},
{
- 'demoId': 'native-properties',
- 'name': { 'zh-CN': '原生属性', 'en-US': 'Native properties' },
- 'desc': {
+ demoId: 'native-properties',
+ name: {
+ 'zh-CN': '原生属性',
+ 'en-US': 'Native properties'
+ },
+ desc: {
'zh-CN':
'通过 name
/ placeholder
/ autocomplete
属性设置下拉组件内置 Input 的原生属性。
\n',
'en-US':
'Set the native properties of the built-in Input in the dropdown component through the name
/ placeholder
/ autocomplete
attribute settings.
\n'
},
- 'codeFiles': ['native-properties.vue']
+ codeFiles: ['native-properties.vue']
},
{
- 'demoId': 'binding-obj',
- 'name': { 'zh-CN': '绑定值为对象', 'en-US': 'Bind value as object' },
- 'desc': {
+ demoId: 'binding-obj',
+ name: {
+ 'zh-CN': '绑定值为对象',
+ 'en-US': 'Bind value as object'
+ },
+ desc: {
'zh-CN': '通过 value-key
属性设置 value 唯一标识的键名,绑定值可以设置为对象。
\n',
'en-US':
'By using the value-key
attribute to set the key name uniquely identified by value, the binding value can be set as an object.
\n'
},
- 'codeFiles': ['binding-obj.vue']
+ codeFiles: ['binding-obj.vue']
},
{
- 'demoId': 'no-data-text',
- 'name': { 'zh-CN': '空数据文本', 'en-US': 'Empty data text' },
- 'desc': {
+ demoId: 'no-data-text',
+ name: {
+ 'zh-CN': '空数据文本',
+ 'en-US': 'Empty data text'
+ },
+ desc: {
'zh-CN':
'通过 no-data-text
属性设置选项为空时显示的文本,show-empty-image
属性设置是否显示空数据图片,默认不显示。
\n',
'en-US':
'By setting theno-data-text
attribute to display text when the option is empty, and by setting the show-empty-image
attribute to display empty data images, it is not displayed by default.
\n'
},
- 'codeFiles': ['no-data-text.vue']
+ codeFiles: ['no-data-text.vue']
},
{
- 'demoId': 'manual-focus-blur',
- 'name': { 'zh-CN': '手动聚焦失焦', 'en-US': 'Manual focusing out of focus' },
- 'desc': {
+ demoId: 'manual-focus-blur',
+ name: {
+ 'zh-CN': '手动聚焦失焦',
+ 'en-US': 'Manual focusing out of focus'
+ },
+ desc: {
'zh-CN': '通过 focus()
方法聚焦,blur()
方法失焦。
\n',
'en-US':
'Focusing is achieved through the focus()
method, while the blur()
method is out of focus.
\n'
},
- 'codeFiles': ['manual-focus-blur.vue']
+ codeFiles: ['manual-focus-blur.vue']
},
{
- 'demoId': 'automatic-dropdown',
- 'name': { 'zh-CN': '获焦即弹出', 'en-US': 'Eject upon capture of focus' },
- 'desc': {
+ demoId: 'automatic-dropdown',
+ name: {
+ 'zh-CN': '获焦即弹出',
+ 'en-US': 'Eject upon capture of focus'
+ },
+ desc: {
'zh-CN': '通过 automatic-dropdown
设置不可搜索的 select 获得焦点并自动弹出选项菜单。
\n',
'en-US':
'Set non searchable select to obtain focus and automatically pop up an option menu through automatic-dropdown
.
\n'
},
- 'codeFiles': ['automatic-dropdown.vue']
+ codeFiles: ['automatic-dropdown.vue']
},
{
- 'demoId': 'is-drop-inherit-width',
- 'name': { 'zh-CN': '继承宽度', 'en-US': 'Inherit width' },
- 'desc': {
+ demoId: 'is-drop-inherit-width',
+ name: {
+ 'zh-CN': '继承宽度',
+ 'en-US': 'Inherit width'
+ },
+ desc: {
'zh-CN':
'通过 is-drop-inherit-width
属性设置下拉弹框的宽度是否跟输入框保持一致。默认超出输入框宽度时由内容撑开。
\n',
'en-US':
'Set whether the width of the dropdown pop-up box is consistent with the input box through the is-drop-inherit-width
attribute. By default, when the width of the input box is exceeded, it is supported by the content.
\n'
},
- 'codeFiles': ['is-drop-inherit-width.vue']
+ codeFiles: ['is-drop-inherit-width.vue']
},
{
- 'demoId': 'hide-drop',
- 'name': { 'zh-CN': '隐藏下拉', 'en-US': 'Hide drop' },
- 'desc': {
+ demoId: 'hide-drop',
+ name: {
+ 'zh-CN': '隐藏下拉',
+ 'en-US': 'Hide drop'
+ },
+ desc: {
'zh-CN': '通过 hide-drop
属性设置下拉列表不显示。
\n',
'en-US': 'Set the drop-down list to not display through the hide-drop
attribute.
'
},
- 'codeFiles': ['hide-drop.vue']
+ codeFiles: ['hide-drop.vue']
},
{
- 'demoId': 'cache-usage',
- 'name': { 'zh-CN': '自动缓存', 'en-US': 'Automatic caching' },
- 'desc': {
+ demoId: 'filter-mode',
+ name: {
+ 'zh-CN': '过滤器模式',
+ 'en-US': 'Filter mode'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 shape
属性设置为 filter
切换至过滤器模式。 过滤器模式下可传入 label 显示标题,tip 显示提示信息,clearable 是否显示清除按钮,placeholder 显示占位符。
\n通过 blank
属性将过滤器背景设置为透明。
',
+ 'en-US':
+ 'Set the shape
attribute to filter
to switch to filter mode. In filter mode, you can transfer the label display title, tip display prompt information, clearable whether to display the clear button, and placeholder display placeholder.
\nSet the filter background to transparent with the blank
attribute.
'
+ },
+ codeFiles: ['filter-mode.vue']
+ },
+ {
+ demoId: 'cache-usage',
+ name: {
+ 'zh-CN': '自动缓存',
+ 'en-US': 'Automatic caching'
+ },
+ desc: {
'zh-CN': '通过 cache-op
开启缓存功能,仅配置式生效。
\n',
'en-US': 'Enable cache function through cache-op
, only configuration mode takes effect
'
},
- 'codeFiles': ['cache-usage.vue']
+ codeFiles: ['cache-usage.vue']
},
{
- 'demoId': 'memoize-usage',
- 'name': { 'zh-CN': '手动缓存', 'en-US': 'Manual caching' },
- 'desc': {
+ demoId: 'memoize-usage',
+ name: {
+ 'zh-CN': '手动缓存',
+ 'en-US': 'Manual caching'
+ },
+ desc: {
'zh-CN': '使用 tiny-option 组件,则需要手动加入缓存功能。
\n',
'en-US': 'If using the tiny-option component, you need to manually add caching functionality.
'
},
- 'codeFiles': ['memoize-usage.vue']
+ codeFiles: ['memoize-usage.vue']
},
{
- 'demoId': 'nest-tree',
- 'name': { 'zh-CN': '下拉树', 'en-US': 'Select Tree' },
- 'desc': {
+ demoId: 'nest-tree',
+ name: {
+ 'zh-CN': '下拉树',
+ 'en-US': 'Select Tree'
+ },
+ desc: {
'zh-CN': '
通过 render-type
设置渲染为树类型,tree-op
设置树组件配置。
',
'en-US':
'Set the rendering to tree type through render-type
, and set the tree component configuration through tree-op
.
\n'
},
- 'codeFiles': ['nest-tree.vue']
+ codeFiles: ['nest-tree.vue']
},
{
- 'demoId': 'nest-grid',
- 'name': { 'zh-CN': '下拉表格', 'en-US': 'Select Table' },
- 'desc': {
+ demoId: 'nest-grid',
+ name: {
+ 'zh-CN': '下拉表格',
+ 'en-US': 'Select Table'
+ },
+ desc: {
'zh-CN': '通过 render-type
设置渲染为表格类型,grid-op
设置表格配置。
',
'en-US':
'Set the rendering to a table type through render-type
, and set the table configuration through grid-op
\n'
},
- 'codeFiles': ['nest-grid.vue']
+ codeFiles: ['nest-grid.vue']
},
{
- 'demoId': 'nest-grid-disable',
- 'name': { 'zh-CN': '下拉表格禁用选项', 'en-US': 'Select Table Disable Options' },
- 'desc': {
- 'zh-CN':
- '通过 select-config
(多选)或 radio-config
(单选)属性的 checkMethod
自定义禁用逻辑,返回 true (启用) / false (禁用)。
\n',
- 'en-US':
- "By customizing the disable logic through the select-config
(multiple selection) or radio-config
(single selection) attribute's checkMethod
, return true (Enable) / false (disable)
"
+ demoId: 'nest-grid-disable',
+ name: {
+ 'zh-CN': '下拉表格禁用选项',
+ 'en-US': 'Select Table Disable Options'
},
- 'codeFiles': ['nest-grid-disable.vue']
+ desc: {
+ 'zh-CN':
+ '通过 select-config
(多选)或 radio-config
(单选)属性的 checkMethod
自定义禁用逻辑,返回 true (启用) / false (禁用)。配置 {trigger: "row"} 可以设置点击行选中数据。
\n',
+ 'en-US':
+ "By customizing the disable logic through the select-config
(multiple selection) or radio-config
(single selection) attribute's checkMethod
, return true (Enable) / false (disable).Configure {trigger: 'row'} to set the selected data in the click row.
"
+ },
+ codeFiles: ['nest-grid-disable.vue']
},
{
- 'demoId': 'nest-grid-remote-single',
- 'name': { 'zh-CN': '下拉表格远程搜索(单选)', 'en-US': 'Select table Remote Search (Single)' },
- 'desc': {
+ demoId: 'nest-grid-remote-single',
+ name: {
+ 'zh-CN': '下拉表格远程搜索(单选)',
+ 'en-US': 'Select table Remote Search (Single)'
+ },
+ desc: {
'zh-CN':
'通过 remote
和 remote-method
和 filterable
开启远程搜索。通过 remote-config
设置自动搜索和显示展开按钮 。
\n',
'en-US':
'Enable remote search through remote
,remote-method
, and filterable
. Set up automatic search and display expansion buttons through remote-config
.
'
},
- 'codeFiles': ['nest-grid-remote-single.vue']
+ codeFiles: ['nest-grid-remote-single.vue']
},
{
- 'demoId': 'nest-grid-remote-multi',
- 'name': { 'zh-CN': '下拉表格远程搜索(多选)', 'en-US': 'Select table Remote Search (Multiple)' },
- 'desc': {
+ demoId: 'nest-grid-remote-multi',
+ name: {
+ 'zh-CN': '下拉表格远程搜索(多选)',
+ 'en-US': 'Select table Remote Search (Multiple)'
+ },
+ desc: {
'zh-CN':
'通过 remote
和 remote-method
和 filterable
开启远程搜索。通过 remote-config
设置自动搜索和显示展开按钮。reserve-keyword
设置多选选中一个选项后依然保留搜索关键字。
\n',
'en-US':
'Enable remote search through remote
,remote-method
, and filterable
. Set up automatic search and display expansion buttons through remote-config
reserve-keyword
set to retain search keywords after selecting multiple options.
'
},
- 'codeFiles': ['nest-grid-remote-multi.vue']
+ codeFiles: ['nest-grid-remote-multi.vue']
},
{
- 'demoId': 'nest-radio-grid-much-data',
- 'name': { 'zh-CN': '下拉表格大数据', 'en-US': 'Select Table Big Data' },
- 'desc': {
+ demoId: 'nest-grid-init-query',
+ name: {
+ 'zh-CN': '下拉表格初始化查询',
+ 'en-US': 'Init query'
+ },
+ desc: {
+ 'zh-CN':
+ 'remote
为 true
时,可设置 init-query
用于初始化列表数据,并可使用 v-model
绑定数据回显同时,可配置 remote-method
方法进行搜索。
\n',
+ 'en-US':
+ 'When remote
is set to true
, you can set init-query
to initialize list data and use v-model
to bind data echoes. You can configure the remote-method
method for search.
'
+ },
+ codeFiles: ['nest-grid-init-query.vue']
+ },
+ {
+ demoId: 'extra-query-params',
+ name: {
+ 'zh-CN': '下拉表格初始化查询传参',
+ 'en-US': 'Extra Parameters'
+ },
+ desc: {
+ 'zh-CN':
+ 'remote
为 true
时,可设置 extra-query-params
传递额外的参数,用于 init-query
和 remote-method
方法的查询。
\n',
+ 'en-US':
+ 'When remote
is set to true
, you can set extra-query-params
to transfer extra parameters for querying the init-query
and remote-method
methods.
'
+ },
+ codeFiles: ['extra-query-params.vue']
+ },
+ {
+ demoId: 'nest-radio-grid-much-data',
+ name: {
+ 'zh-CN': '下拉表格大数据',
+ 'en-US': 'Select Table Big Data'
+ },
+ desc: {
'zh-CN': '表格数据量很大时,会自动启用虚拟滚动,同 Grid 组件。',
'en-US':
'When the table data volume is large, virtual scrolling will be automatically enabled, similar to the Grid component.
\n'
},
- 'codeFiles': ['nest-radio-grid-much-data.vue']
+ codeFiles: ['nest-radio-grid-much-data.vue']
},
{
- 'demoId': 'slot-default',
- 'name': { 'zh-CN': '选项插槽', 'en-US': 'Option slot' },
- 'desc': {
+ demoId: 'slot-default',
+ name: {
+ 'zh-CN': '选项插槽',
+ 'en-US': 'Option slot'
+ },
+ desc: {
'zh-CN': '通过 tiny-option 的 default
插槽自定义选项的 HTML 模板。
\n',
'en-US': 'HTML template for customizing options through the default
slot of tiny-option.
'
},
- 'codeFiles': ['slot-default.vue']
+ codeFiles: ['slot-default.vue']
},
{
- 'demoId': 'slot-footer',
- 'name': { 'zh-CN': '底部插槽', 'en-US': 'Footer slot' },
- 'desc': {
+ demoId: 'slot-footer',
+ name: {
+ 'zh-CN': '底部插槽',
+ 'en-US': 'Footer slot'
+ },
+ desc: {
'zh-CN': '通过 footer
插槽自定义下拉弹框底部的 HTML 模板。
\n',
'en-US':
'Customize the HTML template at the bottom of the dropdown pop-up box through the footer
slot.
'
},
- 'codeFiles': ['slot-footer.vue']
+ codeFiles: ['slot-footer.vue']
},
{
- 'demoId': 'slot-empty',
- 'name': { 'zh-CN': '空数据插槽', 'en-US': 'Empty data slot' },
- 'desc': {
+ demoId: 'slot-empty',
+ name: {
+ 'zh-CN': '空数据插槽',
+ 'en-US': 'Empty data slot'
+ },
+ desc: {
'zh-CN': '通过 empty
插槽自定义没有选项列表时显示的 HTML 模板。
\n',
'en-US':
'Customize the HTML template displayed when there is no option list through the empty
slot.
'
},
- 'codeFiles': ['slot-empty.vue']
+ codeFiles: ['slot-empty.vue']
},
{
- 'demoId': 'slot-prefix',
- 'name': { 'zh-CN': '输入框前缀插槽', 'en-US': 'Predix slot' },
- 'desc': {
+ demoId: 'slot-prefix',
+ name: {
+ 'zh-CN': '输入框前缀插槽',
+ 'en-US': 'Predix slot'
+ },
+ desc: {
'zh-CN': '通过 prefix
插槽自定义输入框前缀的 HTML 模板。
\n',
'en-US': 'Customize the HTML template for the input box prefix through the prefix
slot.
\n'
},
- 'codeFiles': ['slot-prefix.vue']
+ codeFiles: ['slot-prefix.vue']
},
{
- 'demoId': 'slot-reference',
- 'name': { 'zh-CN': '触发源插槽', 'en-US': 'Reference slot' },
- 'desc': {
+ demoId: 'slot-reference',
+ name: {
+ 'zh-CN': '触发源插槽',
+ 'en-US': 'Reference slot'
+ },
+ desc: {
'zh-CN': '通过 reference
插槽自定义触发源的 HTML 模板。
\n',
'en-US': 'Customize the HTML template of the trigger source through the reference
slot.
'
},
- 'codeFiles': ['slot-reference.vue']
+ codeFiles: ['slot-reference.vue']
},
{
- 'demoId': 'events',
- 'name': { 'zh-CN': '事件', 'en-US': 'Events' },
- 'desc': {
- 'zh-CN':
- '' +
- '事件说明
\n' +
- 'change:监听 v-model 的值发生变化。
\n' +
- 'clear:监听单选时,点击清空按钮。
\n' +
- 'blur:监听 input 失去焦点。
\n' +
- 'focus:监听 input 获得焦点。
\n' +
- 'visible-change:监听下拉框可见状态的变化。
\n' +
- 'remove-tag:监听多选移除选中的标签。
\n' +
- '\n',
- 'en-US':
- '' +
- ' Event Description
\n' +
- 'change:Listen for changes in the value of the v-model.
' +
- 'clear:When listening to radio selection, click the clear button.
\n' +
- 'blur:Listening to input losing focus.
\n' +
- 'focus:Listening for input to gain focus.
\n' +
- 'visible-change: Listen for changes in the visible status of the dropdown box
\n' +
- 'remove-tag:Listen for multiple selections to remove selected tags.
\n' +
- '\n'
+ demoId: 'slot-label',
+ name: {
+ 'zh-CN': '标签插槽',
+ 'en-US': 'Reference slot'
},
- 'codeFiles': ['events.vue']
- }
- ],
- apis: [
- {
- 'name': 'select',
- 'type': 'component',
- 'props': [
- {
- 'name': 'allow-copy',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否允许复制输入框的内容,适用单选可搜索场景',
- 'en-US':
- 'Is it allowed to copy the content of the input box, applicable to single choice searchable scenarios'
- },
- 'demoId': 'copy-single'
- },
- {
- 'name': 'allow-create',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否允许创建新条目,需配合 filterable 使用。若搜索字段不在选项列表中,可创建为新的选项',
- 'en-US':
- 'Is it allowed to create new entries? It needs to be used in conjunction with filterable. If the search field is not in the option list, it can be created as a new option'
- },
- 'demoId': 'allow-create'
- },
- {
- 'name': 'autocomplete',
- 'type': 'string',
- 'defaultValue': "'off'",
- 'desc': {
- 'zh-CN': '输入框的原生 autocomplete 属性',
- 'en-US': 'The native autocomplete attribute of the input box'
- },
- 'demoId': 'native-properties'
- },
- {
- 'name': 'clearable',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否启用一键清除的功能',
- 'en-US': 'Whether to display the one click clear button, only applicable to radio selection'
- },
- 'demoId': 'clearable'
- },
- {
- 'name': 'clear-no-match-value',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否自动清空无法在 options 中找到匹配项的值',
- 'en-US': 'Automatically clear values that cannot find matching items in options'
- },
- 'demoId': 'clear-no-match-value'
- },
- {
- 'name': 'copyable',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否启用一键复制的功能。点击复制按钮一键复制所有标签的文本内容并以逗号分隔,仅适用于多选',
- 'en-US':
- 'Is the one click copy function enabled. Click the copy button to copy the text content of all labels with one click, separated by commas, only applicable to multiple selections'
- },
- 'demoId': 'copy-multi'
- },
- {
- 'name': 'collapse-tags',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否将多个标签折叠显示。仅适用多选',
- 'en-US': 'Whether to collapse multiple labels for display. Only applicable to multiple selections'
- },
- 'demoId': 'collapse-tags'
- },
- {
- 'name': 'cache-op',
- 'type': 'ICacheOp',
- 'typeAnchorName': 'ICacheOp',
- 'defaultValue': `
-{
- key: '',
- sortBy: 'frequency',
- sort: 'desc',
- dataKey: 'value',
- highlightClass:
- 'memorize-highlight',
- highlightNum: Infinity,
- cacheNum: Infinity,
- serialize: JSON.stringify
- deserialize: JSON.parse
-}
-
`,
- 'desc': {
- 'zh-CN': '启用本地缓存已选项的功能配置(根据用户点击选择的次数、最后时间继续存储排序)',
- 'en-US': 'Set the component type when Grid or Tree is embedded in the drop-down list box.'
- },
- 'demoId': 'cache-usage'
- },
- {
- 'name': 'default-first-option',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否启用按 Enter 键选择第一个匹配项的功能。需配合 filterable 或 remote 使用',
- 'en-US':
- 'Whether to enable the function of pressing the Enter key to select the first match. Must be used in conjunction with filterable or remote'
- },
- 'demoId': 'allow-create'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否禁用',
- 'en-US': 'Is it disabled'
- },
- 'demoId': 'disabled'
- },
- {
- 'name': 'filterable',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否可搜索',
- 'en-US': 'Is it searchable'
- },
- 'demoId': 'filter-method'
- },
- {
- 'name': 'filter-method',
- 'type': '(query: string) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义过滤方法',
- 'en-US': 'Custom filtering method'
- },
- 'demoId': 'filter-method'
- },
- {
- 'name': 'grid-op',
- 'type': 'IGridOption',
- 'typeAnchorName': 'IGridOption',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '下拉表格时,内置表格的配置,用法同 Grid 组件。需结合 render-type 属性使用',
- 'en-US':
- 'When pulling down a table, the configuration of the built-in table is the same as that of the Grid component. To be used in conjunction with the render type attribute'
- },
- 'demoId': 'nest-grid'
- },
- {
- 'name': 'input-box-type',
- 'type': "'input' | 'underline'",
- 'defaultValue': "'input'",
- 'desc': {
- 'zh-CN': '输入框的显示类型',
- 'en-US': 'Display type of input box'
- },
- 'demoId': 'input-box-type'
- },
- {
- 'name': 'is-drop-inherit-width',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '下拉弹框的宽度是否跟输入框保持一致。默认超出输入框宽度时由内容撑开',
- 'en-US':
- 'Is the width of the dropdown box consistent with the input box. By default, when the width of the input box is exceeded, it is supported by the content'
- },
- 'demoId': 'is-drop-inherit-width'
- },
- {
- 'name': 'loading',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否加载中,适用于远程搜索场景',
- 'en-US': 'Loading or not, suitable for remote search scenarios'
- },
- 'demoId': 'remote-method'
- },
- {
- 'name': 'loading-text',
- 'type': 'string',
- 'defaultValue': "'加载中'",
- 'desc': {
- 'zh-CN': '远程加载时显示的文本',
- 'en-US': 'Text displayed during remote loading'
- },
- 'demoId': 'remote-method'
- },
- {
- 'name': 'modelValue / v-model',
- 'type': 'string | number | Array',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '绑定值',
- 'en-US': 'Bind value'
- },
- 'demoId': 'multiple'
- },
- {
- 'name': 'multiple',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否允许选择多个选项',
- 'en-US': 'Allow multiple options to be selected'
- },
- 'demoId': 'multiple'
- },
- {
- 'name': 'multiple-limit',
- 'type': 'number',
- 'defaultValue': '0',
- 'desc': {
- 'zh-CN': '多选时最多可选择的个数,默认为 0 不限制',
- 'en-US':
- 'When selecting multiple options, the maximum number of options available is 0, with no limit by default'
- },
- 'demoId': 'multiple-limit'
- },
- {
- 'name': 'name',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '输入框的原生 name 属性',
- 'en-US': 'The native name attribute of the input box'
- },
- 'demoId': 'native-properties'
- },
- {
- 'name': 'no-match-text',
- 'type': 'string',
- 'defaultValue': "'无匹配数据'",
- 'desc': {
- 'zh-CN': '搜索条件无匹配时显示的文本,也可以使用 empty 插槽设置',
- 'en-US':
- 'The text displayed when there is no match for the search criteria can also be set using empty slots'
- },
- 'demoId': 'filter-method'
- },
- {
- 'name': 'no-data-text',
- 'type': 'string',
- 'defaultValue': "'暂无相关数据'",
- 'desc': {
- 'zh-CN': '选项列表为空时显示的文本,也可以使用 empty 插槽设置',
- 'en-US': 'The text displayed when the option list is empty can also be set using empty slots'
- },
- 'demoId': 'no-data-text'
- },
- {
- 'name': 'options',
- 'type': 'IOption[]',
- 'typeAnchorName': 'IOption',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '选项列表配置,使用后不需要再配置 tiny-option',
- 'en-US': 'Option list configuration, no need to configure tiny options after use'
- },
- 'demoId': 'map-field'
- },
- {
- 'name': 'placement',
- 'type': 'IPlacement',
- 'typeAnchorName': 'IPlacement',
- 'defaultValue': "'bottom-start'",
- 'desc': {
- 'zh-CN': '下拉弹框相对于触发源的弹出位置',
- 'en-US': 'The pop-up position of the pull-down pop-up box relative to the trigger source'
- },
- 'demoId': 'popup-style-position'
- },
- {
- 'name': 'placeholder',
- 'type': 'string',
- 'defaultValue': "'请选择'",
- 'desc': { 'zh-CN': '占位符', 'en-US': 'Placeholder' },
- 'demoId': 'native-properties'
- },
- {
- 'name': 'popper-class',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义下拉框的类名,用于自定义样式',
- 'en-US': 'The class name of the custom dropdown box, used for customizing styles'
- },
- 'demoId': 'popup-style-position'
- },
- {
- 'name': 'popper-append-to-body',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否将弹出框的 dom 元素插入至 body 元素',
- 'en-US': 'Whether to insert the dom element of the pop-up box into the body element'
- },
- 'demoId': 'popup-style-position'
- },
- {
- 'name': 'remote',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否为远程搜索',
- 'en-US': 'Is it a remote search'
- },
- 'demoId': 'remote-method'
- },
- {
- 'name': 'remote-method',
- 'type': '(query:string) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '远程搜索的方法',
- 'en-US': 'Remote search methods'
- },
- 'demoId': 'remote-method'
- },
- {
- 'name': 'reserve-keyword',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '多选可搜索时,是否在选中一个选项后仍然保留当前的搜索关键词',
- 'en-US':
- 'When selecting multiple searchable options, do you still keep the current search keywords after selecting one option'
- },
- 'demoId': 'remote-method'
- },
- {
- 'name': 'render-type',
- 'type': "'tree' | 'grid'",
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '渲染为下拉表格或下拉树,需结合 grid-op / tree-op 使用',
- 'en-US': 'Rendered as a dropdown table or tree, to be used in conjunction with grid op/tree op'
- },
- 'demoId': 'nest-grid'
- },
- {
- 'name': 'show-empty-image',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否显示空数据图片',
- 'en-US': 'Display empty data image'
- },
- 'demoId': 'no-data-text'
- },
- {
- 'name': 'searchable',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否启用下拉面板搜索',
- 'en-US': 'Whether to allow users to create new items. This parameter must be used together with filterable.'
- },
- 'demoId': 'searchable'
- },
- {
- 'name': 'size',
- 'type': "'medium' | 'small' | 'mini'",
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '输入框尺寸。',
- 'en-US': 'Text box size'
- },
- 'demoId': 'size'
- },
- {
- 'name': 'show-alloption',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否展示 “全选” 选项',
- 'en-US': 'Whether to display the "Select All" option'
- },
- 'demoId': 'show-alloption'
- },
- {
- 'name': 'tag-selectable',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '输入框中的标签是否可通过鼠标选中复制',
- 'en-US': 'Can the label in the input box be copied by selecting it with the mouse'
- },
- 'demoId': 'copy-multi'
- },
- {
- 'name': 'tag-type',
- 'type': "'success' | 'info' | 'warning' | 'danger'",
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '标签类型,仅多选适用。使用 aurora 主题时设置该属性为 info',
- 'en-US':
- 'Label type, only applicable for multiple choices. Set this property to info when using the aurora theme'
- },
- 'demoId': 'tag-type'
- },
- {
- 'name': 'tree-op',
- 'type': 'ITreeOption',
- 'typeAnchorName': 'ITreeOption',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '下拉树时,内置树组件的配置,用法同 Tree 组件。需结合 render-type 属性使用',
- 'en-US':
- 'When pulling down a tree, the configuration of the built-in tree component is the same as that of the Tree component. To be used in conjunction with the render type attribute'
- },
- 'demoId': 'nest-tree'
- },
- {
- 'name': 'text-split',
- 'type': 'string',
- 'defaultValue': "','",
- 'desc': {
- 'zh-CN': '自定义复制文本的分隔符,需结合 copyable 属性使用',
- 'en-US': 'The separator for custom copied text needs to be used in conjunction with the copyable attribute'
- },
- 'demoId': 'copy-multi'
- },
- {
- 'name': 'text-field',
- 'type': 'string',
- 'defaultValue': "'label'",
- 'desc': {
- 'zh-CN': '显示值字段',
- 'en-US': 'Show Value Fields'
- },
- 'demoId': 'map-field'
- },
- {
- 'name': 'value-field',
- 'type': 'string',
- 'defaultValue': "'value'",
- 'desc': {
- 'zh-CN': '绑定值字段',
- 'en-US': 'Bind Value Field'
- },
- 'demoId': 'map-field'
- },
- {
- 'name': 'value-key',
- 'type': 'string',
- 'defaultValue': "'value'",
- 'desc': {
- 'zh-CN': '作为 value 唯一标识的键名,绑定值为对象类型时必填',
- 'en-US':
- 'The key name that uniquely identifies the value must be filled in when the binding value is of object type'
- },
- 'demoId': 'binding-obj'
- }
- ],
- 'events': [
- {
- 'name': 'blur',
- 'type': '(event:MouseEvent) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '监听输入框失去焦点事件',
- 'en-US': 'Listening for input box lose focus event'
- },
- 'demoId': 'events'
- },
- {
- 'name': 'change',
- 'type': '(value:string|number|Array, list:Array) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '监听绑定值变更事件',
- 'en-US': 'Listening for binding value change events'
- },
- 'demoId': 'events'
- },
- {
- 'name': 'clear',
- 'type': '() => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '监听一键清除事件',
- 'en-US': 'Listening for one click clear events'
- },
- 'demoId': 'events'
- },
- {
- 'name': 'focus',
- 'type': '(event:MouseEvent) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '监听输入框获取焦点事件',
- 'en-US': 'Listening to input boxes to obtain focus events'
- },
- 'demoId': 'events'
- },
- {
- 'name': 'visible-change',
- 'type': '(status:boolean) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '监听下拉弹框的显示隐藏状态',
- 'en-US': 'Monitor the display and hidden status of dropdown pop ups'
- },
- 'demoId': 'events'
- },
- {
- 'name': 'remove-tag',
- 'type': '(tag:string|number) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '监听多选时移除标签事件',
- 'en-US': 'Remove label events when listening for multiple selections'
- },
- 'demoId': 'events'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '选项默认插槽',
- 'en-US': 'Option default slot'
- },
- 'demoId': 'slot-default'
- },
- {
- 'name': 'empty',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '空数据插槽',
- 'en-US': 'Empty data slot'
- },
- 'demoId': 'slot-empty'
- },
- {
- 'name': 'footer',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '下拉弹框底部插槽',
- 'en-US': 'Pull down the bottom slot of the pop-up box'
- },
- 'demoId': 'slot-footer'
- },
- {
- 'name': 'prefix',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '输入框前缀插槽',
- 'en-US': 'Input box prefix slot'
- },
- 'demoId': 'slot-prefix'
- },
- {
- 'name': 'reference',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '触发源插槽',
- 'en-US': 'Trigger Source Slot'
- },
- 'demoId': 'slot-reference'
- }
- ],
- 'methods': [
- {
- 'name': 'blur',
- 'type': '() => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '使输入框失去焦点',
- 'en-US': 'Causes the input box to lose focus'
- },
- 'demoId': 'manual-focus-blur'
- },
- {
- 'name': 'focus',
- 'type': '() => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '使输入框获取焦点',
- 'en-US': 'Bring the input box to focus'
- },
- 'demoId': 'manual-focus-blur'
- }
- ]
+ desc: {
+ 'zh-CN': '通过 label
插槽自定义多选选中标签的 HTML 模板。
\n',
+ 'en-US':
+ 'Customize the HTML template for multiple-choice selected labels through the label
slot.
'
+ },
+ codeFiles: ['slot-label.vue']
},
{
- 'name': 'option',
- 'type': 'component',
- 'props': [
- {
- 'name': 'label',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '选项的显示文本',
- 'en-US': 'Display text for option'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'value',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '选项的值',
- 'en-US': 'Value for option'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'icon',
- 'type': 'Component',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义选项的图标',
- 'en-US': 'Customize icons for options'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '选项是否禁用',
- 'en-US': 'Is the option disabled'
- },
- 'demoId': 'disabled'
- },
- {
- 'name': 'required',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '选项是否必选',
- 'en-US': 'Is it mandatory to select an option'
- },
- 'demoId': ''
- }
- /*
- // TINY-TODO: 待确认是否暴露给用户使用
- {
- 'name': 'visible',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '选项是否可见',
- 'en-US': 'Is the option visible'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'highlight-class',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '选项高亮类名',
- 'en-US': 'Is the option visible'
- },
- 'demoId': 'basic-usage'
- },
- */
- ]
- }
- ],
- types: [
- {
- name: 'IOption',
- type: 'interface',
- code: `
-interface IOption {
- value?: string | number
- label?: string
- disabled?: boolean
- icon?: Component
- required?:boolean
-}
-`
- },
- {
- name: 'ICacheOp',
- type: 'interface',
- code: `
-interface ICacheItem {
- frequency: number
- key: string
- time: number
-}
-
-interface ICacheOp {
- key: string // 本地缓存的唯一 key 值
- sortBy?: 'frequency' | 'time' // 排序的字段,默认 frequency (频次)
- sort?: 'desc' | 'asc' // 排序方式,默认 desc (降序)
- dataKey?: string // 数据中的唯一标识的 key 名称,默认 value
- highlightClass?: string // 个性化高亮 class 名称,默认:memorize-highlight
- highlightNum?: number // 高亮个性化的条数,默认:Infinity
- cacheNum?: number // 存储个性化的条数,默认:Infinity
- serialize?: ()=> string // 本地存储序列化方法,默认:JSON.stringify
- deserialize?: ()=> ICacheItem[] // 本地存储序反列化方法,默认:JSON.parse
-}
-`
- },
- {
- name: 'IGridOption',
- type: 'interface',
- code: `
-interface IGridOption {
- data: any[] // 表格数据,用法同 Grid
- columns: any[] // 列配置,用法同 Grid
-}
-`
- },
- {
- name: 'ITreeOption',
- type: 'interface',
- code: `
-interface ITreeNode {
- label: string // 默认树节点的文本字段
- id: number|string // 树节点唯一标识
- children: ITreeNode[] // 子节点
-}
-
-interface ITreeOption {
- data: ITreeNode[] // 树数据,用法同 Tree
-}
-`
- },
- {
- name: 'IPlacement',
- type: 'type',
- code: `
-type IPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end'
-`
+ demoId: 'events',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': 'Events'
+ },
+ desc: {
+ 'zh-CN':
+ '事件说明
\nchange:监听 v-model 的值发生变化。
\nclear:监听单选时,点击清空按钮。
\nblur:监听 input 失去焦点。
\nfocus:监听 input 获得焦点。
\nvisible-change:监听下拉框可见状态的变化。
\nremove-tag:监听多选移除选中的标签。
\ndropdown-click:监听下拉图标的点击事件。
\n\n',
+ 'en-US':
+ ' Event Description
\nchange:Listen for changes in the value of the v-model.
clear:When listening to radio selection, click the clear button.
\nblur:Listening to input losing focus.
\nfocus:Listening for input to gain focus.
\nvisible-change: Listen for changes in the visible status of the dropdown box
\nremove-tag:Listen for multiple selections to remove selected tags.
\ndropdown-click:Listens to the click event of the drop-down icon.
\n\n'
+ },
+ codeFiles: ['events.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/skeleton/webdoc/skeleton.js b/examples/sites/demos/pc/app/skeleton/webdoc/skeleton.js
index d856188fb..9d27fee9e 100644
--- a/examples/sites/demos/pc/app/skeleton/webdoc/skeleton.js
+++ b/examples/sites/demos/pc/app/skeleton/webdoc/skeleton.js
@@ -3,205 +3,99 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'base',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'base',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '基础的骨架效果。
\n',
'en-US': 'Basic skeleton effect.
\n'
},
- 'codeFiles': ['base.vue']
+ codeFiles: ['base.vue']
},
{
- 'demoId': 'complex-demo',
- 'name': { 'zh-CN': '复杂的组合', 'en-US': 'Complex Demo' },
- 'desc': {
+ demoId: 'complex-demo',
+ name: {
+ 'zh-CN': '复杂的组合',
+ 'en-US': 'Complex Demo'
+ },
+ desc: {
'zh-CN': '更复杂的组合,通过 avatar
属性控制骨架段落左侧出现头像占位。
\n',
'en-US':
'More complex combinations, use the avatar
attribute to control the appearance of the avatar placeholder on the left side of the skeleton paragraph.
\n'
},
- 'codeFiles': ['complex-demo.vue']
+ codeFiles: ['complex-demo.vue']
},
{
- 'demoId': 'custom-rows',
- 'name': { 'zh-CN': '自定义段落行数', 'en-US': 'Custom rows' },
- 'desc': {
+ demoId: 'custom-rows',
+ name: {
+ 'zh-CN': '自定义段落行数',
+ 'en-US': 'Custom rows'
+ },
+ desc: {
'zh-CN':
'段落默认渲染 4 行,通过 rows
属性控制段落行数,显示的数量会比传入的数量多 1,首行会被渲染一个长度 40% 的段首,末行会被渲染一个长度 60% 的段尾。
\n',
'en-US':
'By default, paragraphs are rendered in 4 lines. The number of paragraph lines is controlled through the rows
attribute. The number displayed will be 1 more than the number passed in. The first line will render the paragraph header at 40% length, and the last line will render the paragraph trailer at 60% length.
\n'
},
- 'codeFiles': ['custom-rows.vue']
+ codeFiles: ['custom-rows.vue']
},
{
- 'demoId': 'custom-layout',
- 'name': { 'zh-CN': '自定义排版', 'en-US': 'Custom layout' },
- 'desc': {
+ demoId: 'custom-layout',
+ name: {
+ 'zh-CN': '自定义排版',
+ 'en-US': 'Custom layout'
+ },
+ desc: {
'zh-CN':
'当默认排版不满足需求时,可自定义排版结构,通过 class
和 style
可自定义宽高等样式。
\n',
'en-US':
'When the default layout does not meet the needs, the layout structure can be customized, and styles such as width and height can be customized through class
and style
.
\n'
},
- 'codeFiles': ['custom-layout.vue']
+ codeFiles: ['custom-layout.vue']
},
{
- 'demoId': 'loading-completed',
- 'name': { 'zh-CN': '加载完成', 'en-US': 'Loading completed' },
- 'desc': {
+ demoId: 'loading-completed',
+ name: {
+ 'zh-CN': '加载完成',
+ 'en-US': 'Loading completed'
+ },
+ desc: {
'zh-CN':
'通过 loading
属性的值来表示是否加载完成。 可以通过具名插槽 default
来构建 loading
结束之后需要展示的真实 DOM 元素结构。
\n',
'en-US':
'Whether the loading is completed is indicated by the value of the loading
attribute. You can use the named slot default
to build the real DOM element structure that needs to be displayed after loading
ends.
\n'
},
- 'codeFiles': ['loading-completed.vue']
+ codeFiles: ['loading-completed.vue']
},
{
- 'demoId': 'custom-paragraph-width',
- 'name': { 'zh-CN': '自定义段落宽度', 'en-US': 'Custom paragraph width' },
- 'desc': {
+ demoId: 'custom-paragraph-width',
+ name: {
+ 'zh-CN': '自定义段落宽度',
+ 'en-US': 'Custom paragraph width'
+ },
+ desc: {
'zh-CN':
'rows-width
属性可以自定义段落宽度,数组中的每一项可以为 number
或 string
,当为 number
时,组件会自动增加 px
单位。
\n',
'en-US':
'The rows-width
attribute can customize the paragraph width. Each item in the array can be number
or string
. When it is number< /code>, the component will automatically increase the px
unit
\n'
},
- 'codeFiles': ['custom-paragraph-width.vue']
+ codeFiles: ['custom-paragraph-width.vue']
},
{
- 'demoId': 'fine-grained-mode',
- 'name': { 'zh-CN': '细粒度模式', 'en-US': 'Fine-grained mode' },
- 'desc': {
+ demoId: 'fine-grained-mode',
+ name: {
+ 'zh-CN': '细粒度模式',
+ 'en-US': 'Fine-grained mode'
+ },
+ desc: {
'zh-CN':
'细粒度模式,variant
属性可以控制 skeleton-item
的形态,可选值:image / circle / square。size
属性可以控制 skeleton-item
的大小,可选值:medium / small / large。
\n',
'en-US':
'Fine-grained mode, the variant
attribute can control the shape of skeleton-item
, optional values: image / circle / square. The size
attribute can control the size of skeleton-item
. Optional values: medium / small / large.
\n'
},
- 'codeFiles': ['fine-grained-mode.vue']
- }
- ],
- apis: [
- {
- 'name': 'skeleton',
- 'type': 'component',
- 'props': [
- {
- 'name': 'loading',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否显示骨架屏,传 false 时会展示加载完成后的内容',
- 'en-US':
- 'Customized interface. A Promise object is returned. This parameter is mandatory when the framework service is not used.'
- },
- 'demoId': 'custom-layout'
- },
- {
- 'name': 'active',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否开启动画',
- 'en-US':
- 'Customized interface. A Promise object is returned. This parameter is mandatory when the framework service is not used.'
- },
- 'demoId': 'fine-grained-mode'
- },
- {
- 'name': 'avatar',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否显示头像',
- 'en-US':
- 'Customized interface. A Promise object is returned. This parameter is mandatory when the framework service is not used.'
- },
- 'demoId': 'complex-demo'
- },
- {
- 'name': 'rows',
- 'type': 'number',
- 'defaultValue': '3',
- 'desc': {
- 'zh-CN': '默认排版,可配置段落显示行数',
- 'en-US':
- 'Customized interface. A Promise object is returned. This parameter is mandatory when the framework service is not used.'
- },
- 'demoId': 'custom-rows'
- },
- {
- 'name': 'rows-width',
- 'type': 'number[] | string[]',
- 'defaultValue': '[]',
- 'desc': {
- 'zh-CN': '自定义段落每一行的宽度',
- 'en-US':
- 'Customized interface. A Promise object is returned. This parameter is mandatory when the framework service is not used.'
- },
- 'demoId': 'custom-paragraph-width'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '加载完成后显示的内容',
- 'en-US': 'Option default slot'
- },
- 'demoId': 'custom-layout'
- },
- {
- 'name': 'placeholder',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义骨架屏结构',
- 'en-US': 'Option default slot'
- },
- 'demoId': 'custom-layout'
- }
- ]
- },
- {
- 'name': 'skeleton-item',
- 'type': 'component',
- 'props': [
- {
- 'name': 'variant',
- 'type': 'IVariant',
- 'typeAnchorName': 'IVariant',
- 'defaultValue': 'square',
- 'desc': {
- 'zh-CN': '骨架屏形态',
- 'en-US':
- 'Customized interface. A Promise object is returned. This parameter is mandatory when the framework service is not used.'
- },
- 'demoId': 'fine-grained-mode'
- },
- {
- 'name': 'size',
- 'type': 'ISize',
- 'typeAnchorName': 'ISize',
- 'defaultValue': 'medium',
- 'desc': {
- 'zh-CN': '针对 image 和 circle 形态,内置三种大小',
- 'en-US':
- 'Customized interface. A Promise object is returned. This parameter is mandatory when the framework service is not used.'
- },
- 'demoId': 'fine-grained-mode'
- }
- ]
- }
- ],
- types: [
- {
- name: 'IVariant',
- type: 'type',
- code: `type IVariant = 'image' | 'circle' | 'square'`
- },
- {
- name: 'ISize',
- type: 'type',
- code: `type ISize = 'large' | 'medium' | 'small'`
+ codeFiles: ['fine-grained-mode.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/slide-bar/webdoc/slide-bar.js b/examples/sites/demos/pc/app/slide-bar/webdoc/slide-bar.js
index 40c470868..174c8db71 100644
--- a/examples/sites/demos/pc/app/slide-bar/webdoc/slide-bar.js
+++ b/examples/sites/demos/pc/app/slide-bar/webdoc/slide-bar.js
@@ -7,129 +7,66 @@ export default {
},
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '通过:init-blocks="4"
设置可显示的块数。',
'en-US': 'Set the number of blocks that can be displayed through: init blocks="4"
.'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'wheel-blocks',
- 'name': { 'zh-CN': '每次滚动块数', 'en-US': 'Number of blocks scrolled each time' },
- 'desc': {
+ demoId: 'wheel-blocks',
+ name: {
+ 'zh-CN': '每次滚动块数',
+ 'en-US': 'Number of blocks scrolled each time'
+ },
+ desc: {
'zh-CN':
'通过 wheel-blocks
设置每次滚动块数。\n通过 value
调用服务时候获取数据的来源。
\n',
'en-US':
'You can use wheel-blocks
to set the number of blocks to be scrolled each time. \nThe data source can be obtained when the service is invoked through value
.
\n'
},
- 'codeFiles': ['wheel-blocks.vue']
+ codeFiles: ['wheel-blocks.vue']
},
{
- 'demoId': 'custom-content',
- 'name': { 'zh-CN': '自定义滚动块内容', 'en-US': 'Custom Scroll Block Content' },
- 'desc': {
+ demoId: 'custom-content',
+ name: {
+ 'zh-CN': '自定义滚动块内容',
+ 'en-US': 'Custom Scroll Block Content'
+ },
+ desc: {
'zh-CN': '通过插槽自定义滚动块内容。
\n',
'en-US': 'Customize the scroll block content by slot.
\n'
},
- 'codeFiles': ['custom-content.vue']
+ codeFiles: ['custom-content.vue']
},
{
- 'demoId': 'custom-tag',
- 'name': { 'zh-CN': '自定义 DOM 标签', 'en-US': 'Customized DOM Label' },
- 'desc': {
+ demoId: 'custom-tag',
+ name: {
+ 'zh-CN': '自定义 DOM 标签',
+ 'en-US': 'Customized DOM Label'
+ },
+ desc: {
'zh-CN': '通过 tag sub-tag
自定义 DOM 标签。
\n',
'en-US': 'You can use tag sub-tag
to customize DOM tags.
\n'
},
- 'codeFiles': ['custom-tag.vue']
+ codeFiles: ['custom-tag.vue']
},
{
- 'demoId': 'slide-bar-events',
- 'name': { 'zh-CN': '滚动块事件', 'en-US': 'Scroll Block Event' },
- 'desc': {
+ demoId: 'slide-bar-events',
+ name: {
+ 'zh-CN': '滚动块事件',
+ 'en-US': 'Scroll Block Event'
+ },
+ desc: {
'zh-CN': '通过@before-click
触发滑动点击前事件。',
'en-US': 'Trigger the pre click event by@ before click
.'
},
- 'codeFiles': ['slide-bar-events.vue']
- }
- ],
- apis: [
- {
- 'name': 'slide-bar',
- 'type': 'component',
- 'props': [
- {
- 'name': 'value',
- 'type': 'Array',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '调用服务时候获取数据的来源', 'en-US': 'Data source obtained during service invoking' },
- 'demoId': 'wheel-blocks'
- },
- {
- 'name': 'init-blocks',
- 'type': 'number',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '初始时需要显示的块数', 'en-US': 'Number of blocks to be displayed initially' },
- 'demoId': 'wheel-blocks'
- },
- {
- 'name': 'wheel-blocks',
- 'type': 'number',
- 'defaultValue': '该属性的默认值为 1',
- 'desc': {
- 'zh-CN': '鼠标滚轮上下滚动的时候,滚动的块数长度',
- 'en-US': 'Number of scrolling blocks when the mouse wheel is scrolled up or down'
- },
- 'demoId': 'wheel-blocks'
- },
- {
- 'name': 'tag',
- 'type': 'string',
- 'defaultValue': `该属性的默认值为 'ul'`,
- 'desc': { 'zh-CN': '设置组件的 Dom 标签', 'en-US': 'Setting the Dom Label of a Component' },
- 'demoId': 'custom-tag'
- },
- {
- 'name': 'sub-tag',
- 'type': 'string',
- 'defaultValue': `该属性的默认值为 'li'`,
- 'desc': { 'zh-CN': '设置组件的子级 Dom 标签', 'en-US': 'Setting the Dom Label of a Component' },
- 'demoId': 'custom-tag'
- }
- ],
- 'events': [
- {
- 'name': 'before-click',
- 'type': 'Function(value)',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '滑动点击前触发的事件;event: 原生事件',
- 'en-US': 'Event triggered before a user swipes the screen. event: Native event'
- },
- 'demoId': 'slide-bar-events'
- },
- {
- 'name': 'click',
- 'type': 'Function(data, index)',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '滑动块点击事件;data: 点击的滑块数据,index: 点击的滑块索引值',
- 'en-US':
- 'Sliding block click event; data: data of the clicked slider, index: index value of the clicked slider'
- },
- 'demoId': 'slide-bar-events'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '默认的作用域插槽', 'en-US': 'Default scope slot' },
- 'demoId': 'custom-content'
- }
- ]
+ codeFiles: ['slide-bar-events.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/slider/webdoc/slider.js b/examples/sites/demos/pc/app/slider/webdoc/slider.js
index 914bd2c5c..fe77ca010 100644
--- a/examples/sites/demos/pc/app/slider/webdoc/slider.js
+++ b/examples/sites/demos/pc/app/slider/webdoc/slider.js
@@ -3,270 +3,155 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '', 'en-US': '' },
- 'codeFiles': ['basic-usage.vue']
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '',
+ 'en-US': ''
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'vertical-mode',
- 'name': { 'zh-CN': '竖向模式', 'en-US': 'vertical mode' },
- 'desc': {
+ demoId: 'vertical-mode',
+ name: {
+ 'zh-CN': '竖向模式',
+ 'en-US': 'vertical mode'
+ },
+ desc: {
'zh-CN':
'通过设置vertical
属性来展示滑块竖向模式(不设置,默认为横向模式)\n竖向模式可以通过 height
设置组件高度。
\n',
'en-US':
'The vertical mode of the slider is displayed by setting the vertical
attribute. landscape mode by default)\nIn vertical mode, you can set the height of the component by calling height
\n'
},
- 'codeFiles': ['vertical-mode.vue']
+ codeFiles: ['vertical-mode.vue']
},
{
- 'demoId': 'max-min',
- 'name': { 'zh-CN': '最大最小值', 'en-US': 'Maximum/Minimum' },
- 'desc': {
+ demoId: 'max-min',
+ name: {
+ 'zh-CN': '最大最小值',
+ 'en-US': 'Maximum/Minimum'
+ },
+ desc: {
'zh-CN': '
通过设置min
max
来设置滑块取值范围。
',
'en-US': 'Set min
max
to set the value range of the slider.
'
},
- 'codeFiles': ['max-min.vue']
+ codeFiles: ['max-min.vue']
},
{
- 'demoId': 'format-tooltip',
- 'name': { 'zh-CN': '提示当前值', 'en-US': 'Prompt current value' },
- 'desc': {
+ demoId: 'format-tooltip',
+ name: {
+ 'zh-CN': '提示当前值',
+ 'en-US': 'Prompt current value'
+ },
+ desc: {
'zh-CN': '通过设置format-tooltip
来格式化提示值。
',
'en-US': 'Set format-tooltip
to set the format the prompt value
\n'
},
- 'codeFiles': ['format-tooltip.vue']
+ codeFiles: ['format-tooltip.vue']
},
{
- 'demoId': 'range-select',
- 'name': { 'zh-CN': '范围选择', 'en-US': 'Range Selection' },
- 'desc': {
+ demoId: 'range-select',
+ name: {
+ 'zh-CN': '范围选择',
+ 'en-US': 'Range Selection'
+ },
+ desc: {
'zh-CN': '通过v-model
为数组 设定初始范围选择。
',
'en-US': 'Set the initial range selection for the array through v-model
'
},
- 'codeFiles': ['range-select.vue']
+ codeFiles: ['range-select.vue']
},
{
- 'demoId': 'show-input',
- 'name': { 'zh-CN': '输入框模式', 'en-US': 'Text box mode' },
- 'desc': {
+ demoId: 'show-input',
+ name: {
+ 'zh-CN': '输入框模式',
+ 'en-US': 'Text box mode'
+ },
+ desc: {
'zh-CN':
'通过配置show-input
,开启滑块输入框模式。可以通过配置unit
来决定输入框后面显示的单位。
',
'en-US':
'Enable the slider text box mode by configuring show-input
。You can determine the units displayed after the input box by configuringunit
.
'
},
- 'codeFiles': ['show-input.vue']
+ codeFiles: ['show-input.vue']
},
{
- 'demoId': 'shortcut-operation',
- 'name': { 'zh-CN': '快捷键操作', 'en-US': 'Shortcut Key Operations' },
- 'desc': {
+ demoId: 'shortcut-operation',
+ name: {
+ 'zh-CN': '快捷键操作',
+ 'en-US': 'Shortcut Key Operations'
+ },
+ desc: {
'zh-CN':
'通过设置num-pages
总步数,即按快捷键 PageDown/PageUp 时,每次移动的距离是 "⌈(max-min)/num-pages⌉"。
',
'en-US':
'Set num-pages
the total number of steps. That is, when you press the shortcut key PageDown or PageUp, the moving distance is "⌈(max-min)/num-pages⌉"。
'
},
- 'codeFiles': ['shortcut-operation.vue']
+ codeFiles: ['shortcut-operation.vue']
},
{
- 'demoId': 'dynamic-disable',
- 'name': { 'zh-CN': '禁用', 'en-US': 'Disabled' },
- 'desc': {
+ demoId: 'dynamic-disable',
+ name: {
+ 'zh-CN': '禁用',
+ 'en-US': 'Disabled'
+ },
+ desc: {
'zh-CN': '通过设置属性disabled
,设置滑动滑块禁止滑动。
',
'en-US': 'Set the attribute disabled
to disable the sliding slider。
'
},
- 'codeFiles': ['dynamic-disable.vue']
+ codeFiles: ['dynamic-disable.vue']
},
{
- 'demoId': 'show-tip',
- 'name': { 'zh-CN': '提示', 'en-US': 'Prompt' },
- 'desc': {
+ demoId: 'show-tip',
+ name: {
+ 'zh-CN': '提示',
+ 'en-US': 'Prompt'
+ },
+ desc: {
'zh-CN': '通过设定:show-tip="false"
,关闭滑块提示。(默认开启)。
',
'en-US':
'Disable the slider prompt by setting :show-tip="false"
. (enabled by default)。
'
},
- 'codeFiles': ['show-tip.vue']
+ codeFiles: ['show-tip.vue']
},
{
- 'demoId': 'about-step',
- 'name': { 'zh-CN': '步长', 'en-US': 'Step' },
- 'desc': {
+ demoId: 'about-step',
+ name: {
+ 'zh-CN': '步长',
+ 'en-US': 'Step'
+ },
+ desc: {
'zh-CN': '通过设置step
来配置滑块滑动的步长。
',
'en-US': 'Set step
to configure the slider sliding step。
'
},
- 'codeFiles': ['about-step.vue']
+ codeFiles: ['about-step.vue']
},
{
- 'demoId': 'slider-slot',
- 'name': { 'zh-CN': '自定义插槽', 'en-US': 'Custom Slot' },
- 'desc': { 'zh-CN': '显示滑块值的插槽。', 'en-US': 'A slot for displaying details。' },
- 'codeFiles': ['slider-slot.vue']
+ demoId: 'slider-slot',
+ name: {
+ 'zh-CN': '自定义插槽',
+ 'en-US': 'Custom Slot'
+ },
+ desc: {
+ 'zh-CN': '显示滑块值的插槽。',
+ 'en-US': 'A slot for displaying details。'
+ },
+ codeFiles: ['slider-slot.vue']
},
{
- 'demoId': 'slider-event',
- 'name': { 'zh-CN': '事件', 'en-US': 'Event' },
- 'desc': { 'zh-CN': 'change、start、stop 事件。
', 'en-US': 'change, start, stop events.
' },
- 'codeFiles': ['slider-event.vue']
- }
- ],
- apis: [
- {
- 'name': 'slider',
- 'type': 'component',
- 'props': [
- {
- 'name': 'v-model',
- 'type': 'number | [number, number]',
- 'desc': {
- 'zh-CN': '设置单滑块的当前值,必需是整数或数组',
- 'en-US': 'Sets the current value of a single slider. The value must be an integer or an array.'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否禁用', 'en-US': 'Disable' },
- 'demoId': 'dynamic-disable'
- },
- {
- 'name': 'min',
- 'type': 'number',
- 'defaultValue': '0',
- 'desc': { 'zh-CN': '设置最小值', 'en-US': 'Set the minimum value' },
- 'demoId': 'max-min'
- },
- {
- 'name': 'max',
- 'type': 'number',
- 'defaultValue': '100',
- 'desc': {
- 'zh-CN': '设置最大值,必需是整数,可以负数,必需大于所设置的最小值',
- 'en-US':
- 'Set the maximum value. The value must be an integer and can be a negative number. The value must be greater than the minimum value set'
- },
- 'demoId': 'max-min'
- },
- {
- 'name': 'step',
- 'type': 'number',
- 'defaultValue': '1',
- 'desc': {
- 'zh-CN': '设置滑块移动时,每步位移距离,必需是大于0的正整数',
- 'en-US':
- 'Displacement distance of each step when the slider moves. The value must be a positive integer greater than 0'
- },
- 'demoId': 'about-step'
- },
- {
- 'name': 'show-input',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否显示输入框,仅在非范围选择时有效',
- 'en-US': 'Indicates whether to display the text box. This parameter is valid only for non-range selection'
- },
- 'demoId': 'show-input'
- },
- {
- 'name': 'unit',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '输入框后面显示的单位,仅在输入框模式下有效',
- 'en-US': 'The units displayed after the input box, only valid in input box mode'
- },
- 'demoId': 'show-input'
- },
- {
- 'name': 'format-tooltip',
- 'type': '(currentValue: number) => string',
- 'desc': { 'zh-CN': '格式化 tooltip 提示', 'en-US': 'Format tooltip message' },
- 'demoId': 'show-tip'
- },
- {
- 'name': 'vertical',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否竖向模式', 'en-US': 'Whether the vertical mode is used' },
- 'demoId': 'vertical-mode'
- },
- {
- 'name': 'height',
- 'type': 'string',
- 'defaultValue': `'300px'`,
- 'desc': {
- 'zh-CN': 'Slider 组件的高度,当 vertical 为 true 时有效',
- 'en-US': 'Height of Slider component, effective when vertical is true'
- },
- 'demoId': 'vertical-mode'
- },
- {
- 'name': 'num-pages',
- 'type': 'number',
- 'defaultValue': '1',
- 'desc': {
- 'zh-CN': '设置总步数,即按快捷键 PageDown/PageUp 时,每次移动的距离是 "⌈(max-min)/num-pages⌉"',
- 'en-US':
- 'Set the total number of steps. That is, when you press PageDown or PageUp, the moving distance is "⌈(max-min)/num-pages⌉".'
- },
- 'demoId': 'shortcut-operation'
- },
- {
- 'name': 'show-tip',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': { 'zh-CN': '是否显示 tooltip', 'en-US': 'Whether to display tooltip' },
- 'demoId': 'show-tip'
- }
- ],
- 'events': [
- {
- 'name': 'change',
- 'type': '(value: number | [number, number]) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '值改变时触发(使用鼠标拖曳时,只在松开鼠标后触发)',
- 'en-US':
- 'Triggered when the value changes (When you drag the mouse, it is triggered only after you release the mouse).'
- },
- 'demoId': 'slider-event'
- },
- {
- 'name': 'start',
- 'type': '(event: Event, value: number | [number, number]) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置滑块滑动开始时,触发该事件',
- 'en-US': 'This event is triggered when the slider starts to slide.'
- },
- 'demoId': 'slider-event'
- },
- {
- 'name': 'stop',
- 'type': '(value: number | [number, number]) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置滑块滑动结束时,触发该事件',
- 'en-US': 'This event is triggered when the slider sliding ends. '
- },
- 'demoId': 'slider-event'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '显示滑块值的插槽,仅仅 v-model 是单数值时才有效,插槽参数为:slotArg: { slotScope: number }',
- 'en-US':
- 'Slot for displaying slider values, valid only if v-model is a single value. Slot parameters are: slotArg: {slotScope: number}'
- },
- 'demoId': 'slider-slot'
- }
- ]
+ demoId: 'slider-event',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': 'Event'
+ },
+ desc: {
+ 'zh-CN': 'change、start、stop 事件。
',
+ 'en-US': 'change, start, stop events.
'
+ },
+ codeFiles: ['slider-event.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/split/webdoc/split.js b/examples/sites/demos/pc/app/split/webdoc/split.js
index 075b17538..951c28962 100644
--- a/examples/sites/demos/pc/app/split/webdoc/split.js
+++ b/examples/sites/demos/pc/app/split/webdoc/split.js
@@ -3,307 +3,203 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['basic-usage.vue']
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'split-threshold',
- 'name': {
+ demoId: 'split-threshold',
+ name: {
'zh-CN': '面板阈值',
'en-US': 'Panel Threshold'
},
- 'desc': {
+ desc: {
'zh-CN':
'通过 left-top-min
设置左上方面板拖动的最小高度,通过 right-bottom-min
设置右下方面板拖动的最小高度
',
'en-US': 'For details, see the following example.'
},
- 'codeFiles': ['split-threshold.vue']
+ codeFiles: ['split-threshold.vue']
},
{
- 'demoId': 'split-mode',
- 'name': { 'zh-CN': '分割方式', 'en-US': 'Split Mode' },
- 'desc': {
+ demoId: 'split-mode',
+ name: {
+ 'zh-CN': '分割方式',
+ 'en-US': 'Split Mode'
+ },
+ desc: {
'zh-CN':
'同个mode设置分割类型,可选值为 horizontal
(横向) 或 vertical
(纵向);默认值horizontal
。
\n',
'en-US':
'Split type of the same mode. The options are horizontal
(horizontal) and vertical
(vertical). The default value is horizontal
.
\n'
},
- 'codeFiles': ['split-mode.vue']
+ codeFiles: ['split-mode.vue']
},
{
- 'demoId': 'movestart-event',
- 'name': { 'zh-CN': 'movestart 事件', 'en-US': 'movestart event' },
- 'desc': { 'zh-CN': '开始移动事件
\n', 'en-US': 'Start moving event
\n' },
- 'codeFiles': ['movestart-event.vue']
+ demoId: 'movestart-event',
+ name: {
+ 'zh-CN': 'movestart 事件',
+ 'en-US': 'movestart event'
+ },
+ desc: {
+ 'zh-CN': '开始移动事件
\n',
+ 'en-US': 'Start moving event
\n'
+ },
+ codeFiles: ['movestart-event.vue']
},
{
- 'demoId': 'moving-event',
- 'name': { 'zh-CN': 'moving 事件', 'en-US': 'Moving Event' },
- 'desc': { 'zh-CN': '移动中事件
\n', 'en-US': 'Moving Event
\n' },
- 'codeFiles': ['moving-event.vue']
+ demoId: 'moving-event',
+ name: {
+ 'zh-CN': 'moving 事件',
+ 'en-US': 'Moving Event'
+ },
+ desc: {
+ 'zh-CN': '移动中事件
\n',
+ 'en-US': 'Moving Event
\n'
+ },
+ codeFiles: ['moving-event.vue']
},
{
- 'demoId': 'moveend-event',
- 'name': { 'zh-CN': 'moveend 事件', 'en-US': 'moveend event' },
- 'desc': { 'zh-CN': '移动完成事件
\n', 'en-US': 'Move completion event
\n' },
- 'codeFiles': ['moveend-event.vue']
+ demoId: 'moveend-event',
+ name: {
+ 'zh-CN': 'moveend 事件',
+ 'en-US': 'moveend event'
+ },
+ desc: {
+ 'zh-CN': '移动完成事件
\n',
+ 'en-US': 'Move completion event
\n'
+ },
+ codeFiles: ['moveend-event.vue']
},
{
- 'demoId': 'event-click',
- 'name': { 'zh-CN': '点击事件', 'en-US': 'click event' },
- 'desc': {
+ demoId: 'event-click',
+ name: {
+ 'zh-CN': '点击事件',
+ 'en-US': 'click event'
+ },
+ desc: {
'zh-CN':
'left-top-click
事件点击左箭头收起时触发, right-bottom-click
事件点击右箭头收起时触发
\n',
'en-US':
' left-top-click
事件点击左箭头收起时触发,right-bottom-click
事件点击右箭头收起时触发
\n'
},
- 'codeFiles': ['event-click.vue']
+ codeFiles: ['event-click.vue']
},
{
- 'demoId': 'left-right-slot',
- 'name': { 'zh-CN': '左右面板插槽', 'en-US': 'Slots on the left and right panels' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['left-right-slot.vue']
+ demoId: 'left-right-slot',
+ name: {
+ 'zh-CN': '左右面板插槽',
+ 'en-US': 'Slots on the left and right panels'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['left-right-slot.vue']
},
{
- 'demoId': 'top-bottom-slot',
- 'name': { 'zh-CN': '上下面板插槽', 'en-US': 'Slots on the upper and lower panels' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['top-bottom-slot.vue']
+ demoId: 'top-bottom-slot',
+ name: {
+ 'zh-CN': '上下面板插槽',
+ 'en-US': 'Slots on the upper and lower panels'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['top-bottom-slot.vue']
},
{
- 'demoId': 'trigger-slot',
- 'name': { 'zh-CN': '拖拽插槽', 'en-US': 'Drag Slot' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['trigger-slot.vue']
+ demoId: 'trigger-slot',
+ name: {
+ 'zh-CN': '拖拽插槽',
+ 'en-US': 'Drag Slot'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['trigger-slot.vue']
},
{
- 'demoId': 'nested-use',
- 'name': { 'zh-CN': '嵌套使用', 'en-US': 'Nested' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['nested-use.vue']
+ demoId: 'nested-use',
+ name: {
+ 'zh-CN': '嵌套使用',
+ 'en-US': 'Nested'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['nested-use.vue']
},
{
- 'demoId': 'disabled-drag',
- 'name': { 'zh-CN': '禁用拖拽', 'en-US': 'disabled drag' },
- 'desc': {
+ demoId: 'disabled-drag',
+ name: {
+ 'zh-CN': '禁用拖拽',
+ 'en-US': 'disabled drag'
+ },
+ desc: {
'zh-CN': '通过 disabled
来禁用拖拽',
'en-US': 'Use disabled
to disable drag and drop.'
},
- 'codeFiles': ['disabled-drag.vue']
+ codeFiles: ['disabled-drag.vue']
},
{
- 'demoId': 'trigger-simple',
- 'name': { 'zh-CN': '简易模式', 'en-US': 'Simple mode' },
- 'desc': {
+ demoId: 'trigger-simple',
+ name: {
+ 'zh-CN': '简易模式',
+ 'en-US': 'Simple mode'
+ },
+ desc: {
'zh-CN': '通过 trigger-simple
来启用简易模式',
'en-US': 'Use trigger-simple
to enable the simple mode.'
},
- 'codeFiles': ['trigger-simple.vue']
+ codeFiles: ['trigger-simple.vue']
},
{
- 'demoId': 'horizontal-collapse',
- 'name': { 'zh-CN': '简易模式中,双向展开', 'en-US': 'In simple mode, two-way deployment' },
- 'desc': {
+ demoId: 'horizontal-collapse',
+ name: {
+ 'zh-CN': '简易模式中,双向展开',
+ 'en-US': 'In simple mode, two-way deployment'
+ },
+ desc: {
'zh-CN': '通过 collapse-left-top、collapse-right-bottom
来启用简易模式的双向展开按钮',
'en-US':
'Use collapse-left-top, collapse-right-bottom
to enable the bidirectional expansion button in simple mode.'
},
- 'codeFiles': ['horizontal-collapse.vue']
+ codeFiles: ['horizontal-collapse.vue']
},
{
- 'demoId': 'horizontal-collapse-left-top',
- 'name': { 'zh-CN': '简易模式中,单向展开', 'en-US': 'In simple mode, one-way deployment' },
- 'desc': {
+ demoId: 'horizontal-collapse-left-top',
+ name: {
+ 'zh-CN': '简易模式中,单向展开',
+ 'en-US': 'In simple mode, one-way deployment'
+ },
+ desc: {
'zh-CN': '通过 collapse-left-top 或 collapse-right-bottom
来启用简易模式的单向展开按钮',
'en-US':
'Use collapse-left-top or collapse-right-bottom
to enable one-way expansion buttons in simple mode'
},
- 'codeFiles': ['horizontal-collapse-left-top.vue']
+ codeFiles: ['horizontal-collapse-left-top.vue']
},
{
- 'demoId': 'three-areas',
- 'name': { 'zh-CN': '支持配置3个区块', 'en-US': 'Three blocks can be configured' },
- 'desc': {
+ demoId: 'three-areas',
+ name: {
+ 'zh-CN': '支持配置3个区块',
+ 'en-US': 'Three blocks can be configured'
+ },
+ desc: {
'zh-CN': '通过 three-areas
来启用三个区块模式',
'en-US': 'Use three-areas
to enable the three-area mode.'
},
- 'codeFiles': ['three-areas.vue']
- }
- ],
- apis: [
- {
- 'name': 'split',
- 'type': 'component',
- 'props': [
- {
- 'name': 'mode',
- 'type': `'horizontal' | 'vertical'`,
- 'defaultValue': 'horizontal',
- 'desc': {
- 'zh-CN': '分割类型,可选值为 horizontal 或 vertical;默认值horizontal',
- 'en-US':
- 'Separation type. The value can be horizontal or vertical. The default value is horizontal. ;The optional values of this attribute are horizontal / vertical'
- },
- 'demoId': 'split-mode'
- },
- {
- 'name': 'collapse-left-top',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '简易模式启用左/上展开收起按钮',
- 'en-US': 'Easy Mode Enables Left/Top Expand Collapse Button'
- },
- 'demoId': 'split-threshold'
- },
- {
- 'name': 'collapse-right-bottom',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '简易模式启用右/下展开收起按钮',
- 'en-US': 'Easy Mode Enables Right/Down Expand Collapse Button'
- },
- 'demoId': 'split-threshold'
- },
- {
- 'name': ' disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '分割线是否禁用拖拽',
- 'en-US': 'Indicates whether to disable dragging of the split line.'
- },
- 'demoId': 'split-threshold'
- },
- {
- 'name': 'left-top-min',
- 'type': 'number | string',
- 'defaultValue': '40px',
- 'desc': { 'zh-CN': '左面板 / 上面板最小阈值', 'en-US': 'Minimum threshold on the left or upper panel.' },
- 'demoId': 'split-threshold'
- },
- {
- 'name': 'right-bottom-min',
- 'type': 'number | string',
- 'defaultValue': '40px',
- 'desc': { 'zh-CN': '右面板 / 下面板最小阈值', 'en-US': 'Minimum threshold on the right or lower panel.' },
- 'demoId': 'split-threshold'
- },
- {
- 'name': 'modelValue',
- 'type': 'number | string',
- 'defaultValue': '0.5',
- 'desc': { 'zh-CN': '分割面板的位置', 'en-US': 'Position of the split panel.' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'three-areas',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '配置3个区块', 'en-US': 'Three blocks are configured.' },
- 'demoId': 'split-threshold'
- },
- {
- 'name': 'trigger-simple ',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '分割线是否为简易模式', 'en-US': 'Indicates whether the split line is in simple mode.' },
- 'demoId': 'split-threshold'
- }
- ],
- 'events': [
- {
- 'name': 'moveend',
- 'type': '()=> void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '拖拽结束的事件',
- 'en-US': 'Drag end event. ;Drag end event. ;No arguments'
- },
- 'demoId': 'moveend-event'
- },
- {
- 'name': 'movestart',
- 'type': '()=> void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '拖拽开始的事件',
- 'en-US': 'Drag start event. ;Drag start event. ;No arguments'
- },
- 'demoId': 'movestart-event'
- },
- {
- 'name': 'moving',
- 'type': '(event: Event)=> void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '拖拽中的事件',
- 'en-US': 'Draging events. ;Drag the event in. ; arg1:event (type object)'
- },
- 'demoId': 'moving-event'
- },
- {
- 'name': 'left-top-click',
- 'type': '()=> void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '左箭头收起时触发',
- 'en-US': 'Triggered when the left arrow is folded'
- },
- 'demoId': 'moving-event'
- },
- {
- 'name': 'right-bottom-click',
- 'type': '() => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '右箭头收起时触发',
- 'en-US': 'Triggered when the right arrow is folded'
- },
- 'demoId': 'moving-event'
- }
- ],
- 'slots': [
- {
- 'name': 'left',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '左面板插槽', 'en-US': 'Slot on the left panel' },
- 'demoId': 'left-right-slot'
- },
- {
- 'name': 'right',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '右面板插槽', 'en-US': 'Right panel slot' },
- 'demoId': 'left-right-slot'
- },
- {
- 'name': 'top',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '上面板插槽', 'en-US': 'Slot on the upper panel' },
- 'demoId': 'top-bottom-slot'
- },
- {
- 'name': 'bottom',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '下面板插槽', 'en-US': 'Slot on the lower panel' },
- 'demoId': 'top-bottom-slot'
- },
- {
- 'name': 'trigger',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '拖拽插槽', 'en-US': 'Drag Slot' },
- 'demoId': 'trigger-slot'
- }
- ]
+ codeFiles: ['three-areas.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/steps/advanced-steps-composition-api.vue b/examples/sites/demos/pc/app/steps/advanced-steps-composition-api.vue
index c18246ea5..ef7574575 100644
--- a/examples/sites/demos/pc/app/steps/advanced-steps-composition-api.vue
+++ b/examples/sites/demos/pc/app/steps/advanced-steps-composition-api.vue
@@ -1,5 +1,10 @@
-
+
+
+
+ 通过 advanced
属性启用高级向导功能:
+
+
+
+
diff --git a/examples/sites/demos/pc/app/steps/duration.spec.ts b/examples/sites/demos/pc/app/steps/duration.spec.ts
new file mode 100644
index 000000000..ced31f57f
--- /dev/null
+++ b/examples/sites/demos/pc/app/steps/duration.spec.ts
@@ -0,0 +1,18 @@
+import { test, expect } from '@playwright/test'
+
+test('节点滚动时间', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('steps#duration')
+
+ const steps = page.locator('.pc-demo .tiny-steps-senior')
+ const firstNode = steps.locator('.tiny-steps-block').first()
+ await expect(firstNode).toBeVisible()
+
+ // 判断点击后1秒位置是否正确
+ await page.locator('div:nth-child(3) > .more-button-con').click()
+ await page.waitForTimeout(300) // 滑动动画默认时间
+ const { x: mediumX } = await firstNode.boundingBox()
+ await page.waitForTimeout(700)
+ const { x } = await firstNode.boundingBox()
+ expect(x).toBeLessThan(mediumX)
+})
diff --git a/examples/sites/demos/pc/app/steps/duration.vue b/examples/sites/demos/pc/app/steps/duration.vue
new file mode 100644
index 000000000..590b5d9a9
--- /dev/null
+++ b/examples/sites/demos/pc/app/steps/duration.vue
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/steps/line-horizontal-composition-api.vue b/examples/sites/demos/pc/app/steps/line-horizontal-composition-api.vue
new file mode 100644
index 000000000..31518521a
--- /dev/null
+++ b/examples/sites/demos/pc/app/steps/line-horizontal-composition-api.vue
@@ -0,0 +1,26 @@
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/steps/line-horizontal.spec.ts b/examples/sites/demos/pc/app/steps/line-horizontal.spec.ts
new file mode 100644
index 000000000..73ab4d60f
--- /dev/null
+++ b/examples/sites/demos/pc/app/steps/line-horizontal.spec.ts
@@ -0,0 +1,18 @@
+import { test, expect } from '@playwright/test'
+
+test('横向单链型步骤条', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('steps#line-horizontal')
+
+ const steps = page.locator('.pc-demo .tiny-steps-line')
+ const nodes = steps.locator('.tiny-steps-block')
+
+ await expect(nodes.first()).toHaveClass(/done/)
+ await expect(nodes.first()).toHaveClass(/not-vertical/)
+ await expect(nodes.nth(1)).toHaveClass(/doing/)
+ await expect(nodes.nth(1)).toHaveClass(/active/)
+ await expect(nodes.nth(2)).toHaveClass(/disabled/)
+ await expect(nodes.nth(3)).toHaveClass(/fault/)
+ await nodes.first().click()
+ await expect(nodes.first()).toHaveClass(/active/)
+})
diff --git a/examples/sites/demos/pc/app/steps/line-horizontal.vue b/examples/sites/demos/pc/app/steps/line-horizontal.vue
new file mode 100644
index 000000000..a133ef440
--- /dev/null
+++ b/examples/sites/demos/pc/app/steps/line-horizontal.vue
@@ -0,0 +1,36 @@
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/steps/line-vertical-composition-api.vue b/examples/sites/demos/pc/app/steps/line-vertical-composition-api.vue
new file mode 100644
index 000000000..8ea4a51f4
--- /dev/null
+++ b/examples/sites/demos/pc/app/steps/line-vertical-composition-api.vue
@@ -0,0 +1,31 @@
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/steps/line-vertical.spec.ts b/examples/sites/demos/pc/app/steps/line-vertical.spec.ts
new file mode 100644
index 000000000..5cc8e0d8b
--- /dev/null
+++ b/examples/sites/demos/pc/app/steps/line-vertical.spec.ts
@@ -0,0 +1,18 @@
+import { test, expect } from '@playwright/test'
+
+test('横向单链型步骤条', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('steps#line-vertical')
+
+ const steps = page.locator('.pc-demo .tiny-steps-line')
+ const nodes = steps.locator('.tiny-steps-block')
+
+ await expect(nodes.first()).not.toHaveClass(/not-vertical/)
+ await expect(nodes.nth(1)).toHaveClass(/done/)
+ await expect(nodes.nth(1)).toHaveClass(/active/)
+ await expect(nodes.nth(2)).toHaveClass(/doing/)
+ await expect(nodes.nth(3)).toHaveClass(/fault/)
+ await expect(nodes.nth(4)).toHaveClass(/disabled/)
+ await nodes.first().click()
+ await expect(nodes.first()).toHaveClass(/active/)
+})
diff --git a/examples/sites/demos/pc/app/steps/line-vertical.vue b/examples/sites/demos/pc/app/steps/line-vertical.vue
new file mode 100644
index 000000000..f8ca8ba1b
--- /dev/null
+++ b/examples/sites/demos/pc/app/steps/line-vertical.vue
@@ -0,0 +1,40 @@
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/steps/node-status-composition-api.vue b/examples/sites/demos/pc/app/steps/node-status-composition-api.vue
deleted file mode 100644
index 9a95c94ac..000000000
--- a/examples/sites/demos/pc/app/steps/node-status-composition-api.vue
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
diff --git a/examples/sites/demos/pc/app/steps/node-status.spec.ts b/examples/sites/demos/pc/app/steps/node-status.spec.ts
deleted file mode 100644
index 92a45014d..000000000
--- a/examples/sites/demos/pc/app/steps/node-status.spec.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { test, expect } from '@playwright/test'
-
-test('节点状态', async ({ page }) => {
- page.on('pageerror', (exception) => expect(exception).toBeNull())
- await page.goto('steps#node-status')
-
- const nodes = page.locator('.pc-demo .tiny-steps .tiny-timeline-item')
- await expect(nodes.first()).toHaveClass(/process-current/)
- await expect(nodes.nth(1)).toHaveClass(/process-wait/)
- await expect(nodes.nth(2)).toHaveClass(/process-error/)
- await expect(nodes.nth(3)).toHaveClass(/process-disabled/)
-
- // 不同状态节点点击后状态的变化
- await nodes.first().click()
- await expect(nodes.first()).toHaveClass(/process-current/)
- await nodes.nth(1).click()
- await expect(nodes.first()).toHaveClass(/process-done/)
- await expect(nodes.nth(1)).toHaveClass(/process-current/)
- await nodes.nth(2).click()
- await expect(nodes.nth(2)).not.toHaveClass(/process-done/)
- await expect(nodes.nth(1).locator('.line')).toHaveClass(/line-done/)
- await nodes.nth(3).click()
- await expect(nodes.nth(3)).not.toHaveClass(/process-done/)
- await expect(nodes.nth(2).locator('.line')).not.toHaveClass(/line-done/)
-})
diff --git a/examples/sites/demos/pc/app/steps/node-status.vue b/examples/sites/demos/pc/app/steps/node-status.vue
deleted file mode 100644
index 33c98e615..000000000
--- a/examples/sites/demos/pc/app/steps/node-status.vue
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
diff --git a/examples/sites/demos/pc/app/steps/space-composition-api.vue b/examples/sites/demos/pc/app/steps/node-width-composition-api.vue
similarity index 72%
rename from examples/sites/demos/pc/app/steps/space-composition-api.vue
rename to examples/sites/demos/pc/app/steps/node-width-composition-api.vue
index c87a6e0ac..b55af3de6 100644
--- a/examples/sites/demos/pc/app/steps/space-composition-api.vue
+++ b/examples/sites/demos/pc/app/steps/node-width-composition-api.vue
@@ -1,14 +1,16 @@
+ 设置节点宽度为200像素:
-
+ 宽度自适应:
+
diff --git a/examples/sites/demos/pc/app/steps/normal-steps.spec.ts b/examples/sites/demos/pc/app/steps/normal-steps.spec.ts
deleted file mode 100644
index 6501b3ecc..000000000
--- a/examples/sites/demos/pc/app/steps/normal-steps.spec.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { test, expect } from '@playwright/test'
-
-test('单链型步骤条', async ({ page }) => {
- page.on('pageerror', (exception) => expect(exception).toBeNull())
- await page.goto('steps#normal-steps')
-
- const steps = page.locator('.pc-demo .tiny-steps')
- await expect(steps.locator('div').first()).toHaveClass(/tiny-steps-normal/)
- const nodes = steps.locator('.tiny-timeline-item')
-
- await expect(nodes.first()).toHaveClass(/process-current/)
- await expect(nodes.nth(1)).toHaveClass(/process-wait/)
- await nodes.nth(1).click()
- await expect(nodes.nth(1)).toHaveClass(/process-current/)
- await expect(nodes.first()).toHaveClass(/process-done/)
- await nodes.nth(2).click()
- await nodes.nth(3).click()
-})
diff --git a/examples/sites/demos/pc/app/steps/normal-steps.vue b/examples/sites/demos/pc/app/steps/normal-steps.vue
deleted file mode 100644
index a90992ef9..000000000
--- a/examples/sites/demos/pc/app/steps/normal-steps.vue
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
diff --git a/examples/sites/demos/pc/app/steps/only-number-composition-api.vue b/examples/sites/demos/pc/app/steps/only-number-composition-api.vue
deleted file mode 100644
index de7885a13..000000000
--- a/examples/sites/demos/pc/app/steps/only-number-composition-api.vue
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
-
-
diff --git a/examples/sites/demos/pc/app/steps/only-number.spec.ts b/examples/sites/demos/pc/app/steps/only-number.spec.ts
deleted file mode 100644
index caa36f047..000000000
--- a/examples/sites/demos/pc/app/steps/only-number.spec.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-import { test, expect } from '@playwright/test'
-
-test('序号仅显示数字', async ({ page }) => {
- page.on('pageerror', (exception) => expect(exception).toBeNull())
- await page.goto('steps#normal-steps')
-
- const steps = page.locator('.pc-demo .tiny-steps')
- await expect(steps.locator('div').first()).toHaveClass(/tiny-steps-normal/)
- const nodes = steps.locator('.tiny-timeline-item')
-
- await expect(nodes.first()).toHaveClass(/process-current/)
- await expect(nodes.nth(1)).toHaveClass(/process-wait/)
- await nodes.nth(1).click()
- await expect(nodes.nth(1)).toHaveClass(/process-current/)
- await expect(nodes.first()).toHaveClass(/process-done/)
- await nodes.nth(2).click()
- await nodes.nth(3).click()
-})
diff --git a/examples/sites/demos/pc/app/steps/only-number.vue b/examples/sites/demos/pc/app/steps/only-number.vue
deleted file mode 100644
index c5e222274..000000000
--- a/examples/sites/demos/pc/app/steps/only-number.vue
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
diff --git a/examples/sites/demos/pc/app/steps/size-composition-api.vue b/examples/sites/demos/pc/app/steps/size-composition-api.vue
index 32b3f4f3e..e41258fcf 100644
--- a/examples/sites/demos/pc/app/steps/size-composition-api.vue
+++ b/examples/sites/demos/pc/app/steps/size-composition-api.vue
@@ -1,10 +1,27 @@
-
+
+ 单链型步骤条:
+ mini 尺寸
+
+ small 尺寸
+
+ medium 尺寸
+
+ large 尺寸
+
+
+
+ 条形步骤条:
+ medium 尺寸
+
+ large 尺寸
+
+
+
+
diff --git a/examples/sites/demos/pc/app/steps/size.spec.ts b/examples/sites/demos/pc/app/steps/size.spec.ts
index ceb42da58..48e9910f9 100644
--- a/examples/sites/demos/pc/app/steps/size.spec.ts
+++ b/examples/sites/demos/pc/app/steps/size.spec.ts
@@ -4,6 +4,15 @@ test('尺寸', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('steps#size')
- const miniSteps = page.locator('#size .tiny-steps-block').first()
- await expect(miniSteps).toHaveClass(/small/)
+ // 单链型步骤条尺寸
+ const stepsLines = page.locator('.pc-demo .tiny-steps-line')
+ await expect(stepsLines.first()).toHaveClass(/mini/)
+ await expect(stepsLines.nth(1)).toHaveClass(/small/)
+ await expect(stepsLines.nth(2)).toHaveClass(/medium/)
+ await expect(stepsLines.nth(3)).toHaveClass(/large/)
+
+ // 高级向导步骤条尺寸
+ const stepsSenior = page.locator('.pc-demo .tiny-steps-senior')
+ await expect(stepsSenior.first()).toHaveClass(/medium/)
+ await expect(stepsSenior.nth(1)).toHaveClass(/large/)
})
diff --git a/examples/sites/demos/pc/app/steps/size.vue b/examples/sites/demos/pc/app/steps/size.vue
index 0f52c15b3..4d53fd673 100644
--- a/examples/sites/demos/pc/app/steps/size.vue
+++ b/examples/sites/demos/pc/app/steps/size.vue
@@ -1,9 +1,25 @@
-
+
+ 单链型步骤条:
+ mini 尺寸
+
+ small 尺寸
+
+ medium 尺寸
+
+ large 尺寸
+
+
+ 条形步骤条:
+ medium 尺寸
+
+ large 尺寸
+
+
+
+
diff --git a/examples/sites/demos/pc/app/steps/slot-active-node-desc-composition-api.vue b/examples/sites/demos/pc/app/steps/slot-active-node-desc-composition-api.vue
deleted file mode 100644
index 9713b431b..000000000
--- a/examples/sites/demos/pc/app/steps/slot-active-node-desc-composition-api.vue
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
- {{ data[active].desc }}
-
-
-
-
-
-
-
diff --git a/examples/sites/demos/pc/app/steps/slot-active-node-desc.spec.ts b/examples/sites/demos/pc/app/steps/slot-active-node-desc.spec.ts
deleted file mode 100644
index 160e4e63c..000000000
--- a/examples/sites/demos/pc/app/steps/slot-active-node-desc.spec.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { test, expect } from '@playwright/test'
-
-test('当前节点描述信息', async ({ page }) => {
- page.on('pageerror', (exception) => expect(exception).toBeNull())
- await page.goto('steps#slot-active-node-desc')
-
- const steps = page.locator('.pc-demo .tiny-steps')
- const nodes = steps.locator('.tiny-timeline-item')
- await expect(nodes.first().locator('.active-node-desc')).toBeVisible()
- await nodes.nth(1).locator('.name').click()
- await expect(nodes.nth(1).locator('.active-node-desc')).toBeVisible()
- await expect(nodes.first().locator('.active-node-desc')).not.toBeVisible()
-})
diff --git a/examples/sites/demos/pc/app/steps/slot-active-node-desc.vue b/examples/sites/demos/pc/app/steps/slot-active-node-desc.vue
deleted file mode 100644
index 506f7a3c2..000000000
--- a/examples/sites/demos/pc/app/steps/slot-active-node-desc.vue
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
- {{ data[active].desc }}
-
-
-
-
-
-
-
diff --git a/examples/sites/demos/pc/app/steps/space.spec.ts b/examples/sites/demos/pc/app/steps/space.spec.ts
deleted file mode 100644
index 4dbaa79f7..000000000
--- a/examples/sites/demos/pc/app/steps/space.spec.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import { test, expect } from '@playwright/test'
-
-test('节点宽度', async ({ page }) => {
- page.on('pageerror', (exception) => expect(exception).toBeNull())
- await page.goto('steps#space')
-
- const steps = page.locator('.pc-demo .tiny-steps')
- const node = steps.locator('li').first()
- const { width } = await node.boundingBox()
-
- await expect(Math.round(width)).toEqual(200)
-})
diff --git a/examples/sites/demos/pc/app/steps/text-position-composition-api.vue b/examples/sites/demos/pc/app/steps/text-position-composition-api.vue
deleted file mode 100644
index aebec47cd..000000000
--- a/examples/sites/demos/pc/app/steps/text-position-composition-api.vue
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
diff --git a/examples/sites/demos/pc/app/steps/text-position.spec.ts b/examples/sites/demos/pc/app/steps/text-position.spec.ts
deleted file mode 100644
index be04b2839..000000000
--- a/examples/sites/demos/pc/app/steps/text-position.spec.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-import { test, expect } from '@playwright/test'
-
-test('文本内容位置', async ({ page }) => {
- page.on('pageerror', (exception) => expect(exception).toBeNull())
- await page.goto('steps#text-position')
-
- const steps1 = page.locator('#text-position .tiny-steps')
- await expect(steps1.locator('.tiny-steps-normal')).toHaveClass(/text-right/)
-})
diff --git a/examples/sites/demos/pc/app/steps/text-position.vue b/examples/sites/demos/pc/app/steps/text-position.vue
deleted file mode 100644
index e3651f928..000000000
--- a/examples/sites/demos/pc/app/steps/text-position.vue
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
diff --git a/examples/sites/demos/pc/app/steps/vertical-steps-composition-api.vue b/examples/sites/demos/pc/app/steps/vertical-steps-composition-api.vue
deleted file mode 100644
index a26c2f898..000000000
--- a/examples/sites/demos/pc/app/steps/vertical-steps-composition-api.vue
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
- 竖式步骤条 正向
-
-
-
- 竖式步骤条 反向
-
-
-
-
-
-
-
-
diff --git a/examples/sites/demos/pc/app/steps/vertical-steps.spec.ts b/examples/sites/demos/pc/app/steps/vertical-steps.spec.ts
deleted file mode 100644
index e8e70ed18..000000000
--- a/examples/sites/demos/pc/app/steps/vertical-steps.spec.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { test, expect } from '@playwright/test'
-
-test('竖式步骤条', async ({ page }) => {
- page.on('pageerror', (exception) => expect(exception).toBeNull())
- await page.goto('steps#vertical-steps')
-
- const timelineVertical = page.locator('.pc-demo .tiny-steps').first()
- const timelineReverse = page.locator('.pc-demo .tiny-steps').nth(1)
-
- // 竖向步骤条 正序
- await expect(timelineVertical.locator('.tiny-steps-timeline')).toBeVisible()
- await expect(timelineVertical.locator('.icon').first()).toHaveText('1')
- await expect(timelineVertical.locator('.timeline').nth(1)).toHaveClass(/process-wait/)
- await timelineVertical.locator('.icon').nth(1).click()
- await expect(timelineVertical.locator('.timeline').nth(1)).toHaveClass(/process-current/)
-
- // 竖向步骤条 逆序
- await expect(timelineReverse.locator('.tiny-steps-timeline')).toHaveClass(/reverse/)
- await expect(timelineReverse.locator('.icon').first()).toContainText('3')
- await expect(timelineReverse.locator('.timeline').first()).toHaveClass(/process-wait/)
- await timelineReverse.locator('.icon').first().click()
- await expect(timelineReverse.locator('.timeline').first()).toHaveClass(/process-current/)
-})
diff --git a/examples/sites/demos/pc/app/steps/vertical-steps.vue b/examples/sites/demos/pc/app/steps/vertical-steps.vue
deleted file mode 100644
index e754dd12b..000000000
--- a/examples/sites/demos/pc/app/steps/vertical-steps.vue
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
- 竖式步骤条 正向
-
-
-
- 竖式步骤条 反向
-
-
-
-
-
-
-
-
diff --git a/examples/sites/demos/pc/app/steps/webdoc/steps.js b/examples/sites/demos/pc/app/steps/webdoc/steps.js
index 7d7588bda..a9c5358fa 100644
--- a/examples/sites/demos/pc/app/steps/webdoc/steps.js
+++ b/examples/sites/demos/pc/app/steps/webdoc/steps.js
@@ -3,313 +3,120 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'normal-steps',
- 'name': { 'zh-CN': '单链型步骤条', 'en-US': 'chain steps' },
- 'desc': {
+ demoId: 'line-horizontal',
+ name: {
+ 'zh-CN': '横向单链型',
+ 'en-US': 'Horizontal Chain Steps'
+ },
+ desc: {
+ 'zh-CN': '通过添加 line
属性用作横向单链型步骤条。
',
+ 'en-US': 'Use the line
property to create a horizontal chain steps.
'
+ },
+ codeFiles: ['line-horizontal.vue']
+ },
+ {
+ demoId: 'line-vertical',
+ name: {
+ 'zh-CN': '垂直单链型',
+ 'en-US': 'Vertical Line Steps'
+ },
+ desc: {
+ 'zh-CN': '使用 line
与 vertical
属性设置为条形步骤条。
\n',
+ 'en-US': 'Use line
and vertical<
attribute to set vertical steps.'
+ },
+ codeFiles: ['line-vertical.vue']
+ },
+ {
+ demoId: 'advanced-steps',
+ name: {
+ 'zh-CN': '条形步骤条',
+ 'en-US': 'Bar steps'
+ },
+ desc: {
+ 'zh-CN': '默认显示为条形步骤条。
\n',
+ 'en-US': 'The default display is a bar-style steps.
'
+ },
+ codeFiles: ['advanced-steps.vue']
+ },
+ {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '尺寸',
+ 'en-US': 'Use of slots'
+ },
+ desc: {
'zh-CN':
- '使用 tiny-time-line
标签时显示为单链型步骤条,通过 data
属性绑定节点数据, active
属性指定当前选中节点。
\n',
+ '步骤条两种模式支持 size
属性设置尺寸:
\n 1. line
单链型模式支持 mini
、small
、medium
、large
4 种尺寸,默认值为 medium
。
\n 2. advanced
高级向导模式支持 medium
、large
2 种尺寸,默认值为 medium
。
',
'en-US':
- 'When using tiny-time-line
tags, it displays as a chain steps.The node data is bound through the data
attribute, and the active
property specifies the currently selected node.
\n'
+ 'Two modes of the steps support the size
setting:
\n 1. The line
mode supports 4 sizes: mini
, small
, medium
, and large
, with a default value of medium
.
\n 2. The advanced
mode support 2 sizes: medium
, and large
, with a default value of medium
.
'
},
- 'codeFiles': ['normal-steps.vue']
+ codeFiles: ['size.vue']
},
{
- 'demoId': 'advanced-steps',
- 'name': { 'zh-CN': '条形步骤条', 'en-US': 'Bar steps' },
- 'desc': {
- 'zh-CN': '使用 tiny-steps
标签时,显示为条形步骤条。
\n',
- 'en-US': 'When using tiny-steps<
tags, it displays as a bar steps.'
+ demoId: 'node-width',
+ name: {
+ 'zh-CN': '节点宽度',
+ 'en-US': 'Common Step Bar'
},
- 'codeFiles': ['advanced-steps.vue']
- },
- {
- 'demoId': 'vertical-steps',
- 'name': { 'zh-CN': '竖式步骤条', 'en-US': 'Vertical steps' },
- 'desc': {
- 'zh-CN': '使用 vertical
属性设置为条形步骤条。
\n',
- 'en-US': 'Use vertical<
attribute to set vertical steps.'
- },
- 'codeFiles': ['vertical-steps.vue']
- },
- {
- 'demoId': 'space',
- 'name': { 'zh-CN': '节点宽度', 'en-US': 'Common Step Bar' },
- 'desc': {
- 'zh-CN': '使用 space
属性配置步骤条节点的宽度。
\n',
- 'en-US': 'Using space
attribute to set node width.
\n'
- },
- 'codeFiles': ['space.vue']
- },
- {
- 'demoId': 'node-status',
- 'name': { 'zh-CN': '节点状态', 'en-US': 'Timeline Step Bar' },
- 'desc': {
+ desc: {
'zh-CN':
- '通过单个节点数据中的 disabled
属性配置是否禁用;error
属性配置错误状态。
\n',
+ '使用 space
属性配置步骤条节点的宽度。
通过 flex
属性开启总宽度自适应,节点等宽,撑满父容器,节点名称超出省略。
',
'en-US':
- 'The disabled
attribute in single node data is used to configure whether to disable, while the error
attribute is used to configure error state
\n'
+ 'Using space
attribute to set node width.
Enable responsive total width using the flex
property, with equal width for nodes that fill the parent container, and node names that exceed the container width are truncated.
'
},
- 'codeFiles': ['node-status.vue']
+ codeFiles: ['node-width.vue']
},
{
- 'demoId': 'text-position',
- 'name': { 'zh-CN': '节点名称位置', 'en-US': 'Node name position' },
- 'desc': {
+ demoId: 'duration',
+ name: {
+ 'zh-CN': '节点滚动时间',
+ 'en-US': 'Node Scroll Time'
+ },
+ desc: {
'zh-CN':
- '通过 text-position
配置节点名称位置,默认位于序号下方, 当取值为 right
时名称位于序号右侧。
\n',
+ '通过 duration
设置节点左右滚动的持续时间,默认值为 300(单位 ms),设置 0 则无滚动动画,仅开启 advanced 高级向导模式有效。
',
'en-US':
- 'Configure the position of the node name using text-position
, with the default position being below the number. When the value is right
, the name is positioned to the right of the number.
\n'
+ 'Set the duration of node left and right scrolling through the duration
parameter, with a default value of 300 (in ms). Setting it to 0 disables the scrolling animation. This parameter only works in advanced wizard mode.
'
},
- 'codeFiles': ['text-position.vue']
+ codeFiles: ['duration.vue']
},
{
- 'demoId': 'show-divider',
- 'name': { 'zh-CN': '底部分割线', 'en-US': 'Bottom dividing line' },
- 'desc': {
- 'zh-CN':
- '通过 show-divider
属性设置是否显示步骤条底部分隔线,仅当节点文本内容位于序号右边时生效。
\n',
- 'en-US':
- 'show-divider
attribute is used to set whether to display the bottom dividing line of the step bar. It only takes effect when the node text content is located to the right of the number.
\n'
+ demoId: 'custom-steps-item',
+ name: {
+ 'zh-CN': '自定义字段',
+ 'en-US': 'Custom fields'
},
- 'codeFiles': ['show-divider.vue']
- },
- {
- 'demoId': 'slot-description',
- 'name': { 'zh-CN': '节点描述插槽', 'en-US': 'Node Description' },
- 'desc': {
- 'zh-CN': '通过 description
插槽添加单个节点的描述信息。
\n',
- 'en-US': 'Add description information for a single node through the description
slot.
\n'
- },
- 'codeFiles': ['slot-description.vue']
- },
- {
- 'demoId': 'slot-active-node-desc',
- 'name': { 'zh-CN': '当前节点描述信息', 'en-US': 'Click Event' },
- 'desc': {
- 'zh-CN': '通过 active-node-desc
插槽添加当前选中节点的描述信息。
\n',
- 'en-US':
- 'Add description information for the active node through the active-node-desc
slot.
\n'
- },
- 'codeFiles': ['slot-active-node-desc.vue']
- },
- {
- 'demoId': 'size',
- 'name': { 'zh-CN': '尺寸', 'en-US': 'Use of slots' },
- 'desc': {
- 'zh-CN': '通过 size
属性设置步骤条尺寸。
\n',
- 'en-US': 'Set size of steps through size
attribute.
\n'
- },
- 'codeFiles': ['size.vue']
- },
- {
- 'demoId': 'custom-steps-item',
- 'name': { 'zh-CN': '自定义字段', 'en-US': 'Custom fields' },
- 'desc': {
+ desc: {
'zh-CN':
"可以通过以下属性自定义数据项字段:
name-field
: 设置节点信息中名称对应的字段名,默认为 'name'
count-field
:设置条形步骤条里徽标计数对应的字段名,默认为 'count' 。
status-field
:设置数据状态对应的字段名,默认为 'status' 。
\n",
'en-US':
"You can customize the data item fields with the following attributes.
name-field
: Set the field name corresponding to the name in the node information, the default is 'name'.
count-field
Set the field name corresponding to the count in the logo counter of the bar step bar, the default is 'count'.
status-field
: Set the field name corresponding to the status in the data item, the default is 'status'."
},
- 'codeFiles': ['custom-steps-item.vue']
+ codeFiles: ['custom-steps-item.vue']
},
{
- 'demoId': 'only-number',
- 'name': { 'zh-CN': '纯数字序号', 'en-US': 'Only numeric order' },
- 'desc': {
- 'zh-CN':
- '设置 only-number
为true时,节点只显示数字序号而不显示任何状态图标,仅适用单链型步骤条。
\n',
- 'en-US':
- 'When setting only-number
to true, the node only displays numeric serial numbers without any status icons, only applicable to chain steps.'
+ demoId: 'slot-item',
+ name: {
+ 'zh-CN': 'item插槽',
+ 'en-US': 'item slot'
},
- 'codeFiles': ['only-number.vue']
- },
- {
- 'demoId': 'slot-item',
- 'name': { 'zh-CN': 'item插槽', 'en-US': 'item slot' },
- 'desc': {
+ desc: {
'zh-CN': '通过插槽 item
自定义节点内容。
\n',
'en-US': 'Customize step bar node content through scope slot item
.'
},
- 'codeFiles': ['slot-item.vue']
+ codeFiles: ['slot-item.vue']
},
{
- 'demoId': 'click',
- 'name': { 'zh-CN': '点击事件', 'en-US': '' },
- 'desc': {
+ demoId: 'click',
+ name: {
+ 'zh-CN': '点击事件',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN': '点击节点时触发 click
事件。
\n',
'en-US': 'Trigger click
event when clicking on a node.'
},
- 'codeFiles': ['click.vue']
- }
- ],
- apis: [
- {
- 'name': 'steps',
- 'type': 'component',
- 'props': [
- {
- 'name': 'active',
- 'type': 'number',
- 'defaultValue': '-1',
- 'desc': {
- 'zh-CN': '当前步骤索引,从0开始计数',
- 'en-US': 'Current step index and count from 0'
- },
- 'demoId': 'advanced-steps'
- },
- {
- 'name': 'count-field',
- 'type': 'string',
- 'defaultValue': "'count'",
- 'desc': {
- 'zh-CN': '条形步骤条里徽标计数对应的字段名',
- 'en-US': 'Custom field name corresponding to logo count in bar steps'
- },
- 'demoId': 'custom-steps-item'
- },
- {
- 'name': 'data',
- 'type': 'IStepsItem',
- 'typeAnchorName': 'IStepsItem[] | ITimelineItem[]',
- 'defaultValue': '[]',
- 'desc': {
- 'zh-CN':
- '步骤条数据,其中条形步骤条的数据类型参考IStepsItem;单链型步骤条的数据类型参考Timeline组件',
- 'en-US':
- 'The data type of the step bar is referred to IStepsItem, and the data type of the chain step bar is referred to Timeline component.'
- },
- 'demoId': 'normal-steps'
- },
- {
- 'name': 'name-field',
- 'type': 'string',
- 'defaultValue': "'name'",
- 'desc': {
- 'zh-CN': '节点名称对应的字段名',
- 'en-US': 'Field name corresponds to name of node'
- },
- 'demoId': 'custom-steps-item'
- },
- {
- 'name': 'only-number',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '节点序号是否只显示数字,用于单链型步骤条',
- 'en-US': 'Whether the node sequence number only displays numbers, used for chain steps'
- },
- 'demoId': 'only-number'
- },
- {
- 'name': 'reverse',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否逆序展示数据,用于单链型步骤条',
- 'en-US': 'Whether to display data in reverse order, used for chain steps'
- },
- 'demoId': 'vertical-steps'
- },
- {
- 'name': 'show-divider',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否显示单链型步骤条的底部分割线',
- 'en-US': 'Whether to display the bottom separator line of the chain steps'
- },
- 'demoId': 'show-divider'
- },
- {
- 'name': 'space',
- 'type': 'string | number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '节点宽度, 可取值数字、带长度单位数值与百分比,传数字则默认以 px 为长度单位',
- 'en-US':
- 'Node width can be set to numeric values, values with length units, or percentages. Numeric values will default to using pixels as the length unit'
- },
- 'demoId': 'space'
- },
- {
- 'name': 'status-field',
- 'type': 'string',
- 'defaultValue': "'status'",
- 'desc': {
- 'zh-CN': '数据状态对应的字段名,用于条形步骤条',
- 'en-US': 'Field name corresponding to data status, used for bar steps '
- },
- 'demoId': 'custom-steps-item'
- },
- {
- 'name': 'text-position',
- 'type': 'string',
- 'defaultValue': "'bottom'",
- 'desc': {
- 'zh-CN': '节点名称的位置, 可选值有right | bottom,用于单链型步骤条',
- 'en-US':
- 'The position of the node name, with optional values of right | bottom, is used for the chain steps'
- },
- 'demoId': 'text-position'
- }
- ],
- 'events': [
- {
- 'name': 'click',
- 'type':
- '(index: number, node: IStepsItem | ITimelineItem) => void',
- 'desc': {
- 'zh-CN': '节点点击事件,参数:- index: 点击节点的索引
- node:点击节点的数据
',
- 'en-US': 'Node click event. Parameter: (index: node index, node: node data information)'
- },
- 'demoId': 'click'
- }
- ],
- 'slots': [
- {
- 'name': 'active-node-desc',
- 'desc': {
- 'zh-CN': '当前节点描述信息插槽,用于单链型步骤条',
- 'en-US': 'Current node description information slot, used for chain steps'
- },
- 'demoId': 'slot-active-node-desc'
- },
- {
- 'name': 'description',
- 'desc': {
- 'zh-CN': '节点描述信息插槽,用于单链型步骤条',
- 'en-US': 'Node description information slot, used for chain steps'
- },
- 'demoId': 'slot-description'
- },
- {
- 'name': 'item',
- 'desc': {
- 'zh-CN': '步骤条数据项插槽,用于条形步骤条',
- 'en-US': 'Step bar data item slot, used for bar steps'
- },
- 'demoId': 'slot-item'
- }
- ]
- }
- ],
- 'types': [
- {
- 'name': 'IStepsItem',
- 'type': 'interface',
- 'code': `
-interface IStepsItem {
- // 条形步骤条数据项
- name: string, // 节点名称
- status: IStepsStatus, // 节点状态,取值见下面IStepsStatus类型说明
- count: number // 节点右上角徽标计数
-}
- `
- },
- {
- 'name': 'IStepsStatus',
- 'type': 'type',
- 'code': `type IStepsStatus = 'doing' | 'done' | 'disabled' | 'error' | ''`
+ codeFiles: ['click.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/switch/webdoc/switch.js b/examples/sites/demos/pc/app/switch/webdoc/switch.js
index 0bac215ff..4bc5b60df 100644
--- a/examples/sites/demos/pc/app/switch/webdoc/switch.js
+++ b/examples/sites/demos/pc/app/switch/webdoc/switch.js
@@ -3,184 +3,93 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '通过 v-model
绑定开关值。
',
'en-US': 'Bind switch values through v model
.
'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'mini-mode',
- 'name': { 'zh-CN': '迷你尺寸', 'en-US': 'Mini Size' },
- 'desc': {
+ demoId: 'mini-mode',
+ name: {
+ 'zh-CN': '迷你尺寸',
+ 'en-US': 'Mini Size'
+ },
+ desc: {
'zh-CN': '通过 mini
设置小尺寸开关。
',
'en-US': 'Set small size switches through mini
.'
},
- 'codeFiles': ['mini-mode.vue']
+ codeFiles: ['mini-mode.vue']
},
{
- 'demoId': 'custom-open-close',
- 'name': { 'zh-CN': '自定义开关显示', 'en-US': 'Customized switch display' },
- 'desc': {
+ demoId: 'custom-open-close',
+ name: {
+ 'zh-CN': '自定义开关显示',
+ 'en-US': 'Customized switch display'
+ },
+ desc: {
'zh-CN':
'
通过 show-text
配置是否显示开关文本,开启配置后,可以使用具名插槽 open
和 close
自定义开关内容。
',
'en-US':
'Configure whether to display switch text through show text
. After enabling the configuration, you can customize the switch content using named slots open
and close
.
'
},
- 'codeFiles': ['custom-open-close.vue']
+ codeFiles: ['custom-open-close.vue']
},
{
- 'demoId': 'before-change',
- 'name': { 'zh-CN': '变更前置处理', 'en-US': 'Before change' },
- 'desc': {
+ demoId: 'before-change',
+ name: {
+ 'zh-CN': '变更前置处理',
+ 'en-US': 'Before change'
+ },
+ desc: {
'zh-CN':
'通过 before-change
设置开关变化前置处理逻辑,参数为一个回调函数,调用后完成变更。
',
'en-US':
'By setting the pre processing logic for switch changes through before change
, the parameter is a callback function that completes the change after being called.
'
},
- 'codeFiles': ['before-change.vue']
+ codeFiles: ['before-change.vue']
},
{
- 'demoId': 'custom-true-false-value',
- 'name': { 'zh-CN': '自定义开关取值', 'en-US': 'User-defined switch value' },
- 'desc': {
+ demoId: 'custom-true-false-value',
+ name: {
+ 'zh-CN': '自定义开关取值',
+ 'en-US': 'User-defined switch value'
+ },
+ desc: {
'zh-CN': '通过 true-label
设置开关开启时的值, false-label
设置关闭时的值。
',
'en-US':
'Set the value when the switch is turned on by true label
, and set the value when it is turned off by false label
.
'
},
- 'codeFiles': ['custom-true-false-value.vue']
+ codeFiles: ['custom-true-false-value.vue']
},
{
- 'demoId': 'dynamic-disable',
- 'name': { 'zh-CN': '禁用状态', 'en-US': 'Disabled' },
- 'desc': {
+ demoId: 'dynamic-disable',
+ name: {
+ 'zh-CN': '禁用状态',
+ 'en-US': 'Disabled'
+ },
+ desc: {
'zh-CN': '通过 disabled
设置开关禁用状态。
',
'en-US': 'Set the switch disable status through disabled
.
'
},
- 'codeFiles': ['dynamic-disable.vue']
+ codeFiles: ['dynamic-disable.vue']
},
{
- 'demoId': 'event-change',
- 'name': { 'zh-CN': '变更事件', 'en-US': 'Event change' },
- 'desc': {
+ demoId: 'event-change',
+ name: {
+ 'zh-CN': '变更事件',
+ 'en-US': 'Event change'
+ },
+ desc: {
'zh-CN': '当开关值变化后,会触发 change
事件。
',
'en-US': 'When the switch value changes, the change
event will be triggered.
'
},
- 'codeFiles': ['event-change.vue']
- }
- ],
- apis: [
- {
- 'name': 'switch',
- 'type': 'component',
- 'props': [
- {
- 'name': 'before-change',
- 'type': '(done: () => void) => void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '开关值变化前置处理',
- 'en-US': 'Pre processing of switch value changes'
- },
- 'demoId': 'before-change'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否禁用',
- 'en-US': 'Disable'
- },
- 'demoId': 'dynamic-disable'
- },
- {
- 'name': 'false-value',
- 'type': 'boolean | string | number',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': 'switch 关闭时的值',
- 'en-US': 'Value when switch is disabled'
- },
- 'demoId': 'custom-true-false-value'
- },
- {
- 'name': 'mini',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '设置是否显示为 mini 模式,mini 模式下不会显示 slot 的内容',
- 'en-US': 'Sets whether to display in mini mode. In mini mode, the content of the slot is not displayed'
- },
- 'demoId': 'mini-mode'
- },
- {
- 'name': 'modelValue / v-model',
- 'type': 'boolean | string | number',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '开关绑定值',
- 'en-US': 'Switch bind value'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'show-text',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': 'switch 是否显示内容里面的文字',
- 'en-US': 'Switch whether to display the text in the content'
- },
- 'demoId': 'custom-open-close'
- },
- {
- 'name': 'true-value',
- 'type': 'boolean | string | number',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': 'switch 打开时的值',
- 'en-US': 'Value when switch is enabled'
- },
- 'demoId': 'custom-true-false-value'
- }
- ],
- 'events': [
- {
- 'name': 'change',
- 'type': '(value: boolean | string | number) => void',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': 'switch 状态发生变化时的回调函数',
- 'en-US': 'Callback function for switch changes'
- },
- 'demoId': 'event-change'
- }
- ],
- 'slots': [
- {
- 'name': 'close',
- 'type': '',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '关闭内容,当 show-text 为 true 时有效',
- 'en-US': 'Close Content'
- },
- 'demoId': 'custom-open-close'
- },
- {
- 'name': 'open',
- 'type': '',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '开启内容,当 show-text 为 true 时有效',
- 'en-US': 'Enable Content'
- },
- 'demoId': 'custom-open-close'
- }
- ]
+ codeFiles: ['event-change.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/tabs/custom-tab-title-composition-api.vue b/examples/sites/demos/pc/app/tabs/custom-tab-title-composition-api.vue
index 8dd04a448..6c288f3b1 100644
--- a/examples/sites/demos/pc/app/tabs/custom-tab-title-composition-api.vue
+++ b/examples/sites/demos/pc/app/tabs/custom-tab-title-composition-api.vue
@@ -1,35 +1,53 @@
-
-
-
-
-
- 表单组件
-
-
- 表单组件,具有与用户交互,并可完成数据采集功能的控件。
-
-
-
-
-
- 数据组件
-
-
- 数据组件,提供了非常强大数据表格功能,在Grid可以展示数据列表,可以对数据列表进行选择、编辑等。
-
- 导航组件,帮助网站访问者浏览站点的组件。
- 业务组件,与业务紧密相关实现某种业务功能的组件集。
-
+
+ 改变标题
+
+
+
+
+
+
+
+
+ 表单组件,具有与用户交互,并可完成数据采集功能的控件。
+
+
+
+
+
+
+
+
+ 数据组件,提供了非常强大数据表格功能,在Grid可以展示数据列表,可以对数据列表进行选择、编辑等
+
+ 导航组件,帮助网站访问者浏览站点的组件.
+ 业务组件,与业务紧密相关实现某种业务功能的组件集
+
+
-
+
+
diff --git a/examples/sites/demos/pc/app/tabs/custom-tab-title.vue b/examples/sites/demos/pc/app/tabs/custom-tab-title.vue
index 69e8a1ae0..3f86e7dd8 100644
--- a/examples/sites/demos/pc/app/tabs/custom-tab-title.vue
+++ b/examples/sites/demos/pc/app/tabs/custom-tab-title.vue
@@ -1,30 +1,33 @@
-
-
-
-
-
- 表单组件
-
-
- 表单组件,具有与用户交互,并可完成数据采集功能的控件。
-
-
-
-
-
- 数据组件
-
-
- 数据组件,提供了非常强大数据表格功能,在Grid可以展示数据列表,可以对数据列表进行选择、编辑等。
-
- 导航组件,帮助网站访问者浏览站点的组件。
- 业务组件,与业务紧密相关实现某种业务功能的组件集。
-
+
+ 改变标题
+
+
+
+
+
+
+
+
+ 表单组件,具有与用户交互,并可完成数据采集功能的控件。
+
+
+
+
+
+
+
+
+ 数据组件,提供了非常强大数据表格功能,在Grid可以展示数据列表,可以对数据列表进行选择、编辑等
+
+ 导航组件,帮助网站访问者浏览站点的组件.
+ 业务组件,与业务紧密相关实现某种业务功能的组件集
+
+
-
+
+
diff --git a/examples/sites/demos/pc/app/tabs/stretch-wh.spec.ts b/examples/sites/demos/pc/app/tabs/stretch-wh.spec.ts
index ce7eb0221..5e0de1c54 100644
--- a/examples/sites/demos/pc/app/tabs/stretch-wh.spec.ts
+++ b/examples/sites/demos/pc/app/tabs/stretch-wh.spec.ts
@@ -6,5 +6,5 @@ test('自动撑宽', async ({ page }) => {
const { width } = await page.getByRole('tab', { name: '表单组件,测试标签页宽度根据标题长度自动撑开' }).boundingBox()
- await expect(width).toBeGreaterThanOrEqual(364)
+ await expect(width).toBeGreaterThanOrEqual(360)
})
diff --git a/examples/sites/demos/pc/app/tabs/tab-style-bordercard-composition-api.vue b/examples/sites/demos/pc/app/tabs/tab-style-bordercard-composition-api.vue
index 8792c3601..70aae7f3f 100644
--- a/examples/sites/demos/pc/app/tabs/tab-style-bordercard-composition-api.vue
+++ b/examples/sites/demos/pc/app/tabs/tab-style-bordercard-composition-api.vue
@@ -1,5 +1,5 @@
-
+
{{ item.content }}
diff --git a/examples/sites/demos/pc/app/tabs/tab-style-bordercard.vue b/examples/sites/demos/pc/app/tabs/tab-style-bordercard.vue
index a1305c6d9..d9339bb68 100644
--- a/examples/sites/demos/pc/app/tabs/tab-style-bordercard.vue
+++ b/examples/sites/demos/pc/app/tabs/tab-style-bordercard.vue
@@ -1,5 +1,5 @@
-
+
{{ item.content }}
diff --git a/examples/sites/demos/pc/app/tabs/tab-style-card-composition-api.vue b/examples/sites/demos/pc/app/tabs/tab-style-card-composition-api.vue
index 2ce2bae03..5b76fb515 100644
--- a/examples/sites/demos/pc/app/tabs/tab-style-card-composition-api.vue
+++ b/examples/sites/demos/pc/app/tabs/tab-style-card-composition-api.vue
@@ -1,5 +1,5 @@
-
+
{{ item.content }}
diff --git a/examples/sites/demos/pc/app/tabs/tab-style-card.vue b/examples/sites/demos/pc/app/tabs/tab-style-card.vue
index c457b3d53..6cbc3cb78 100644
--- a/examples/sites/demos/pc/app/tabs/tab-style-card.vue
+++ b/examples/sites/demos/pc/app/tabs/tab-style-card.vue
@@ -1,5 +1,5 @@
-
+
{{ item.content }}
diff --git a/examples/sites/demos/pc/app/tabs/tabs-separator-composition-api.vue b/examples/sites/demos/pc/app/tabs/tabs-separator-composition-api.vue
index cb0cf59f9..38df09cff 100644
--- a/examples/sites/demos/pc/app/tabs/tabs-separator-composition-api.vue
+++ b/examples/sites/demos/pc/app/tabs/tabs-separator-composition-api.vue
@@ -11,7 +11,7 @@
业务组件,与业务紧密相关实现某种业务功能的组件集。
-
+
表单组件,具有与用户交互,并可完成数据采集功能的控件。
diff --git a/examples/sites/demos/pc/app/tabs/tabs-separator.vue b/examples/sites/demos/pc/app/tabs/tabs-separator.vue
index f9f2eed69..0f0db3ce9 100644
--- a/examples/sites/demos/pc/app/tabs/tabs-separator.vue
+++ b/examples/sites/demos/pc/app/tabs/tabs-separator.vue
@@ -11,7 +11,7 @@
业务组件,与业务紧密相关实现某种业务功能的组件集。
-
+
表单组件,具有与用户交互,并可完成数据采集功能的控件。
diff --git a/examples/sites/demos/pc/app/tabs/tooltip-composition-api.vue b/examples/sites/demos/pc/app/tabs/tooltip-composition-api.vue
index 10f73b3e2..97ef98f79 100644
--- a/examples/sites/demos/pc/app/tabs/tooltip-composition-api.vue
+++ b/examples/sites/demos/pc/app/tabs/tooltip-composition-api.vue
@@ -1,9 +1,8 @@
- 当前tooltip-config是{{
- value ? 'tooltip配置' : '字符串title'
- }}。
+
+ 当前 tooltip-config 是 {{ value ? 'tooltip配置' : '字符串title' }}。
diff --git a/examples/sites/demos/pc/app/tabs/tooltip.vue b/examples/sites/demos/pc/app/tabs/tooltip.vue
index 790cd235e..c770d8555 100644
--- a/examples/sites/demos/pc/app/tabs/tooltip.vue
+++ b/examples/sites/demos/pc/app/tabs/tooltip.vue
@@ -1,9 +1,8 @@
- 当前tooltip-config是{{
- value ? 'tooltip配置' : '字符串title'
- }}。
+
+ 当前 tooltip-config 是 {{ value ? 'tooltip配置' : '字符串title' }}。
@@ -25,6 +24,7 @@ export default {
data() {
return {
activeName4: 'navigation1',
+ value: true,
tooltipConfig: { effect: 'light', placement: 'left', visible: 'auto' },
tabs3: [
{
diff --git a/examples/sites/demos/pc/app/tabs/webdoc/tabs.js b/examples/sites/demos/pc/app/tabs/webdoc/tabs.js
index fa5b231ec..74aac3b77 100644
--- a/examples/sites/demos/pc/app/tabs/webdoc/tabs.js
+++ b/examples/sites/demos/pc/app/tabs/webdoc/tabs.js
@@ -3,547 +3,243 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
- 'zh-CN': `Tabs
:通过 v-model 设置选中的页签项,对应 TabItem 页签项中 name 属性的值;
- TabItem
:通过 title 设置页签项标题, name 设置页签项的值,disabled 设置页签项禁用,默认插槽自定义对应的内容。`,
- 'en-US': ` Tabs
:Set the selected tag item through the v-model , corresponding to the value of the name attribute in the TabItem tag item;
- TabItem
:Set the label item title through title .nameSet the value of tab items.disabledSet tab items to be disabled.Customize the corresponding content for the default slot.
`
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
},
- 'codeFiles': ['basic-usage.vue']
- },
- {
- 'demoId': 'tab-style-card',
- 'name': { 'zh-CN': 'card 类型', 'en-US': 'Card Type' },
- 'desc': {
+ desc: {
'zh-CN':
- '通过 tab-style="card"
设置风格类型为 card
, active-name
设置初始选中的页签项, size="small"
设置小尺寸类型。',
+ 'Tabs
:通过 v-model 设置选中的页签项,对应 TabItem 页签项中 name 属性的值;
\n TabItem
:通过 title 设置页签项标题, name 设置页签项的值,disabled 设置页签项禁用,默认插槽自定义对应的内容。',
'en-US':
- 'Set the style type by tab-style
, set the initially selected label item by active-name
, and set the small size type by size="small"
.'
+ ' Tabs
:Set the selected tag item through the v-model , corresponding to the value of the name attribute in the TabItem tag item;
\n TabItem
:Set the label item title through title .nameSet the value of tab items.disabledSet tab items to be disabled.Customize the corresponding content for the default slot.
'
},
- 'codeFiles': ['tab-style-card.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'tab-style-bordercard',
- 'name': { 'zh-CN': 'bordercard 类型', 'en-US': 'BorderCard Type' },
- 'desc': {
- 'zh-CN': '通过 tab-style="border-card"
设置风格类型为 bordercard
。',
- 'en-US': 'Use tab-style="border-card
to set the tab style type to bordercard
. '
+ demoId: 'tab-style-card',
+ name: {
+ 'zh-CN': 'card 类型',
+ 'en-US': 'Card Type'
},
- 'codeFiles': ['tab-style-bordercard.vue']
+ desc: {
+ 'zh-CN':
+ '通过 tab-style="card"
设置风格类型为 card
, active-name
设置初始选中的页签项。',
+ 'en-US':
+ 'Set the style type by tab-style
, set the initially selected label item by active-name
.'
+ },
+ codeFiles: ['tab-style-card.vue']
},
{
- 'demoId': 'tabs-separator',
- 'name': { 'zh-CN': '分隔符', 'en-US': 'Separator' },
- 'desc': {
+ demoId: 'tab-style-bordercard',
+ name: {
+ 'zh-CN': 'bordercard 类型',
+ 'en-US': 'BorderCard Type'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 tab-style="border-card"
设置风格类型为 bordercard
, size="small"
设置小尺寸类型。',
+ 'en-US':
+ 'Use tab-style="border-card
to set the tab style type to bordercard
, and set the small size type by size="small"
. '
+ },
+ codeFiles: ['tab-style-bordercard.vue']
+ },
+ {
+ demoId: 'tabs-separator',
+ name: {
+ 'zh-CN': '分隔符',
+ 'en-US': 'Separator'
+ },
+ desc: {
'zh-CN': '通过 separator
设置分隔符。
\n',
'en-US': 'Use separator
to set the separator.
\n'
},
- 'codeFiles': ['tabs-separator.vue']
+ codeFiles: ['tabs-separator.vue']
},
{
- 'demoId': 'custom-more-icon',
- 'name': { 'zh-CN': "定义'更多'按钮", 'en-US': "'More' icon slot" },
- 'desc': {
+ demoId: 'custom-more-icon',
+ name: {
+ 'zh-CN': "定义'更多'按钮",
+ 'en-US': "'More' icon slot"
+ },
+ desc: {
'zh-CN':
'通过 show-more-tabs
设置页签项超出时显示 更多
按钮; moreIcon
插槽自定义 更多
按钮; popper-class
给“更多”下拉框添加自定义类名,可用来自定义样式。',
'en-US':
'Set the show-more-tabs
button to display the More
button when the label item exceeds the limit< Code>moreIcon Slot Customization More
buttons;Add custom class names to "more" dropdown boxes, can be used to customize styles.'
},
- 'codeFiles': ['custom-more-icon.vue']
+ codeFiles: ['custom-more-icon.vue']
},
{
- 'demoId': 'with-add',
- 'name': { 'zh-CN': '添加功能', 'en-US': 'Adding Functionality' },
- 'desc': {
+ demoId: 'with-add',
+ name: {
+ 'zh-CN': '添加功能',
+ 'en-US': 'Adding Functionality'
+ },
+ desc: {
'zh-CN': '通过 with-add
打开添加按钮,并监听 add
事件自定义实现添加页签项的逻辑。',
'en-US':
'Open the add button through with-add
and listen for the add
event to customize the logic for adding tag items.'
},
- 'codeFiles': ['with-add.vue']
+ codeFiles: ['with-add.vue']
},
{
- 'demoId': 'tabs-events-close',
- 'name': { 'zh-CN': '删除', 'en-US': 'Delete' },
- 'desc': {
+ demoId: 'tabs-events-close',
+ name: {
+ 'zh-CN': '删除',
+ 'en-US': 'Delete'
+ },
+ desc: {
'zh-CN':
'通过 with-close
打开关闭按钮,并监听 close
事件自定义实现删除页签项的逻辑。',
'en-US':
'Open the close button through with-close
and listen to the close
event to customize the logic of deleting tag items.'
},
- 'codeFiles': ['tabs-events-close.vue']
+ codeFiles: ['tabs-events-close.vue']
},
{
- 'demoId': 'position',
- 'name': { 'zh-CN': '位置', 'en-US': 'Position' },
- 'desc': {
+ demoId: 'position',
+ name: {
+ 'zh-CN': '位置',
+ 'en-US': 'Position'
+ },
+ desc: {
'zh-CN':
'通过 position
设置显示位置,可选值有 top
、 right
、 bottom
、 left
,默认为 top
。',
'en-US':
'Set the display position through position
. The optional values include top
, right
, bottom
, and left
. The default value is top
.'
},
- 'codeFiles': ['position.vue']
+ codeFiles: ['position.vue']
},
{
- 'demoId': 'tooltip',
- 'name': { 'zh-CN': '提示', 'en-US': 'Tip' },
- 'desc': {
+ demoId: 'tooltip',
+ name: {
+ 'zh-CN': '提示',
+ 'en-US': 'Tip'
+ },
+ desc: {
'zh-CN': '通过 tooltip-config
设置 Title 提示。',
'en-US': 'Set the Title prompt through tooltip-config
.'
},
- 'codeFiles': ['tooltip.vue']
+ codeFiles: ['tooltip.vue']
},
{
- 'demoId': 'before-leave',
- 'name': { 'zh-CN': '阻止切换', 'en-US': 'Block switching' },
- 'desc': {
+ demoId: 'before-leave',
+ name: {
+ 'zh-CN': '阻止切换',
+ 'en-US': 'Block switching'
+ },
+ desc: {
'zh-CN':
'通过 before-leave
钩子函数处理切换页签项前的逻辑,若返回是 false
或 Promise.reject
,则阻止切换,返回 true 则可以切换。',
'en-US':
'Use the before-leave
hook function to handle the logic before switching label items. If false
or Promise.reject
is returned, the switch is blocked, and if true is returned, the switch can be made.'
},
- 'codeFiles': ['before-leave.vue']
+ codeFiles: ['before-leave.vue']
},
{
- 'demoId': 'stretch-wh',
- 'name': { 'zh-CN': '自动撑宽', 'en-US': 'Automatic widening' },
- 'desc': {
+ demoId: 'stretch-wh',
+ name: {
+ 'zh-CN': '自动撑宽',
+ 'en-US': 'Automatic widening'
+ },
+ desc: {
'zh-CN': '通过 stretch
设置页签项的宽度是否自撑开,默认为 false 。',
'en-US':
'Set whether the width of the label item is self expanding by stretch
, and the default is false.'
},
- 'codeFiles': ['stretch-wh.vue']
+ codeFiles: ['stretch-wh.vue']
},
{
- 'demoId': 'custom-tab-title',
- 'name': { 'zh-CN': '定义页签项标题', 'en-US': 'Custom Tab Item Title' },
- 'desc': {
+ demoId: 'custom-tab-title',
+ name: {
+ 'zh-CN': '定义页签项标题',
+ 'en-US': 'Custom Tab Item Title'
+ },
+ desc: {
'zh-CN': '通过 TabItem
的 title
插槽自定义页签项标题,比如在标题前增加图标。',
'en-US':
'Customize the title of the tab page through the title
slot of the TabItem
, for example, add an icon before the title. '
},
- 'codeFiles': ['custom-tab-title.vue']
+ codeFiles: ['custom-tab-title.vue']
},
{
- 'demoId': 'lazy',
- 'name': { 'zh-CN': '懒加载', 'en-US': 'Lazy Loading' },
- 'desc': {
+ demoId: 'lazy',
+ name: {
+ 'zh-CN': '懒加载',
+ 'en-US': 'Lazy Loading'
+ },
+ desc: {
'zh-CN': '通过 lazy
设置页签项内容懒加载,默认值为 false
。',
'en-US':
'By setting the lazy loading of label item content through lazy
, the default value is false
.'
},
- 'codeFiles': ['lazy.vue']
+ codeFiles: ['lazy.vue']
},
{
- 'demoId': 'tabs-second-layer',
- 'name': { 'zh-CN': '多层级', 'en-US': 'Multi Level' },
- 'desc': { 'zh-CN': '通过嵌套使用即可。', 'en-US': 'It can be used through nesting.' },
- 'codeFiles': ['tabs-second-layer.vue']
+ demoId: 'tabs-second-layer',
+ name: {
+ 'zh-CN': '多层级',
+ 'en-US': 'Multi Level'
+ },
+ desc: {
+ 'zh-CN': '通过嵌套使用即可。',
+ 'en-US': 'It can be used through nesting.'
+ },
+ codeFiles: ['tabs-second-layer.vue']
},
{
- 'demoId': 'show-different-grid-data',
- 'name': { 'zh-CN': '与Grid结合', 'en-US': 'Combining with Grid' },
- 'desc': {
+ demoId: 'show-different-grid-data',
+ name: {
+ 'zh-CN': '与Grid结合',
+ 'en-US': 'Combining with Grid'
+ },
+ desc: {
'zh-CN': 'Grid组件需要设置 :auto-resize=“true”
,自适应父元素 TabItem
相应变化。',
'en-US':
'The Grid component needs to set :auto-resize="true"
to adapt to the corresponding changes of the parent element TabItem
.'
},
- 'codeFiles': ['show-different-grid-data.vue']
+ codeFiles: ['show-different-grid-data.vue']
},
{
- 'demoId': 'tabs-draggable',
- 'name': { 'zh-CN': '拖拽', 'en-US': 'Drag' },
- 'desc': {
- 'zh-CN': `drop-config
设置 Sortable
排序插件;
- tab-drag-start
监听拖拽开始事件;
- tab-drag-over
监听拖拽中事件;
- tab-drag-end
监听拖拽结束事件,以此改变页签项顺序。
`,
- 'en-US': ` drop configuration
Set the Sortable
sorting plugin
- tab-drag-start
Listen for drag start events
- tab-drag-over
Listen for dragging events
- tab-drag-end
Listen for drag end events to change the order of tags.
`
+ demoId: 'tabs-draggable',
+ name: {
+ 'zh-CN': '拖拽',
+ 'en-US': 'Drag'
},
- 'codeFiles': ['tabs-draggable.vue']
+ desc: {
+ 'zh-CN':
+ 'drop-config
设置 Sortable
排序插件;
\n tab-drag-start
监听拖拽开始事件;
\n tab-drag-over
监听拖拽中事件;
\n tab-drag-end
监听拖拽结束事件,以此改变页签项顺序。
',
+ 'en-US':
+ ' drop configuration
Set the Sortable
sorting plugin
\n tab-drag-start
Listen for drag start events
\n tab-drag-over
Listen for dragging events
\n tab-drag-end
Listen for drag end events to change the order of tags.
'
+ },
+ codeFiles: ['tabs-draggable.vue']
},
{
- 'demoId': 'tabs-events-click',
- 'name': { 'zh-CN': '点击事件', 'en-US': 'Click Event' },
- 'desc': {
+ demoId: 'tabs-events-click',
+ name: {
+ 'zh-CN': '点击事件',
+ 'en-US': 'Click Event'
+ },
+ desc: {
'zh-CN': '通过 click
监听单击页签项事件。',
'en-US': 'Listen for tag item click events through click
.'
},
- 'codeFiles': ['tabs-events-click.vue']
+ codeFiles: ['tabs-events-click.vue']
},
{
- 'demoId': 'tabs-events-edit',
- 'name': { 'zh-CN': '编辑事件', 'en-US': 'Edit Event' },
- 'desc': {
+ demoId: 'tabs-events-edit',
+ name: {
+ 'zh-CN': '编辑事件',
+ 'en-US': 'Edit Event'
+ },
+ desc: {
'zh-CN':
'通过 editable
设置同时显示 删除
和 添加
按钮, edit
监听这两类按钮的点击事件。',
'en-US':
'By setting edit
to display both delete
and add
buttons, edit
listens for click events of these two types of buttons.'
},
- 'codeFiles': ['tabs-events-edit.vue']
- }
- ],
- apis: [
- {
- 'name': 'tabs',
- 'type': 'component',
- 'props': [
- {
- 'name': 'active-name',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置初始选中的页签项', 'en-US': 'Set initially selected label items' },
- 'demoId': 'tab-style-card'
- },
- {
- 'name': 'before-leave',
- 'type': '(activeName: string, oldActiveName: string) => boolean | Promise',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '切换页签项之前的钩子,若返回 false 或返回 Promise 且被 reject,则阻止切换; activeName: 即将切换的页签项名称, oldActiveName: 当前页签项名称',
- 'en-US':
- 'The hook before the tag is switched. If false is returned or Promise is returned and rejected, the switch is blocked; ActiveName: The name of the label item that is about to be switched, oldActiveName: The name of the current label item'
- },
- 'demoId': 'before-leave'
- },
- {
- 'name': 'drop-config',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '启用页签拖拽功能,配置第三方排序插件,对页签项进行重新排序;需注意:不是通过 v-for 渲染的 tab-item,在拖拽排序后,无法在 tab-drag-end 事件中对其顺序进行保存',
- 'en-US':
- 'Enable tab drag and drop functionality, configure third-party sorting plugins, and reorder tabs; Please note that tab items that are not rendered through v-for cannot be saved in the tab drag end event after dragging and sorting'
- },
- 'demoId': 'tabs-draggable'
- },
- {
- 'name': 'editable',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否同时显示添加和删除按钮,与 edit 事件搭配使用',
- 'en-US': 'Do you want to display both add and delete buttons for use with the edit event'
- },
- 'demoId': 'tabs-events-edit'
- },
- {
- 'name': 'modelValue / v-model',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '绑定选中值,选中项的 name',
- 'en-US': 'Bound selected value, The name of the selected item'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'popper-class',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '为"更多"下拉页签框添加类名,可用于自定义下拉选项的样式',
- 'en-US':
- 'Add a class name to the “More” dropdown label box, which can be used to customize the style of dropdown options'
- },
- 'demoId': 'custom-more-icon'
- },
- {
- 'name': 'position',
- 'type': 'IPosition',
- 'typeAnchorName': 'IPosition',
- 'defaultValue': `'top'`,
- 'desc': {
- 'zh-CN': '设置页签栏所在位置; 默认为 top',
- 'en-US': 'Set the location of the label bar; Default to top'
- },
- 'demoId': 'position'
- },
- {
- 'name': 'separator',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '设置分隔符样式',
- 'en-US': 'Set Separator Style'
- },
- 'demoId': 'tabs-separator'
- },
- {
- 'name': 'show-more-tabs',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN':
- '设置当页签栏超过一定宽度时是否显示"更多"按钮,若为 true,则当鼠标悬停到按钮上时,将出现下拉框展示超出宽度的页签项',
- 'en-US':
- 'Set whether to display the "More" button when the label bar exceeds a certain width. If true, a drop-down box will appear when the mouse hovers over the button to display label items that exceed the width'
- },
- 'demoId': 'custom-more-icon'
- },
- {
- 'name': 'size',
- 'type': '"small"',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置页签尺寸,当与 tab-style 为 card 或者 border-card 时生效, 该属性可选值为 small',
- 'en-US':
- 'Sets the tabs size. This attribute is valid only when tab-style is set to card or border-card. The value of this attribute can be small'
- },
- 'demoId': 'tab-style-card'
- },
- {
- 'name': 'stretch',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '页签项的宽度是否自动撑开',
- 'en-US': 'Does the width of the label item automatically expand'
- },
- 'demoId': 'stretch-wh'
- },
- {
- 'name': 'tab-style',
- 'type': 'ITabStyle',
- 'typeAnchorName': 'ITabStyle',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '页签的类型;默认为空字符串',
- 'en-US': 'Tabs style; Default to empty string'
- },
- 'demoId': 'tab-style-card'
- },
- {
- 'name': 'tooltip-config',
- 'type': 'ITooltipProps | "title"',
- 'typeAnchorName': 'ITooltipProps',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '设置文字超出提示, object 类型的值参考 tooltip 组件的 Props 配置,如果想使用默认的 title 属性,可设置为 string 类型,值为 title,【3.8.0版本新增】',
- 'en-US':
- 'Set the message indicating that the text exceeds the limit. The value of the object type refers to the Props configuration of the tooltip component. If you want to use the default title attribute, set it to the string type and set it to title. [Added in 3.8.0]'
- },
- 'demoId': 'tooltip'
- },
- {
- 'name': 'with-add',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否显示添加按钮,用来添加页签项',
- 'en-US': 'Do you want to display the add button to add tab item'
- },
- 'demoId': 'with-add'
- },
- {
- 'name': 'with-close',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否显示页签项的关闭按钮,用来删除页签项',
- 'en-US': 'Do you want to display the close button for label items to delete them'
- },
- 'demoId': 'tabs-events-close'
- }
- ],
- 'events': [
- {
- 'name': 'add',
- 'type': '() => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点击"添加"按钮后触发,用于编写增加页签项的逻辑',
- 'en-US': 'Triggered after clicking the "Add" button, used to write logic for adding tab items'
- },
- 'demoId': 'with-add'
- },
- {
- 'name': 'click',
- 'type': '(TabItem: Component, event: Event) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点击页签项时触发,tab 被选中时触发; TabItem: 点中页签项的vueComponent对象信息',
- 'en-US':
- 'Trigger an event when clicking on a tab item, Triggered when tab is selected; TabItem: Click on the Component object information of the tab item in the middle'
- },
- 'demoId': 'tabs-events-click'
- },
- {
- 'name': 'close',
- 'type': '(name: string) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点击页签项关闭按钮后触发,用于编写删除页签项的逻辑; name: 要删除的页签项name值',
- 'en-US':
- 'Triggered after clicking the tab item close button, used to write logic for deleting tab items; name: The name value of the tab item to be deleted'
- },
- 'demoId': 'tabs-events-close'
- },
- {
- 'name': 'edit',
- 'type': '(name: string, type: "add" | "remove") => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点击"添加"或"关闭"按钮触发; name:null或删除的tab名称, type:添加或删除字段',
- 'en-US':
- 'Click the "Add" or "Close" button to trigger; name: null or deleted tab name, type: added or deleted field'
- },
- 'demoId': 'tabs-events-edit'
- },
- {
- 'name': 'tab-drag-end',
- 'type': '(event: DragEvent) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '拖动结束后的事件',
- 'en-US': 'Event after the drag is complete'
- },
- 'demoId': 'tabs-draggable'
- },
- {
- 'name': 'tab-drag-over',
- 'type': '(event: DragEvent) => void',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '拖动中的事件', 'en-US': 'Dragging event' },
- 'demoId': 'tabs-draggable'
- },
- {
- 'name': 'tab-drag-start',
- 'type': '(event: DragEvent) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '拖动开始时的事件',
- 'en-US': 'Drag start event'
- },
- 'demoId': 'tabs-draggable'
- }
- ],
- 'slots': [
- {
- 'name': 'moreIcon',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '更多按钮插槽', 'en-US': 'More Button Slot' },
- 'demoId': 'custom-more-icon'
- },
- {
- 'name': 'title',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '页签项标题插槽', 'en-US': 'Label Item Title Slot' },
- 'demoId': 'custom-tab-title'
- }
- ]
- },
- {
- 'name': 'tab-item',
- 'type': 'component',
- 'props': [
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '设置页签项禁用,设置为 true 则无法点击',
- 'en-US': 'Set tab items to disable, set to true to prevent clicking'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'lazy',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '设置本页签项内容是否为懒加载,默认为否',
- 'en-US': 'Set whether the content of this tab is lazy loading, default to no'
- },
- 'demoId': 'lazy'
- },
- {
- 'name': 'name',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '页签项的值', 'en-US': 'Value of tab items' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'title',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '页签项标题', 'en-US': 'Tab Item Title' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'with-close',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '页签项是否展示删除按钮,与 Tabs 的 with-close 取或,只要有一个为true,则此项展示删除按钮',
- 'en-US': `Does the tab item display a delete button, which is equal to or greater than the 'with close' option in Tabs? As long as one of these options is true, this option displays the delete button`
- },
- 'demoId': 'tabs-events-close'
- }
- ],
- 'events': [
- {
- 'name': 'tab-nav-update',
- 'type': '() => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当页签项的 title 值发生变化时触发',
- 'en-US': 'Triggered when the title value of the tab item changes'
- },
- 'demoId': ''
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '页签项对应内容部分的默认插槽,用来自定义页签项对应的页面内容',
- 'en-US':
- 'The default slot for the content section corresponding to the tab item, used to customize the page content corresponding to the tab item'
- },
- 'demoId': 'basic-usage'
- }
- ]
- }
- ],
- types: [
- {
- name: 'IPosition',
- type: 'type',
- code: `
-type IPosition = 'top' | 'right' | 'bottom' | 'left'
-`
- },
- {
- name: 'ITabStyle',
- type: 'type',
- code: `
-type ITabStyle = 'card' | 'border-card' | 'button-card' | ''
-`
- },
- {
- name: 'ITooltipProps',
- type: 'interface',
- code: `
-interface ITooltipProps { // 参照tooltip的props进行配置
- effect?: string
- placement?: string
- visible?: string
- [propName: string]: any
-}
-`
+ codeFiles: ['tabs-events-edit.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/tag-group/webdoc/tag-group.js b/examples/sites/demos/pc/app/tag-group/webdoc/tag-group.js
index 6189db321..6e66cf195 100644
--- a/examples/sites/demos/pc/app/tag-group/webdoc/tag-group.js
+++ b/examples/sites/demos/pc/app/tag-group/webdoc/tag-group.js
@@ -3,106 +3,60 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'basic usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'basic usage'
+ },
+ desc: {
'zh-CN':
'通过 name
属性设置对应标签名。通过 type
属性可以为标签设置相应的类型,可选值 (success / warning / info / danger )
。
',
'en-US':
'Set the name of the corresponding tag through the name
attribute.You can set the type of a tag through the type
attribute. The value can be (success / warning / info / danger)
. info
. '
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'tag-group-size',
- 'name': { 'zh-CN': '尺寸', 'en-US': 'size' },
- 'desc': {
+ demoId: 'tag-group-size',
+ name: {
+ 'zh-CN': '尺寸',
+ 'en-US': 'size'
+ },
+ desc: {
'zh-CN':
'可通过 size
设置标签组标签大小,可选值 medium / small / mini
,默认值为 medium
。
',
'en-US':
'You can use size
to set the label size of a label group. The options are medium / small / mini
. The default value is medium
. '
},
- 'codeFiles': ['tag-group-size.vue']
+ codeFiles: ['tag-group-size.vue']
},
{
- 'demoId': 'tag-group-effect',
- 'name': { 'zh-CN': '主题', 'en-US': 'effect' },
- 'desc': {
+ demoId: 'tag-group-effect',
+ name: {
+ 'zh-CN': '主题',
+ 'en-US': 'effect'
+ },
+ desc: {
'zh-CN':
'可通过 effect
设置 TagGroup 标签组 标签主题,可选值 dark / light / plain
,默认值为 light
。
',
'en-US':
'You can use effect
to set the tag group tag theme. The options are dark / light / plain
. The default value is light
. '
},
- 'codeFiles': ['tag-group-effect.vue']
+ codeFiles: ['tag-group-effect.vue']
},
{
- 'demoId': 'tag-group-event',
- 'name': { 'zh-CN': 'Click 事件', 'en-US': 'click event' },
- 'desc': {
+ demoId: 'tag-group-event',
+ name: {
+ 'zh-CN': 'Click 事件',
+ 'en-US': 'click event'
+ },
+ desc: {
'zh-CN':
'TagGroup 标签组提供了 item-click
事件,item-click
事件默认提供的参数有 item,index,event
。
',
'en-US':
'The TagGroup tag group provides the item-click event. By default, the item-click event provides the following parameters: item, index, and event
. '
},
- 'codeFiles': ['tag-group-event.vue']
- }
- ],
- apis: [
- {
- 'name': 'tag-group',
- 'type': 'component',
- 'props': [
- {
- 'name': 'data',
- 'type': 'ITagGroupDataItem[]',
- 'defaultValue': '',
- 'typeAnchorName': 'ITagGroupDataItem',
- 'desc': { 'zh-CN': ' 数据源', 'en-US': 'Data source' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'size',
- 'type': "'medium' | 'small' | 'mini'",
- 'defaultValue': "'medium'",
- 'desc': {
- 'zh-CN': '尺寸',
- 'en-US': 'Size '
- },
- 'demoId': 'tag-group-size'
- },
- {
- 'name': 'effect',
- 'type': "'dark' | 'light' | 'plain'",
- 'defaultValue': "'light'",
- 'desc': {
- 'zh-CN': '主题',
- 'en-US': 'Effect'
- },
- 'demoId': 'tag-group-effect'
- }
- ],
- 'events': [
- {
- 'name': 'item-click',
- 'type': 'ITagGroupItemClick',
- 'typeAnchorName': 'ITagGroupItemClick',
- 'desc': { 'zh-CN': '单个标签的点击事件', 'en-US': 'Click event of a single tag. ' },
- 'demoId': 'tag-group-event'
- }
- ],
- 'slots': []
- }
- ],
- types: [
- {
- name: 'ITagGroupDataItem',
- type: 'type',
- code: `type ITagGroupDataItem = { name: string, type?: 'success' | 'info' | 'warning' | 'danger' }`
- },
- {
- name: 'ITagGroupItemClick',
- type: 'type',
- code: `type ITagGroupItemClick = (item: ITagGroupDataItem, index: number, event: Event) => void`
+ codeFiles: ['tag-group-event.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/tag/webdoc/tag.js b/examples/sites/demos/pc/app/tag/webdoc/tag.js
index b5676ed9d..c78e0ef22 100644
--- a/examples/sites/demos/pc/app/tag/webdoc/tag.js
+++ b/examples/sites/demos/pc/app/tag/webdoc/tag.js
@@ -3,235 +3,119 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '通过 size
设置尺寸大小,可选值: (medium / small / mini)
。',
'en-US': 'Set the size through size
, with optional values: (medium/small/mini)
.'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'content',
- 'name': { 'zh-CN': '配置式', 'en-US': 'Bind Value' },
- 'desc': {
+ demoId: 'content',
+ name: {
+ 'zh-CN': '配置式',
+ 'en-US': 'Bind Value'
+ },
+ desc: {
'zh-CN': '通过 value
设置标签值。',
'en-US': 'Set label values through value
. '
},
- 'codeFiles': ['content.vue']
+ codeFiles: ['content.vue']
},
{
- 'demoId': 'color3',
- 'name': { 'zh-CN': '背景色与边框', 'en-US': 'Background color and border' },
- 'desc': {
+ demoId: 'color3',
+ name: {
+ 'zh-CN': '背景色与边框',
+ 'en-US': 'Background color and border'
+ },
+ desc: {
'zh-CN': '通过 color
设置背景色, hit
设置边框。',
'en-US': 'Set the size through size
, with optional values: (medium/small/mini)
.'
},
- 'codeFiles': ['color3.vue']
+ codeFiles: ['color3.vue']
},
{
- 'demoId': 'effect',
- 'name': { 'zh-CN': '主题', 'en-US': 'Subject' },
- 'desc': {
+ demoId: 'effect',
+ name: {
+ 'zh-CN': '主题',
+ 'en-US': 'Subject'
+ },
+ desc: {
'zh-CN':
'通过 effect
设置主题,可选值: (dark / light / plain)
; type
设置类型,可选值: (success / info / warning / danger)
。',
'en-US':
'Set the theme through effect
, with optional values: (dark/light/plain)
; type
Set the type, optional values: (success/info/warning/danger)
.'
},
- 'codeFiles': ['effect.vue']
+ codeFiles: ['effect.vue']
},
{
- 'demoId': 'disabled',
- 'name': { 'zh-CN': '禁用', 'en-US': 'Disabled' },
- 'desc': {
+ demoId: 'disabled',
+ name: {
+ 'zh-CN': '禁用',
+ 'en-US': 'Disabled'
+ },
+ desc: {
'zh-CN': '通过 disabled
设置禁用。',
'en-US': 'You can set disabled
to disable. '
},
- 'codeFiles': ['disabled.vue']
+ codeFiles: ['disabled.vue']
},
{
- 'demoId': 'delete',
- 'name': { 'zh-CN': '删除操作', 'en-US': 'Delete' },
- 'desc': {
+ demoId: 'delete',
+ name: {
+ 'zh-CN': '删除操作',
+ 'en-US': 'Delete'
+ },
+ desc: {
'zh-CN':
'通过 closable
设置展示关闭按钮, before-delete
设置删除前的操作,可以在此钩子中做提示或确认;close
监听关闭按钮点击事件,做删除操作。',
'en-US':
'Set the display close button throughclose
, andbefore-delete
to set the operation before deletion, which can be prompted or confirmed in this hook< Code>closeListen to the close button click event and perform the deletion operation.'
},
- 'codeFiles': ['delete.vue']
+ codeFiles: ['delete.vue']
},
{
- 'demoId': 'create',
- 'name': { 'zh-CN': '动态编辑', 'en-US': 'Dynamic Edit' },
- 'desc': {
- 'zh-CN': `添加新标签:监听 + New Tag
元素点击事件,打开 input
输入框,监听输入框事件做添加操作;
- 修改旧标签:监听旧标签的双击事件,打开 input
输入框,监听输入框事件做修改操作。`,
- 'en-US': `Add a new tag: listen for +New Tag
element click events, open the input
input box, and listen for input box events to add
- Modify old tags: listen for double click events on old tags, open the input
input box, and listen for input box events to make modifications.`
+ demoId: 'create',
+ name: {
+ 'zh-CN': '动态编辑',
+ 'en-US': 'Dynamic Edit'
},
- 'codeFiles': ['create.vue']
+ desc: {
+ 'zh-CN':
+ '添加新标签:监听 + New Tag
元素点击事件,打开 input
输入框,监听输入框事件做添加操作;
\n 修改旧标签:监听旧标签的双击事件,打开 input
输入框,监听输入框事件做修改操作。',
+ 'en-US':
+ 'Add a new tag: listen for +New Tag
element click events, open the input
input box, and listen for input box events to add
\n Modify old tags: listen for double click events on old tags, open the input
input box, and listen for input box events to make modifications.'
+ },
+ codeFiles: ['create.vue']
},
{
- 'demoId': 'slot-default',
- 'name': { 'zh-CN': '图标型', 'en-US': 'Icon type' },
- 'desc': {
+ demoId: 'slot-default',
+ name: {
+ 'zh-CN': '图标型',
+ 'en-US': 'Icon type'
+ },
+ desc: {
'zh-CN': '通过 default
默认插槽自定义标签内容,生成图标标签。',
'en-US':
'Generate icon labels by customizing the label content for the default slot through default
.'
},
- 'codeFiles': ['slot-default.vue']
+ codeFiles: ['slot-default.vue']
},
{
- 'demoId': 'tag-event-click',
- 'name': { 'zh-CN': '点击事件', 'en-US': 'Click Event' },
- 'desc': {
+ demoId: 'tag-event-click',
+ name: {
+ 'zh-CN': '点击事件',
+ 'en-US': 'Click Event'
+ },
+ desc: {
'zh-CN': '通过 click
监听点击事件。',
'en-US': 'Listen for click events through click
.'
},
- 'codeFiles': ['tag-event-click.vue']
- }
- ],
- apis: [
- {
- 'name': 'tag',
- 'type': 'component',
- 'props': [
- {
- 'name': 'before-delete',
- 'type': '(close: () => void) => void',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '删除前回调函数', 'en-US': 'Delete callback function before deletion' },
- 'demoId': 'delete'
- },
- {
- 'name': 'closable',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否可关闭', 'en-US': 'Can be disabled' },
- 'demoId': 'delete'
- },
- {
- 'name': 'color',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '背景色:rgb,rgba,hex 三种格式',
- 'en-US': 'Background color: The value can be in rgb, rgba, or hex format'
- },
- 'demoId': 'color3'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否禁用', 'en-US': 'Whether to disable' },
- 'demoId': 'disabled'
- },
- {
- 'name': 'effect',
- 'type': 'IEffect',
- 'typeAnchorName': 'IEffect',
- 'defaultValue': `'light'`,
- 'desc': {
- 'zh-CN': '主题',
- 'en-US': 'Subject'
- },
- 'demoId': 'effect'
- },
- {
- 'name': 'hit',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否有边框', 'en-US': 'Whether there is a border stroke' },
- 'demoId': 'color3'
- },
- {
- 'name': 'size',
- 'type': 'ISize',
- 'typeAnchorName': 'ISize',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '尺寸',
- 'en-US': 'Size'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'type',
- 'type': 'IType',
- 'typeAnchorName': 'IType',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '显示类型',
- 'en-US': 'Display type'
- },
- 'demoId': 'effect'
- },
- {
- 'name': 'value',
- 'type': 'number | string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '配置式标签,自定义标签内容【3.9.1新增】',
- 'en-US': 'Configurable labels, custom label content [Added in 3.9.1]'
- },
- 'demoId': 'content'
- }
- ],
- 'events': [
- {
- 'name': 'click',
- 'type': '(event: Event) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点击标签时触发的事件',
- 'en-US': 'Event triggered when clicking on Tag'
- },
- 'demoId': 'tag-event-click'
- },
- {
- 'name': 'close',
- 'type': '(event: Event)) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点击关闭按钮时触发的事件',
- 'en-US': 'Event triggered when the close button is clicked'
- },
- 'demoId': 'delete'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '标签内容', 'en-US': 'Label Content' },
- 'demoId': 'slot-default'
- }
- ]
- }
- ],
- types: [
- {
- name: 'IEffect',
- type: 'type',
- code: `
-type IEffect = 'dark' | 'light' | 'plain'
-`
- },
- {
- name: 'ISize',
- type: 'type',
- code: `
-type ISize = 'medium' | 'small' | 'mini' | ''
-`
- },
- {
- name: 'IType',
- type: 'type',
- code: `
-type IType = 'success' | 'info' | 'mini' | 'warning' | 'danger'
-`
+ codeFiles: ['tag-event-click.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/text-popup/webdoc/text-popup.js b/examples/sites/demos/pc/app/text-popup/webdoc/text-popup.js
index 0f7c1656b..d23d3ba32 100644
--- a/examples/sites/demos/pc/app/text-popup/webdoc/text-popup.js
+++ b/examples/sites/demos/pc/app/text-popup/webdoc/text-popup.js
@@ -3,111 +3,90 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['basic-usage.vue']
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'placeholder',
- 'name': { 'zh-CN': '提示占位文本', 'en-US': 'Prompt Placeholder Text' },
- 'desc': {
+ demoId: 'placeholder',
+ name: {
+ 'zh-CN': '提示占位文本',
+ 'en-US': 'Prompt Placeholder Text'
+ },
+ desc: {
'zh-CN': 'placeholder
属性的值为 string
此属性会把值默认显示到输入框中。
\n',
'en-US':
'The value of the placeholder
attribute is string
. This attribute displays the value in the text box by default.
\n'
},
- 'codeFiles': ['placeholder.vue']
+ codeFiles: ['placeholder.vue']
},
{
- 'demoId': 'readonly',
- 'name': { 'zh-CN': '只读', 'en-US': 'Read-only' },
- 'desc': {
+ demoId: 'readonly',
+ name: {
+ 'zh-CN': '只读',
+ 'en-US': 'Read-only'
+ },
+ desc: {
'zh-CN': '通过 readonly
设置是否只读。
\n',
'en-US': 'You can use readonly
to set whether to read only.
\n'
},
- 'codeFiles': ['readonly.vue']
+ codeFiles: ['readonly.vue']
},
{
- 'demoId': 'separtor',
- 'name': { 'zh-CN': '分隔符', 'en-US': 'Separator' },
- 'desc': {
+ demoId: 'separtor',
+ name: {
+ 'zh-CN': '分隔符',
+ 'en-US': 'Separator'
+ },
+ desc: {
'zh-CN': '通过 separtor
设置分隔符,在文本框中输入回车就是分隔符的位置。
\n',
'en-US':
'You can use separtor
to set the separator. Enter the position of the separator in the text box and press Enter.
\n'
},
- 'codeFiles': ['separtor.vue']
+ codeFiles: ['separtor.vue']
},
{
- 'demoId': 'value',
- 'name': { 'zh-CN': '绑定值', 'en-US': 'Bound Value' },
- 'desc': {
+ demoId: 'value',
+ name: {
+ 'zh-CN': '绑定值',
+ 'en-US': 'Bound Value'
+ },
+ desc: {
'zh-CN': '通过 value
或 v-model
设置绑定值。
\n',
'en-US': 'You can set the binding value using value
or v-model
.
\n'
},
- 'codeFiles': ['value.vue']
+ codeFiles: ['value.vue']
},
{
- 'demoId': 'clear-value',
- 'name': { 'zh-CN': '清除 value 值', 'en-US': 'Clear value' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['clear-value.vue']
+ demoId: 'clear-value',
+ name: {
+ 'zh-CN': '清除 value 值',
+ 'en-US': 'Clear value'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['clear-value.vue']
},
{
- 'demoId': 'width',
- 'name': { 'zh-CN': '宽度', 'en-US': 'Width' },
- 'desc': {
+ demoId: 'width',
+ name: {
+ 'zh-CN': '宽度',
+ 'en-US': 'Width'
+ },
+ desc: {
'zh-CN': '通过 width
设置宽度。
\n',
'en-US': 'You can set the width through width
.
\n'
},
- 'codeFiles': ['width.vue']
- }
- ],
- apis: [
- {
- 'name': 'text-popup',
- 'type': 'component',
- 'props': [
- {
- 'name': 'value',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '绑定值', 'en-US': 'Bound Value' },
- 'demoId': 'value'
- },
- {
- 'name': 'placeholder',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '输入框内的提示占位文本',
- 'en-US': 'Set the prompt placeholder text in the text box.'
- },
- 'demoId': 'placeholder'
- },
- {
- 'name': 'readonly',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '是否只读', 'en-US': 'Set whether to read only' },
- 'demoId': 'readonly'
- },
- {
- 'name': 'width',
- 'type': 'number , string',
- 'defaultValue': '150',
- 'desc': { 'zh-CN': '宽度', 'en-US': 'Set width' },
- 'demoId': 'width'
- },
- {
- 'name': 'separtor',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '分隔符', 'en-US': 'Separator' },
- 'demoId': 'separtor'
- }
- ],
- 'events': [],
- 'slots': []
+ codeFiles: ['width.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/steps/show-divider-composition-api.vue b/examples/sites/demos/pc/app/time-line/show-divider-composition-api.vue
similarity index 73%
rename from examples/sites/demos/pc/app/steps/show-divider-composition-api.vue
rename to examples/sites/demos/pc/app/time-line/show-divider-composition-api.vue
index 2f799862e..f6befbcd1 100644
--- a/examples/sites/demos/pc/app/steps/show-divider-composition-api.vue
+++ b/examples/sites/demos/pc/app/time-line/show-divider-composition-api.vue
@@ -4,11 +4,11 @@
diff --git a/examples/sites/demos/pc/app/steps/slot-description.spec.ts b/examples/sites/demos/pc/app/time-line/slot-description.spec.ts
similarity index 92%
rename from examples/sites/demos/pc/app/steps/slot-description.spec.ts
rename to examples/sites/demos/pc/app/time-line/slot-description.spec.ts
index a16f2ccc2..77d44f06e 100644
--- a/examples/sites/demos/pc/app/steps/slot-description.spec.ts
+++ b/examples/sites/demos/pc/app/time-line/slot-description.spec.ts
@@ -2,7 +2,7 @@ import { test, expect } from '@playwright/test'
test('节点描述信息插槽', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
- await page.goto('steps#slot-description')
+ await page.goto('time-line#slot-description')
const steps = page.locator('.pc-demo .tiny-steps')
const nodes = steps.locator('.tiny-timeline-item')
diff --git a/examples/sites/demos/pc/app/steps/slot-description.vue b/examples/sites/demos/pc/app/time-line/slot-description.vue
similarity index 61%
rename from examples/sites/demos/pc/app/steps/slot-description.vue
rename to examples/sites/demos/pc/app/time-line/slot-description.vue
index a8841f64a..753b0193a 100644
--- a/examples/sites/demos/pc/app/steps/slot-description.vue
+++ b/examples/sites/demos/pc/app/time-line/slot-description.vue
@@ -1,13 +1,15 @@
-
-
-
-
- {{ item.description }}
-
-
-
-
+
+
+
+
+
+ {{ item.description }}
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/time-line/text-position-composition-api.vue b/examples/sites/demos/pc/app/time-line/text-position-composition-api.vue
new file mode 100644
index 000000000..c3185c41a
--- /dev/null
+++ b/examples/sites/demos/pc/app/time-line/text-position-composition-api.vue
@@ -0,0 +1,23 @@
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/time-line/text-position.spec.ts b/examples/sites/demos/pc/app/time-line/text-position.spec.ts
new file mode 100644
index 000000000..b55c194ba
--- /dev/null
+++ b/examples/sites/demos/pc/app/time-line/text-position.spec.ts
@@ -0,0 +1,20 @@
+import { test, expect } from '@playwright/test'
+
+test('节点名称位置', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('time-line#text-position')
+
+ const timeline = page.locator('.pc-demo .tiny-steps')
+ const nodes = timeline.locator('.normal')
+
+ // 节点名称位于序号右侧
+ await expect(timeline.locator('.tiny-steps-normal')).toHaveClass(/text-right/)
+
+ // 点击切换节点状态
+ await nodes.first().locator('.name').click()
+ await expect(nodes.first()).toHaveClass(/process-current/)
+ await expect(nodes.nth(1)).toHaveClass(/process-wait/)
+ await nodes.nth(2).locator('.name').click()
+ await expect(nodes.nth(2)).toHaveClass(/process-current/)
+ await expect(nodes.nth(1)).toHaveClass(/process-done/)
+})
diff --git a/examples/sites/demos/pc/app/time-line/text-position.vue b/examples/sites/demos/pc/app/time-line/text-position.vue
new file mode 100644
index 000000000..c210f428d
--- /dev/null
+++ b/examples/sites/demos/pc/app/time-line/text-position.vue
@@ -0,0 +1,32 @@
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/time-line/timeline-item.spec.ts b/examples/sites/demos/pc/app/time-line/timeline-item.spec.ts
index 3408da9c2..f640bee4c 100644
--- a/examples/sites/demos/pc/app/time-line/timeline-item.spec.ts
+++ b/examples/sites/demos/pc/app/time-line/timeline-item.spec.ts
@@ -1,6 +1,6 @@
import { test, expect } from '@playwright/test'
-test('步骤条节点组件', async ({ page }) => {
+test('时间线节点组件', async ({ page }) => {
page.on('pageerror', (exception) => expect(exception).toBeNull())
await page.goto('time-line#basic-usage')
diff --git a/examples/sites/demos/pc/app/time-line/webdoc/time-line.js b/examples/sites/demos/pc/app/time-line/webdoc/time-line.js
index c6d15753d..3567cb43a 100644
--- a/examples/sites/demos/pc/app/time-line/webdoc/time-line.js
+++ b/examples/sites/demos/pc/app/time-line/webdoc/time-line.js
@@ -3,340 +3,175 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN':
'通过 data
属性设置时间线的节点数据;active
属性设置当前节点,click
监听单节点的点击事件。
\n',
'en-US':
'Use the data
attribute to set data, the active
attribute to set the selected node, and click
to listen to click event on node.
\n'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'timeline-item',
- 'name': { 'zh-CN': '时间线节点组件', 'en-US': 'Timeline Node Component' },
- 'desc': {
+ demoId: 'timeline-item',
+ name: {
+ 'zh-CN': '时间线节点组件',
+ 'en-US': 'Timeline Node Component'
+ },
+ desc: {
'zh-CN': '通过时间线节点组件 timeline-item
自定义单个节点的属性、事件和插槽。
\n',
'en-US':
'Customize the attributes, events, and slots of individual nodes through the timeline-item
component of the Timeline node component.
\n'
},
- 'codeFiles': ['timeline-item.vue']
+ codeFiles: ['timeline-item.vue']
},
{
- 'demoId': 'vertical-timeline',
- 'name': { 'zh-CN': '竖向时间线', 'en-US': 'Vertical Timeline' },
- 'desc': {
+ demoId: 'vertical-timeline',
+ name: {
+ 'zh-CN': '竖向时间线',
+ 'en-US': 'Vertical Timeline'
+ },
+ desc: {
'zh-CN':
'通过 vertical
属性设置为竖直方向时间线,reverse
设置是否逆序展示数据。
\n',
'en-US':
'Use the vertical
attribute to set the vertical timeline and reverse
to set whether display data in reverse order.
\n'
},
- 'codeFiles': ['vertical-timeline.vue']
+ codeFiles: ['vertical-timeline.vue']
},
{
- 'demoId': 'shape',
- 'name': { 'zh-CN': '圆点外观', 'en-US': 'Appearance of Node' },
- 'desc': {
+ demoId: 'text-position',
+ name: {
+ 'zh-CN': '节点名称位置',
+ 'en-US': 'Node name position'
+ },
+ desc: {
+ 'zh-CN': '通过 text-position
属性设置节点名称位置,仅适用于横向时间线。
',
+ 'en-US':
+ 'Set the position of the node name using the text-position
attribute, which applies only to horizontal timelines.
'
+ },
+ codeFiles: ['text-position.vue']
+ },
+ {
+ demoId: 'shape',
+ name: {
+ 'zh-CN': '圆点外观',
+ 'en-US': 'Appearance of Node'
+ },
+ desc: {
'zh-CN': '通过 shape
属性设置竖向时间线节点的外观风格。
',
'en-US': 'Use the shape
attribute to set the appearance of a vertical time line node.
'
},
- 'codeFiles': ['shape.vue']
+ codeFiles: ['shape.vue']
},
{
- 'demoId': 'status',
- 'name': { 'zh-CN': '节点状态', 'en-US': 'Status of Node' },
- 'desc': {
- 'zh-CN': '在单项数据中使用 status
指定对应节点的状态。
',
- 'en-US': 'Use the shape
attribute to set the appearance of a vertical time line node.
'
+ demoId: 'status',
+ name: {
+ 'zh-CN': '节点状态',
+ 'en-US': 'Status of Node'
},
- 'codeFiles': ['status.vue']
+ desc: {
+ 'zh-CN': '横向时间线可以使用 error
|disabled
指定单节点的状态。
',
+ 'en-US':
+ 'Use the error
or disabled
attribute to set the appearance of a horizontal timeline node.
'
+ },
+ codeFiles: ['status.vue']
},
{
- 'demoId': 'set-node-width',
- 'name': { 'zh-CN': '宽度', 'en-US': 'Width Setting' },
- 'desc': {
+ demoId: 'set-node-width',
+ name: {
+ 'zh-CN': '宽度',
+ 'en-US': 'Width Setting'
+ },
+ desc: {
'zh-CN': '通过 space
属性设置节点的宽度。
\n',
'en-US': 'Use the space
attribute to set the width of timeline node.
\n'
},
- 'codeFiles': ['set-node-width.vue']
+ codeFiles: ['set-node-width.vue']
},
{
- 'demoId': 'custom-horizontal-timeline',
- 'name': { 'zh-CN': '自定义横向时间线', 'en-US': 'Customizing a Horizontal Timeline' },
- 'desc': {
+ demoId: 'show-divider',
+ name: {
+ 'zh-CN': '底部分割线',
+ 'en-US': 'Bottom dividing line'
+ },
+ desc: {
'zh-CN':
- '通过 top
插槽可以自定义步骤条顶部内容,bottom
插槽自定义步骤条底部内容。
\n',
+ '通过 show-divider
属性设置是否显示时间线底部分隔线,仅当节点文本内容位于序号右边时生效。
',
+ 'en-US':
+ 'show-divider
attribute is used to set whether to display the bottom dividing line of the timeline. It only takes effect when the node text content is located to the right of the number.
'
+ },
+ codeFiles: ['show-divider.vue']
+ },
+ {
+ demoId: 'slot-description',
+ name: {
+ 'zh-CN': '节点描述插槽',
+ 'en-US': 'Node Description'
+ },
+ desc: {
+ 'zh-CN': '通过 description
插槽添加单个节点的描述信息。
',
+ 'en-US': 'Add description information for a single node through the description
slot.
'
+ },
+ codeFiles: ['slot-description.vue']
+ },
+ {
+ demoId: 'custom-horizontal-timeline',
+ name: {
+ 'zh-CN': '自定义横向时间线',
+ 'en-US': 'Customizing a Horizontal Timeline'
+ },
+ desc: {
+ 'zh-CN':
+ '通过 top
插槽可以自定义时间线顶部内容,bottom
插槽自定义时间线底部内容。
\n',
'en-US':
'If slot
is top
, you can customize the top content of the timeline. If
slot
is slot
, you can customize the bottom content of the timeline.
\n'
},
- 'codeFiles': ['custom-horizontal-timeline.vue']
+ codeFiles: ['custom-horizontal-timeline.vue']
},
{
- 'demoId': 'custom-vertical-timeline',
- 'name': { 'zh-CN': '自定义竖向时间线', 'en-US': 'Customized Vertical Timeline' },
- 'desc': {
+ demoId: 'custom-vertical-timeline',
+ name: {
+ 'zh-CN': '自定义竖向时间线',
+ 'en-US': 'Customized Vertical Timeline'
+ },
+ desc: {
'zh-CN':
- '通过left
插槽自定义步骤条左侧内容,right
插槽自定义步骤条右侧内容。
\n',
+ '通过 left
插槽自定义时间线左侧内容,right
插槽自定义时间线右侧内容。
\n',
'en-US':
'If slot
is set to left
, you can customize the content on the left of the timeline. If
slot
is set to right
, you can customize the content on the right of the timeline.
\n'
},
- 'codeFiles': ['custom-vertical-timeline.vue']
+ codeFiles: ['custom-vertical-timeline.vue']
},
{
- 'demoId': 'custom-field',
- 'name': { 'zh-CN': '自定义字段', 'en-US': 'Custom Field' },
- 'desc': {
+ demoId: 'custom-field',
+ name: {
+ 'zh-CN': '自定义字段',
+ 'en-US': 'Custom Field'
+ },
+ desc: {
'zh-CN':
'通过 name-field
属性设置节点信息中名称对应的字段名,time-field
属性设置节点时间信息对应的字段名。
\n',
'en-US':
'The name-field
attribute is used to set the field name corresponding to the node name in the node information, and the time-field
attribute is used to set the field name corresponding to the node time information.
\n'
},
- 'codeFiles': ['custom-field.vue']
+ codeFiles: ['custom-field.vue']
},
{
- 'demoId': 'set-start-value',
- 'name': { 'zh-CN': '序号起始值', 'en-US': 'Start value of the sequence number' },
- 'desc': {
+ demoId: 'set-start-value',
+ name: {
+ 'zh-CN': '序号起始值',
+ 'en-US': 'Start value of the sequence number'
+ },
+ desc: {
'zh-CN': '通过 start
属性设置时间线序号起始值。
\n',
'en-US': 'Set the start sequence number through the start
attribute.
\n'
},
- 'codeFiles': ['set-start-value.vue']
- }
- ],
- apis: [
- {
- 'name': 'time-line',
- 'type': 'component',
- 'props': [
- {
- 'name': 'active',
- 'type': 'number',
- 'defaultValue': '-1',
- 'desc': {
- 'zh-CN': '当前节点索引,从0开始计数',
- 'en-US': 'Current node index and count from 0'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'data',
- 'type': 'ITimelineItem',
- 'typeAnchorName': 'ITimelineItem',
- 'defaultValue': '[]',
- 'desc': {
- 'zh-CN': '节点数据',
- 'en-US': 'Nodes data'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'horizontal',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否水平方向',
- 'en-US': 'Whether horizontal constructure'
- },
- 'demoId': ''
- },
- {
- 'name': 'line-width',
- 'type': 'string | number',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '连接线长度,仅当 text-position 取值为 true 时生效,设置后 space 属性失效。',
- 'en-US':
- 'The length of the connection line and it is valid only when text-position is set to true. After setting, the space property is invalid'
- },
- 'demoId': ''
- },
- {
- 'name': 'name-field',
- 'type': 'string',
- 'defaultValue': "'name'",
- 'desc': {
- 'zh-CN': '节点名称对应的字段名',
- 'en-US': 'Set the field name in the node information.'
- },
- 'demoId': 'custom-field'
- },
- {
- 'name': 'reverse',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否逆序排列节点,仅用于竖式时间线',
- 'en-US': 'Whether the node in reverse order and only for vertical timeline'
- },
- 'demoId': 'vertical-timeline'
- },
- {
- 'name': 'shape',
- 'type': 'string',
- 'defaultValue': "'circle'",
- 'desc': {
- 'zh-CN': "圆点外形: 空心圆形或实心圆点,取值分别对应 'circle' | 'dot'",
- 'en-US': "Set the appearance of point, optional values include 'circle' and 'dot'"
- },
- 'demoId': 'shape'
- },
- {
- 'name': 'show-number',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '未完成状态的节点是否显示序号',
- 'en-US': 'Whether to display sequence numbers for unfinished states'
- },
- 'demoId': ''
- },
- {
- 'name': 'space',
- 'type': 'string | number',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '节点宽度, 取值为数字、带长度单位的数值字符串和百分比字符串,数字会默认以px为长度单位',
- 'en-US':
- 'Set the width of the timeline.The value can be a number, a numeric string with length units, or a percentage string. For numbers, the default length unit is px'
- },
- 'demoId': 'set-node-width'
- },
- {
- 'name': 'start',
- 'type': 'number',
- 'defaultValue': '1',
- 'desc': {
- 'zh-CN': '节点序号起始值',
- 'en-US': 'The start step sequence number.'
- },
- 'demoId': 'set-start-value'
- },
- {
- 'name': 'time-field',
- 'type': 'string',
- 'defaultValue': "'time'",
- 'desc': {
- 'zh-CN': '节点时间信息对应的字段名',
- 'en-US': 'The name of the field corresponding to the node time information'
- },
- 'demoId': 'custom-field'
- },
- {
- 'name': 'vertical',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否竖直方向',
- 'en-US': 'Vertical direction'
- },
- 'demoId': 'vertical-timeline'
- }
- ],
- 'events': [
- {
- 'name': 'click',
- 'type': '(index: number, node: ITimelineItem) => void',
- 'desc': {
- 'zh-CN': '节点的点击事件,参数:
index:点击节点的下标
node: 点击节点数据}',
- 'en-US': 'Click event of a node. arguments:
index: click the subscript of a node
node: node data'
- },
- 'demoId': 'basic-usage'
- }
- ],
- 'slots': [
- {
- 'name': 'bottom',
- 'desc': {
- 'zh-CN': '自定义节点底部内容',
- 'en-US': 'Customize bottom content for timeline item'
- },
- 'demoId': 'custom-normal-timeline'
- },
- {
- 'name': 'left',
- 'desc': {
- 'zh-CN': '自定义节点左侧内容',
- 'en-US': 'Customize left content for timeline item'
- },
- 'demoId': 'custom-vertical-timeline'
- },
- {
- 'name': 'right',
- 'desc': {
- 'zh-CN': '自定义节点右侧内容',
- 'en-US': 'Customize right content for timeline item'
- },
- 'demoId': 'custom-horizontal-timeline'
- },
- {
- 'name': 'top',
- 'desc': {
- 'zh-CN': '自定义节点顶部内容',
- 'en-US': 'Customize bottom content for timeline item'
- },
- 'demoId': 'custom-horizontal-timeline'
- }
- ]
- },
- {
- 'name': 'timeline-item',
- 'type': 'component',
- 'props': [
- {
- 'name': 'node',
- 'type': 'ITimelineItem',
- 'typeAnchorName': 'ITimelineItem',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '节点数据',
- 'en-US': 'Node data'
- },
- 'demoId': 'timeline-item'
- },
- {
- 'name': 'line-width',
- 'type': 'string | number',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '连接线长度,仅当 timeline 组件 text-position 属性取值为 true 时生效,设置后 space 属性失效',
- 'en-US':
- 'The length of the connection line and it is valid only when text-position is set to true. After setting, the space property is invalid'
- },
- 'demoId': ''
- },
- {
- 'name': 'space',
- 'type': 'string | number',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '节点宽度, 取值为数字、带长度单位的数值字符串和百分比字符串,数字会默认以px为长度单位',
- 'en-US':
- 'Set the width of the timeline.The value can be a number, a numeric string with length units, or a percentage string. For numbers, the default length unit is px'
- },
- 'demoId': 'set-node-width'
- }
- ]
- }
- ],
- types: [
- {
- 'name': 'ITimelineItem',
- 'type': 'interface',
- 'code': `
-interface ITimelineItem {
- name: string // 节点名称
- time: string // 节点时间
- error: boolean // 是否异常状态
- disabled: boolean // 是否禁用
- type: ITimelineItemType // 节点类型
-}
- `
- },
- {
- 'name': 'ITimelineItemType',
- 'type': 'type',
- 'code': `type ITimelineItemType = 'primary' | 'success' | 'warning' | 'error' | 'info'`
+ codeFiles: ['set-start-value.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/time-picker/event-composition-api.vue b/examples/sites/demos/pc/app/time-picker/event-composition-api.vue
index a8a49b4d4..8cc3ce409 100644
--- a/examples/sites/demos/pc/app/time-picker/event-composition-api.vue
+++ b/examples/sites/demos/pc/app/time-picker/event-composition-api.vue
@@ -23,15 +23,15 @@ function handleFocus() {
}
function blur() {
- Modal.message('blur事件')
+ Modal.message({ message: 'blur事件', status: 'info' })
}
function change() {
- Modal.message('change事件')
+ Modal.message({ message: 'change事件', status: 'info' })
}
function focus() {
- Modal.message('focus事件')
+ Modal.message({ message: 'focus事件', status: 'info' })
}
diff --git a/examples/sites/demos/pc/app/time-picker/picker-options-composition-api.vue b/examples/sites/demos/pc/app/time-picker/picker-options-composition-api.vue
new file mode 100644
index 000000000..978f98be0
--- /dev/null
+++ b/examples/sites/demos/pc/app/time-picker/picker-options-composition-api.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/time-picker/picker-options.spec.ts b/examples/sites/demos/pc/app/time-picker/picker-options.spec.ts
new file mode 100644
index 000000000..29d11ff32
--- /dev/null
+++ b/examples/sites/demos/pc/app/time-picker/picker-options.spec.ts
@@ -0,0 +1,20 @@
+import { test, expect } from '@playwright/test'
+
+test('选择时间范围', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('time-picker#is-range')
+
+ const startTime = page.getByRole('textbox').nth(1)
+ const endTime = page.getByRole('textbox').nth(2)
+ await page.getByRole('textbox').nth(1).click()
+ await page.getByText('42').first().click()
+ await page
+ .locator(
+ 'div:nth-child(2) > div:nth-child(2) > .tiny-time-spinner > div > .tiny-scrollbar__wrap > .tiny-scrollbar__view > li:nth-child(21) > span'
+ )
+ .first()
+ .click()
+ await page.getByRole('button', { name: '确定' }).click()
+ await expect(startTime).toHaveValue('18:42:00')
+ await expect(endTime).toHaveValue('20:50:00')
+})
diff --git a/examples/sites/demos/pc/app/time-picker/picker-options.vue b/examples/sites/demos/pc/app/time-picker/picker-options.vue
new file mode 100644
index 000000000..d9b20eeca
--- /dev/null
+++ b/examples/sites/demos/pc/app/time-picker/picker-options.vue
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/time-picker/webdoc/time-picker.js b/examples/sites/demos/pc/app/time-picker/webdoc/time-picker.js
index e0c47d68a..8093293f6 100644
--- a/examples/sites/demos/pc/app/time-picker/webdoc/time-picker.js
+++ b/examples/sites/demos/pc/app/time-picker/webdoc/time-picker.js
@@ -3,471 +3,201 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '默认是通过滚动的方式选择时间,arrow-control
属性可以设置通过箭头的方式选择时间。
',
'en-US':
'The default is to select the time by scrolling, and the arrow-control
property can be set to select the time by the arrow.'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'is-range',
- 'name': { 'zh-CN': '范围选择', 'en-US': 'Select time range' },
- 'desc': {
+ demoId: 'picker-options',
+ name: {
+ 'zh-CN': '固定时间范围',
+ 'en-US': 'Select time range'
+ },
+ desc: {
+ 'zh-CN': 'picker-options
设置固定时间范围
',
+ 'en-US': 'picker-options
Setting a fixed time range.
'
+ },
+ codeFiles: ['picker-options.vue']
+ },
+ {
+ demoId: 'is-range',
+ name: {
+ 'zh-CN': '选择时间范围',
+ 'en-US': 'Select time range'
+ },
+ desc: {
'zh-CN':
"is-range
设置是否为范围选择,默认为 false,range-separator
,设置范围选择分隔符(为可选值)默认为 '-'。
",
'en-US':
" is-range
whether the setting is range selection. Default is false, range-separator
, and the range selection delimiter (optional) defaults to'-'.
"
},
- 'codeFiles': ['is-range.vue']
+ codeFiles: ['is-range.vue']
},
{
- 'demoId': 'disabled',
- 'name': { 'zh-CN': '禁用状态', 'en-US': 'Disabled status' },
- 'desc': {
+ demoId: 'disabled',
+ name: {
+ 'zh-CN': '禁用状态',
+ 'en-US': 'Disabled status'
+ },
+ desc: {
'zh-CN':
'通过设置 disabled
为 true 后,禁用时间输入框。
通过设置 picker-options
的 selectableRange
属性,可以实现部分禁用,此时只能选择一部分时间。
',
'en-US':
'Disable the time input box by setting disabled
to true.
Partial disable can be achieved by setting the selectableRange property of picker-options, and only a part of time can be selected at this time.
'
},
- 'codeFiles': ['disabled.vue']
+ codeFiles: ['disabled.vue']
},
{
- 'demoId': 'placeholder',
- 'name': { 'zh-CN': '占位符', 'en-US': 'Placeholder' },
- 'desc': {
+ demoId: 'placeholder',
+ name: {
+ 'zh-CN': '占位符',
+ 'en-US': 'Placeholder'
+ },
+ desc: {
'zh-CN':
'通过 placeholder
属性设置时间输入框的占位符,通过 start-placeholder
/ end-placeholder
设置时间范围输入框的开始和结束时间的占位符。
',
'en-US':
'Set the placeholder for the time input box through the placeholder
property, and set the placeholder for the start and end time of the time range input box through start-placeholder
/ end-placeholder
.
'
},
- 'codeFiles': ['placeholder.vue']
+ codeFiles: ['placeholder.vue']
},
{
- 'demoId': 'size',
- 'name': { 'zh-CN': '尺寸', 'en-US': 'Size' },
- 'desc': {
+ demoId: 'size',
+ name: {
+ 'zh-CN': '尺寸',
+ 'en-US': 'Size'
+ },
+ desc: {
'zh-CN': '通过 size
自定义组件尺寸。
',
'en-US': 'Customize size by size
.
'
},
- 'codeFiles': ['size.vue']
+ codeFiles: ['size.vue']
},
{
- 'demoId': 'step',
- 'name': { 'zh-CN': '步长', 'en-US': 'Step' },
- 'desc': {
+ demoId: 'step',
+ name: {
+ 'zh-CN': '步长',
+ 'en-US': 'Step'
+ },
+ desc: {
'zh-CN':
'通过 step
设置步长,默认值为 { hour: 1, minute: 1, second: 1 }
,其中 hour
的设置范围是 0-23
,minute
、second
的设置范围是 0-59
。可单独设置其中的一项或多项值,未设置的默认值为 1
。
',
'en-US':
'Set the step size through step
. The default value is {hour: 1, minute: 1, second: 1}
, where the setting range of hour
is 0-23
, minute
, second
is 0-60
. One or more of these values can be set separately, and the unset default value is 1
.
'
},
- 'codeFiles': ['step.vue']
+ codeFiles: ['step.vue']
},
{
- 'demoId': 'clearable',
- 'name': { 'zh-CN': '清除按钮', 'en-US': 'Customized clear icon' },
- 'desc': {
+ demoId: 'clearable',
+ name: {
+ 'zh-CN': '清除按钮',
+ 'en-US': 'Customized clear icon'
+ },
+ desc: {
'zh-CN':
'通过 clearable
属性设置是否显示清除按钮,默认值为 true。通过 clear-icon
属性可以自定义清除按钮的图标。
',
'en-US':
'Set whether the clear button is displayed through the clearable
property, which defaults to true. You can customize the icon of the clear button through the clear-icon
property.
'
},
- 'codeFiles': ['clearable.vue']
+ codeFiles: ['clearable.vue']
},
{
- 'demoId': 'format',
- 'name': { 'zh-CN': '时间格式化', 'en-US': 'Time format' },
- 'desc': {
- 'zh-CN': `
- format
时间格式化显示\ntimestamp
JS 时间戳,仅 value-format 可用;组件绑定值为 number 类型。
- 通过 hh
属性可设置 12 小时制。 HH
属性为 24 小时制,须和 A 或 a 使用。 h
与 H
属性设置不补 0。\n通过 mm
属性可设置分钟显示格式,例如 01。 m
属性设置不补 0。\n通过 ss
属性可设置秒的显示格式,例如 01。 s
属性设置不补 0。\n通过 a
属性可设置显示时间为 am/pm A
属性设置显示时间为 AM/PM。
- `,
+ demoId: 'format',
+ name: {
+ 'zh-CN': '时间格式化',
+ 'en-US': 'Time format'
+ },
+ desc: {
+ 'zh-CN':
+ '\n format
时间格式化显示\ntimestamp
JS 时间戳,仅 value-format 可用;组件绑定值为 number 类型。
\n 通过 hh
属性可设置 12 小时制。 HH
属性为 24 小时制,须和 A 或 a 使用。 h
与 H
属性设置不补 0。\n通过 mm
属性可设置分钟显示格式,例如 01。 m
属性设置不补 0。\n通过 ss
属性可设置秒的显示格式,例如 01。 s
属性设置不补 0。\n通过 a
属性可设置显示时间为 am/pm A
属性设置显示时间为 AM/PM。
\n ',
'en-US':
'You can set the 12-hour format through the hh
attribute. The HH
attribute is in the 24-hour format and must be used with A or a. The h
and H
attributes are not set to 0. \nYou can use the mm
attribute to set the minute display format, for example, 01. The m
attribute is not set to 0. \nYou can use the ss
attribute to set the display format of seconds, for example, 01. The s
attribute is not set to 0. \nThe a
property can be used to set the display time to am/pm A
property can be used to set the display time to AM/PM.
'
},
- 'codeFiles': ['format.vue']
+ codeFiles: ['format.vue']
},
{
- 'demoId': 'default-value',
- 'name': { 'zh-CN': '默认时间', 'en-US': 'Default value' },
- 'desc': {
+ demoId: 'default-value',
+ name: {
+ 'zh-CN': '默认时间',
+ 'en-US': 'Default value'
+ },
+ desc: {
'zh-CN': '通过 default-value
设置选择器打开显示默认时间。
',
'en-US': 'Open and display the default time through the default-value
setting selector.
'
},
- 'codeFiles': ['default-value.vue']
+ codeFiles: ['default-value.vue']
},
{
- 'demoId': 'name',
- 'name': { 'zh-CN': '原生属性', 'en-US': 'Native attribute' },
- 'desc': {
+ demoId: 'name',
+ name: {
+ 'zh-CN': '原生属性',
+ 'en-US': 'Native attribute'
+ },
+ desc: {
'zh-CN': '通过 name
属性设置默认 name。
',
'en-US': 'Set the default name through the name
property.
'
},
- 'codeFiles': ['name.vue']
+ codeFiles: ['name.vue']
},
{
- 'demoId': 'suffix-icon',
- 'name': { 'zh-CN': '自定义后置图标', 'en-US': 'Customize suffix icon' },
- 'desc': {
+ demoId: 'suffix-icon',
+ name: {
+ 'zh-CN': '自定义后置图标',
+ 'en-US': 'Customize suffix icon'
+ },
+ desc: {
'zh-CN':
'通过 suffix-icon
属性设置日期输入框后置图标,从 @opentiny/vue-icon
中导入一个图标并进行初始化后传给 suffix-icon
。
',
'en-US':
'The format
time format is displayed. \ntimestamp
JS timestamp is available only in value-format. The component binding value is of the number type
'
},
- 'codeFiles': ['suffix-icon.vue']
+ codeFiles: ['suffix-icon.vue']
},
{
- 'demoId': 'popper-class',
- 'name': { 'zh-CN': '下拉框的类名', 'en-US': 'Popper class' },
- 'desc': {
+ demoId: 'popper-class',
+ name: {
+ 'zh-CN': '下拉框的类名',
+ 'en-US': 'Popper class'
+ },
+ desc: {
'zh-CN':
'通过 popper-class
属性设置下拉框的类名。通过 popper-append-to-body
属性设置是否将下拉框放到 body 元素上,默认值为 true,下拉框挂在 body 元素上。
',
'en-US':
'Set the class name of the drop-down box through the popper-class
attribute, and set whether the drop-down box is placed on the body element through the popper-append-to-body
attribute. The default value is true, and the drop-down box hangs on the body element.
'
},
- 'codeFiles': ['popper-class.vue']
+ codeFiles: ['popper-class.vue']
},
{
- 'demoId': 'editable',
- 'name': { 'zh-CN': '文本框不可输入', 'en-US': 'Text box is not editable' },
- 'desc': {
+ demoId: 'editable',
+ name: {
+ 'zh-CN': '文本框不可输入',
+ 'en-US': 'Text box is not editable'
+ },
+ desc: {
'zh-CN': '日期输入框默认可以输入日期,设置 editable
为 false 后,将不能输入。
',
'en-US': 'You can set disabled
to true, you can disabled the time picker。
'
},
- 'codeFiles': ['editable.vue']
+ codeFiles: ['editable.vue']
},
{
- 'demoId': 'event',
- 'name': { 'zh-CN': '事件', 'en-US': 'Event' },
- 'desc': {
+ demoId: 'event',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': 'Event'
+ },
+ desc: {
'zh-CN': '当聚焦和失焦时会触发 focus 和 blur 事件,当确定选值时会触发 change 事件。
',
'en-US': ''
},
- 'codeFiles': ['event.vue']
- }
- ],
- apis: [
- {
- 'name': 'time-picker',
- 'type': 'component',
- 'props': [
- {
- 'name': 'arrow-control',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否使用箭头进行时间选择',
- 'en-US': 'Whether to use arrows for time selection'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'clearable',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否显示清除按钮',
- 'en-US': 'Display Clear Button'
- },
- 'demoId': 'clearable'
- },
- {
- 'name': 'clear-icon',
- 'type': 'Component',
- 'defaultValue': 'IconOperationfaild',
- 'desc': {
- 'zh-CN': '自定义清空图标',
- 'en-US':
- 'Indicates whether to insert a pop-up box to the body element. If a fault occurs in locating the fault in the dialog box that is displayed, you can set this attribute to false'
- },
- 'demoId': 'clearable'
- },
- {
- 'name': 'default-value',
- 'type': 'Date | string | number | Array',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当选中的日期值为空时,选择器面板打开时默认显示的时间,需设置为可被 new Date() 解析的值',
- 'en-US': 'Native attribute'
- },
- 'demoId': 'default-value'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '禁用',
- 'en-US': 'Disabled'
- },
- 'demoId': 'disabled'
- },
- {
- 'name': 'editable',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '文本框可输入',
- 'en-US': 'The text box can be entered.'
- },
- 'demoId': 'editable'
- },
- {
- 'name': 'end-placeholder',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '范围选择时结束日期的占位内容',
- 'en-US': 'Placeholder of the end date when the range is selected'
- },
- 'demoId': 'placeholder'
- },
- {
- 'name': 'is-range',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否为时间范围选择',
- 'en-US':
- 'Indicates whether to use arrows to select time. This parameter is valid only for .'
- },
- 'demoId': 'is-range'
- },
- {
- 'name': 'modelValue / v-model',
- 'type': 'Date | string | number | Array',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '日期选择器选中的日期值,可设置选择器的初始值',
- 'en-US': 'Date value selected by the date selector. You can set the initial value of the selector.'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'name',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '原生 input name
属性',
- 'en-US': 'Native input name
attribute'
- },
- 'demoId': 'name'
- },
- {
- 'name': 'picker-options',
- 'type': 'IPickerOptions',
- 'typeAnchorName': 'IPickerOptions',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '配置可选的时间范围、下拉框中显示的格式',
- 'en-US': ''
- },
- 'demoId': 'disabled'
- },
- {
- 'name': 'placeholder',
- 'type': 'string',
- 'defaultValue': "''",
- 'desc': {
- 'zh-CN': '非范围选择时的占位内容',
- 'en-US': 'Placeholder content for non-range selection'
- },
- 'demoId': 'placeholder'
- },
- {
- 'name': 'popper-append-to-body',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否将弹出框插入至 body 元素,在弹出框的定位出现问题时,可将该属性设置为 false',
- 'en-US': ''
- },
- 'demoId': 'popper-class'
- },
- {
- 'name': 'popper-class',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': 'TimePicker 下拉框的 class 类名',
- 'en-US': 'The following table lists the options of the current time and date selector.'
- },
- 'demoId': 'popper-class'
- },
- {
- 'name': 'range-separator',
- 'type': 'string',
- 'defaultValue': "'-'",
- 'desc': {
- 'zh-CN': '选择范围时的分隔符',
- 'en-US':
- 'Optional. When the selected date is empty, the time displayed by default when the selector panel is opened. Set it to a value that can be parsed by new Date().'
- },
- 'demoId': 'is-range'
- },
- {
- 'name': 'size',
- 'type': "'medium' | 'small' | '' | 'mini'",
- 'defaultValue': "''",
- 'desc': {
- 'zh-CN': '输入框尺寸',
- 'en-US': 'Text box size; The values of this attribute are medium, small, and mini'
- },
- 'demoId': 'size'
- },
- {
- 'name': 'start-placeholder',
- 'type': 'string',
- 'defaultValue': "''",
- 'desc': {
- 'zh-CN': '范围选择时开始日期的占位内容',
- 'en-US': 'Placeholder of the start date when the range is selected'
- },
- 'demoId': 'placeholder'
- },
- {
- 'name': 'step',
- 'type': 'IStep',
- 'typeAnchorName': 'IStep',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '自定义时分秒步长',
- 'en-US': 'Indicates whether to select a time range. This parameter is valid only for .'
- },
- 'demoId': 'step'
- },
- {
- 'name': 'suffix-icon',
- 'type': 'object',
- 'defaultValue': 'IconCalendar',
- 'desc': {
- 'zh-CN': '自定义头部图标的类名',
- 'en-US': 'Custom Clear Icon'
- },
- 'demoId': 'suffix-icon'
- }
- ],
- 'events': [
- {
- 'name': 'blur',
- 'type': '() => void',
- 'desc': {
- 'zh-CN': '当 input 失去焦点时触发',
- 'en-US': 'This event is triggered when the input loses focus. arg:{object Time Component Vue Object}'
- },
- 'demoId': 'event'
- },
- {
- 'name': 'change',
- 'type': '(date: Date | Date[]) => void',
- 'desc': {
- 'zh-CN': '用户确认选定的值时触发',
- 'en-US':
- 'This event is triggered when the user confirms the selected value. arg:{Date|Array is the time object of the currently selected value when it is not selected in a range. When the range is selected, it is the time object array of the currently selected value}'
- },
- 'demoId': 'event'
- },
- {
- 'name': 'focus',
- 'type': '() => void',
- 'desc': {
- 'zh-CN': '当 input 获得焦点时触发',
- 'en-US': 'This event is triggered when the input is focused. arg:{object Time Component Vue object}'
- },
- 'demoId': 'event'
- }
- ],
- 'slots': [],
- 'methods': [
- {
- 'name': 'focus',
- 'type': '() => void',
- 'desc': {
- 'zh-CN': '使 input 获取焦点',
- 'en-US': 'Enable input to focus.'
- },
- 'demoId': 'event'
- }
- ],
- 'props format': [
- {
- 'name': 'a',
- 'desc': { 'zh-CN': 'am/pm', 'en-US': '' },
- 'demoId': ''
- },
- {
- 'name': 'A',
- 'desc': { 'zh-CN': 'AM/PM', 'en-US': '' },
- 'demoId': ''
- },
- {
- 'name': 'h',
- 'desc': { 'zh-CN': '小时,12小时制,需要和 A 或 a 一起使用,不补0', 'en-US': '' },
- 'demoId': ''
- },
- {
- 'name': 'H',
- 'desc': { 'zh-CN': '小时,24小时制,不补0', 'en-US': '' },
- 'demoId': ''
- },
- {
- 'name': 'hh',
- 'desc': { 'zh-CN': '小时,12小时制,需要和 A 或 a 一起使用', 'en-US': '' },
- 'demoId': ''
- },
- {
- 'name': 'HH',
- 'desc': { 'zh-CN': '小时,24小时制', 'en-US': '' },
- 'demoId': ''
- },
- {
- 'name': 'm',
- 'desc': { 'zh-CN': '分钟,不补0', 'en-US': '' },
- 'demoId': ''
- },
- {
- 'name': 'mm',
- 'desc': { 'zh-CN': '分钟', 'en-US': '' },
- 'demoId': ''
- },
- {
- 'name': 's',
- 'desc': { 'zh-CN': '秒,不补0', 'en-US': '' },
- 'demoId': ''
- },
- {
- 'name': 'ss',
- 'desc': { 'zh-CN': '秒', 'en-US': '' },
- 'demoId': ''
- }
- ]
- }
- ],
- 'types': [
- {
- name: 'IStep',
- type: 'interface',
- code: `
-interface IStep {
- hour: number
- minute: number
- second: number
-}
- `
- },
- {
- name: 'IPickerOptions',
- type: 'interface',
- code: `
-interface IPickerOptions {
- // 可选的时间范围
- selectableRange: string
- // 下拉框中显示的格式
- format: string
-}
- `
+ codeFiles: ['event.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/time-select/webdoc/time-select.js b/examples/sites/demos/pc/app/time-select/webdoc/time-select.js
index 8f460512e..c6ca38e02 100644
--- a/examples/sites/demos/pc/app/time-select/webdoc/time-select.js
+++ b/examples/sites/demos/pc/app/time-select/webdoc/time-select.js
@@ -3,254 +3,129 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '详细用法参考如下示例。', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['basic-usage.vue']
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例。',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'range-placeholder',
- 'name': { 'zh-CN': '固定时间范围', 'en-US': 'Fixed Time Range' },
- 'desc': {
+ demoId: 'range-placeholder',
+ name: {
+ 'zh-CN': '固定时间范围',
+ 'en-US': 'Fixed Time Range'
+ },
+ desc: {
'zh-CN': '如果先选中了开始(或结束)时间,则结束(或开始)时间的状态也将会随之改变。',
'en-US': 'For details, see the following example.'
},
- 'codeFiles': ['range-placeholder.vue']
+ codeFiles: ['range-placeholder.vue']
},
{
- 'demoId': 'default-value',
- 'name': { 'zh-CN': '设置打开默认时间', 'en-US': 'Default time setting when the selector is enabled' },
- 'desc': {
+ demoId: 'default-value',
+ name: {
+ 'zh-CN': '设置打开默认时间',
+ 'en-US': 'Default time setting when the selector is enabled'
+ },
+ desc: {
'zh-CN': '通过 default-value
设置选择器打开显示默认时间。
\n',
'en-US': 'Use default-value
to set the selector to open the default display time
\n'
},
- 'codeFiles': ['default-value.vue']
+ codeFiles: ['default-value.vue']
},
{
- 'demoId': 'picker-options',
- 'name': { 'zh-CN': '固定时间点', 'en-US': 'Specified time point' },
- 'desc': {
+ demoId: 'picker-options',
+ name: {
+ 'zh-CN': '固定时间点',
+ 'en-US': 'Specified time point'
+ },
+ desc: {
'zh-CN':
'提供固定时间点,可通过 picker-options 对象中的 start、end、step、minTime、maxTime 设置起始时间、结束时间、步长、最小有效时间和最大有效时间。
\n',
'en-US': 'picker-options Set Time
\n'
},
- 'codeFiles': ['picker-options.vue']
+ codeFiles: ['picker-options.vue']
},
{
- 'demoId': 'suffix-icon',
- 'name': { 'zh-CN': '后置图标', 'en-US': 'Rear icon' },
- 'desc': {
+ demoId: 'suffix-icon',
+ name: {
+ 'zh-CN': '后置图标',
+ 'en-US': 'Rear icon'
+ },
+ desc: {
'zh-CN': '通过 suffix-icon
属性设置时间输入框后置图标。
\n',
'en-US': ' uses the suffix-icon
attribute to set the icon behind the time text box.
\n'
},
- 'codeFiles': ['suffix-icon.vue']
+ codeFiles: ['suffix-icon.vue']
},
{
- 'demoId': 'clear-icon',
- 'name': { 'zh-CN': '清空图标', 'en-US': 'Customized Clear Icon' },
- 'desc': {
+ demoId: 'clear-icon',
+ name: {
+ 'zh-CN': '清空图标',
+ 'en-US': 'Customized Clear Icon'
+ },
+ desc: {
'zh-CN':
'通过 clearable
显示清空图标,通过 clear-icon
自定义清空图标,通过 popper-class
属性设置下拉框的类名。
',
'en-US': 'Clear the icon by clear-icon
\n'
},
- 'codeFiles': ['clear-icon.vue']
+ codeFiles: ['clear-icon.vue']
},
{
- 'demoId': 'event-blur',
- 'name': { 'zh-CN': '事件', 'en-US': 'Event' },
- 'desc': {
+ demoId: 'event-blur',
+ name: {
+ 'zh-CN': '事件',
+ 'en-US': 'Event'
+ },
+ desc: {
'zh-CN':
'focus
input 框聚焦时触发,blur
input 框失焦时触发,change
input 绑定值改变时触发。
\n',
'en-US':
'Triggered when the focus
input frame is focused and when the input frame is out of focus
\n'
},
- 'codeFiles': ['event-blur.vue']
+ codeFiles: ['event-blur.vue']
},
{
- 'demoId': 'editable',
- 'name': { 'zh-CN': '文本框不可编辑', 'en-US': 'The text box cannot be edited.' },
- 'desc': {
+ demoId: 'editable',
+ name: {
+ 'zh-CN': '文本框不可编辑',
+ 'en-US': 'The text box cannot be edited.'
+ },
+ desc: {
'zh-CN': '时间输入框默认可以输入时间,设置 editable
为 false 后,将不能输入。
\n',
'en-US':
'By default, you can enter a time in the Time text box. If you set editable
to false, you cannot enter a time in the
Time text box.
\n'
},
- 'codeFiles': ['editable.vue']
+ codeFiles: ['editable.vue']
},
{
- 'demoId': 'size-medium',
- 'name': { 'zh-CN': '尺寸', 'en-US': 'medium Size' },
- 'desc': {
+ demoId: 'size-medium',
+ name: {
+ 'zh-CN': '尺寸',
+ 'en-US': 'medium Size'
+ },
+ desc: {
'zh-CN': '通过修改 size 的属性值可调整输入框尺寸,提供 medium、small、mini三个固定属性值。',
'en-US': 'For details, see the following example.'
},
- 'codeFiles': ['size-medium.vue']
+ codeFiles: ['size-medium.vue']
},
{
- 'demoId': 'focus',
- 'name': { 'zh-CN': '手动获取焦点', 'en-US': 'Manually obtaining the focus' },
- 'desc': {
+ demoId: 'focus',
+ name: {
+ 'zh-CN': '手动获取焦点',
+ 'en-US': 'Manually obtaining the focus'
+ },
+ desc: {
'zh-CN': '通过给组件设置 ref 手动调用触发 focus 事件。',
'en-US': 'For details, see the following example.'
},
- 'codeFiles': ['focus.vue']
- }
- ],
- apis: [
- {
- 'name': 'time-select',
- 'type': 'component',
- 'props': [
- {
- 'name': 'modelValue / v-model',
- 'type': 'date(DatePicker) / array(DateRangePicker)',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '日期选择器选中的日期值,可设置选择器的初始值',
- 'en-US': 'Date value selected by the date selector. You can set the initial value of the selector.'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': ' false',
- 'desc': { 'zh-CN': '时间选择器是否禁用', 'en-US': 'Disabled' },
- 'demoId': ''
- },
- {
- 'name': 'editable',
- 'type': 'boolean',
- 'defaultValue': ' true',
- 'desc': { 'zh-CN': '文本框是否可手动输入', 'en-US': 'The text box can be entered.' },
- 'demoId': 'editable'
- },
- {
- 'name': 'clearable',
- 'type': 'boolean',
- 'defaultValue': ' true',
- 'desc': { 'zh-CN': '清除按钮是否显示', 'en-US': 'Display Clear Button' },
- 'demoId': 'clear-icon'
- },
- {
- 'name': 'size',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '输入框尺寸;该属性的可选值为 medium、small、mini',
- 'en-US': 'Text box size; The values of this attribute are medium, small, and mini'
- },
- 'demoId': 'size-medium'
- },
- {
- 'name': 'placeholder',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '输入框的提示占位内容', 'en-US': 'Placeholder content for non-range selection' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'popper-class',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': 'TimePicker 下拉框的 class 类名',
- 'en-US': 'Class name of the TimePicker drop-down list box'
- },
- 'demoId': ''
- },
- {
- 'name': 'picker-options',
- 'type': 'object',
- 'defaultValue': '{}',
- 'desc': {
- 'zh-CN': '当前时间日期选择器特有的选项参考下表',
- 'en-US': 'The following table lists the options of the current time and date selector.'
- },
- 'demoId': 'picker-options'
- },
- {
- 'name': 'default-value',
- 'type': 'Date',
- 'defaultValue': '--',
- 'desc': {
- 'zh-CN': '可选,当选中的日期值为空时,选择器面板打开时默认显示的时间,需设置为可被new Date()解析的值',
- 'en-US':
- 'Optional. When the selected date is empty, the time displayed by default when the selector panel is opened. Set it to a value that can be parsed by new Date().'
- },
- 'demoId': 'default-value'
- },
- {
- 'name': 'name',
- 'type': 'string',
- 'defaultValue': '--',
- 'desc': { 'zh-CN': '原生属性', 'en-US': 'Native attribute' },
- 'demoId': 'clear-icon'
- },
- {
- 'name': 'suffix-icon',
- 'type': 'string',
- 'defaultValue': 'IconCalendar',
- 'desc': { 'zh-CN': '自定义头部图标', 'en-US': 'Custom header icon' },
- 'demoId': 'suffix-icon'
- },
- {
- 'name': 'clear-icon',
- 'type': 'string',
- 'defaultValue': 'IconOperationfaild',
- 'desc': { 'zh-CN': '自定义清空图标', 'en-US': 'Customized clear icon' },
- 'demoId': 'clear-icon'
- },
- {
- 'name': 'popper-append-to-body',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false',
- 'en-US':
- 'Indicates whether to insert a pop-up box to the body element. If a fault occurs in locating the fault in the dialog box that is displayed, you can set this attribute to false'
- },
- 'demoId': ''
- }
- ],
- 'events': [
- {
- 'name': 'change',
- 'type': '(value: string) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当 input 绑定的值发生改变时触发',
- 'en-US': 'This event is triggered when the user confirms the selected value.'
- },
- 'demoId': 'event-blur'
- },
- {
- 'name': 'blur',
- 'type': '( ) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当 input 失去焦点时触发',
- 'en-US': 'This event is triggered when the input loses focus.'
- },
- 'demoId': 'event-blur'
- },
- {
- 'name': 'focus',
- 'type': '( ) => void',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '当 input 获得焦点时触发', 'en-US': 'This event is triggered when the input is focused.' },
- 'demoId': 'event-blur'
- }
- ],
- 'slots': [],
- 'methods': [
- {
- 'name': 'handleFocus',
- 'type': '( ) => void',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '使 input 获取焦点', 'en-US': 'Enable input to focus.' },
- 'demoId': 'focus'
- }
- ]
+ codeFiles: ['focus.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/toggle-menu/webdoc/toggle-menu.js b/examples/sites/demos/pc/app/toggle-menu/webdoc/toggle-menu.js
index ccf9d0c14..bd5059ae3 100644
--- a/examples/sites/demos/pc/app/toggle-menu/webdoc/toggle-menu.js
+++ b/examples/sites/demos/pc/app/toggle-menu/webdoc/toggle-menu.js
@@ -3,413 +3,213 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '通过:data
设置数据源。',
'en-US': 'Set the data source through: data
.'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'custom-icon',
- 'name': { 'zh-CN': '自定义菜单左侧图标', 'en-US': 'Icon on the left of the customized menu' },
- 'desc': {
+ demoId: 'custom-icon',
+ name: {
+ 'zh-CN': '自定义菜单左侧图标',
+ 'en-US': 'Icon on the left of the customized menu'
+ },
+ desc: {
'zh-CN': '通过 icon
属性自定义菜单左侧图标。
\n',
'en-US': 'You can customize the icon on the left of the menu through the icon
attribute.
\n'
},
- 'codeFiles': ['custom-icon.vue']
+ codeFiles: ['custom-icon.vue']
},
{
- 'demoId': 'get-menu-data-sync',
- 'name': { 'zh-CN': '自定义菜单数据', 'en-US': 'Customized menu data service' },
- 'desc': {
+ demoId: 'get-menu-data-sync',
+ name: {
+ 'zh-CN': '自定义菜单数据',
+ 'en-US': 'Customized menu data service'
+ },
+ desc: {
'zh-CN':
'通过 get-menu-data-sync
自定义菜单数据服务。(deprecated v3.4.0废弃, v3.16.0移除;移除原因:如果是同步数据则和:data功能重复)。
\n',
'en-US':
'Customize menu data services throughget menu data sync
. (deprecated v3.4.0 abandoned, v3.16.0 removed; removal reason: if it is synchronized data, it is duplicated with the: data function).
\n'
},
- 'codeFiles': ['get-menu-data-sync.vue']
+ codeFiles: ['get-menu-data-sync.vue']
},
{
- 'demoId': 'get-menu-data-async',
- 'name': { 'zh-CN': '自定义菜单异步数据服务', 'en-US': 'props option mapping' },
- 'desc': {
+ demoId: 'get-menu-data-async',
+ name: {
+ 'zh-CN': '自定义菜单异步数据服务',
+ 'en-US': 'props option mapping'
+ },
+ desc: {
'zh-CN': '通过 get-menu-data-async
自定义菜单异步数据服务。
\n',
'en-US':
"You can use props
to configure the mapping field. The default value of this attribute is {children:'children', label:'label', disabled:'disabled'}.
\n"
},
- 'codeFiles': ['get-menu-data-async.vue']
+ codeFiles: ['get-menu-data-async.vue']
},
{
- 'demoId': 'toggle-props',
- 'name': { 'zh-CN': 'props 选项映射', 'en-US': 'Custom Node Content' },
- 'desc': {
+ demoId: 'toggle-props',
+ name: {
+ 'zh-CN': 'props 选项映射',
+ 'en-US': 'Custom Node Content'
+ },
+ desc: {
'zh-CN':
"通过props
配置选项映射字段该属性的默认值为{children:'children',label:'label',disabled:'disabled'}
。
\n",
'en-US': 'Customize the node content through the node
slot.
\n'
},
- 'codeFiles': ['toggle-props.vue']
+ codeFiles: ['toggle-props.vue']
},
{
- 'demoId': 'slot-node',
- 'name': { 'zh-CN': '自定义节点内容', 'en-US': 'All nodes are expanded by default' },
- 'desc': {
+ demoId: 'slot-node',
+ name: {
+ 'zh-CN': '自定义节点内容',
+ 'en-US': 'All nodes are expanded by default'
+ },
+ desc: {
'zh-CN': '通过 node
插槽自定义节点内容。
\n',
'en-US':
'You can use the default-expand-all
attribute to set whether to expand all nodes by default, and use the expand-on-click-node
attribute to set whether to expand or collapse menus by clicking a node.
\n'
},
- 'codeFiles': ['slot-node.vue']
+ codeFiles: ['slot-node.vue']
},
{
- 'demoId': 'default-expand-all',
- 'name': { 'zh-CN': '默认展开所有节点', 'en-US': 'Drag Node' },
- 'desc': {
+ demoId: 'default-expand-all',
+ name: {
+ 'zh-CN': '默认展开所有节点',
+ 'en-US': 'Drag Node'
+ },
+ desc: {
'zh-CN':
'通过 default-expand-all
属性设置是否默认展开所有节点,通过 expand-on-click-node
属性设置是否可以通过点击节点,展开/收起菜单。
\n',
'en-US':
'You can use the draggable
attribute to set whether to enable the node drag function. The default value is false
. \nYou can use the ellipsis
property to set whether to enable the function of omitting the overlong text content. The default value is false
.
\n'
},
- 'codeFiles': ['default-expand-all.vue']
+ codeFiles: ['default-expand-all.vue']
},
{
- 'demoId': 'draggable',
- 'name': { 'zh-CN': '拖拽节点', 'en-US': 'Display the filter search box' },
- 'desc': {
+ demoId: 'draggable',
+ name: {
+ 'zh-CN': '拖拽节点',
+ 'en-US': 'Display the filter search box'
+ },
+ desc: {
'zh-CN':
'通过 draggable
属性设置是否开启拖拽节点的功能,默认值为 false
。\n可通过 ellipsis
属性设置是否开启文本内容超长是省略显示,默认值为 false
。
\n',
'en-US':
'You can set the show-filter
attribute to determine whether to display the filter search box. The default value is true
. You can set it to false
not to display the filter search box.
\n'
},
- 'codeFiles': ['draggable.vue']
+ codeFiles: ['draggable.vue']
},
{
- 'demoId': 'show-filter',
- 'name': { 'zh-CN': '显示过滤搜索框', 'en-US': 'Auto Filter' },
- 'desc': {
+ demoId: 'show-filter',
+ name: {
+ 'zh-CN': '显示过滤搜索框',
+ 'en-US': 'Auto Filter'
+ },
+ desc: {
'zh-CN':
'通过 show-filter
属性设置是否展示过滤搜索框,默认为 true
,可设置为false
不展示过滤搜索框。
\n',
'en-US':
'You can set the placeholder of the text box through the placeholder
attribute. Use automatic-filtering
to set whether to automatically filter input data. The default value is true.
\n'
},
- 'codeFiles': ['show-filter.vue']
+ codeFiles: ['show-filter.vue']
},
{
- 'demoId': 'automatic-filtering',
- 'name': { 'zh-CN': '自动过滤', 'en-US': 'The content exceeds the line feed' },
- 'desc': {
+ demoId: 'automatic-filtering',
+ name: {
+ 'zh-CN': '自动过滤',
+ 'en-US': 'The content exceeds the line feed'
+ },
+ desc: {
'zh-CN':
'通过 placeholder
属性设置输入框的占位符。 通过设置 automatic-filtering
为false
关闭输入时自动过滤功能,默认值为true
。
\n',
'en-US':
'Set the placeholder for the input box through theplaceholder
property. By settingautomatic filtering
tofalse
, the automatic filtering function on input is turned off, and the default value istrue
.
'
},
- 'codeFiles': ['automatic-filtering.vue']
+ codeFiles: ['automatic-filtering.vue']
},
{
- 'demoId': 'show-filter1',
- 'name': { 'zh-CN': '内容超出换行', 'en-US': 'Node Click Event' },
- 'desc': {
+ demoId: 'show-filter1',
+ name: {
+ 'zh-CN': '内容超出换行',
+ 'en-US': 'Node Click Event'
+ },
+ desc: {
'zh-CN': '通过wrap
设置换行。',
'en-US': 'Set line breaks throughwrap
.'
},
- 'codeFiles': ['show-filter.vue']
+ codeFiles: ['show-filter.vue']
},
{
- 'demoId': 'node-click',
- 'name': { 'zh-CN': '点击节点事件', 'en-US': 'Expand Node Event' },
- 'desc': {
+ demoId: 'node-click',
+ name: {
+ 'zh-CN': '点击节点事件',
+ 'en-US': 'Expand Node Event'
+ },
+ desc: {
'zh-CN': '通过node-click
点击节点后触发的事件。
\n',
'en-US': 'The event triggered by clicking on a node throughnode click
.
\n'
},
- 'codeFiles': ['node-click.vue']
+ codeFiles: ['node-click.vue']
},
{
- 'demoId': 'node-expand',
- 'name': { 'zh-CN': '展开节点事件', 'en-US': 'Shrunk Node Event' },
- 'desc': {
+ demoId: 'node-expand',
+ name: {
+ 'zh-CN': '展开节点事件',
+ 'en-US': 'Shrunk Node Event'
+ },
+ desc: {
'zh-CN': '通过node-expand
展开节点后触发的事件。
\n',
'en-US': 'The event triggered after expanding a node throughnode expand
.
\n'
},
- 'codeFiles': ['node-expand.vue']
+ codeFiles: ['node-expand.vue']
},
{
- 'demoId': 'node-collapse',
- 'name': { 'zh-CN': '收缩节点事件', 'en-US': 'Drag Node Event' },
- 'desc': {
+ demoId: 'node-collapse',
+ name: {
+ 'zh-CN': '收缩节点事件',
+ 'en-US': 'Drag Node Event'
+ },
+ desc: {
'zh-CN': '通过node-collapse
收缩节点后触发的事件。
\n',
'en-US': 'The event triggered after shrinking a node throughnode collapse
.
'
},
- 'codeFiles': ['node-collapse.vue']
+ codeFiles: ['node-collapse.vue']
},
{
- 'demoId': 'node-drop',
- 'name': { 'zh-CN': '拖放节点事件', 'en-US': 'Drag Event' },
- 'desc': {
+ demoId: 'node-drop',
+ name: {
+ 'zh-CN': '拖放节点事件',
+ 'en-US': 'Drag Event'
+ },
+ desc: {
'zh-CN':
'通过node-drop
拖放节点后触发的事件,需要设置 draggable
属性为 true
。
\n',
'en-US':
'The event triggered by dragging and dropping a node throughnode drop
needs to set thedraggable
attribute totrue
.
\n'
},
- 'codeFiles': ['node-drop.vue']
+ codeFiles: ['node-drop.vue']
},
{
- 'demoId': 'drag-events',
- 'name': { 'zh-CN': '拖拽事件', 'en-US': 'Dragging event' },
- 'desc': {
+ demoId: 'drag-events',
+ name: {
+ 'zh-CN': '拖拽事件',
+ 'en-US': 'Dragging event'
+ },
+ desc: {
'zh-CN':
'通过node-drag-start
拖拽节点后的事件,node-drag-enter
拖拽进入其他节点时触发的事件,node-drag-over
在拖拽节点时触发的事件,node-drag-leave
拖拽离开某个节点时触发的事件,node-drag-end
拖拽结束时触发的事件。
\n',
'en-US':
'Events triggered when dragging nodes throughnode drag start
, events triggered when dragging into other nodes, events triggered when dragging nodes, events triggered when dragging out of a node, and events triggered when dragging out of a node.
'
},
- 'codeFiles': ['drag-events.vue']
- }
- ],
- apis: [
- {
- 'name': 'toggle-menu',
- 'type': 'component',
- 'props': [
- {
- 'name': 'data',
- 'type': 'Array',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置收缩菜单的数据', 'en-US': 'Set the data of the collapsed menu' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'draggable',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置是否开启拖拽节点的功能,默认值为false',
- 'en-US': 'Whether to enable the node drag function. The default value is false'
- },
- 'demoId': 'draggable'
- },
- {
- 'name': 'show-filter',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置是否展示过滤搜索框,默认为 `true`',
- 'en-US': 'Specifies whether to display the search box. The default value is true'
- },
- 'demoId': 'show-filter'
- },
- {
- 'name': 'icon',
- 'type': 'object',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '自定义菜单左侧图标', 'en-US': 'Customize the icon on the left of the menu' },
- 'demoId': 'custom-icon'
- },
- {
- 'name': 'default-expand-all',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置菜单默认是否展开所有节点,默认为 false',
- 'en-US': 'Whether to expand all nodes in the menu by default. The default value is false'
- },
- 'demoId': 'default-expand-all'
- },
- {
- 'name': 'expand-on-click-node',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置是否可以通过点击节点展开/收起菜单,默认为 false',
- 'en-US': 'Whether to expand or collapse menus by clicking a node. The default value is false'
- },
- 'demoId': 'default-expand-all'
- },
- {
- 'name': 'placeholder',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '输入框占位符', 'en-US': 'Placeholder in the text box' },
- 'demoId': 'show-filter'
- },
- {
- 'name': 'ellipsis',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '菜单内容超长时省略显示,默认为 false',
- 'en-US': 'Omitted if the menu content is too long. The default value is false'
- },
- 'demoId': 'draggable'
- },
- {
- 'name': 'wrap',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '菜单内容超长时换行显示,默认为 false',
- 'en-US': 'The menu content is displayed in a new line when it is too long. The default value is false'
- },
- 'demoId': 'show-filter'
- },
- {
- 'name': 'automatic-filtering',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '输入框输入内容时是否自动过滤内容,默认是 true',
- 'en-US':
- 'Whether to automatically filter content when you enter content in the text box. The default value is true'
- },
- 'demoId': 'automatic-filtering'
- },
- {
- 'name': 'props',
- 'type': 'object',
- 'defaultValue': "该属性的默认值为 {children: 'children',label: 'label',disabled: 'disabled'}",
- 'desc': { 'zh-CN': '配置数据选项的映射字段名称', 'en-US': 'Configuration data option mapping field name' },
- 'demoId': 'toggle-props'
- },
- {
- 'name': 'get-menu-data-sync',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '自定义菜单数据服务,直接返回数据(deprecated v3.4.0废弃, v3.16.0移除;移除原因:如果是同步数据则和:data功能重复)',
- 'en-US':
- 'Customized menu data service, directly returning data (deprecated v3.4.0 discarded, v3.16.0 removed; reason for removal: if it is synchronized data, it is duplicated with the: data function)'
- },
- 'demoId': 'get-menu-data-sync'
- },
- {
- 'name': 'get-menu-data-async',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义菜单数据服务,返回异步数据,需返回Promise对象',
- 'en-US': 'Custom menu data service, returns asynchronous data, requires a Promise object to be returned'
- },
- 'demoId': 'get-menu-data-aync'
- }
- ],
- 'events': [
- {
- 'name': 'node-click',
- 'type': 'Function(arg1,arg2)',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '点击节点后的事件。;点击节点后触发的回调函数;//参数arg1:\n{children: 点击节点的子节点, id: 点击节点的id ,label: 点击节点的title} \n//参数arg2:\n object 当前点击节点的数据信息对象',
- 'en-US':
- 'Indicates that a node is clicked. ;Callback function triggered after a node is clicked. //Parameter arg1:\n{children: child node of the clicked node, id: ID of the clicked node, label: title of the clicked node} \n//Parameter arg2:\n object Data information object of the currently clicked node'
- },
- 'demoId': 'node-click'
- },
- {
- 'name': 'node-expand',
- 'type': 'Function(arg1,arg2,arg3)',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '展开节点后的事件。;节点被展开时触发的事件;//参数arg1:\n{children: 点击节点的子节点, id: 点击节点的id, label: 点击节点的title}\n//参数arg2:\nComponent 点击节点的componet对象信息\n//参数arg3:\n{ children: 点击节点的子节点id: 点击节点的id, label: 点击节点的title}',
- 'en-US':
- 'Event after a node is expanded. ; Event triggered when a node is expanded; / / Parameter arg1:\n{children: child node of the clicked node, id: ID of the clicked node, label: title of the clicked node}\n//Parameter arg2:\nComponent Componet object information of the clicked node\n//Parameter arg3:\n{children: subnode ID of the clicked node: ID of the clicked node, label: Click title} of the node'
- },
- 'demoId': 'node-expand'
- },
- {
- 'name': 'node-collapse',
- 'type': 'Function(arg1,arg2)',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '收缩节点后的事件。;节点被关闭时触发的事件;//参数arg1:object \n{children: 点击节点的子节点,id: 点击节点的id,label: 点击节点的title}\n//参数arg2:object 当前点击节点的数据信息对象',
- 'en-US':
- 'Event after the node is scaled in. ; Event triggered when a node is shut down; //Parameter arg1:object \n{children: child node of the clicked node, id: ID of the clicked node, label: title of the clicked node}\n//Parameter arg2:object Data information object of the currently clicked node'
- },
- 'demoId': 'node-collapse'
- },
- {
- 'name': 'node-drag-start',
- 'type': 'Function(arg1,arg2)',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '节点开始拖拽时触发的事件。;节点开始拖拽时触发的事件。;//参数: \narg1:object 当前拖拽节点的数据信息对象\narg2:event',
- 'en-US':
- 'Event triggered when a node starts to be dragged. ;Event triggered when a node starts to be dragged. ; / / Parameters:\narg1:object Data information object of the current node \narg2:event'
- },
- 'demoId': 'drag-events'
- },
- {
- 'name': 'node-drag-enter',
- 'type': 'Function(arg1,arg2)',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '拖拽进入其他节点时触发的事件;拖拽进入其他节点时触发的事件;//参数\narg1:object 当前拖拽节点的数据信息对象\narg2: object 当前点击节点拖拽后位置的节点数据信息对象',
- 'en-US':
- 'This event is triggered when a user drags a node to another node. Event triggered when a user drags a node to another node. / / Parameter \narg1: object Data information object of the current node \narg2: object Data information object of the current node after the node is dragged'
- },
- 'demoId': 'drag-events'
- },
- {
- 'name': 'node-drag-leave',
- 'type': 'Function(arg1,arg2)',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '拖拽离开某个节点时触发的事件;拖拽离开某个节点时触发的事件;//参数\narg1:object 当前拖拽节点的数据信息对象\narg2: object 当前拖出后节点的数据信息对象',
- 'en-US':
- 'This event is triggered when a user drags a node. Event triggered when a user drags a node. / / Parameter \narg1:object Data information object of the currently dragged node \narg2: object Data information object of the currently dragged node'
- },
- 'demoId': 'drag-events'
- },
- {
- 'name': 'node-drag-over',
- 'type': 'Function(arg1,arg2,arg3)',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '在拖拽节点时触发的事件(类似浏览器的 mouseover 事件);在拖拽节点时触发的事件(类似浏览器的 mouseover 事件);//参数\narg1:object 当前拖拽节点的数据信息对象\narg2:object 当前拖拽节点拖拽时节点的数据信息对象\n arg3:event',
- 'en-US':
- 'Event triggered when a node is dragged (similar to the mouseover event of the browser); Event triggered when a node is dragged (similar to the mouseover event of the browser) / / Parameter \narg1:object Data information object of the current dragged node \narg2:object Data information object of the current dragged node \n arg3:event'
- },
- 'demoId': 'drag-events'
- },
- {
- 'name': 'node-drag-end',
- 'type': 'Function(arg1,arg2,arg3,arg4)',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- "拖拽结束时(r可能未成功)触发的事件;拖拽成功完成时触发的事件;//参数\narg1: object当前拖拽节点的数据信息对象\narg2: object当前点击节点拖拽后位置的节点数据信息对象\narg3: 拖拽的类型,如:'inner'\narg4:event",
- 'en-US':
- "Event triggered when dragging ends (r may not succeed). Event triggered when the drag is successfully completed; / / Parameter \narg1: object Data information object of the current node\narg2: object Data information object of the current node after the node is dragged\narg3: Drag type, for example,'inner'\narg4:event"
- },
- 'demoId': 'drag-events'
- },
- {
- 'name': 'node-drop',
- 'type': 'Function(arg1,arg2)',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '拖放节点后的事件。开启 draggable 属性为 true 有效。;拖放节点后的事件。开启 draggable 属性为 true 有效。;//参数\narg1:object 当前拖拽节点的数据信息对象\n arg2:object 当前点击节点拖拽后的位置节点的数据信息对象\narg3: 拖拽的类型\narg4:event',
- 'en-US':
- 'Indicates the event after a node is dragged and dropped. This parameter is valid when the draggable attribute is set to true. ; Events after a node is dragged and dropped. This parameter is valid when the draggable attribute is set to true. ; / / Parameter \narg1:object Data information object of the current dragged node \n arg2:object Data information object of the current clicked node after the dragged node \narg3:Drag type \narg4:event'
- },
- 'demoId': 'node-drop'
- }
- ],
- 'slots': [
- {
- 'name': 'node',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '自定义插槽', 'en-US': 'Custom Slot' },
- 'demoId': 'toggle-props'
- }
- ]
+ codeFiles: ['drag-events.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/tooltip/content-composition-api.vue b/examples/sites/demos/pc/app/tooltip/content-composition-api.vue
index f5a177a18..0fb0f3b7d 100644
--- a/examples/sites/demos/pc/app/tooltip/content-composition-api.vue
+++ b/examples/sites/demos/pc/app/tooltip/content-composition-api.vue
@@ -1,19 +1,19 @@
- 使用content属性:
+ 使用 content 属性:
- 使用renderContent属性:
+ 使用 renderContent 属性:
- 使用content插槽:
+ 使用 content 插槽:
该网段不可用!可用网段:163
diff --git a/examples/sites/demos/pc/app/tooltip/content.vue b/examples/sites/demos/pc/app/tooltip/content.vue
index 690282b99..43b30a905 100644
--- a/examples/sites/demos/pc/app/tooltip/content.vue
+++ b/examples/sites/demos/pc/app/tooltip/content.vue
@@ -1,19 +1,19 @@
- 使用content属性:
+ 使用 content 属性:
- 使用renderContent属性:
+ 使用 renderContent 属性:
- 使用content插槽:
+ 使用 content 插槽:
该网段不可用!可用网段:163
diff --git a/examples/sites/demos/pc/app/tooltip/custom-popper-composition-api.vue b/examples/sites/demos/pc/app/tooltip/custom-popper-composition-api.vue
index 35de0d430..8e85d003e 100644
--- a/examples/sites/demos/pc/app/tooltip/custom-popper-composition-api.vue
+++ b/examples/sites/demos/pc/app/tooltip/custom-popper-composition-api.vue
@@ -22,7 +22,7 @@
- 自定义类名popper1, 让字体变大
+ 自定义类名 popper1 , 让字体变大
- 自定义类名popper1, 让字体变大
+ 自定义类名 popper1 , 让字体变大
+
+ 文本预格式化
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/tooltip/pre.spec.js b/examples/sites/demos/pc/app/tooltip/pre.spec.js
new file mode 100644
index 000000000..8480fcb86
--- /dev/null
+++ b/examples/sites/demos/pc/app/tooltip/pre.spec.js
@@ -0,0 +1,36 @@
+import { test, expect } from '@playwright/test'
+
+test('测试Tooltip的是否能出现', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+
+ await page.goto('tooltip#basic-usage')
+
+ const preview = page.locator('.pc-demo-container')
+ let button = preview.getByRole('button', { name: '上左' })
+ let tooltip = page.getByRole('tooltip', { name: 'Top Left 提示文字' })
+
+ await page.waitForTimeout(100)
+ await page.mouse.move(600, 300)
+ await expect(tooltip).toBeVisible()
+
+ // 测试Tooltip的位置是否正确
+ button = preview.getByRole('button', { name: '上右' })
+ tooltip = page.getByRole('tooltip', { name: 'Top Right 提示文字' })
+
+ await button.hover()
+ let buttonBox = await button.boundingBox()
+ let tooltipBox = await tooltip.boundingBox()
+
+ // tooltip + 高度 要小于button的y
+ expect(tooltipBox.y + tooltipBox.height).toBeLessThan(buttonBox.y)
+
+ button = preview.getByRole('button', { name: '下左' })
+ tooltip = page.getByRole('tooltip', { name: 'Bottom Left 提示文字' })
+
+ await button.hover()
+ buttonBox = await button.boundingBox()
+ tooltipBox = await tooltip.boundingBox()
+
+ // button + 高度 要小于 tooltip 的y
+ expect(buttonBox.y + buttonBox.height).toBeLessThan(tooltipBox.y)
+})
diff --git a/examples/sites/demos/pc/app/tooltip/pre.vue b/examples/sites/demos/pc/app/tooltip/pre.vue
new file mode 100644
index 000000000..d4f661942
--- /dev/null
+++ b/examples/sites/demos/pc/app/tooltip/pre.vue
@@ -0,0 +1,26 @@
+
+
+ 文本预格式化
+
+
+
+
diff --git a/examples/sites/demos/pc/app/tooltip/theme-composition-api.vue b/examples/sites/demos/pc/app/tooltip/theme-composition-api.vue
index 6a8b676f9..cf51207bf 100644
--- a/examples/sites/demos/pc/app/tooltip/theme-composition-api.vue
+++ b/examples/sites/demos/pc/app/tooltip/theme-composition-api.vue
@@ -1,6 +1,6 @@
- Effects示例:
+ Effects 示例:
Dark
@@ -9,7 +9,7 @@
- Types示例:
+ Types 示例:
normal
diff --git a/examples/sites/demos/pc/app/tooltip/theme.vue b/examples/sites/demos/pc/app/tooltip/theme.vue
index 6873ae21c..4687e15da 100644
--- a/examples/sites/demos/pc/app/tooltip/theme.vue
+++ b/examples/sites/demos/pc/app/tooltip/theme.vue
@@ -1,6 +1,6 @@
- Effects示例:
+ Effects 示例:
Dark
@@ -9,7 +9,7 @@
- Types示例:
+ Types 示例:
normal
diff --git a/examples/sites/demos/pc/app/tooltip/webdoc/tooltip.js b/examples/sites/demos/pc/app/tooltip/webdoc/tooltip.js
index dd757bee7..a73deb3d6 100644
--- a/examples/sites/demos/pc/app/tooltip/webdoc/tooltip.js
+++ b/examples/sites/demos/pc/app/tooltip/webdoc/tooltip.js
@@ -3,366 +3,140 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
- 'zh-CN': `
- 通过 content
属性指定提示的内容
- 通过 placement
属性指定提示的显示位置,支持12个显示位置
- 通过 effect
属性指定提示的效果
- `,
- 'en-US': `
- Specify the content of the prompt via the content
attribute
- Use the placement
property to specify the display location of the prompt. 12 display locations are supported
- Specify the effect of the prompt with the effect
property
- `
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
},
- 'codeFiles': ['basic-usage.vue']
+ desc: {
+ 'zh-CN':
+ '\n 通过 content
属性指定提示的内容。
\n 通过 placement
属性指定提示的显示位置,支持12个显示位置。
\n 通过 effect
属性指定提示的效果。
\n ',
+ 'en-US':
+ '\n Specify the content of the prompt via the content
attribute
\n Use the placement
property to specify the display location of the prompt. 12 display locations are supported
\n Specify the effect of the prompt with the effect
property
\n '
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'theme',
- 'name': { 'zh-CN': '主题', 'en-US': 'Theme' },
- 'desc': {
- 'zh-CN': `
- 通过 effect
属性设置明暗效果,可选值 dark/light ,默认值为 dark,通常使用effect
设置效果。
- 通过 type
属性设置主题,它的优先级大于 effect
。
- `,
- 'en-US': `
- The effect
property is used to set the light and dark effect. The optional dark/light effect is dark by default. The effect< br> is usually set by effect
.
- Set the theme with the type
property, which has a higher priority than the effect
.
- `
+ demoId: 'theme',
+ name: {
+ 'zh-CN': '主题',
+ 'en-US': 'Theme'
},
- 'codeFiles': ['theme.vue']
+ desc: {
+ 'zh-CN':
+ '\n 通过 effect
属性设置明暗效果,可选值 dark/light
,默认值为 dark
,通常使用effect
设置效果。
\n 通过 type
属性设置主题,它的优先级大于 effect
。\n ',
+ 'en-US':
+ '\n The effect
property is used to set the light and dark effect. The optional dark/light effect is dark by default. The effect< br> is usually set by effect
.\n Set the theme with the type
property, which has a higher priority than the effect
.\n '
+ },
+ codeFiles: ['theme.vue']
},
{
- 'demoId': 'control',
- 'name': { 'zh-CN': '控制/禁用提示', 'en-US': 'Control/disable' },
- 'desc': {
- 'zh-CN': `
- 提示组件默认是监听鼠标移入/移出事件来触发,手动控制提示的出现,有以下方法:
- 1.通过 visible
属性设置是否智能识别溢出后提示,属性取值为 always / auto
。当取值为auto
时,智能提示是自动识别文字是否有长度溢出,动态的显示提示。
- 2.通过 manual
属性为 true 后,就可以通过设置 v-model
属性,动态控制显示和隐藏
- 3.通过 diabled
属性,直接禁用提示。
- `,
- 'en-US': `
- The Tooltip component is triggered by listening for mouse move in/out events by default, and manually controls the appearance of the prompt in the following ways:
- 1. Use the visible
property to set whether the overflow prompt is intelligently recognized. The property value is always/auto
. If the value is auto
, the smart prompt automatically identifies whether the text length overruns and dynamically displays the prompt.
- 2. After the manual
property is true, you can dynamically control the display and hiding of
by setting the v-model
property.
- 3. Use the diabled
property to disable the tooltip.
- `
+ demoId: 'control',
+ name: {
+ 'zh-CN': '控制/禁用提示',
+ 'en-US': 'Control/disable'
},
- 'codeFiles': ['control.vue']
+ desc: {
+ 'zh-CN':
+ '\n 提示组件默认是监听鼠标移入/移出事件来触发,手动控制提示的出现,有以下方法:
\n 1.通过 visible
属性设置是否智能识别溢出后提示,属性取值为 always / auto
。当取值为auto
时,智能提示是自动识别文字是否有长度溢出,动态的显示提示。
\n 2.通过 manual
属性为 true 后,就可以通过设置 v-model
属性,动态控制显示和隐藏。
\n 3.通过 diabled
属性,直接禁用提示。
\n ',
+ 'en-US':
+ '\n The Tooltip component is triggered by listening for mouse move in/out events by default, and manually controls the appearance of the prompt in the following ways:
\n 1. Use the visible
property to set whether the overflow prompt is intelligently recognized. The property value is always/auto
. If the value is auto
, the smart prompt automatically identifies whether the text length overruns and dynamically displays the prompt.
\n 2. After the manual
property is true, you can dynamically control the display and hiding of
by setting the v-model
property.\n 3. Use the diabled
property to disable the tooltip.
\n '
+ },
+ codeFiles: ['control.vue']
},
{
- 'demoId': 'content',
- 'name': { 'zh-CN': '弹出层内容', 'en-US': 'Tooltip content' },
- 'desc': {
- 'zh-CN': `
- 通过 content
属性指定弹出的文本。
- 通过 renderContent
自定义渲染函数,可使用 JSX
返回需要渲染的节点内容
- 通过 content
插槽,自定义内容,当弹出复杂的内容结构时,推荐使用插槽的方式。
- `,
- 'en-US': `
- Specify the pop-up text via the content
property.
- A custom rendering function with renderContent
returns the node content to be rendered. The function is declared as (h, content)=>vnode.
- The content
slot is used to customize content. It is recommended to use the slot when a complex content structure pops up.
- `
+ demoId: 'content',
+ name: {
+ 'zh-CN': '弹出层内容',
+ 'en-US': 'Tooltip content'
},
- 'codeFiles': ['content.vue']
+ desc: {
+ 'zh-CN':
+ '\n 通过 content
属性指定弹出的文本。
\n 通过 renderContent
自定义渲染函数,可使用 JSX
返回需要渲染的节点内容。
\n 通过 content
插槽,自定义内容,当弹出复杂的内容结构时,推荐使用插槽的方式。
\n ',
+ 'en-US':
+ '\n Specify the pop-up text via the content
property.
\n A custom rendering function with renderContent
returns the node content to be rendered. The function is declared as (h, content)=>vnode.
\n The content
slot is used to customize content. It is recommended to use the slot when a complex content structure pops up.
\n '
+ },
+ codeFiles: ['content.vue']
},
{
- 'demoId': 'offset',
- 'name': { 'zh-CN': '弹出层的偏移', 'en-US': 'Offset' },
- 'desc': {
- 'zh-CN': `通过 offset
属性设置 Tooltip 组件出现位置的偏移量。`,
+ demoId: 'offset',
+ name: {
+ 'zh-CN': '弹出层的偏移',
+ 'en-US': 'Offset'
+ },
+ desc: {
+ 'zh-CN': '通过 offset
属性设置组件出现位置的偏移量。',
'en-US':
'Use the offset
property to set the offset of the position where the Tooltip component appears. \n'
},
- 'codeFiles': ['offset.vue']
+ codeFiles: ['offset.vue']
},
{
- 'demoId': 'custom-popper',
- 'name': { 'zh-CN': '弹出层的特性', 'en-US': 'Features of the popper layer' },
- 'desc': {
- 'zh-CN': `
- 通过 visible-arrow
属性设置是否显示小箭头。
- 通过 enterable
属性设置鼠标是否可进入到 tooltip 中。
- 通过 popper-class
属性设置弹出dom的类名,便于用户定制弹出层的样式。
- `,
- 'en-US': `
- The visible-arrow
property sets whether the small arrow is displayed.
- Use the enterable
property to set whether the mouse can enter the tooltip.
- You can use the popper-class
property to set the class name of the eject dom to customize the style of the eject layer.
- `
+ demoId: 'custom-popper',
+ name: {
+ 'zh-CN': '弹出层的特性',
+ 'en-US': 'Features of the popper layer'
},
- 'codeFiles': ['custom-popper.vue']
- },
- {
- 'demoId': 'delay',
- 'name': { 'zh-CN': '延迟控制', 'en-US': 'Delay control' },
- 'desc': {
- 'zh-CN': `
- 通过 open-delay
属性设置 Tooltip 组件延迟出现的时间,单位毫秒,默认值为 0。
- 通过 close-delay
属性设置 Tooltip 组件延迟关闭的时间,单位毫秒,默认值为 300。
- 通过 hide-after
属性设置 Tooltip 组件出现后自动隐藏的时间,单位毫秒,为 0 则不会自动隐藏,默认值为 0。
- `,
- 'en-US': `
- Use the open-delay
property to set the delay in milliseconds for the Tooltip component to appear. The default value is 0.
- Use the close-delay
property to set the delay in closing the Tooltip component, in milliseconds. The default value is 300.
- Run the hide-after
property to set the time for the Tooltip component to be automatically hidden after it appears, in milliseconds. If it is 0, it will not be automatically hidden. The default value is 0.
- `
- },
- 'codeFiles': ['delay.vue']
- },
- {
- 'demoId': 'popper-options',
- 'name': { 'zh-CN': '高级配置', 'en-US': 'Advanced configuration' },
- 'desc': {
+ desc: {
'zh-CN':
- '通过 popper-options
属性为 Tooltip 的弹出层的配置参数,请参考下面的IPopperOption文档',
+ '\n 通过 visible-arrow
属性设置是否显示小箭头。
\n 通过 enterable
属性设置鼠标是否可进入到 tooltip 中。
\n 通过 popper-class
属性设置弹出dom的类名,便于用户定制弹出层的样式。
\n ',
'en-US':
- 'Use the popper-options
property to configure popper parameters for Tooltip. Refer to the IPopperOption documentation below \n'
+ '\n The visible-arrow
property sets whether the small arrow is displayed.
\n Use the enterable
property to set whether the mouse can enter the tooltip.
\n You can use the popper-class
property to set the class name of the eject dom to customize the style of the eject layer.
\n '
},
- 'codeFiles': ['popper-options.vue']
+ codeFiles: ['custom-popper.vue']
},
{
- 'demoId': 'transition',
- 'name': { 'zh-CN': '自定义渐变动画', 'en-US': 'Customized Animation' },
- 'desc': {
- 'zh-CN': '通过 transition
定义渐变动画,默认选值为 tiny-fade-in-linear
\n',
+ demoId: 'delay',
+ name: {
+ 'zh-CN': '延迟控制',
+ 'en-US': 'Delay control'
+ },
+ desc: {
+ 'zh-CN':
+ '\n 通过 open-delay
属性设置组件延迟出现的时间,单位毫秒,默认值为 0。
\n 通过 close-delay
属性设置 组件延迟关闭的时间,单位毫秒,默认值为 300。
\n 通过 hide-after
属性设置组件出现后自动隐藏的时间,单位毫秒,为 0 则不会自动隐藏,默认值为 0。
\n ',
+ 'en-US':
+ '\n Use the open-delay
property to set the delay in milliseconds for the Tooltip component to appear. The default value is 0.
\n Use the close-delay
property to set the delay in closing the Tooltip component, in milliseconds. The default value is 300.
\n Run the hide-after
property to set the time for the Tooltip component to be automatically hidden after it appears, in milliseconds. If it is 0, it will not be automatically hidden. The default value is 0.
\n '
+ },
+ codeFiles: ['delay.vue']
+ },
+ {
+ demoId: 'popper-options',
+ name: {
+ 'zh-CN': '高级配置',
+ 'en-US': 'Advanced configuration'
+ },
+ desc: {
+ 'zh-CN': '通过 popper-options
属性为组件的弹出层的配置参。',
+ 'en-US': 'Use the popper-options
property to configure popper parameters for Tooltip. '
+ },
+ codeFiles: ['popper-options.vue']
+ },
+ {
+ demoId: 'transition',
+ name: {
+ 'zh-CN': '自定义渐变动画',
+ 'en-US': 'Customized Animation'
+ },
+ desc: {
+ 'zh-CN': '通过 transition
定义渐变动画,默认选值为 tiny-fade-in-linear
。',
'en-US':
'Define a gradient animation using transition
. The default value is tiny-fade-in-linear
'
},
- 'codeFiles': ['transition.vue']
- }
- ],
- apis: [
+ codeFiles: ['transition.vue']
+ },
{
- 'name': 'tooltip',
- 'type': 'component',
- 'props': [
- {
- 'name': 'effect',
- 'type': '"dark" | "light"',
- 'defaultValue': '"dark"',
- 'desc': {
- 'zh-CN': '提示的主题',
- 'en-US': 'Default theme; The value of this attribute can be dark or light'
- },
- 'demoId': 'theme'
- },
- {
- 'name': 'type',
- 'type': '"normal" | "warning" | "error" | "info" | "success"',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '提示的类型,type的优先级大于effect',
- 'en-US':
- 'The default type is provided. The options for this attribute are normal, warning, error, information, and success. The priority of type is higher than that of effect.'
- },
- 'demoId': 'theme'
- },
- {
- 'name': 'content',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '显示的内容',
- 'en-US': 'Displayed content.'
- },
- 'demoId': 'content'
- },
- {
- 'name': 'placement',
- 'type':
- '"top/top-start/top-end/bottom/bottom-start/bottom-end/left/left-start/left-end/right/right-start/right-end"',
- 'defaultValue': ' "bottom"',
- 'desc': {
- 'zh-CN':
- 'Tooltip 的出现位置;该属性的可选值为 top/top-start/top-end/bottom/bottom-start/bottom-end/left/left-start/left-end/right/right-start/right-end',
- 'en-US':
- 'Location where the tooltip appears; The optional value of this attribute is top/top-start/top-end/bottom/bottom-start/bottom-end/left/left-start/left-end/right/right-start/right-end'
- },
- 'demoId': 'basic-usage'
- },
-
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': 'Tooltip 是否禁用', 'en-US': 'Whether Tooltip is disable' },
- 'demoId': 'control'
- },
- {
- 'name': 'manual',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '手动控制模式,设置为 true 后,mouseenter 和 mouseleave 事件将不会生效',
- 'en-US':
- 'Manual control mode. If this parameter is set to true, the mouseenter and mouseleave events do not take effect.'
- },
- 'demoId': 'control'
- },
- {
- 'name': 'modelValue / v-model',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '配置 manual = true时,控制弹出状态',
- 'en-US': 'If manual is set to true, the pop-up status is controlled'
- },
- 'demoId': 'control'
- },
- {
- 'name': 'offset',
- 'type': 'number',
- 'defaultValue': '0',
- 'desc': { 'zh-CN': '弹出层出现位置的偏移量', 'en-US': 'Offset of the occurrence position' },
- 'demoId': 'offset'
- },
-
- {
- 'name': 'visible-arrow',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否显示箭头',
- 'en-US': 'Indicates whether to display the tooltip arrow.'
- },
- 'demoId': 'custom-popper'
- },
- {
- 'name': 'open-delay',
- 'type': 'number',
- 'defaultValue': '0',
- 'desc': { 'zh-CN': '延迟出现的时长,单位毫秒', 'en-US': 'Open delay time, in milliseconds.' },
- 'demoId': 'delay'
- },
- {
- 'name': 'close-delay',
- 'type': 'number',
- 'defaultValue': '300',
- 'desc': { 'zh-CN': '延迟关闭的时长,单位毫秒', 'en-US': 'Close Delay time, in milliseconds.' },
- 'demoId': 'delay'
- },
- {
- 'name': 'hide-after',
- 'type': 'number',
- 'defaultValue': ' 0',
- 'desc': {
- 'zh-CN': '出现后自动隐藏的时长,单位毫秒,为 0 则不会自动隐藏',
- 'en-US':
- 'Duration of automatic hiding after appearing, in milliseconds. If 0, it will not be automatically hidden'
- },
- 'demoId': 'delay'
- },
-
- {
- 'name': 'visible',
- 'type': 'string',
- 'defaultValue': '"always"',
- 'desc': {
- 'zh-CN': '提示的智能出现的模式;该属性的可选值为 auto/always',
- 'en-US':
- 'The pattern of intelligent emergence of hints; The optional value for this property is auto/always'
- },
- 'demoId': 'control'
- },
- {
- 'name': 'enterable',
- 'type': 'boolean',
- 'defaultValue': ' true',
- 'desc': {
- 'zh-CN': '鼠标是否可进入到 tooltip 的弹出层中',
- 'en-US': 'Whether the mouse can enter the pop-up layer of the tooltip'
- },
- 'demoId': 'custom-popper'
- },
- {
- 'name': 'popper-options',
- 'type': 'object',
- 'defaultValue': ' { }',
- 'desc': {
- 'zh-CN': '弹出层参数;请参考IPopperOption的说明',
- 'en-US': 'Advanced parameters; Refer to the description of IPopperOption'
- },
- 'demoId': 'popper-options'
- },
- {
- 'name': 'popper-class',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '为 Tooltip 的弹出层添加类名',
- 'en-US': 'Add a class name to the pop-up layer of Tooltip'
- },
- 'demoId': 'custom-popper'
- },
- {
- 'name': 'append-to-body',
- 'type': 'boolean',
- 'defaultValue': ' true',
- 'desc': { 'zh-CN': '是否将弹出层的元素添加到body上', 'en-US': 'Whether to append to body' },
- 'demoId': ''
- },
- {
- 'name': 'transition',
- 'type': 'string',
- 'defaultValue': '"tiny-fade-in-linear"',
- 'desc': { 'zh-CN': '定义渐变动画的类名', 'en-US': 'Define the class name of the gradient animation' },
- 'demoId': 'transition'
- },
- {
- 'name': 'tabindex',
- 'type': 'number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置组件的触发原的tabindex',
- 'en-US': 'Sets the trigger original tabindex of the component'
- },
- 'demoId': ''
- },
- {
- 'name': 'renderContent',
- 'type': '(h: Vue.h, content:string)=> vnode',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义渲染函数,返回需要渲染的节点内容',
- 'en-US': 'A custom rendering function that returns the contents of the node to be rendered'
- },
- 'demoId': 'content'
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '默认插槽', 'en-US': 'Default slot' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'content',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '内容插槽', 'en-US': 'Content Slot' },
- 'demoId': 'content'
- }
- ]
- }
- ],
- types: [
- {
- name: 'IPopperOption',
- type: 'interface',
- code: `
-interface IPopperOption {
- bubbling: boolean // 是否监听元素所有上级有滚动元素的scroll事件,监听到则更新popper的位置。用于解决某些弹出层位置在页面滚动时,位置不正确的场景,默认false
- followReferenceHide: boolean // 当触发源隐藏时,自动隐藏弹出层,默认true
- removeOnDestroy: boolean // 弹出层消失后,是否移除弹出层的DOM元素,布尔false
-}
- `
+ demoId: 'pre',
+ name: {
+ 'zh-CN': '文本预格式化',
+ 'en-US': 'Customized Animation'
+ },
+ desc: {
+ 'zh-CN':
+ '配置 pre
为 true
,就会预格式化 content
文本。
\n 被包围在 <pre> </pre> 标签元素中的文本会保留空格和换行符,文本也会呈现为等宽字体。',
+ 'en-US':
+ 'If pre
is set to true
, the content
text is preformatted.
\n Text enclosed in the
-
- 功能控制:
-
- {{ showAllBtn ? '不显示all-btns' : '显示all-btns' }}
-
-
- {{ alwaysDisable ? '无选中时禁用' : '无选中时高亮' }}
-
+
+
+ 功能控制:
+
+ {{ showAllBtn ? '不显示all-btns' : '显示all-btns' }}
+
+
+ {{ alwaysDisable ? '无选时中禁用' : '无选中时高亮' }}
+
+
+
-
diff --git a/examples/sites/demos/pc/app/tree-menu/with-icon.spec.ts b/examples/sites/demos/pc/app/tree-menu/with-icon.spec.ts
new file mode 100644
index 000000000..7dca9071a
--- /dev/null
+++ b/examples/sites/demos/pc/app/tree-menu/with-icon.spec.ts
@@ -0,0 +1,12 @@
+import { test, expect } from '@playwright/test'
+
+test('节点配置带图标', async ({ page }) => {
+ page.on('pageerror', (exception) => expect(exception).toBeNull())
+ await page.goto('tree-menu#with-icon')
+
+ const treeMenu = page.locator('#with-icon .tiny-tree-menu')
+ const treeMenuSvg = page.locator('.tree-node-name svg')
+
+ await expect(treeMenu.getByText('首页')).toBeVisible()
+ await expect(treeMenuSvg.nth(0)).toBeVisible()
+})
diff --git a/examples/sites/demos/pc/app/tree-menu/with-icon.vue b/examples/sites/demos/pc/app/tree-menu/with-icon.vue
new file mode 100644
index 000000000..2509495fe
--- /dev/null
+++ b/examples/sites/demos/pc/app/tree-menu/with-icon.vue
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/tree/basic-usage.spec.ts b/examples/sites/demos/pc/app/tree/basic-usage.spec.ts
index c64676aa3..7f2927e80 100644
--- a/examples/sites/demos/pc/app/tree/basic-usage.spec.ts
+++ b/examples/sites/demos/pc/app/tree/basic-usage.spec.ts
@@ -26,8 +26,10 @@ test('测试基本使用', async ({ page }) => {
await expect(tree.getByText('数据 1-1-1')).toHaveCSS('font-size', '12px')
// 测试偏移 18px + 8 padding
- await expect(indentSpan).toHaveCSS('width', '26px')
+ const { width: widthOrigin } = await indentSpan.boundingBox()
+ await expect(widthOrigin).toBeCloseTo(26, 1)
await offsetBtn.click()
await page.waitForTimeout(20)
- await expect(indentSpan).toHaveCSS('width', '46px')
+ const { width: widthChanged } = await indentSpan.boundingBox()
+ await expect(widthChanged).toBeCloseTo(46, 1)
})
diff --git a/examples/sites/demos/pc/app/tree/edit-control-composition-api.vue b/examples/sites/demos/pc/app/tree/edit-control-composition-api.vue
new file mode 100644
index 000000000..08658ccc0
--- /dev/null
+++ b/examples/sites/demos/pc/app/tree/edit-control-composition-api.vue
@@ -0,0 +1,112 @@
+
+
+ 进入编辑
+ 取消编辑
+ 保存编辑
+
+ 数据1 禁止添加; 数据2 禁止编辑; 数据3 禁止删除;
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/tree/edit-control.vue b/examples/sites/demos/pc/app/tree/edit-control.vue
new file mode 100644
index 000000000..e4e0a5c1e
--- /dev/null
+++ b/examples/sites/demos/pc/app/tree/edit-control.vue
@@ -0,0 +1,120 @@
+
+
+ 进入编辑
+ 取消编辑
+ 保存编辑
+
+ 数据1 禁止添加; 数据2 禁止编辑; 数据3 禁止删除;
+
+
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/tree/filter-view-composition-api.vue b/examples/sites/demos/pc/app/tree/filter-view-composition-api.vue
index 9b5ccc552..9f499d98f 100644
--- a/examples/sites/demos/pc/app/tree/filter-view-composition-api.vue
+++ b/examples/sites/demos/pc/app/tree/filter-view-composition-api.vue
@@ -24,8 +24,10 @@
:data="data"
:view-type="viewType"
:filter-node-method="filterNodeMethod"
- default-expand-all
:show-auxi="showAuxi === 'show'"
+ default-expand-all
+ show-checkbox
+ node-key="id"
>
diff --git a/examples/sites/demos/pc/app/tree/filter-view.vue b/examples/sites/demos/pc/app/tree/filter-view.vue
index b4098449b..7472a3190 100644
--- a/examples/sites/demos/pc/app/tree/filter-view.vue
+++ b/examples/sites/demos/pc/app/tree/filter-view.vue
@@ -24,8 +24,10 @@
:data="data"
:view-type="viewType"
:filter-node-method="filterNodeMethod"
- default-expand-all
:show-auxi="showAuxi === 'show'"
+ default-expand-all
+ show-checkbox
+ node-key="id"
>
diff --git a/examples/sites/demos/pc/app/tree/lazy-composition-api.vue b/examples/sites/demos/pc/app/tree/lazy-composition-api.vue
index edfdd5103..af728eb8f 100644
--- a/examples/sites/demos/pc/app/tree/lazy-composition-api.vue
+++ b/examples/sites/demos/pc/app/tree/lazy-composition-api.vue
@@ -9,7 +9,6 @@ import { Tree as TinyTree } from '@opentiny/vue'
// node为点击的节点, resolve为回调函数,用于异步返回下层节点的数据
function load(node, resolve) {
- // eslint-disable-next-line no-console
console.log('即将加载节点下级数据:', node)
// 通过 level =0 来识别第一次加载
@@ -37,11 +36,9 @@ function load(node, resolve) {
}
}
function afterLoad(data) {
- // eslint-disable-next-line no-console
console.log('afterLoad属性触发:', data)
}
function loadedData(data) {
- // eslint-disable-next-line no-console
console.log('load-data 事件触发:', data)
}
diff --git a/examples/sites/demos/pc/app/tree/lazy.vue b/examples/sites/demos/pc/app/tree/lazy.vue
index d65f3206f..9ac06c546 100644
--- a/examples/sites/demos/pc/app/tree/lazy.vue
+++ b/examples/sites/demos/pc/app/tree/lazy.vue
@@ -14,7 +14,6 @@ export default {
methods: {
// node为点击的节点, resolve为回调函数,用于异步返回下层节点的数据
load(node, resolve) {
- // eslint-disable-next-line no-console
console.log('即将加载节点下级数据:', node)
// 通过 level =0 来识别第一次加载
@@ -42,11 +41,9 @@ export default {
}
},
afterLoad(data) {
- // eslint-disable-next-line no-console
console.log('afterLoad属性触发:', data)
},
loadedData(data) {
- // eslint-disable-next-line no-console
console.log('load-data 事件触发:', data)
}
}
diff --git a/examples/sites/demos/pc/app/tree/other-composition-api.vue b/examples/sites/demos/pc/app/tree/other-composition-api.vue
index 9843b36af..cc62482b5 100644
--- a/examples/sites/demos/pc/app/tree/other-composition-api.vue
+++ b/examples/sites/demos/pc/app/tree/other-composition-api.vue
@@ -1,13 +1,15 @@
-
+ 手风琴模式,父子严格显示自动勾选
+
+
+
+ 非手风琴模式,自定义自动勾选的内容
+
+
+ 自定义开关的内容
+
+
@@ -36,3 +38,9 @@ const data = ref([
}
])
+
+
diff --git a/examples/sites/demos/pc/app/tree/other.spec.ts b/examples/sites/demos/pc/app/tree/other.spec.ts
index d63de3667..50c11040e 100644
--- a/examples/sites/demos/pc/app/tree/other.spec.ts
+++ b/examples/sites/demos/pc/app/tree/other.spec.ts
@@ -5,6 +5,6 @@ test('增删其它功能', async ({ page }) => {
await page.goto('tree#other')
const tree = page.locator('.pc-demo-container')
- await expect(tree.getByText('数据 1')).toHaveCount(1)
+ await expect(tree.getByText('数据 1')).toHaveCount(2)
await expect(tree.getByText('同时勾选下级')).toHaveCount(1)
})
diff --git a/examples/sites/demos/pc/app/tree/other.vue b/examples/sites/demos/pc/app/tree/other.vue
index 87fe5721d..049df365f 100644
--- a/examples/sites/demos/pc/app/tree/other.vue
+++ b/examples/sites/demos/pc/app/tree/other.vue
@@ -1,13 +1,15 @@
-
+ 手风琴模式,父子严格显示自动勾选
+
+
+
+ 非手风琴模式,自定义自动勾选的内容
+
+
+ 自定义开关的内容
+
+
@@ -44,3 +46,9 @@ export default {
}
}
+
+
diff --git a/examples/sites/demos/pc/app/tree/radio-composition-api.vue b/examples/sites/demos/pc/app/tree/radio-composition-api.vue
index e8dc894eb..d7afa91ab 100644
--- a/examples/sites/demos/pc/app/tree/radio-composition-api.vue
+++ b/examples/sites/demos/pc/app/tree/radio-composition-api.vue
@@ -59,7 +59,6 @@ function getChecks() {
// 查询半选的节点数据
const checkedHalfNodes = treeRef.value.getHalfCheckedNodes()
- // eslint-disable-next-line no-console
console.log('当前组件的勾选状态为: ', treeRef.value, {
checkedKeys,
checkedKeysOnlyLeaf,
@@ -75,7 +74,6 @@ function setCurrentRadio() {
}
function checkChange(data, checked, indeterminate) {
- // eslint-disable-next-line no-console
console.log('checkChange事件:', { data, checked, indeterminate })
}
diff --git a/examples/sites/demos/pc/app/tree/radio.vue b/examples/sites/demos/pc/app/tree/radio.vue
index 2d7e64b3e..e9c5267e4 100644
--- a/examples/sites/demos/pc/app/tree/radio.vue
+++ b/examples/sites/demos/pc/app/tree/radio.vue
@@ -65,7 +65,6 @@ export default {
// 查询半选的节点数据
const checkedHalfNodes = this.$refs.treeRef.getHalfCheckedNodes()
- // eslint-disable-next-line no-console
console.log('当前组件的勾选状态为: ', this.$refs.treeRef, {
checkedKeys,
checkedKeysOnlyLeaf,
@@ -80,7 +79,6 @@ export default {
this.$refs.treeRef.setCurrentRadio()
},
checkChange(data, checked, indeterminate) {
- // eslint-disable-next-line no-console
console.log('checkChange事件:', { data, checked, indeterminate })
}
}
diff --git a/examples/sites/demos/pc/app/tree/webdoc/tree.js b/examples/sites/demos/pc/app/tree/webdoc/tree.js
index 5ecca5eeb..d1571b36a 100644
--- a/examples/sites/demos/pc/app/tree/webdoc/tree.js
+++ b/examples/sites/demos/pc/app/tree/webdoc/tree.js
@@ -3,1342 +3,242 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
- 'zh-CN': `
- 通过 data
属性设置数据源, 默认通过数据项的 label
, children
属性展示数据。
- 通过 show-line
属性设置是否显示连接线。
- 通过 size
属性设置组件的大小, 可选值为medium
, small
。
- 通过 indent
属性设置每一级的水平缩进,默认18px。
- 通过 node-click
事件,监听节点的点击。
- `,
- 'en-US': `
- The data source is set through the data
property. By default, the data is displayed through the label
and children
properties of the data item.
- The show-line
property is used to set whether the connection line is displayed.
- Use the size
property to set the component size. The optional values are medium
, small
.
- Use the indent
property to set the horizontal indent for each level. The default is 18px.
- Listen for a node click via the node-click
event.
- `
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
},
- 'codeFiles': ['basic-usage.vue']
+ desc: {
+ 'zh-CN':
+ '\n 通过 data
属性设置数据源, 默认通过数据项的 label
, children
属性展示数据。
\n 通过 show-line
属性设置是否显示连接线。
\n 通过 size
属性设置组件的大小, 可选值为medium
, small
。
\n 通过 indent
属性设置每一级的水平缩进,默认18px。
\n 通过 node-click
事件,监听节点的点击。
\n ',
+ 'en-US':
+ '\n The data source is set through the data
property. By default, the data is displayed through the label
and children
properties of the data item.
\n The show-line
property is used to set whether the connection line is displayed.
\n Use the size
property to set the component size. The optional values are medium
, small
.
\n Use the indent
property to set the horizontal indent for each level. The default is 18px.
\n Listen for a node click via the node-click
event.
\n '
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'props',
- 'name': { 'zh-CN': '数据格式 / 禁用', 'en-US': 'Data format/Disabled' },
- 'desc': {
- 'zh-CN': `
- 通过 props
属性,指定 label / children / disabled / isLeaf
映射关系,以支持用户传入非标准格式的数据到 data
属性。
- disabled
指定节点的禁用状态。
- isLeaf
指定节点是否为叶子节点,仅在懒加载时有效。
- `,
- 'en-US': `Using the props
property, specify the label/children/disabled/isLeaf
mapping. To enable users to pass data in a non-standard format to the data
property.
- disabled
Specifies the disabled status of a node.
- isLeaf
Specifies whether the node is a leaf node and is valid only for lazy loading.
- `
+ demoId: 'props',
+ name: {
+ 'zh-CN': '数据格式 / 禁用',
+ 'en-US': 'Data format/Disabled'
},
- 'codeFiles': ['props.vue']
+ desc: {
+ 'zh-CN':
+ '\n 通过 props
属性,指定 label / children / disabled / isLeaf
映射关系,以支持用户传入非标准格式的数据到 data
属性。
\n disabled
指定节点的禁用状态。
\n isLeaf
指定节点是否为叶子节点,仅在懒加载时有效。
\n ',
+ 'en-US':
+ 'Using the props
property, specify the label/children/disabled/isLeaf
mapping. To enable users to pass data in a non-standard format to the data
property.
\n disabled
Specifies the disabled status of a node.
\n isLeaf
Specifies whether the node is a leaf node and is valid only for lazy loading.
\n '
+ },
+ codeFiles: ['props.vue']
},
{
- 'demoId': 'icons',
- 'name': { 'zh-CN': '自定义图标', 'en-US': 'Custom icon' },
- 'desc': {
- 'zh-CN': `
- 通过 icon
属性设置组件的图标。
- 通过 expandIcon
属性设置组件的打开图标,expandIconColor
属性设置打开图标颜色。
- 通过 shrinkIcon
属性设置组件的收起图标,shrinkIconColor
属性设置收起图标颜色。
- expandIcon
,shrinkIcon
2个属性的优先级更高。
- `,
- 'en-US': `Set the icon of the component with the icon
property.
- The expandIcon
property sets the open icon of the component, and the expandIconColor
property sets the open icon color.
- The shrinkIcon
property is used to set the component's shrinkIconColor, and the shrinkiconcolor
property is used to set the shrinkiconcolor.
- expandIcon
,shrinkIcon
The two attributes are preferred.
- `
+ demoId: 'icons',
+ name: {
+ 'zh-CN': '自定义图标',
+ 'en-US': 'Custom icon'
},
- 'codeFiles': ['icons.vue']
+ desc: {
+ 'zh-CN':
+ '\n 通过 icon
属性设置组件的图标。
\n 通过 expandIcon
属性设置组件的打开图标,expandIconColor
属性设置打开图标颜色。
\n 通过 shrinkIcon
属性设置组件的收起图标,shrinkIconColor
属性设置收起图标颜色。
\n expandIcon
,shrinkIcon
2个属性的优先级更高。\n ',
+ 'en-US':
+ 'Set the icon of the component with the icon
property.
\n The expandIcon
property sets the open icon of the component, and the expandIconColor
property sets the open icon color.
\n The shrinkIcon
property is used to set the component\'s shrinkIconColor, and the shrinkiconcolor
property is used to set the shrinkiconcolor.
\n expandIcon
,shrinkIcon
The two attributes are preferred. \n '
+ },
+ codeFiles: ['icons.vue']
},
{
- 'demoId': 'slot',
- 'name': { 'zh-CN': '自定义节点 / 插槽', 'en-US': 'Customize nodes/slots' },
- 'desc': {
- 'zh-CN': `
- default
插槽, 节点内容元素,默认为节点数据的 label
值。
- prefix
插槽, 节点内容前置元素。
- suffix
插槽, 节点内容后置元素。
- operation
插槽,节点内容靠右对齐的元素,当启用编辑时, 它显示在编辑按钮的左边。
- empty
插槽,传入的 data
属性为空时,自定义无数据的元素。
-
- 除以上5个插槽外,组件还提供了2个自定义节点的属性:
- 通过 emptyText
属性,指定无数据时文本提示。
- 通过 render-content
函数属性,自定义渲染函数,可使用 JSX 返回需要渲染的节点内容。
- `,
- 'en-US': `The default
slot, node content element, defaults to the label
value of the node data.
- prefix
slot, the prefix element of the node content.
- suffix
Slots, element after node content.
- The operation
slot, the right-aligned element of the node content, which appears to the left of the edit button when is enabled to edit .
- The empty
slot, custom data-free elements when the data
property is passed in.
-
- In addition to the above five slots, the component also provides properties for two custom nodes:
- Using the emptyText
property, specify a text prompt when no data is available.
- Using the render-content
function property, you can customize the rendering function to return the node content to be rendered using JSX.
- `
+ demoId: 'slot',
+ name: {
+ 'zh-CN': '自定义节点 / 插槽',
+ 'en-US': 'Customize nodes/slots'
},
- 'codeFiles': ['slot.vue']
+ desc: {
+ 'zh-CN':
+ '\n default
插槽, 节点内容元素,默认为节点数据的 label
值。
\n prefix
插槽, 节点内容前置元素。
\n suffix
插槽, 节点内容后置元素。
\n operation
插槽,节点内容靠右对齐的元素,当启用编辑时, 它显示在编辑按钮的左边。
\n empty
插槽,传入的 data
属性为空时,自定义无数据的元素。
\n\n 除以上5个插槽外,组件还提供了2个自定义节点的属性:
\n 通过 emptyText
属性,指定无数据时文本提示。
\n 通过 render-content
函数属性,自定义渲染函数,可使用 JSX 返回需要渲染的节点内容。
\n ',
+ 'en-US':
+ 'The default
slot, node content element, defaults to the label
value of the node data.
\n prefix
slot, the prefix element of the node content.
\n suffix
Slots, element after node content.
\n The operation
slot, the right-aligned element of the node content, which appears to the left of the edit button when is enabled to edit .
\n The empty
slot, custom data-free elements when the data
property is passed in.
\n\n In addition to the above five slots, the component also provides properties for two custom nodes:
\n Using the emptyText
property, specify a text prompt when no data is available.
\n Using the render-content
function property, you can customize the rendering function to return the node content to be rendered using JSX.
\n '
+ },
+ codeFiles: ['slot.vue']
},
{
- 'demoId': 'node-hl',
- 'name': { 'zh-CN': '节点的高亮 / 查询', 'en-US': 'Highlighting/querying nodes' },
- 'desc': {
- 'zh-CN': `
- 通过 node-key
属性,指定节点的唯一标识,节点的高亮与查询,都必须设置节点的唯一标识。
- 通过 highlight-current
属性,是否启用节点高亮的功能,默认值为 true
。
- 通过 current-node-key
属性, 设置当前高亮的节点。
- 通过 current-change
事件, 监听选择节点的动作。
-
- 实用技巧
- 节点数据:传入的节点数据。
- 节点对象:组件内节点对象。
- 节点路径:从根节点开始,由节点数据组成的数组。
- 通过节点对象,可以取到当前节点的 parent 、childNodes 、nextSibling、previousSibling
等属性,从而实现节点间的自由访问,也可以调用它的内部函数,进行节点展开/收起,节点编辑/勾选等操作。
-
- 通过 getCurrentNode 、getCurrentKey 、getNode 、getNodeKey 、getNodePath
等组件函数,查询以上节点的信息。
- 通过 setCurrentKey 、setCurrentNode
等组件函数,手动设置高亮节点。
- `,
- 'en-US': `The node-key
attribute specifies the unique identifier of a node. The unique identifier must be set for highlighting and querying nodes.
- Whether to enable node highlighting by using the highlight-current
property. The default value is true
.
- Use the current-node-key
property to set the currently highlighted node.
- The current-change
event is used to listen for the action of the selected node.
-
- Practical tips
- Node data: Incoming node data.
- Node object: Node objects in a component.
- Node path: An array of node data starting from the root node.
- Through the node object, you can obtain the parent, childNodes, nextSibling, previousSibling
attributes of the current node, so as to achieve free access between nodes.
-
- Run the getCurrentNode, getCurrentKey, getNode, getNodeKey, and getNodePath
component functions to query information about the preceding nodes.
- Manually set the highlighted node using component functions such as setCurrentKey and setCurrentNode
.
- `
+ demoId: 'node-hl',
+ name: {
+ 'zh-CN': '节点的高亮 / 查询',
+ 'en-US': 'Highlighting/querying nodes'
},
- 'codeFiles': ['node-hl.vue']
+ desc: {
+ 'zh-CN':
+ '\n 通过 node-key
属性,指定节点的唯一标识,节点的高亮与查询,都必须设置节点的唯一标识。
\n 通过 highlight-current
属性,是否启用节点高亮的功能,默认值为 true
。
\n 通过 current-node-key
属性, 设置当前高亮的节点。
\n 通过 current-change
事件, 监听选择节点的动作。
\n \n 实用技巧
\n 节点数据:传入的节点数据。
\n 节点对象:组件内节点对象。
\n 节点路径:从根节点开始,由节点数据组成的数组。
\n 通过节点对象,可以取到当前节点的 parent 、childNodes 、nextSibling、previousSibling
等属性,从而实现节点间的自由访问,也可以调用它的内部函数,进行节点展开/收起,节点编辑/勾选等操作。\n \n 通过 getCurrentNode 、getCurrentKey 、getNode 、getNodeKey 、getNodePath
等组件函数,查询以上节点的信息。
\n 通过 setCurrentKey 、setCurrentNode
等组件函数,手动设置高亮节点。
\n ',
+ 'en-US':
+ 'The node-key
attribute specifies the unique identifier of a node. The unique identifier must be set for highlighting and querying nodes.
\n Whether to enable node highlighting by using the highlight-current
property. The default value is true
.
\n Use the current-node-key
property to set the currently highlighted node.
\n The current-change
event is used to listen for the action of the selected node.
\n \n Practical tips
\n Node data: Incoming node data.
\n Node object: Node objects in a component.
\n Node path: An array of node data starting from the root node.
\n Through the node object, you can obtain the parent, childNodes, nextSibling, previousSibling
attributes of the current node, so as to achieve free access between nodes.\n \n Run the getCurrentNode, getCurrentKey, getNode, getNodeKey, and getNodePath
component functions to query information about the preceding nodes.
\n Manually set the highlighted node using component functions such as setCurrentKey and setCurrentNode
.
\n '
+ },
+ codeFiles: ['node-hl.vue']
},
{
- 'demoId': 'expand-control',
- 'name': { 'zh-CN': '节点的展开控制', 'en-US': 'Expansion control of nodes' },
- 'desc': {
- 'zh-CN': `
- 通过 default-expand-all
属性,加载时默认展开所有节点, 默认为 false
。
- 通过 default-expanded-keys
属性,加载时默认展开指定数组里的节点,需要指定node-key
的值。
- 通过 expand-on-click-node
属性,设置节点在点击内容时展开 / 收起, 默认为 true
。 当设置为 false
时,只有点击图标才展开。
- 通过 expandAllNodes
组件方法,可以全部展开或收起所有节点。函数入参为 true
时全部展开,反之则全部收起。
- 通过 node-expand
事件,监听节点展开的动作。
- 通过 node-collapse
事件,监听节点收起的动作。
-
- 实用技巧
- 节点对象上包含expand
和 collapse
方法,可以展开或收起该节点。
-
- `,
- 'en-US': `By using the default-expand-all
property, all nodes are expanded by default when loading. The default value is false
.
- Using the default-expanded-keys
property, the nodes in the specified array are expanded by default when loaded. You need to specify the value of node-key
.
- Use the expand-on-click-node
property to set the node to expand/collapse when clicking content. The default is true
. When set to false
, it only expands by clicking the icon.
- The expandAllNodes
component method allows you to expand or collapse all nodes. If the function enters true
, expand all; otherwise, collapse all.
- Use the node-expand
event to listen for the expansion of a node.
- Listen for the collapse of a node through the node-collapse
event.
-
- Practical tips
- The node object contains expand
and< code>collapse methods to expand or collapse the node.
-
- `
+ demoId: 'expand-control',
+ name: {
+ 'zh-CN': '节点的展开控制',
+ 'en-US': 'Expansion control of nodes'
},
- 'codeFiles': ['expand-control.vue']
- },
-
- {
- 'demoId': 'node-op',
- 'name': { 'zh-CN': '节点的增删改', 'en-US': 'Adding, deleting or modifying nodes' },
- 'desc': {
- 'zh-CN': `
- 通过 insertBefore
组件方法,在当前节点前增加一个节点。
- 通过 insertAfter
组件方法,在当前节点后增加一个节点。
- 通过 append
组件方法,追加一个节点到当前节点的子节点的顶部。
- 通过 updateKeyChildren
组件方法,更新当前节点的子节点,原有的子节点会丢失。
- 通过 remove
组件方法,删除当前节点。如果要保留该节点的所有子节点,则传递参数: isSaveChildNode=true,详见 API 说明。
-
- 实用技巧
- 当更新子节点,且需要保留子节点时,请先使用 getNode
查询到当前节点的 children
, 修改它后再调用 updateKeyChildren
更新子节点。
- 除了使用组件实例进行节点操作之外,还可以通过节点对象的 insert
、 remove
等相关方法,操作节点。
-
- `,
- 'en-US': `Add a node in front of the current node using the insertBefore
component method.
- Add a node after the current one by using the insertAfter
component method.
- append a node to the top of the children of the current node using the append
component method.
- Run the updateKeyChildren
component method to update the children of the current node. The original children will be lost.
- Run the remove
component method to delete the current node.
-
- Practical tips
- When updating child nodes and retaining child nodes, use getNode
to query children
of the current node. Modify it and then call updateKeyChildren
to update the child node.
-
- `
+ desc: {
+ 'zh-CN':
+ '\n 通过 default-expand-all
属性,加载时默认展开所有节点, 默认为 false
。
\n 通过 default-expanded-keys
属性,加载时默认展开指定数组里的节点,需要指定node-key
的值。
\n 通过 expand-on-click-node
属性,设置节点在点击内容时展开 / 收起, 默认为 true
。 当设置为 false
时,只有点击图标才展开。
\n 通过 expandAllNodes
组件方法,可以全部展开或收起所有节点。函数入参为 true
时全部展开,反之则全部收起。
\n 通过 node-expand
事件,监听节点展开的动作。
\n 通过 node-collapse
事件,监听节点收起的动作。
\n \n 实用技巧
\n 节点对象上包含expand
和 collapse
方法,可以展开或收起该节点。
\n \n ',
+ 'en-US':
+ 'By using the default-expand-all
property, all nodes are expanded by default when loading. The default value is false
.
\n Using the default-expanded-keys
property, the nodes in the specified array are expanded by default when loaded. You need to specify the value of node-key
.
\n Use the expand-on-click-node
property to set the node to expand/collapse when clicking content. The default is true
. When set to false
, it only expands by clicking the icon.
\n The expandAllNodes
component method allows you to expand or collapse all nodes. If the function enters true
, expand all; otherwise, collapse all.
\n Use the node-expand
event to listen for the expansion of a node.
\n Listen for the collapse of a node through the node-collapse
event.
\n \n Practical tips
\n The node object contains expand
and< code>collapse methods to expand or collapse the node.
\n \n '
},
- 'codeFiles': ['node-op.vue']
+ codeFiles: ['expand-control.vue']
},
{
- 'demoId': 'checkbox',
- 'name': { 'zh-CN': '多选模式', 'en-US': 'Multiple choice mode' },
- 'desc': {
- 'zh-CN': `
- 通过 show-checkbox
属性,启用多选模式。
- 通过 check-strictly
属性,指定是否严格模式。属性默认为 false
。严格模式时勾选父节点,子节点自动全选中;子节点全选中,自动勾选父节点。
- 通过 check-on-click-node
属性,点击节点时,同时进行勾选/反勾选节点。 属性默认值为 false
, 即点击节点不自动勾选。
- 通过 default-checked-keys
属性,设置默认加载时,自动勾选的节点的keys数组。
- 严格模式下父子不相互影响,勾选父节点时不会自动勾选子节点,适用于某些特殊场景。
- `,
- 'en-US': `Enable multiple selection by using the show-checkbox
property.
- The check-strictly
property specifies whether strict mode is used. The default property is false
. If you select the parent node, all child nodes are automatically selected. If all child nodes are selected, the parent node is automatically selected.
- Using the check-on-click-node
property, when you click a node, select or deselect the node at the same time. The default value of the property is false
, that is, the node is not automatically selected when you click it.
- With the default-checked-keys
property, set the keys array of nodes that are automatically checked when loaded by default.
- In strict mode, the child node is not automatically selected when the parent node is selected, which is suitable for some special scenarios.
- `
+ demoId: 'node-op',
+ name: {
+ 'zh-CN': '节点的增删改',
+ 'en-US': 'Adding, deleting or modifying nodes'
},
- 'codeFiles': ['checkbox.vue']
+ desc: {
+ 'zh-CN':
+ '\n 通过 insertBefore
组件方法,在当前节点前增加一个节点。
\n 通过 insertAfter
组件方法,在当前节点后增加一个节点。
\n 通过 append
组件方法,追加一个节点到当前节点的子节点的顶部。
\n 通过 updateKeyChildren
组件方法,更新当前节点的子节点,原有的子节点会丢失。
\n 通过 remove
组件方法,删除当前节点。如果要保留该节点的所有子节点,则传递参数: isSaveChildNode=true,详见 API 说明。
\n \n 实用技巧
\n 当更新子节点,且需要保留子节点时,请先使用 getNode
查询到当前节点的 children
, 修改它后再调用 updateKeyChildren
更新子节点。
\n 除了使用组件实例进行节点操作之外,还可以通过节点对象的 insert
、 remove
等相关方法,操作节点。\n \n ',
+ 'en-US':
+ 'Add a node in front of the current node using the insertBefore
component method.
\n Add a node after the current one by using the insertAfter
component method.
\n append a node to the top of the children of the current node using the append
component method.
\n Run the updateKeyChildren
component method to update the children of the current node. The original children will be lost.
\n Run the remove
component method to delete the current node.
\n \n Practical tips
\n When updating child nodes and retaining child nodes, use getNode
to query children
of the current node. Modify it and then call updateKeyChildren
to update the child node.\n \n '
+ },
+ codeFiles: ['node-op.vue']
},
{
- 'demoId': 'check-op',
- 'name': { 'zh-CN': '多选的查询 / 勾选', 'en-US': 'Multiple-selection query/select' },
- 'desc': {
- 'zh-CN': `
- 通过 getCheckedKeys、getCheckedNodes、getHalfCheckedKeys、getHalfCheckedNodes
组件函数,查询当前组件的勾选状态。
- 通过 setChecked、setCheckedByNodeKey、setCheckedKeys、setCheckedNodes
组件函数,手动勾选组件的指定节点。
-
- setChecked
勾选时,可以深度递归勾选(deep:true),也可以只勾选某节点。
- 建议使用 setCheckedKeys
进行勾选,保证父子联动状态统一,详见下面例子。
-
- 通过 check
事件,监听组件的勾选事件。
- 通过 check-change
事件,监听节点状态变化的回调。
-
- check
事件触发在点击的元素上, 事件参数为:被点击的节点和勾选后组件的整体勾选状态。
- check-change
事件是发生在每一个发生勾选状态变化的节点, 事件参数为:状态变化的节点和该节点当前的checked值
和indeterminate值
。
- 通常一次勾选动作会触发多个节点的状态变化。
-
-
- 实用技巧
- 除了使用组件实例进行勾选操作之外,还可以通过节点对象的 setChecked
进行勾选。
-
- `,
- 'en-US': `Run the getCheckedKeys, getCheckedNodes, getHalfCheckedKeys, getHalfCheckedNodes
component functions to query the status of the current component.
- Manually select a specified node of a component using the setChecked, setCheckedByNodeKey, setCheckedKeys, and setCheckedNodes
component functions.
-
- setChecked
When checked, you can select deep:true or select only a node.
- You are advised to select setCheckedKeys
to ensure consistent parent-child interaction. For details, see the following example.
-
- The check
event is used to listen for events on the selected node.
- Use the check-change
event to listen for callbacks of node status changes.
-
- check
The event is triggered on the clicked element. The event parameters are: the node that is clicked and the overall checked status of the selected component.
- The check-change
event occurs on each node whose status changes. The event parameters are: the node whose status changes, the current checked value
and the indeterminate value
of the node.
- Usually, a single check action triggers the status change of multiple nodes.
-
-
- Practical tips
- In addition to checking with the component instance, you can also check with the setChecked
of the node object.
-
- `
+ demoId: 'checkbox',
+ name: {
+ 'zh-CN': '多选模式',
+ 'en-US': 'Multiple choice mode'
},
- 'codeFiles': ['check-op.vue']
+ desc: {
+ 'zh-CN':
+ '\n 通过 show-checkbox
属性,启用多选模式。
\n 通过 check-strictly
属性,指定是否严格模式。属性默认为 false
。严格模式时勾选父节点,子节点自动全选中;子节点全选中,自动勾选父节点。
\n 通过 check-on-click-node
属性,点击节点时,同时进行勾选/反勾选节点。 属性默认值为 false
, 即点击节点不自动勾选。
\n 通过 default-checked-keys
属性,设置默认加载时,自动勾选的节点的keys数组。
\n 严格模式下父子不相互影响,勾选父节点时不会自动勾选子节点,适用于某些特殊场景。 \n ',
+ 'en-US':
+ 'Enable multiple selection by using the show-checkbox
property.
\n The check-strictly
property specifies whether strict mode is used. The default property is false
. If you select the parent node, all child nodes are automatically selected. If all child nodes are selected, the parent node is automatically selected.
\n Using the check-on-click-node
property, when you click a node, select or deselect the node at the same time. The default value of the property is false
, that is, the node is not automatically selected when you click it.
\n With the default-checked-keys
property, set the keys array of nodes that are automatically checked when loaded by default.
\n In strict mode, the child node is not automatically selected when the parent node is selected, which is suitable for some special scenarios. \n '
+ },
+ codeFiles: ['checkbox.vue']
},
{
- 'demoId': 'radio',
- 'name': { 'zh-CN': '单选模式', 'en-US': 'Radio mode' },
- 'desc': {
- 'zh-CN': `
- 通过 show-radio
属性启用单选模式。
- 通过 default-checked-keys 、 check-change
等属性和事件,在单选模式下用法不变。
- 通过 setCurrentRadio
组件函数,设置 default-checked-keys
的第一项为勾选值,详见下面例子。
-
- 建议尽量不使用单选模式
-
- `,
- 'en-US': `Enable radio mode with the show-radio
property.
- The usage is unchanged in radio mode via attributes and events such as default-checked-keys and check-change
.
- Using the setCurrentRadio
component function, set the first item of default-checked-keys
as the checked value, as shown in the following example.
-
- You are advised not to use the single option mode
-
- `
+ demoId: 'check-op',
+ name: {
+ 'zh-CN': '多选的查询 / 勾选',
+ 'en-US': 'Multiple-selection query/select'
},
- 'codeFiles': ['radio.vue']
+ desc: {
+ 'zh-CN':
+ '\n 通过 getCheckedKeys、getCheckedNodes、getHalfCheckedKeys、getHalfCheckedNodes
组件函数,查询当前组件的勾选状态。
\n 通过 setChecked、setCheckedByNodeKey、setCheckedKeys、setCheckedNodes
组件函数,手动勾选组件的指定节点。
\n \n setChecked
勾选时,可以深度递归勾选(deep:true),也可以只勾选某节点。
\n 建议使用 setCheckedKeys
进行勾选,保证父子联动状态统一,详见下面例子。\n \n 通过 check
事件,监听组件的勾选事件。
\n 通过 check-change
事件,监听节点状态变化的回调。
\n \n check
事件触发在点击的元素上, 事件参数为:被点击的节点和勾选后组件的整体勾选状态。
\n check-change
事件是发生在每一个发生勾选状态变化的节点, 事件参数为:状态变化的节点和该节点当前的checked值
和indeterminate值
。
\n 通常一次勾选动作会触发多个节点的状态变化。\n \n \n 实用技巧
\n 除了使用组件实例进行勾选操作之外,还可以通过节点对象的 setChecked
进行勾选。\n \n ',
+ 'en-US':
+ 'Run the getCheckedKeys, getCheckedNodes, getHalfCheckedKeys, getHalfCheckedNodes
component functions to query the status of the current component.
\n Manually select a specified node of a component using the setChecked, setCheckedByNodeKey, setCheckedKeys, and setCheckedNodes
component functions.
\n \n setChecked
When checked, you can select deep:true or select only a node.
\n You are advised to select setCheckedKeys
to ensure consistent parent-child interaction. For details, see the following example.\n \n The check
event is used to listen for events on the selected node.
\n Use the check-change
event to listen for callbacks of node status changes.
\n \n check
The event is triggered on the clicked element. The event parameters are: the node that is clicked and the overall checked status of the selected component.
\n The check-change
event occurs on each node whose status changes. The event parameters are: the node whose status changes, the current checked value
and the indeterminate value
of the node.
\n Usually, a single check action triggers the status change of multiple nodes.\n \n \n Practical tips
\n In addition to checking with the component instance, you can also check with the setChecked
of the node object.\n \n '
+ },
+ codeFiles: ['check-op.vue']
},
{
- 'demoId': 'filter-view',
- 'name': { 'zh-CN': '节点过滤与视图', 'en-US': 'Node filtering and views' },
- 'desc': {
- 'zh-CN': `
- 通过 filter-node-method
属性, 指定过滤节点时的函数,函数返回true
时节点显示,否则节点隐藏。
- 通过 filter
组件方法,触发组件进行过滤。
- 通过 view-type
属性,设置组件的视图模式,可选值为 tree
和 plain
,默认为 tree
。
- 通过 show-auxi
属性,设置在平铺视图时,是否显示节点的辅助信息,默认为true
。
-
- `,
- 'en-US': `The filter-node-method
property is used to specify the function for filtering nodes. The function returns true
to display the nodes.
- Run the filter
component method to trigger the component to filter.
- Use the view-type
property to set the component view mode. The optional values are tree
and plain
. The default value is tree
.
- The show-auxi
property is used to set whether to display auxiliary node information in tiled view. The default is true
.
-
- Tiled view is mostly used for filtering scenes
- Tiling view supports default, prefix, suffix
three slots to achieve custom nodes, see slot example
-
- `
+ demoId: 'radio',
+ name: {
+ 'zh-CN': '单选模式',
+ 'en-US': 'Radio mode'
},
- 'codeFiles': ['filter-view.vue']
+ desc: {
+ 'zh-CN':
+ '\n 通过 show-radio
属性启用单选模式。
\n 通过 default-checked-keys 、 check-change
等属性和事件,在单选模式下用法不变。
\n 通过 setCurrentRadio
组件函数,设置 default-checked-keys
的第一项为勾选值,详见下面例子。
\n \n 建议尽量不使用单选模式\n \n ',
+ 'en-US':
+ 'Enable radio mode with the show-radio
property.
\n The usage is unchanged in radio mode via attributes and events such as default-checked-keys and check-change
.
\n Using the setCurrentRadio
component function, set the first item of default-checked-keys
as the checked value, as shown in the following example.
\n \n You are advised not to use the single option mode\n \n '
+ },
+ codeFiles: ['radio.vue']
},
{
- 'demoId': 'lazy',
- 'name': { 'zh-CN': '懒加载', 'en-US': 'Lazy loading' },
- 'desc': {
- 'zh-CN': `
- 通过 lazy
属性, 启用懒加载模式。
- 通过 load
函数属性,触发加载,初始会执行一次。
- 通过 props.isLeaf
属性,指定返回数据体的节点是否为叶子节点,叶子节点点击后不再触发 load
函数。
- 通过 afterLoad
函数属性 或者 load-data
事件,监听下级节点加载完毕的事件,它们完全等效。
-
- 懒加载模式下, data
属性无效
-
- `,
- 'en-US': `Enable lazy loading mode with the lazy
property.
- load is triggered by the load
function property, which is initially executed once.
- Using the props.isLeaf
property, you can specify whether the node that returns the props is a leaf node. After a leaf node is clicked, the load
function is no longer triggered.
- afterLoad function properties or load-data
events are used to listen for events when a subordinate node has finished loading, which is exactly equivalent.
-
- The data
property is invalid in lazy load mode
-
- `
+ demoId: 'filter-view',
+ name: {
+ 'zh-CN': '节点过滤与视图',
+ 'en-US': 'Node filtering and views'
},
- 'codeFiles': ['lazy.vue']
+ desc: {
+ 'zh-CN':
+ '\n 通过 filter-node-method
属性, 指定过滤节点时的函数,函数返回true
时节点显示,否则节点隐藏。
\n 通过 filter
组件方法,触发组件进行过滤。
\n 通过 view-type
属性,设置组件的视图模式,可选值为 tree
和 plain
,默认为 tree
。
\n 通过 show-auxi
属性,设置在平铺视图时,是否显示节点的辅助信息,默认为true
。
\n \n ',
+ 'en-US':
+ 'The filter-node-method
property is used to specify the function for filtering nodes. The function returns true
to display the nodes.
\n Run the filter
component method to trigger the component to filter.
\n Use the view-type
property to set the component view mode. The optional values are tree
and plain
. The default value is tree
.
\n The show-auxi
property is used to set whether to display auxiliary node information in tiled view. The default is true
.
\n \n Tiled view is mostly used for filtering scenes
\n Tiling view supports default, prefix, suffix
three slots to achieve custom nodes, see slot example \n \n '
+ },
+ codeFiles: ['filter-view.vue']
},
{
- 'demoId': 'drag',
- 'name': { 'zh-CN': '拖拽节点', 'en-US': 'Drag node' },
- 'desc': {
- 'zh-CN': `
- 通过 draggable
属性, 启用拖拽功能。
- 通过 allow-drag
函数属性,判断目标节点能否拖拽,返回false
时,不能拖拽。
- 通过 allow-drop
函数属性,判断目标节点能否被放置,函数入参为:源节点、目标节点、释放位置
,函数返回false
时,不能释放。
-
- 释放位置可选值为'prev'、'inner' 和 'next'
,分别表示放置在目标节点前、插入至目标节点和放置在目标节点后。
-
- 通过 node-drop
事件,监听拖拽成功后触发的事件。
- 通过 node-drag-start 、node-drag-enter、node-drag-over、node-drag-leave 、node-drag-end
等事件,监听拖拽过程中触发的事件。
-
- 事件 node-drop 、node-drag-end
的释放类型参数,可选值为: 'before'/'after'/'inner'/'none'
。
- 拖拽过程中的事件触发频率高,请考虑使用事件节流函数。
-
- `,
- 'en-US': `Enable drag and drop by using the draggable
property.
- Use the allow-drag
function property to determine whether the target node can be dragged. If false
is returned, it cannot be dragged.
- The allow-drop
function property is used to determine whether the target node can be placed. The parameters of the function are: source node, target node, and release location
. When the function returns false
, the target node cannot be released.
-
- Release position The optional values are 'prev', 'inner', and 'next'
, indicating place before, insert to, and place after the target node, respectively.
-
- Use the node-drop
event to listen for events triggered after a successful drag and drop.
- Use node-drag-start, node-drag-enter, node-drag-over, node-drag-leave, and node-drag-end
to listen for events that are triggered during the drag and drop process.
-
- The release type parameter of the node-drop, node-drag-end
event, optional values are 'before'/'after'/'inner'/'none'
.
- Events trigger frequently during drag and drop. Consider using the event throttling function.
-
- `
+ demoId: 'lazy',
+ name: {
+ 'zh-CN': '懒加载',
+ 'en-US': 'Lazy loading'
},
- 'codeFiles': ['drag.vue']
+ desc: {
+ 'zh-CN':
+ '\n 通过 lazy
属性, 启用懒加载模式。
\n 通过 load
函数属性,触发加载,初始会执行一次。
\n 通过 props.isLeaf
属性,指定返回数据体的节点是否为叶子节点,叶子节点点击后不再触发 load
函数。
\n 通过 afterLoad
函数属性 或者 load-data
事件,监听下级节点加载完毕的事件,它们完全等效。
\n \n 懒加载模式下, data
属性无效\n \n ',
+ 'en-US':
+ 'Enable lazy loading mode with the lazy
property.
\n load is triggered by the load
function property, which is initially executed once.
\n Using the props.isLeaf
property, you can specify whether the node that returns the props is a leaf node. After a leaf node is clicked, the load
function is no longer triggered.
\n afterLoad function properties or load-data
events are used to listen for events when a subordinate node has finished loading, which is exactly equivalent.
\n \n The data
property is invalid in lazy load mode\n \n '
+ },
+ codeFiles: ['lazy.vue']
},
{
- 'demoId': 'edit',
- 'name': { 'zh-CN': '编辑节点', 'en-US': 'Edit node' },
- 'desc': {
- 'zh-CN': `
- 通过调用实例的 openEdit
方法来进入编辑, closeEdit
方法取消编辑, saveEdit
方法保存编辑。
- 通过调用实例的 addNode(node)
方法为 node 节点添加一个子节点,并立即进入编辑模式。
- 通过调用实例的 editNode(node)
方法,立即编辑 node 节点。
- 通过调用实例的 saveNode()
方法,保存正在编辑的节点。
-
- 在使用编辑功能时,不要使用 props
去定义数据列的映射关系,要使用默认的数据格式。
-
- `,
- 'en-US': `Edit is accessed by calling the openEdit
method of the instance, the closeEdit
method cancellations the edit, and the saveEdit
method saves the edit.
- Add a child node to the node node by calling the instance's addNode(node)
method and immediately enter edit mode.
- Edit the node node immediately by calling the instance's editNode(node)
method.
- Save the node being edited by calling the instance's saveNode()
method.
-
- When using the editing functions, do not use props
to define the mapping of data columns. Instead, use the default data format.
-
- `
+ demoId: 'drag',
+ name: {
+ 'zh-CN': '拖拽节点',
+ 'en-US': 'Drag node'
},
- 'codeFiles': ['edit.vue']
+ desc: {
+ 'zh-CN':
+ "\n 通过 draggable
属性, 启用拖拽功能。
\n 通过 allow-drag
函数属性,判断目标节点能否拖拽,返回false
时,不能拖拽。
\n 通过 allow-drop
函数属性,判断目标节点能否被放置,函数入参为:源节点、目标节点、释放位置
,函数返回false
时,不能释放。
\n \n 释放位置可选值为'prev'、'inner' 和 'next'
,分别表示放置在目标节点前、插入至目标节点和放置在目标节点后。
\n \n 通过 node-drop
事件,监听拖拽成功后触发的事件。
\n 通过 node-drag-start 、node-drag-enter、node-drag-over、node-drag-leave 、node-drag-end
等事件,监听拖拽过程中触发的事件。
\n \n 事件 node-drop 、node-drag-end
的释放类型参数,可选值为: 'before'/'after'/'inner'/'none'
。
\n 拖拽过程中的事件触发频率高,请考虑使用事件节流函数。\n \n ",
+ 'en-US':
+ "Enable drag and drop by using the draggable
property.
\n Use the allow-drag
function property to determine whether the target node can be dragged. If false
is returned, it cannot be dragged.
\n The allow-drop
function property is used to determine whether the target node can be placed. The parameters of the function are: source node, target node, and release location
. When the function returns false
, the target node cannot be released.
\n \n Release position The optional values are 'prev', 'inner', and 'next'
, indicating place before, insert to, and place after the target node, respectively.
\n \n Use the node-drop
event to listen for events triggered after a successful drag and drop.
\n Use node-drag-start, node-drag-enter, node-drag-over, node-drag-leave, and node-drag-end
to listen for events that are triggered during the drag and drop process.
\n \n The release type parameter of the node-drop, node-drag-end
event, optional values are 'before'/'after'/'inner'/'none'
.
\n Events trigger frequently during drag and drop. Consider using the event throttling function.\n \n "
+ },
+ codeFiles: ['drag.vue']
},
{
- 'demoId': 'contextmenu',
- 'name': { 'zh-CN': '右键菜单', 'en-US': 'Right-click menu' },
- 'desc': {
- 'zh-CN': `
- 通过 show-contextmenu
属性,启用右键菜单功能。
- 通过 contextmenu
插槽,自定义右键菜单的元素。
- 通过 closeMenu
方法,关闭右键菜单的元素。
- 通过 node-contextmenu
事件,监听用户右键点击节点的事件。
- `,
- 'en-US': `The show-contextmenu
property enables the right-click menu function.
- Customize the elements of the right-click menu through the contextmenu
slot.
- Close the element of the right-click menu using the closeMenu
method.
- The node-contextMenu
event is used to listen for the event of the user right-clicking on the node.
- `
+ demoId: 'edit',
+ name: {
+ 'zh-CN': '编辑节点',
+ 'en-US': 'Edit node'
},
- 'codeFiles': ['contextmenu.vue']
+ desc: {
+ 'zh-CN':
+ '\n 通过调用实例的 openEdit
方法来进入编辑, closeEdit
方法取消编辑, saveEdit
方法保存编辑。
\n 通过调用实例的 addNode(node)
方法为 node 节点添加一个子节点,并立即进入编辑模式。
\n 通过调用实例的 editNode(node)
方法,立即编辑 node 节点。
\n 通过调用实例的 saveNode()
方法,保存正在编辑的节点。
\n \n 在使用编辑功能时,不要使用 props
去定义数据列的映射关系,要使用默认的数据格式。\n \n ',
+ 'en-US':
+ "Edit is accessed by calling the openEdit
method of the instance, the closeEdit
method cancellations the edit, and the saveEdit
method saves the edit.
\n Add a child node to the node node by calling the instance's addNode(node)
method and immediately enter edit mode.
\n Edit the node node immediately by calling the instance's editNode(node)
method.
\n Save the node being edited by calling the instance's saveNode()
method.
\n \n When using the editing functions, do not use props
to define the mapping of data columns. Instead, use the default data format.\n \n "
+ },
+ codeFiles: ['edit.vue']
},
{
- 'demoId': 'other',
- 'name': { 'zh-CN': '其它特性', 'en-US': 'Other characteristics' },
- 'desc': {
- 'zh-CN': `
- 通过 accordion
属性,启用手风琴模式,每次展开节点时,自动关闭其它已打开的节点,默认值为 false
。
- 通过 icon-trigger-click-node
属性,指定点击图标,是否触发点击的行为,默认值为 true
。
- 通过 render-after-expand
属性,是否在展开节点时,才渲染下级节点,默认值为 true
。
- 通过 show-check-easily
属性,在严格模式时,是否勾选父节点时,自动勾选子节点, false
。
- `,
- 'en-US': `accordion mode is enabled through the accordion
property, and other open nodes are automatically closed each time a node is expanded. The default value is false
.
- The icon-trigger-click-node
property specifies whether clicking an icon triggers the clicking behavior. The default value is true
.
- The render-after-expand
property determines whether to render subordinate nodes only when expanding nodes. The default value is true
.
- With the show-check-easily
property, when the parent node is selected in strict mode, the child node is automatically selected, false
.
- `
+ demoId: 'edit-control',
+ name: {
+ 'zh-CN': '编辑权限和事件',
+ 'en-US': 'Edit node'
},
- 'codeFiles': ['other.vue']
- }
- ],
- apis: [
+ desc: {
+ 'zh-CN':
+ '\n 通过 add-disabled-keys
属性,禁止添加的节点 key 值列表,也可通过 setAddDisabledKeys
方法设置;
\n 通过 edit-disabled-keys
属性,禁止编辑的节点 key 值列表,也可通过 setEditDisabledKeys
方法设置;
\n 通过 delete-disabled-keys
属性,禁止删除的节点 key 值列表,也可通过 setDeleteDisabledKeys
方法设置;
\n 通过 delete-node-method
函数属性,开启自定义删除节点的处理方法,若返回 false 或者返回 Promise 且被 reject,则停止删除。
\n 组件会触发一组编辑事件,用于监听编辑过程中的各个阶段: open-edit 、 close-edit 、 save-edit 、 add-node 、edit-node 、delete-node
。\n ',
+ 'en-US':
+ 'The add-disabled-keys
attribute indicates the list of key values of nodes that cannot be added. You can also use the setAddDisabledKeys
method to set the key values.
\n List of key values of nodes that cannot be edited through the edit-disabled-keys
attribute. You can also use the setEditDisabledKeys
method to set the key values.
\n List of key values of nodes that cannot be deleted by using the delete-disabled-keys
attribute. You can also use the setDeleteDisabledKeys
method to set the key values.
\n Use the delete-node-method
function attribute to enable the customized method for deleting nodes. If false is returned or Promise is returned and rejected, the deletion stops.
\n The component triggers a set of editing events to listen to each phase of the editing process: open-edit, close-edit, save-edit, add-node, edit-node, delete-node
.\n '
+ },
+ codeFiles: ['edit-control.vue']
+ },
{
- 'name': 'tree',
- 'type': 'component',
- 'props': [
- {
- 'name': 'data',
- 'type': 'Array',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置数据源, 默认通过数据项的 label , children 属性展示数据',
- 'en-US':
- 'Set the data source. By default, the data is displayed through the label and children attributes of the data item'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'show-line',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否显示连接线',
- 'en-US': 'Whether the connection cable is displayed'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'size',
- 'type': "'medium'|'small'",
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '组件的大小',
- 'en-US': 'Component size'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'indent',
- 'type': 'number',
- 'defaultValue': '18',
- 'desc': {
- 'zh-CN': '相邻级节点间的水平缩进,单位为像素',
- 'en-US': 'horizontal indentation between adjacent nodes, in pixels.'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'props',
- 'type': 'object',
- 'defaultValue': "{children: 'children',label: 'label',disabled: 'disabled',isLeaf: 'isLeaf'}",
- 'desc': {
- 'zh-CN': '用户传入非标准格式的数据时,指定映射属性的关系',
- 'en-US':
- 'Specifies the relationship of the mapping properties when the user passes in data in a non-standard format'
- },
- 'demoId': 'props'
- },
- {
- 'name': 'icon',
- 'type': 'Component',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义节点图标',
- 'en-US': 'Customize the node icon'
- },
- 'demoId': 'icons'
- },
- {
- 'name': 'expand-icon',
- 'type': 'Component',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '指示展开的图标', 'en-US': 'Indicates the expanded icon' },
- 'demoId': 'icons'
- },
- {
- 'name': 'expand-icon-color',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '指示展开的图标色',
- 'en-US': 'Indicates the expanded icon color'
- },
- 'demoId': 'icons'
- },
- {
- 'name': 'shrink-icon',
- 'type': 'Component',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '指示收缩的图标', 'en-US': 'Icon indicating shrink' },
- 'demoId': 'icons'
- },
- {
- 'name': 'shrink-icon-color',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '指示收缩的图标色',
- 'en-US': 'Icon indicating shrink color'
- },
- 'demoId': 'icons'
- },
- {
- 'name': 'empty-text',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '内容为空的时候展示的文本',
- 'en-US': 'Text displayed when the content is empty'
- },
- 'demoId': 'slot'
- },
- {
- 'name': 'render-content',
- 'type': '(h: Vue.h, { node, data, store }=> VNode',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '树节点的内容区的渲染函数',
- 'en-US': 'Rendering function for the content area of the tree node'
- },
- 'demoId': 'slot'
- },
- {
- 'name': 'node-key',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '节点唯一标识属性名称',
- 'en-US': 'The node uniquely identifies the attribute name'
- },
- 'demoId': 'node-hl'
- },
- {
- 'name': 'highlight-current',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否高亮当前选中节点',
- 'en-US': 'Whether to highlight the selected node'
- },
- 'demoId': 'node-hl'
- },
- {
- 'name': 'current-node-key',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '当前选中节点',
- 'en-US': 'Currently selected node'
- },
- 'demoId': 'node-hl'
- },
- {
- 'name': 'default-expand-all',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否默认展开所有节点',
- 'en-US': 'Whether to expand all nodes by default'
- },
- 'demoId': 'expand-control'
- },
- {
- 'name': 'default-expanded-keys',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '默认展开节点的keys',
- 'en-US': 'The keys of the node are expanded by default'
- },
- 'demoId': 'expand-control'
- },
- {
- 'name': 'expand-on-click-node',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '节点在点击内容时,是否展开 / 收起',
- 'en-US': 'Whether the node expands/collapses when it clicks on content'
- },
- 'demoId': 'expand-control'
- },
- {
- 'name': 'show-checkbox',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否为多选模式',
- 'en-US': 'Whether to select multiple mode'
- },
- 'demoId': 'checkbox'
- },
- {
- 'name': 'check-strictly',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否为父子严格模式',
- 'en-US': 'Whether it is in strict parent-child mode'
- },
- 'demoId': 'checkbox'
- },
- {
- 'name': 'check-on-click-node',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否点击节点时,自动勾选节点',
- 'en-US': 'When you click a node, the node is automatically selected'
- },
- 'demoId': 'checkbox'
- },
- {
- 'name': 'default-checked-keys',
- 'type': 'string[]',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '默认勾选的节点的keys',
- 'en-US': 'keys of the node selected by default'
- },
- 'demoId': 'checkbox'
- },
- {
- 'name': 'show-radio',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否为单选模式',
- 'en-US': 'Whether to select an radio mode'
- },
- 'demoId': 'radio'
- },
- {
- 'name': 'filter-node-method',
- 'type': '(value, data, node)=>boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '对树节点进行筛选时执行的方法,返回 true 表示这个节点可以显示,返回 false 则表示这个节点会被隐藏',
- 'en-US':
- 'Method to be executed when filtering a tree node, returning true means the node can be displayed, and returning false means the node is hidden'
- },
- 'demoId': 'filter-view'
- },
- {
- 'name': 'view-type',
- 'type': "'tree' | 'plain'",
- 'defaultValue': 'tree',
- 'desc': {
- 'zh-CN': '视图模式,其中tree是普通视图,plain是平铺视图',
- 'en-US': 'View mode, where tree is a normal view and plain is a tiled view'
- },
- 'demoId': 'filter-view'
- },
- {
- 'name': 'show-auxi',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '平铺视图模式时,是否显示节点的上级路径的辅助信息',
- 'en-US': 'Whether to display auxiliary information about the upper path of a node in the tile view mode'
- },
- 'demoId': 'filter-view'
- },
- {
- 'name': 'lazy',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否为异步加载模式,展开节点时再请求数据',
- 'en-US': 'Whether to load asynchronously and request data when the node is expanded'
- },
- 'demoId': 'lazy'
- },
- {
- 'name': 'load',
- 'type': '(node, resolve)=> void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '加载子树数据的方法。点击节点后,组件开始调用load方法,只有在load函数内调用resolve(data),才表示返回下级的数据成功。',
- 'en-US':
- 'Method of loading subtree data. After the node is clicked, the component starts to call the load method. Only when resolve(data) is called in the load function, the data at the lower level is successfully returned.'
- },
- 'demoId': 'lazy'
- },
- {
- 'name': 'after-load',
- 'type': '(nodes: object[])=> void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '下级树节点数据加载完毕后的回调函数',
- 'en-US': 'The callback function after the data of the subordinate tree node is loaded'
- },
- 'demoId': 'lazy'
- },
- {
- 'name': 'draggable',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否开启节点拖拽',
- 'en-US': 'Whether to enable the node dragging function'
- },
- 'demoId': 'drag'
- },
- {
- 'name': 'allow-drag',
- 'type': '(node)=>boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '判断节点能否被拖拽',
- 'en-US': 'Whether a node can be dragged.'
- },
- 'demoId': 'drag'
- },
- {
- 'name': 'allow-drop',
- 'type': '(srcNode, targetNode, type)=>void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- "拖拽时判定目标节点能否被放置。type 参数有三种情况:'prev'、'inner' 和 'next',分别表示放置在目标节点前、插入至目标节点和放置在目标节点后",
- 'en-US':
- "Whether the target node can be placed during dragging. The type parameter has three situations: 'prev',' inner', and'next', which indicate that it is placed before the target node, inserted into the target node, and placed after the target node respectively"
- },
- 'demoId': 'drag'
- },
- {
- 'name': 'show-contextmenu',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否启用右键菜单功能',
- 'en-US': 'Whether to enable the right-click menu function'
- },
- 'demoId': 'contextmenu'
- },
- {
- 'name': 'accordion',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '是否为手风琴模式,每次只打开一个同级树节点展开',
- 'en-US': 'Whether in accordion mode, only open one sibling tree node expansion at a time'
- },
- 'demoId': 'other'
- },
- {
- 'name': 'icon-trigger-click-node',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '点击图标展开节点时是否触发 node-click 事件',
- 'en-US': 'Whether a node-click event is triggered when a node is expanded by clicking the icon'
- },
- 'demoId': 'other'
- },
- {
- 'name': 'render-after-expand',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '是否在第一次展开某个树节点后才渲染其子节点',
- 'en-US': 'Whether to render child nodes after the first expansion of a tree node'
- },
- 'demoId': ''
- },
- {
- 'name': 'show-check-easily',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '在严格模式时,是否显示勾选父节点时,自动勾选子节点的功能区域',
- 'en-US':
- 'In strict mode, when the parent node is displayed, the function area of the child node is automatically selected.'
- },
- 'demoId': 'other'
- }
- ],
- 'events': [
- {
- 'name': 'node-click',
- 'type': '(data, node, vm)=>void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '点击节点后的事件。
参数说明:{data: 节点数据,node: 节点状态信息(包括数据),vm: 组件实例}',
- 'en-US':
- 'The event after clicking a node.
Parameter description: {data: node data,node: node status information (including data),vm: component instance}'
- },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'current-change',
- 'type': '(data, currentNode)=>void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '当前选中节点变化时触发的事件;
参数说明:{data: 节点数据,currentNode: 节点状态信息(包括数据)}',
- 'en-US':
- 'The event triggered when the currently selected node changes;
Parameter description: {data: node data,currentNode: node status information (including data)}'
- },
- 'demoId': 'node-hl'
- },
- {
- 'name': 'node-expand',
- 'type': '(data, node, vm)=>void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '展开节点后的事件。
参数说明:{data: 节点数据,node: 节点状态信息(包括数据,vm: 当前组件实例}',
- 'en-US':
- 'Events after expanding a node.
Parameter description: {data: node data,node: node status information (including data,vm: current component instance)}'
- },
- 'demoId': 'expand-control'
- },
- {
- 'name': 'node-collapse',
- 'type': '(data, node, vm)=>void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '收缩节点后的事件
参数说明:{data: 节点数据,node: 节点状态信息(包括数据),vm: 当前组件实例}',
- 'en-US':
- 'Events after a node is shrunk
Parameter Description: {data: node data,node: node status information (including data),vm: current component instance}'
- },
- 'demoId': 'expand-control'
- },
- {
- 'name': 'check',
- 'type': '(data, currentChecked)=>void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '勾选节点后的事件
参数说明:{data: 当前选中节点信息, currentChecked: 树组件目前的选中状态信息}',
- 'en-US':
- 'Parameter description: {data: information about the selected node; currentChecked: information about the selected tree component}'
- },
- 'demoId': 'check-op'
- },
- {
- 'name': 'check-change',
- 'type': '(data, checked, indeterminate)=>void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '节点选中状态发生变化时的回调;
参数说明:{data: 节点状态信息,checked:当前点击节点的勾选状态,indeterminate:当前节点的半选状态}',
- 'en-US':
- 'Callback when node status changes;
Parameter description: {data: node status information,checked: the selected state of the current node,indeterminate: the semi-selected state of the current node}'
- },
- 'demoId': 'check-op'
- },
- {
- 'name': 'load-data',
- 'type': '(data)=>void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '懒加载时,加载数据成功的事件;
参数说明:{data: 加载的数据}',
- 'en-US': 'During lazy loading, data is loaded successfully.
Parameter description: {data: loaded data}'
- },
- 'demoId': 'lazy'
- },
- {
- 'name': 'node-drop',
- 'type': '(srcNode, targetNode, dropType, event)=>void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '拖拽成功完成时触发的事件;
参数说明:{srcNode: 拖拽节点,targetNode: 目标节点,dropType: 拖拽类型, (before/after/inner/none),event: 原生事件}',
- 'en-US':
- 'Drag-and-drop events triggered upon successful completion;
Parameter description: {srcNode: drag node,targetNode: target node,dropType: drag type, (before/after/inner/none),event: native event}'
- },
- 'demoId': 'drag'
- },
- {
- 'name': 'node-drag-start',
- 'type': '(node, event)=>void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '节点开始拖拽时触发的事件;
参数说明:{node: 拖拽节点,event: 原生事件}',
- 'en-US':
- 'The event triggered when the node starts dragging;
Parameter description: {node: drags a node, event: native event}'
- },
- 'demoId': 'drag'
- },
- {
- 'name': 'node-drag-enter',
- 'type': '(srcNode, targetNode, event)=>void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '拖拽进入其他节点时触发的事件;
参数说明:{srcNode: 拖拽节点,targetNode: 目标节点,event: 原生事件}',
- 'en-US':
- 'An event triggered when dragging to another node;
Parameter description: {srcNode: drag node,targetNode: target node,event: native event}'
- },
- 'demoId': 'drag'
- },
- {
- 'name': 'node-drag-over',
- 'type': '(srcNode, targetNode, event)=>void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '在拖拽节点时触发的事件;
参数说明:{srcNode: 拖拽节点,targetNode: 目标节点,event: 原生事件}',
- 'en-US':
- 'An event that is triggered when a node is dragged;
Parameter description: {srcNode: drag node,targetNode: target node,event: native event}'
- },
- 'demoId': 'drag'
- },
- {
- 'name': 'node-drag-leave',
- 'type': '(srcNode, targetNode, event)=>void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '拖拽离开某个节点时触发的事件;
参数说明:{srcNode: 拖拽节点,targetNode: 目标节点,event: 原生事件}',
- 'en-US':
- 'An event that is triggered when you drag and drop away from a node;
Parameter description: {srcNode: drag node,targetNode: target node,event: native event}'
- },
- 'demoId': 'drag'
- },
- {
- 'name': 'node-drag-end',
- 'type': '(srcNode, targetNode, dropType, event)=>void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '拖拽结束时(可能未成功)触发的事件;
参数说明:{srcNode: 拖拽节点,targetNode: 目标节点,dropType: 拖拽类型, (before/after/inner/none),event: 原生事件}',
- 'en-US':
- 'An event triggered at the end of a (possibly unsuccessful) drag;
Parameter description: {srcNode: drag node,targetNode: target node,dropType: drag type, (before/after/inner/none),event: native event}'
- },
- 'demoId': 'drag'
- },
- {
- 'name': 'node-contextmenu',
- 'type': '(event, data, node, vm)=>void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '当某一节点被鼠标右键点击时会触发该事件;
参数说明:{event:原生事件,data: 节点数据,node: 节点状态信息(包括数据),vm: 组件实例}',
- 'en-US':
- 'This event is triggered when a node is clicked by the right mouse button.
Parameter description: {event: native event,data: node data,node state information (including data),vm: component instance}'
- },
- 'demoId': 'contextmenu'
- },
- {
- 'name': 'leave-plain-view',
- 'type': '(plainNode, event)=>void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '平铺模式下,点击节点定位图标触发的事件。
参数说明:{ plainNode: 被点击的节点数据, event: 原生点击事件 }',
- 'en-US':
- 'In tile mode, click the node positioning icon to trigger the event.
Parameter description: {plainNode: node data to be clicked, event: native click event}'
- },
- 'demoId': ''
- },
- {
- 'name': 'check-plain',
- 'type': '(plainNode, value)=>void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '平铺模式下,勾选或取消勾选节点的事件,需要设置show-checkbox为true才生效。
参数说明:{ plainNode: 被点击的节点数据, value: 复选框是否选中,取值true或false }',
- 'en-US':
- 'In tile mode, select or deselect node events to take effect only when show-checkbox is set to true.
Parameter description: {plainNode: indicates the node data to be clicked. value: indicates whether the check box is selected. The value can be true or false.'
- },
- 'demoId': ''
- }
- ],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义树节点的内容,插槽上下文数据为 { node, data }',
- 'en-US': 'Custom tree node content, slot context data is {node, data}'
- },
- 'demoId': 'slot'
- },
- {
- 'name': 'prefix',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '节点内容前置元素,插槽上下文数据为 { node }',
- 'en-US': 'node content prefix element, slot context data is {node}'
- },
- 'demoId': 'slot'
- },
- {
- 'name': 'suffix',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '节点内容后置元素,插槽上下文数据为 { node }',
- 'en-US': 'node content post element, slot context data is {node}'
- },
- 'demoId': 'slot'
- },
- {
- 'name': 'operation',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '节点内容靠右对齐的元素,插槽上下文数据为 { node }',
- 'en-US': 'node content right-justified element, slot context data is {node}'
- },
- 'demoId': 'slot'
- },
- {
- 'name': 'empty',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '自定义空数据的元素', 'en-US': 'Custom elements for empty data' },
- 'demoId': 'slot'
- },
- {
- 'name': 'contextmenu',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义树节点的右键菜单内容,插槽上下文数据为 { node }',
- 'en-US': 'Custom tree node right-click menu content, slot context data is {node}'
- },
- 'demoId': 'contextmenu'
- }
- ],
- 'methods': [
- {
- 'name': 'getCurrentNode',
- 'type': '() => data',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '获得当前的选中的节点数据,若没有节点被选中则返回 null',
- 'en-US': 'Gets the current selected node data, or null if no node is selected'
- },
- 'demoId': 'node-hl'
- },
- {
- 'name': 'getCurrentKey',
- 'type': '() => string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '获取当前被选中节点的 key',
- 'en-US': 'Gets the key of the currently selected node'
- },
- 'demoId': 'node-hl'
- },
- {
- 'name': 'getNode',
- 'type': '(data: string | object) => node',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '通过 "节点数据" 或者 "节点的key", 获得 Tree 组件中的 node 节点对象',
- 'en-US': 'Obtain the node node object in the Tree component using Node Data or Node key'
- },
- 'demoId': 'node-hl'
- },
- {
- 'name': 'getNodeKey',
- 'type': '(node:object) => number',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '查询节点对象的内部唯一id',
- 'en-US': 'Query the unique internal id of a node object'
- },
- 'demoId': 'node-hl'
- },
- {
- 'name': 'getNodePath',
- 'type': '(key:string) => object[]',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '通过节点的id, 返回整个路径上节点数据的数组',
- 'en-US': 'Returns an array of node data along the entire path, via the node id'
- },
- 'demoId': 'node-hl'
- },
- {
- 'name': 'setCurrentKey',
- 'type': '(key:string) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '通过 key 设置某个节点的当前选中状态',
- 'en-US': 'Use key to set the selected status of a node'
- },
- 'demoId': 'node-op'
- },
- {
- 'name': 'setCurrentNode',
- 'type': '(data:object) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '通过节点数据, 设置某个节点的当前选中状态',
- 'en-US': 'This section describes how to set the selected status of a node based on node data'
- },
- 'demoId': 'node-op'
- },
- {
- 'name': 'expandAllNodes',
- 'type': '(isExpand:boolean) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '展开或收起全部节点',
- 'en-US': 'Expand or collapse all nodes'
- },
- 'demoId': 'expand-control'
- },
- {
- 'name': 'append',
- 'type': '(newData:object, targetNodeOrTargetKey: object | string) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN':
- '为一个节点追加一个子节点,且位于其它子节点的最上方。
参数中的目标节点可以是节点数据或节点的key',
- 'en-US':
- 'Appends a child node to a node, on top of the other children. The target node in the
parameter can be the node data or the key of the node'
- },
- 'demoId': 'node-op'
- },
- {
- 'name': 'insertBefore',
- 'type': '(newData:object, targetNodeOrTargetKey: object | string) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '在一个节点的前面增加一个节点',
- 'en-US': 'Add a node before a tree node.'
- },
- 'demoId': 'node-op'
- },
- {
- 'name': 'insertAfter',
- 'type': '(newData:object, targetNodeOrTargetKey: object | string) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '在一个节点的后面增加一个节点',
- 'en-US': 'Add a node after a node'
- },
- 'demoId': 'node-op'
- },
- {
- 'name': 'updateKeyChildren',
- 'type': '(key, children: object[]) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '更新指定节点的所有子元素',
- 'en-US': 'Updates all child elements of the specified node'
- },
- 'demoId': 'node-op'
- },
- {
- 'name': 'remove',
- 'type': '(targetNodeOrTargetKey: object | string, isSaveChildNode :boolean ) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '删除节点。当参数:isSaveChildNode为true时,当前节点的子元素上移至删除节点的父节点中去。',
- 'en-US':
- 'Delete a node. When isSaveChildNode is true, the child elements of the current node are moved up to the parent node of the deleted node.'
- },
- 'demoId': 'node-op'
- },
- {
- 'name': 'getCheckedKeys',
- 'type': '(leafOnly:boolean) => string[]',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '返回目前被选中的节点的 key 所组成的数组。当参数:leafOnly 为true时,只返回被选中的叶子节点。',
- 'en-US':
- 'Returns an array of keys for the currently selected node. If the parameter: leafOnly is true, only the selected leaf nodes are returned.'
- },
- 'demoId': 'check-op'
- },
- {
- 'name': 'getCheckedNodes',
- 'type': '(leafOnly:boolean, includeHalfChecked:boolean) => object[]',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '返回目前被选中的节点所组成的数组。',
- 'en-US': 'Returns an array of currently selected nodes'
- },
- 'demoId': 'check-op'
- },
- {
- 'name': 'getHalfCheckedNodes',
- 'type': '() => object[]',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '返回目前半选中的节点所组成的数组',
- 'en-US': 'Returns an array of currently half-selected nodes.'
- },
- 'demoId': 'check-op'
- },
- {
- 'name': 'getHalfCheckedKeys',
- 'type': '() => result',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '返回目前半选中的节点的 key 所组成的数组',
- 'en-US': 'Returns an array of keys for the currently semi-selected node'
- },
- 'demoId': 'check-op'
- },
- {
- 'name': 'setChecked',
- 'type': '( nodeOrKey: object|string,checked:boolean,deep:boolean) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '通过节点或节点的key,设置它的勾选状态',
- 'en-US': 'Set the checked status of the node or node by its key'
- },
- 'demoId': 'check-op'
- },
- {
- 'name': 'setCheckedNodes',
- 'type': '( nodeArr: object[], leafOnly:boolean) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '通过节点数据,设置一组节点为勾选状态',
- 'en-US': 'Set a group of nodes to the selected state based on node data'
- },
- 'demoId': 'check-op'
- },
-
- {
- 'name': 'setCheckedKeys',
- 'type': '(keys:string[], leafOnly:boolean) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '通过节点的key,设置一组节点为勾选状态',
- 'en-US': 'You can set a group of nodes to the selected state by using the node key'
- },
- 'demoId': 'check-op'
- },
- {
- 'name': 'setCheckedByNodeKey',
- 'type': '(key:string, checked:boolean) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '通过节点的key, 设置它为勾选或不勾选',
- 'en-US': "Through the node's key, set it to checked or unchecked"
- },
- 'demoId': 'check-op'
- },
- {
- 'name': 'setCurrentRadio',
- 'type': '() => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '在单选模式下,设置组件实例的default-checked-keys 的第一项为勾选值',
- 'en-US':
- "In radio mode, set the first item of the component instance's default-checked keys to the checked value"
- },
- 'demoId': 'radio'
- },
- {
- 'name': 'filter',
- 'type': '(value:string) => void',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '触发树节点进行筛选操作', 'en-US': 'The tree node is triggered for filtering operations' },
- 'demoId': 'filter-view'
- },
- {
- 'name': 'openEdit',
- 'type': '() => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '组件进入编辑状态',
- 'en-US': 'The component enters the edit state'
- },
- 'demoId': 'edit'
- },
-
- {
- 'name': 'closeEdit',
- 'type': '() => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '组件退出编辑状态',
- 'en-US': 'The component exits the editing state'
- },
- 'demoId': 'edit'
- },
- {
- 'name': 'saveEdit',
- 'type': '() => object[]',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '返回组件编辑状态的值', 'en-US': "Returns the value of the component's edit status" },
- 'demoId': 'edit'
- },
- {
- 'name': 'addNode',
- 'type': '(node:object) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '在指定的节点对象中,添加一个子节点',
- 'en-US': 'In the specified node object, adds a child node'
- },
- 'demoId': 'edit'
- },
- {
- 'name': 'editNode',
- 'type': '(node:object) => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '让指定的节点对象进入编辑状态',
- 'en-US': 'Puts the specified node object in the edit state'
- },
- 'demoId': 'edit'
- },
- {
- 'name': 'saveNode',
- 'type': '() => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '正在进行编辑的节点保存并退出编辑状态',
- 'en-US': 'The node being edited is saved and exits the editing state'
- },
- 'demoId': 'edit'
- },
- {
- 'name': 'closeMenu',
- 'type': '() => void',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '关闭节点的自定义菜单',
- 'en-US': 'Close the custom menu of the node'
- },
- 'demoId': 'contextmenu'
- }
- ]
+ demoId: 'contextmenu',
+ name: {
+ 'zh-CN': '右键菜单',
+ 'en-US': 'Right-click menu'
+ },
+ desc: {
+ 'zh-CN':
+ '\n 通过 show-contextmenu
属性,启用右键菜单功能。
\n 通过 contextmenu
插槽,自定义右键菜单的元素。
\n 通过 closeMenu
方法,关闭右键菜单的元素。
\n 通过 node-contextmenu
事件,监听用户右键点击节点的事件。
\n ',
+ 'en-US':
+ 'The show-contextmenu
property enables the right-click menu function.
\n Customize the elements of the right-click menu through the contextmenu
slot.
\n Close the element of the right-click menu using the closeMenu
method.
\n The node-contextMenu
event is used to listen for the event of the user right-clicking on the node.
\n '
+ },
+ codeFiles: ['contextmenu.vue']
+ },
+ {
+ demoId: 'other',
+ name: {
+ 'zh-CN': '其它特性',
+ 'en-US': 'Other characteristics'
+ },
+ desc: {
+ 'zh-CN':
+ '\n 树组件默认开启快捷键功能,可通过键盘的 ↑, ↓ (上下箭头)上下移动选中节点, ←,→(左右箭头)收缩展开节点, Enter、Space 控制节点复选按钮的勾选
\n 通过 accordion
属性,启用手风琴模式,每次展开节点时,自动关闭其它已打开的节点,默认值为 false
。
\n 通过 icon-trigger-click-node
属性,指定点击图标,是否触发点击的行为,默认值为 true
。
\n 通过 render-after-expand
属性,是否在展开节点时,才渲染下级节点,默认值为 true
。
\n 通过 show-check-easily
属性,在严格模式时,是否勾选父节点时,自动勾选子节点, false
。
\n 通过 switch-text
插槽自定义开关右侧的内容。
\n ',
+ 'en-US':
+ 'By default, the shortcut key function is enabled for the tree component. You can press ← and ← (up and down arrows) on the keyboard to move the selected node up or down, and press ← and → (left and right arrows) to collapse and expand the node. Enter and Space control the check button of the node.
\n accordion mode is enabled through the accordion
property, and other open nodes are automatically closed each time a node is expanded. The default value is false
.
\n The icon-trigger-click-node
property specifies whether clicking an icon triggers the clicking behavior. The default value is true
.
\n The render-after-expand
property determines whether to render subordinate nodes only when expanding nodes. The default value is true
.
\n With the show-check-easily
property, when the parent node is selected in strict mode, the child node is automatically selected, false
.
\n Use the switch-text
slot to customize the contents to the right of the switch.
\n '
+ },
+ codeFiles: ['other.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/user-account/webdoc/user-account.js b/examples/sites/demos/pc/app/user-account/webdoc/user-account.js
index b996164f3..3a61e3870 100644
--- a/examples/sites/demos/pc/app/user-account/webdoc/user-account.js
+++ b/examples/sites/demos/pc/app/user-account/webdoc/user-account.js
@@ -3,96 +3,40 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': { 'zh-CN': '详细用法参考如下示例', 'en-US': 'For details, see the following example.' },
- 'codeFiles': ['basic-usage.vue']
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
+ 'zh-CN': '详细用法参考如下示例',
+ 'en-US': 'For details, see the following example.'
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'custom-service',
- 'name': { 'zh-CN': '自定义服务', 'en-US': 'Custom Service' },
- 'desc': { 'zh-CN': '设置自定义服务
\n', 'en-US': 'Setting a Custom Service
\n' },
- 'codeFiles': ['custom-service.vue']
+ demoId: 'custom-service',
+ name: {
+ 'zh-CN': '自定义服务',
+ 'en-US': 'Custom Service'
+ },
+ desc: {
+ 'zh-CN': '设置自定义服务
\n',
+ 'en-US': 'Setting a Custom Service
\n'
+ },
+ codeFiles: ['custom-service.vue']
},
{
- 'demoId': 'custom-operation',
- 'name': { 'zh-CN': '自定义功能', 'en-US': 'Custom Function' },
- 'desc': { 'zh-CN': '通过默认插槽自定义功能
\n', 'en-US': 'Customize functions by default slot
\n' },
- 'codeFiles': ['custom-operation.vue']
- }
- ],
- apis: [
- {
- 'name': 'user-account',
- 'type': 'component',
- 'props': [
- {
- 'name': 'getUserInfo',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '自定义配置用户查询服务', 'en-US': 'User-defined configuration query service' },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'popper-class',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '为 popper 添加类名(可参考 popover 组件)',
- 'en-US': 'Add a class name for the popper. For details, see the popover component.'
- },
- 'demoId': ''
- },
- {
- 'name': 'popper-append-to-body',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 true',
- 'desc': {
- 'zh-CN':
- '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)',
- 'en-US':
- 'Indicates whether to insert the pop-up box to the body element. If a fault occurs in locating the fault in the dialog box that is displayed, you can set this attribute to false (for details, see the select component).'
- },
- 'demoId': ''
- },
- {
- 'name': 'getUserImageUrl',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义配置获取用户头像服务',
- 'en-US': 'Customized configuration for obtaining user avatars'
- },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'showArrow',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '设置为true时,箭头会与Roles组件的箭头方向保持一致',
- 'en-US': 'If this parameter is set to true, the arrow direction is the same as that of the Roles component.'
- },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'beforeLogout',
- 'type': 'Function(params)',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '注销前的回调函数', 'en-US': 'Callback function before deregistration' },
- 'demoId': ''
- }
- ],
- 'events': [],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '默认插槽', 'en-US': 'Default slot' },
- 'demoId': 'custom-operation'
- }
- ]
+ demoId: 'custom-operation',
+ name: {
+ 'zh-CN': '自定义功能',
+ 'en-US': 'Custom Function'
+ },
+ desc: {
+ 'zh-CN': '通过默认插槽自定义功能
\n',
+ 'en-US': 'Customize functions by default slot
\n'
+ },
+ codeFiles: ['custom-operation.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/user-contact/basic-usage.vue b/examples/sites/demos/pc/app/user-contact/basic-usage.vue
index c1eddee64..2d9693c95 100644
--- a/examples/sites/demos/pc/app/user-contact/basic-usage.vue
+++ b/examples/sites/demos/pc/app/user-contact/basic-usage.vue
@@ -2,14 +2,14 @@
-
diff --git a/examples/sites/demos/pc/app/user-contact/contact-espace.vue b/examples/sites/demos/pc/app/user-contact/contact-espace.vue
new file mode 100644
index 000000000..c36e9bcf6
--- /dev/null
+++ b/examples/sites/demos/pc/app/user-contact/contact-espace.vue
@@ -0,0 +1,36 @@
+
+
+
+
+
diff --git a/examples/sites/demos/pc/app/user-contact/data-source.vue b/examples/sites/demos/pc/app/user-contact/data-source.vue
index c1eddee64..2d9693c95 100644
--- a/examples/sites/demos/pc/app/user-contact/data-source.vue
+++ b/examples/sites/demos/pc/app/user-contact/data-source.vue
@@ -2,14 +2,14 @@
-
diff --git a/examples/sites/demos/pc/app/user-head/basic-usage.vue b/examples/sites/demos/pc/app/user-head/basic-usage.vue
index 95fdff6ae..4a100fa8e 100644
--- a/examples/sites/demos/pc/app/user-head/basic-usage.vue
+++ b/examples/sites/demos/pc/app/user-head/basic-usage.vue
@@ -1,13 +1,19 @@
-
+
diff --git a/examples/sites/demos/pc/app/user-head/webdoc/user-head.js b/examples/sites/demos/pc/app/user-head/webdoc/user-head.js
index 78ca61fc2..01edf938e 100644
--- a/examples/sites/demos/pc/app/user-head/webdoc/user-head.js
+++ b/examples/sites/demos/pc/app/user-head/webdoc/user-head.js
@@ -3,216 +3,163 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
- 'zh-CN': '可通过type="icon"
属性设置头像。',
- 'en-US': 'Set a profile picture throughtype="icon"
.'
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
},
- 'codeFiles': ['basic-usage.vue']
+ desc: {
+ 'zh-CN': '可通过model-value
属性设置头像值。',
+ 'en-US': 'You can use the model-value
attribute to set the avatar value.'
+ },
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'min-user-head',
- 'name': { 'zh-CN': '小头像', 'en-US': 'Avatar' },
- 'desc': {
+ demoId: 'min-user-head',
+ name: {
+ 'zh-CN': '小头像',
+ 'en-US': 'Avatar'
+ },
+ desc: {
'zh-CN': '可通过min
属性设置小头像。
\n',
'en-US': 'You can use min
to set a small avatar.
\n'
},
- 'codeFiles': ['min-user-head.vue']
+ codeFiles: ['min-user-head.vue']
},
{
- 'demoId': 'round-user-head',
- 'name': { 'zh-CN': '圆形头像', 'en-US': 'Round Head' },
- 'desc': {
+ demoId: 'round-user-head',
+ name: {
+ 'zh-CN': '圆形头像',
+ 'en-US': 'Round Head'
+ },
+ desc: {
'zh-CN': '可通过round
属性设置圆形头像。
\n',
'en-US': 'You can use round
to set a round avatar.
\n'
},
- 'codeFiles': ['round-user-head.vue']
+ codeFiles: ['round-user-head.vue']
},
{
- 'demoId': 'label-user-head',
- 'name': { 'zh-CN': '文字头像', 'en-US': 'Avatar' },
- 'desc': {
+ demoId: 'label-user-head',
+ name: {
+ 'zh-CN': '文字头像',
+ 'en-US': 'Avatar'
+ },
+ desc: {
'zh-CN': '可通过type="label"
属性设置文字头像。
\n',
'en-US': 'You can use type="label"
to set the text avatar.
\n'
},
- 'codeFiles': ['label-user-head.vue']
+ codeFiles: ['label-user-head.vue']
},
{
- 'demoId': 'icon-user-head',
- 'name': { 'zh-CN': '图标头像', 'en-US': 'Icon avatar' },
- 'desc': {
+ demoId: 'icon-user-head',
+ name: {
+ 'zh-CN': '图标头像',
+ 'en-US': 'Icon avatar'
+ },
+ desc: {
'zh-CN': '可通过type="icon"
属性设置图标头像。
\n',
'en-US': 'You can use type="icon"
to set the icon avatar.
\n'
},
- 'codeFiles': ['icon-user-head.vue']
+ codeFiles: ['icon-user-head.vue']
},
{
- 'demoId': 'image-user-head',
- 'name': { 'zh-CN': '图片头像', 'en-US': 'Avatar' },
- 'desc': {
+ demoId: 'image-user-head',
+ name: {
+ 'zh-CN': '图片头像',
+ 'en-US': 'Avatar'
+ },
+ desc: {
'zh-CN': '可通过type="image"
属性设置图片头像。
\n',
'en-US': 'You can use type="image"
to set the picture avatar.
\n'
},
- 'codeFiles': ['image-user-head.vue']
+ codeFiles: ['image-user-head.vue']
},
{
- 'demoId': 'message-count-total',
- 'name': { 'zh-CN': '头像消息计数', 'en-US': 'Avatar Message Count' },
- 'desc': {
+ demoId: 'message-count-total',
+ name: {
+ 'zh-CN': '头像消息计数',
+ 'en-US': 'Avatar Message Count'
+ },
+ desc: {
'zh-CN': '可通过message-total="100"
属性设置消息数据。',
- 'en-US': `Set message data throughmessage-total='100'
. `
+ 'en-US': "Set message data throughmessage-total='100'
. "
},
- 'codeFiles': ['message-count-total.vue']
+ codeFiles: ['message-count-total.vue']
},
{
- 'demoId': 'message-count-type',
- 'name': { 'zh-CN': '使用小红点代替具体数值', 'en-US': 'Use a red dot instead of a specific value' },
- 'desc': {
+ demoId: 'message-count-type',
+ name: {
+ 'zh-CN': '使用小红点代替具体数值',
+ 'en-US': 'Use a red dot instead of a specific value'
+ },
+ desc: {
'zh-CN': '可通过message-type="basic"
属性设置消息显示替代成小红点。',
- 'en-US': `Set the message display to be replaced with a small red dot throughmessage-type='basic'
.`
+ 'en-US': "Set the message display to be replaced with a small red dot throughmessage-type='basic'
."
},
- 'codeFiles': ['message-count-type.vue']
+ codeFiles: ['message-count-type.vue']
},
{
- 'demoId': 'message-count-limit',
- 'name': { 'zh-CN': '消息计数上限', 'en-US': 'Maximum number of messages' },
- 'desc': {
+ demoId: 'message-count-limit',
+ name: {
+ 'zh-CN': '消息计数上限',
+ 'en-US': 'Maximum number of messages'
+ },
+ desc: {
'zh-CN': '可通过message-upper-limit="99"
属性设置消息数据上限。',
- 'en-US': `Set the message data upper limit throughmessage-upper-limit='99'
.`
+ 'en-US': "Set the message data upper limit throughmessage-upper-limit='99'
."
},
- 'codeFiles': ['message-count-limit.vue']
+ codeFiles: ['message-count-limit.vue']
},
{
- 'demoId': 'color',
- 'name': { 'zh-CN': '自定义颜色', 'en-US': 'Custom Color' },
- 'desc': {
+ demoId: 'color',
+ name: {
+ 'zh-CN': '自定义颜色',
+ 'en-US': 'Custom Color'
+ },
+ desc: {
'zh-CN':
'可通过color
属性设置自定义颜色,图标或文字类型(type属性值为 icon 或 label )的情况下,设置字体颜色和背景色。
\n',
'en-US':
'You can use color
to customize the color. If the icon or text type is set to icon or label, set the font color and background color.
\n'
},
- 'codeFiles': ['color.vue']
+ codeFiles: ['color.vue']
},
{
- 'demoId': 'custom-background-color',
- 'name': { 'zh-CN': '自定义背景颜色', 'en-US': 'Custom background color' },
- 'desc': {
+ demoId: 'custom-background-color',
+ name: {
+ 'zh-CN': '自定义背景颜色',
+ 'en-US': 'Custom background color'
+ },
+ desc: {
'zh-CN': '可通过background-color
属性设置自定义背景颜色。
\n',
'en-US': 'You can use background-color
to customize the background color.
\n'
},
- 'codeFiles': ['custom-background-color.vue']
+ codeFiles: ['custom-background-color.vue']
},
{
- 'demoId': 'custom-user-head-content',
- 'name': { 'zh-CN': '自定义图像内容', 'en-US': 'Custom Image Content' },
- 'desc': {
+ demoId: 'custom-user-head-content',
+ name: {
+ 'zh-CN': '自定义图像内容',
+ 'en-US': 'Custom Image Content'
+ },
+ desc: {
'zh-CN': '可通过#default
插槽设置自定义图像内容。
\n',
'en-US': 'Customize the image content by slot#default
.
\n'
},
- 'codeFiles': ['custom-user-head-content.vue']
+ codeFiles: ['custom-user-head-content.vue']
},
{
- 'demoId': 'render-user-head-in-grid',
- 'name': { 'zh-CN': 'Grid 单元格展示头像', 'en-US': 'Avatar Displayed in Grid Cells' },
- 'desc': {
+ demoId: 'render-user-head-in-grid',
+ name: {
+ 'zh-CN': 'Grid 单元格展示头像',
+ 'en-US': 'Avatar Displayed in Grid Cells'
+ },
+ desc: {
'zh-CN': '可通过Grid单元格renderer
属性设置传入封装用户头像组件(HTML格式)。',
'en-US':
'Pass in the encapsulated user avatar component (in HTML format) through the Grid cell attributerenderer
.'
},
- 'codeFiles': ['render-user-head-in-grid.vue']
- }
- ],
- apis: [
- {
- 'name': 'user-head',
- 'type': 'component',
- 'props': [
- {
- 'name': 'background-color',
- 'type': 'string',
- 'defaultValue': `'#d9d9d9'`,
- 'desc': { 'zh-CN': '背景色', 'en-US': 'Background color' },
- 'demoId': 'custom-background-color'
- },
- {
- 'name': 'color',
- 'type': 'string',
- 'defaultValue': `'#ffffff'`,
- 'desc': { 'zh-CN': '文字颜色', 'en-US': 'Text color' },
- 'demoId': 'color'
- },
- {
- 'name': 'message-total',
- 'type': 'number',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '消息计数', 'en-US': 'Number of messages' },
- 'demoId': 'message-count-total'
- },
- {
- 'name': 'message-type',
- 'type': 'string',
- 'defaultValue': `'details'`,
- 'desc': {
- 'zh-CN': '消息类型 details|basic 可选',
- 'en-US': 'Message type details|basic is optional. The value of this attribute can be details or basic.'
- },
- 'demoId': 'message-count-type'
- },
- {
- 'name': 'message-upper-limit',
- 'type': 'number',
- 'defaultValue': '0',
- 'desc': { 'zh-CN': '消息显示上限', 'en-US': 'Maximum number of displayed messages' },
- 'demoId': 'message-count-limit'
- },
- {
- 'name': 'min',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '小尺寸模式', 'en-US': 'Small size mode' },
- 'demoId': 'min-user-head'
- },
- {
- 'name': 'round',
- 'type': 'boolean',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '圆形模式', 'en-US': 'Circular mode' },
- 'demoId': 'round-user-head'
- },
- {
- 'name': 'type',
- 'type': 'string',
- 'defaultValue': `'label'`,
- 'desc': {
- 'zh-CN': '头像类型,icon|image|label 可选',
- 'en-US':
- 'Avatar type. The options are icon, image, and label. ;The value of this attribute can be icon / image / label'
- },
- 'demoId': 'image-user-head'
- },
- {
- 'name': 'value',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': 'type=icon 时为图标类名,type=label 时为字体串,type=image 时为资源路径',
- 'en-US':
- 'If type is set to icon, it indicates the icon class name. If type is set to label, it indicates the font string. If type is set to image, it indicates the resource path'
- },
- 'demoId': 'icon-user-head'
- }
- ],
- 'events': [],
- 'slots': [
- {
- 'name': 'default',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '自定义图像内容', 'en-US': 'Customized image content' },
- 'demoId': 'custom-user-head-content'
- }
- ]
+ codeFiles: ['render-user-head-in-grid.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/user-link/webdoc/user-link.js b/examples/sites/demos/pc/app/user-link/webdoc/user-link.js
index c7c7d5484..c1cd1cd62 100644
--- a/examples/sites/demos/pc/app/user-link/webdoc/user-link.js
+++ b/examples/sites/demos/pc/app/user-link/webdoc/user-link.js
@@ -3,205 +3,113 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '注意 UserLink 组件请求的是 mock 数据,其他用户查询不了,开发时请用真实服务。
\n',
'en-US':
'Note that the UserLink component requests mock data, which cannot be queried by other users. Use real services during development.
\n'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'text-field',
- 'name': { 'zh-CN': '显示字段映射', 'en-US': 'Display Field Mapping' },
- 'desc': {
+ demoId: 'text-field',
+ name: {
+ 'zh-CN': '显示字段映射',
+ 'en-US': 'Display Field Mapping'
+ },
+ desc: {
'zh-CN':
'通过 text-field 设置显示字段信息,默认是 userCN\n注意 UserLink 组件请求的是 mock 数据,其他用户查询不了,开发时请用真实服务。
\n',
'en-US':
'Use text-field to set the displayed field information. The default value is userCN.\nNote that the UserLink component requests mock data, which cannot be queried by other users. Use the real service during development.
\n'
},
- 'codeFiles': ['text-field.vue']
+ codeFiles: ['text-field.vue']
},
{
- 'demoId': 'text-split',
- 'name': { 'zh-CN': '自定义文本分隔符', 'en-US': 'Custom Text Separator' },
- 'desc': {
+ demoId: 'text-split',
+ name: {
+ 'zh-CN': '自定义文本分隔符',
+ 'en-US': 'Custom Text Separator'
+ },
+ desc: {
'zh-CN':
"通过 text-split 自定义文本分隔符,默认是 ','\n注意 UserLink 组件请求的是 mock 数据,其他用户查询不了,开发时请用真实服务。
\n",
'en-US':
"Use text-split to customize the text separator. The default value is ','\nNote that the UserLink component requests mock data, which cannot be queried by other users. Use the real service during development.
\n"
},
- 'codeFiles': ['text-split.vue']
+ codeFiles: ['text-split.vue']
},
{
- 'demoId': 'value-field',
- 'name': { 'zh-CN': '值字段映射', 'en-US': 'Value Field Mapping' },
- 'desc': {
+ demoId: 'value-field',
+ name: {
+ 'zh-CN': '值字段映射',
+ 'en-US': 'Value Field Mapping'
+ },
+ desc: {
'zh-CN':
'通过 value-field 设置值字段映射,默认是 userId\n注意 UserLink 组件请求的是 mock 数据,其他用户查询不了,开发时请用真实服务。
\n',
'en-US':
'Use value-field to set the value field mapping. The default value is userId.\nNote that the UserLink component requests mock data, which cannot be queried by other users. Use the real service during development.
\n'
},
- 'codeFiles': ['value-field.vue']
+ codeFiles: ['value-field.vue']
},
{
- 'demoId': 'value-split',
- 'name': { 'zh-CN': '自定义值分隔符', 'en-US': 'Customized value separator' },
- 'desc': {
+ demoId: 'value-split',
+ name: {
+ 'zh-CN': '自定义值分隔符',
+ 'en-US': 'Customized value separator'
+ },
+ desc: {
'zh-CN':
"通过 value-split 自定义值分隔符,默认是 ','\n注意 UserLink 组件请求的是 mock 数据,其他用户查询不了,开发时请用真实服务。
\n",
'en-US':
"Use value-split to define the value separator. The default value separator is ','.\nNote that the UserLink component requests mock data, which cannot be queried by other users. Use real services during development.
\n"
},
- 'codeFiles': ['value-split.vue']
+ codeFiles: ['value-split.vue']
},
{
- 'demoId': 'custom-service',
- 'name': { 'zh-CN': '自定义服务', 'en-US': 'Custom Service' },
- 'desc': {
+ demoId: 'custom-service',
+ name: {
+ 'zh-CN': '自定义服务',
+ 'en-US': 'Custom Service'
+ },
+ desc: {
'zh-CN': '注意 UserLink 组件请求的是 mock 数据,其他用户查询不了,开发时请用真实服务。
\n',
'en-US':
'Note that the UserLink component requests mock data, which cannot be queried by other users. Use real services during development.
\n'
},
- 'codeFiles': ['custom-service.vue']
+ codeFiles: ['custom-service.vue']
},
{
- 'demoId': 'cache-users',
- 'name': { 'zh-CN': '用户数据缓存', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'cache-users',
+ name: {
+ 'zh-CN': '用户数据缓存',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '注意 UserLink 组件请求的是 mock 数据,其他用户查询不了,开发时请用真实服务。
\n',
'en-US':
'Note that the UserLink component requests mock data, which cannot be queried by other users. Use real services during development.
\n'
},
- 'codeFiles': ['cache-users.vue']
+ codeFiles: ['cache-users.vue']
},
{
- 'demoId': 'value',
- 'name': { 'zh-CN': '自定义默认值', 'en-US': 'Custom Default Value' },
- 'desc': {
+ demoId: 'value',
+ name: {
+ 'zh-CN': '自定义默认值',
+ 'en-US': 'Custom Default Value'
+ },
+ desc: {
'zh-CN':
'通过 value 自定义默认值,默认为空注意 value 值与 v-model 不能同时使用,同时使用时 v-model 权重更高
\n',
'en-US':
'Customize the default value by value. The default value is empty. Note that value and v-model cannot be used at the same time. When v-model is used at the same time, v-model has a higher weight.
\n'
},
- 'codeFiles': ['value.vue']
- }
- ],
- apis: [
- {
- 'name': 'user-link',
- 'type': 'component',
- 'props': [
- {
- 'name': 'value',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '配置默认值,默认为空', 'en-US': 'The default value is empty.' },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'cache',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 true',
- 'desc': {
- 'zh-CN': '是否开启用户数据缓存,默认为 ture 缓存用户数据',
- 'en-US': 'Indicates whether to enable the user data cache function. The default value is true.'
- },
- 'demoId': 'cache-users'
- },
- {
- 'name': 'cache-key',
- 'type': 'string',
- 'defaultValue': '该属性的默认值为 tiny-user',
- 'desc': {
- 'zh-CN': '自定义缓存 key 默认值为 tiny-user',
- 'en-US': 'The default value of the customized cache key is tiny-user'
- },
- 'demoId': 'cache-users'
- },
- {
- 'name': 'cache-fields',
- 'type': 'Array',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '自定义缓存的字段', 'en-US': 'Custom cached fields' },
- 'demoId': 'cache-users'
- },
- {
- 'name': 'value-split',
- 'type': 'string',
- 'defaultValue': '该属性的默认值为 ,',
- 'desc': {
- 'zh-CN':
- '在多选的情况下,设置输入框显示多个文本时的分隔符,默认为 ; 分号;在多选的情况下,设置输入框显示多个文本时的分隔符,默认为 , 逗号',
- 'en-US':
- 'Separator for displaying multiple texts in the text box. The default value is semicolon (;). Set the separator when multiple texts are displayed in the text box. The default value is, comma (,)'
- },
- 'demoId': 'value-split'
- },
- {
- 'name': 'value-field',
- 'type': 'string',
- 'defaultValue': '该属性的默认值为 userId',
- 'desc': {
- 'zh-CN': '设置下拉框的值所对应数据源的字段名称',
- 'en-US': 'Field name of the data source corresponding to the value in the drop-down list box.'
- },
- 'demoId': 'value-field'
- },
- {
- 'name': 'text-split',
- 'type': 'string',
- 'defaultValue': '该属性的默认值为 ,',
- 'desc': {
- 'zh-CN': '在多选的情况下,设置输入框显示多个文本时的分隔符',
- 'en-US': 'Separator for displaying multiple texts in the text box when multiple texts are selected.'
- },
- 'demoId': 'text-split'
- },
- {
- 'name': 'text-field',
- 'type': 'string',
- 'defaultValue': '该属性的默认值为 userCN',
- 'desc': {
- 'zh-CN': '设置下拉框的文本对应的数据源的字段名称',
- 'en-US': 'Set the field name of the data source corresponding to the text in the drop-down list box.'
- },
- 'demoId': 'text-field'
- },
- {
- 'name': 'fetchUser',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '配置通过员区号查询用户信息(展示在卡片上)',
- 'en-US': 'Configure the function of querying user information by area code (displayed on the card).'
- },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'fetchW3Accounts',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义配置批量查询用户信息服务',
- 'en-US': 'Customize the user information batch query service'
- },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'getUserImageUrl',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义配置获取用户头像服务',
- 'en-US': 'Customized configuration for obtaining user avatars'
- },
- 'demoId': 'custom-service'
- }
- ],
- 'events': [],
- 'slots': []
+ codeFiles: ['value.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/user/webdoc/user.js b/examples/sites/demos/pc/app/user/webdoc/user.js
index f9c650968..31cb5cc47 100644
--- a/examples/sites/demos/pc/app/user/webdoc/user.js
+++ b/examples/sites/demos/pc/app/user/webdoc/user.js
@@ -3,497 +3,340 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN': '注意 User 组件请求的是 mock 数据,其他用户查询不了,开发时请用真实服务。
\n',
'en-US':
'Note that the User component requests mock data, which cannot be queried by other users. Use the real service during development.
\n'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'multiple-users',
- 'name': { 'zh-CN': '多用户', 'en-US': 'Multi-User' },
- 'desc': {
+ demoId: 'multiple-users',
+ name: {
+ 'zh-CN': '多用户',
+ 'en-US': 'Multi-User'
+ },
+ desc: {
'zh-CN': '设置 multiple
属性即可启用多用户形式。
\n',
'en-US': 'Set the multiple
property to enable the multi-user mode.
\n'
},
- 'codeFiles': ['multiple-users.vue']
+ codeFiles: ['multiple-users.vue']
},
{
- 'demoId': 'multiple-users-tag',
- 'name': { 'zh-CN': '折叠 Tag', 'en-US': 'Collapse Tag' },
- 'desc': {
+ demoId: 'multiple-users-tag',
+ name: {
+ 'zh-CN': '折叠 Tag',
+ 'en-US': 'Collapse Tag'
+ },
+ desc: {
'zh-CN':
'设置 multiple
属性即可启用多用户形式。\n通过 collapse-tags
配置多用户模式下是否展示折叠标签,默认为 false。
\n',
'en-US':
'Set the multiple
property to enable the multi-user mode. \n Use collapse-tags
to configure whether to display collapsed tags in multi-user mode. The default value is false.
\n'
},
- 'codeFiles': ['multiple-users-tag.vue']
+ codeFiles: ['multiple-users-tag.vue']
},
{
- 'demoId': 'hide-selected',
- 'name': { 'zh-CN': '隐藏已选择用户', 'en-US': '' },
- 'desc': {
+ demoId: 'hide-selected',
+ name: {
+ 'zh-CN': '隐藏已选择用户',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN':
'设置 hide-selected
属性为 true
,过滤搜索结果,已选择的人员不出现在搜索列表中。默认为 false
,表示不过滤。
\n',
'en-US': '\n'
},
- 'codeFiles': ['hide-selected.vue']
+ codeFiles: ['hide-selected.vue']
},
{
- 'demoId': 'multiple-users-hover-expand',
- 'name': { 'zh-CN': '折叠 Tag, hover 展开', 'en-US': 'Collapse Tag' },
- 'desc': {
+ demoId: 'multiple-users-hover-expand',
+ name: {
+ 'zh-CN': '折叠 Tag, hover 展开',
+ 'en-US': 'Collapse Tag'
+ },
+ desc: {
'zh-CN':
'多选时通过设置 hover-expand
为 true ,默认折叠 tag, hover 时展示所有 tag。tag 超出隐藏并展示 tooltip。
\n',
'en-US': '\n'
},
- 'codeFiles': ['multiple-users-hover-expand.vue']
+ codeFiles: ['multiple-users-hover-expand.vue']
},
{
- 'demoId': 'allow-copy',
- 'name': { 'zh-CN': '单用户场景支持复制', 'en-US': '' },
- 'desc': {
+ demoId: 'allow-copy',
+ name: {
+ 'zh-CN': '单用户场景支持复制',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN': '通过 allow-copy
设置输入框账号可通过鼠标选中,然后按 Ctrl + C 或右键进行复制。
\n',
'en-US': '\n'
},
- 'codeFiles': ['allow-copy.vue']
+ codeFiles: ['allow-copy.vue']
},
{
- 'demoId': 'tag-copy',
- 'name': { 'zh-CN': '多用户场景支持复制', 'en-US': 'User selector options can be copied' },
- 'desc': {
+ demoId: 'tag-copy',
+ name: {
+ 'zh-CN': '多用户场景支持复制',
+ 'en-US': 'User selector options can be copied'
+ },
+ desc: {
'zh-CN':
'通过 tag-selectable
输入框中已选择的选项可通过鼠标选择,然后按 Ctrl + C 或右键进行复制。
\n',
'en-US':
'You can select an option in the tag-selectable
text box with the mouse, and then press Ctrl + C or right-click to copy it.
\n'
},
- 'codeFiles': ['tag-copy.vue']
+ codeFiles: ['tag-copy.vue']
},
{
- 'demoId': 'tag-copy-all',
- 'name': { 'zh-CN': 'user选择器选项可一键复制', 'en-US': 'User selector options can be copied' },
- 'desc': {
+ demoId: 'tag-copy-all',
+ name: {
+ 'zh-CN': 'user选择器选项可一键复制',
+ 'en-US': 'User selector options can be copied'
+ },
+ desc: {
'zh-CN':
'设置 copyable
属性后,可以点击复制按钮复制所有的 tag
文本内容以逗号分隔
\n',
'en-US':
'After the copyable
attribute is set, all tag
text contents can be copied and separated by commas.
\n'
},
- 'codeFiles': ['tag-copy-all.vue']
+ codeFiles: ['tag-copy-all.vue']
},
{
- 'demoId': 'dynamic-disable',
- 'name': { 'zh-CN': '禁用状态', 'en-US': 'Disabled' },
- 'desc': {
+ demoId: 'dynamic-disable',
+ name: {
+ 'zh-CN': '禁用状态',
+ 'en-US': 'Disabled'
+ },
+ desc: {
'zh-CN': '设置 disabled
属性可禁用 User 组件。
\n',
'en-US': 'Set the disabled
property to disable the User component.
\n'
},
- 'codeFiles': ['dynamic-disable.vue']
+ codeFiles: ['dynamic-disable.vue']
},
{
- 'demoId': 'collapse-show-overflow-tooltip',
- 'name': { 'zh-CN': '超出提示', 'en-US': 'Exceeding prompt' },
- 'desc': {
+ demoId: 'collapse-show-overflow-tooltip',
+ name: {
+ 'zh-CN': '超出提示',
+ 'en-US': 'Exceeding prompt'
+ },
+ desc: {
'zh-CN':
'设置 collapse-show-overflow-tooltip
此属性必须设置缓存 cache
为 true
时才会生效。
\n',
'en-US':
'Set collapse-show-overflow-tooltip
This attribute takes effect only when cache
is set to true
.
\n'
},
- 'codeFiles': ['collapse-show-overflow-tooltip.vue']
+ codeFiles: ['collapse-show-overflow-tooltip.vue']
},
{
- 'demoId': 'value-split',
- 'name': { 'zh-CN': '值分隔符', 'en-US': 'Value Separator' },
- 'desc': {
+ demoId: 'value-split',
+ name: {
+ 'zh-CN': '值分隔符',
+ 'en-US': 'Value Separator'
+ },
+ desc: {
'zh-CN':
'通过 value-split
属性可指定多用户下获取到的 value 值中不同用户之间的分隔符,默认为 ,
。\n通过 text-split
属性可指定多用户模式下输入匹配的文本分隔符,默认为 ,
,可选值为 !~%(=+^{/}).!]<->[\\,:*#;
。
\n',
'en-US':
'You can use the value-split
attribute to specify the separator between different users in the value obtained for multiple users. The default value is ,
. \n You can use the text-split
attribute to specify the text separator that matches the input in multi-user mode. The default value is ,
, and the value can be !~%(=+^{/}).!]<->[\\,:*#;
.
\n'
},
- 'codeFiles': ['value-split.vue']
+ codeFiles: ['value-split.vue']
},
{
- 'demoId': 'value-field',
- 'name': { 'zh-CN': '取值字段映射', 'en-US': 'Value Field Mapping' },
- 'desc': {
+ demoId: 'value-field',
+ name: {
+ 'zh-CN': '取值字段映射',
+ 'en-US': 'Value Field Mapping'
+ },
+ desc: {
'zh-CN':
'通过 value-field
属性可指定获取到的 value 值的形式,默认为 userId,还包括 userAccount。
\n',
'en-US':
'The value-field
attribute specifies the format of the obtained value. The default value is userId and userAccount are also included.
\n'
},
- 'codeFiles': ['value-field.vue']
+ codeFiles: ['value-field.vue']
},
{
- 'demoId': 'text-field',
- 'name': { 'zh-CN': '显示字段映射', 'en-US': 'Display Field Mapping' },
- 'desc': {
+ demoId: 'text-field',
+ name: {
+ 'zh-CN': '显示字段映射',
+ 'en-US': 'Display Field Mapping'
+ },
+ desc: {
'zh-CN': '通过 text-field
属性可指定显示用户的哪个字段信息。
\n',
'en-US':
'You can use the text-field
attribute to specify the field of the user to be displayed.
\n'
},
- 'codeFiles': ['text-field.vue']
+ codeFiles: ['text-field.vue']
},
{
- 'demoId': 'cache-users',
- 'name': { 'zh-CN': '缓存用户', 'en-US': 'Cache User' },
- 'desc': {
+ demoId: 'cache-users',
+ name: {
+ 'zh-CN': '缓存用户',
+ 'en-US': 'Cache User'
+ },
+ desc: {
'zh-CN':
'通过 cache
属性指定用户数据是否缓存,默认为缓存。\n\ncache-key
属性可以自定义缓存的 key 值,默认为 tiny-user 。\n\ncache-fields
属性用于指定缓存哪些用户数据。
\n',
'en-US':
'The cache
attribute specifies whether user data is cached. The default value is cached. The \n\ncache-key
attribute can be used to customize the cache key value. The default value is tiny-user. The \n\ncache-fields
property is used to specify which user data is cached.
\n'
},
- 'codeFiles': ['cache-users.vue']
+ codeFiles: ['cache-users.vue']
},
{
- 'demoId': 'delay-load',
- 'name': { 'zh-CN': '延时加载', 'en-US': 'Delayed loading' },
- 'desc': {
+ demoId: 'delay-load',
+ name: {
+ 'zh-CN': '延时加载',
+ 'en-US': 'Delayed loading'
+ },
+ desc: {
'zh-CN': '通过 delay
属性指定延时加载的时间,单位是毫秒。
\n',
'en-US': 'The delay
attribute specifies the loading delay, in milliseconds.
\n'
},
- 'codeFiles': ['delay-load.vue']
+ codeFiles: ['delay-load.vue']
},
{
- 'demoId': 'load-after-input-the-length',
- 'name': { 'zh-CN': '输入完指定长度后加载', 'en-US': 'Load after the specified length is entered.' },
- 'desc': {
+ demoId: 'load-after-input-the-length',
+ name: {
+ 'zh-CN': '输入完指定长度后加载',
+ 'en-US': 'Load after the specified length is entered.'
+ },
+ desc: {
'zh-CN': '通过 suggest-length
属性可指定输入多少个字符后开始请求服务。
\n',
'en-US':
'You can use the suggest-length
attribute to specify the number of characters to start requesting services.
\n'
},
- 'codeFiles': ['load-after-input-the-length.vue']
+ codeFiles: ['load-after-input-the-length.vue']
},
{
- 'demoId': 'event-change',
- 'name': { 'zh-CN': '值改变事件', 'en-US': 'Value change event' },
- 'desc': {
+ demoId: 'event-change',
+ name: {
+ 'zh-CN': '值改变事件',
+ 'en-US': 'Value change event'
+ },
+ desc: {
'zh-CN': '通过 change
事件能获取用户类型。
\n',
'en-US': 'The user type can be obtained through the change
event.
\n'
},
- 'codeFiles': ['event-change.vue']
+ codeFiles: ['event-change.vue']
},
{
- 'demoId': 'event-error',
- 'name': { 'zh-CN': '用户查询错误提示', 'en-US': 'User query error message' },
- 'desc': {
+ demoId: 'event-error',
+ name: {
+ 'zh-CN': '用户查询错误提示',
+ 'en-US': 'User query error message'
+ },
+ desc: {
'zh-CN': '通过 error
事件能获取查询失败的输入。
\n',
'en-US': 'The error
event can be used to obtain the input that fails to be queried.
\n'
},
- 'codeFiles': ['event-error.vue']
+ codeFiles: ['event-error.vue']
},
{
- 'demoId': 'user-options',
- 'name': { 'zh-CN': '自定义选项文本', 'en-US': 'Custom Option Text' },
- 'desc': {
+ demoId: 'user-options',
+ name: {
+ 'zh-CN': '自定义选项文本',
+ 'en-US': 'Custom Option Text'
+ },
+ desc: {
'zh-CN': '通过 options
插槽设置自定义下拉选项文本。
\n',
'en-US': 'Sets the custom drop-down option text through the options
slot.
\n'
},
- 'codeFiles': ['user-options.vue']
+ codeFiles: ['user-options.vue']
},
{
- 'demoId': 'no-data-text',
- 'name': { 'zh-CN': '自定义选自定义空数据文本项文本', 'en-US': '' },
- 'desc': {
+ demoId: 'no-data-text',
+ name: {
+ 'zh-CN': '自定义选自定义空数据文本项文本',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN': '通过 no-data-text
设置未查询到数据时的空数据提示。
\n',
'en-US': '\n'
},
- 'codeFiles': ['no-data-text.vue']
+ codeFiles: ['no-data-text.vue']
},
{
- 'demoId': 'custom-service',
- 'name': { 'zh-CN': '自定义服务', 'en-US': 'Custom Service' },
- 'desc': {
+ demoId: 'custom-service',
+ name: {
+ 'zh-CN': '自定义服务',
+ 'en-US': 'Custom Service'
+ },
+ desc: {
'zh-CN':
'通过 service
属性可自定义用户服务,当用户在文本框中输入准确的账号时,会在下拉菜单中出现此用户。\n通过 sort-by-fetch-data
联想时下拉框的数据顺序和接口返回的数据顺序一致
\n',
'en-US':
'You can customize the user service through the service
attribute. When a user enters an accurate account in the text box, the user is displayed in the drop-down menu. \nThe data sequence in the drop-down list box during sort-by-fetch-data
association is the same as that returned by the interface.
\n'
},
- 'codeFiles': ['custom-service.vue']
+ codeFiles: ['custom-service.vue']
},
{
- 'demoId': 'custom-sort',
- 'name': { 'zh-CN': '自定义排序', 'en-US': 'Custom Sorting' },
- 'desc': {
+ demoId: 'custom-sort',
+ name: {
+ 'zh-CN': '自定义排序',
+ 'en-US': 'Custom Sorting'
+ },
+ desc: {
'zh-CN': '通过 sortable
属性引用 sortablejs
进行排序。
\n',
'en-US': ' uses the sortable
attribute to reference sortablejs
for sorting.
\n'
},
- 'codeFiles': ['custom-sort.vue']
+ codeFiles: ['custom-sort.vue']
},
{
- 'demoId': 'user-select-size',
- 'name': { 'zh-CN': '尺寸设置', 'en-US': 'Size Settings' },
- 'desc': {
+ demoId: 'user-select-size',
+ name: {
+ 'zh-CN': '尺寸设置',
+ 'en-US': 'Size Settings'
+ },
+ desc: {
'zh-CN': '通过 size
属性可指定用户输入框的尺寸,包括 medium、small、mini 三个选项。
\n',
'en-US':
'You can use the size
attribute to specify the size of the text box, including medium, small, and mini.
\n'
},
- 'codeFiles': ['user-select-size.vue']
+ codeFiles: ['user-select-size.vue']
},
{
- 'demoId': 'hidden-tips-disable',
- 'name': { 'zh-CN': '禁用多选不展示用户信息', 'en-US': '' },
- 'desc': {
+ demoId: 'hidden-tips-disable',
+ name: {
+ 'zh-CN': '禁用多选不展示用户信息',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN':
'设置 show-tips
属性可展示用户信息,默认展示。
\n设置 max-width
属性可设置 tips 展示信息最大宽度,默认`200`。
\n',
'en-US': '\n'
},
- 'codeFiles': ['hidden-tips-disable.vue']
+ codeFiles: ['hidden-tips-disable.vue']
},
{
- 'demoId': 'batch',
- 'name': { 'zh-CN': '合并请求用户信息', 'en-US': '' },
- 'desc': {
+ demoId: 'batch',
+ name: {
+ 'zh-CN': '合并请求用户信息',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN':
'在进行批量发起用户信息查询时,例如同页面使用了多处 user 组件,通过配置 batch
为 true
将用户信息查询进行合并(组件内部会进行请求合并)。
\n',
'en-US': '\n'
},
- 'codeFiles': ['batch.vue']
+ codeFiles: ['batch.vue']
},
{
- 'demoId': 'display-only',
- 'name': { 'zh-CN': '只读', 'en-US': '' },
- 'desc': {
+ demoId: 'display-only',
+ name: {
+ 'zh-CN': '只读',
+ 'en-US': ''
+ },
+ desc: {
'zh-CN': '通过 display-only
属性设置只读态。
\n',
'en-US': '\n'
},
- 'codeFiles': ['display-only.vue']
- }
- ],
- apis: [
- {
- 'name': 'user',
- 'type': 'component',
- 'props': [
- {
- 'name': 'value',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '配置默认值', 'en-US': 'Default value' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'tag-selectable',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 false',
- 'desc': {
- 'zh-CN': '是否开启输入框中已选择的选项可复制',
- 'en-US': 'Whether to enable copying of selected options in the text box'
- },
- 'demoId': 'tag-copy'
- },
- {
- 'name': 'multiple',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 false',
- 'desc': {
- 'zh-CN': '是否开启多用户形式,默认为 false ',
- 'en-US': 'Whether to enable the multi-user mode. The default value is false.'
- },
- 'demoId': 'multiple-users'
- },
- {
- 'name': 'disabled',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 false',
- 'desc': { 'zh-CN': '是否禁用户组件', 'en-US': 'Whether to disable the user component' },
- 'demoId': 'dynamic-disable'
- },
- {
- 'name': 'value-split',
- 'type': 'string',
- 'defaultValue': '该属性的默认值为 ,',
- 'desc': { 'zh-CN': '值分隔符', 'en-US': 'Value Separator' },
- 'demoId': 'value-split'
- },
- {
- 'name': 'popper-class',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '为 popper 添加类名(可参考 popover 组件)',
- 'en-US': 'Add a class name for the popper. For details, see the popover component.'
- },
- 'demoId': ''
- },
- {
- 'name': 'popper-append-to-body',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 true',
- 'desc': {
- 'zh-CN':
- '是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false (可参考 select 组件)',
- 'en-US':
- 'Indicates whether to insert a pop-up box to the body element. When a fault occurs in the dialog box that is displayed, you can set this attribute to false (for details, see the select component).'
- },
- 'demoId': ''
- },
- {
- 'name': 'sort-by-fetch-data',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 false',
- 'desc': {
- 'zh-CN': '联想时下拉框的数据顺序和接口返回的数据顺序一致',
- 'en-US':
- 'The data sequence in the drop-down list box during association is the same as that returned by the interface.'
- },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'textSplit',
- 'type': 'string',
- 'defaultValue': '文本粘贴复制查询时的分割符,该属性的默认值为 ,',
- 'desc': { 'zh-CN': '文本分隔符', 'en-US': 'Text separator' },
- 'demoId': 'value-split'
- },
- {
- 'name': 'value-field',
- 'type': 'string',
- 'defaultValue': '该属性的默认值为 userId',
- 'desc': { 'zh-CN': '取值字段映射', 'en-US': 'Value Field Mapping' },
- 'demoId': 'value-field'
- },
- {
- 'name': 'text-field',
- 'type': 'string',
- 'defaultValue': '该属性的默认值为 userCN',
- 'desc': { 'zh-CN': '显示字段映射', 'en-US': 'Display field mapping' },
- 'demoId': 'text-field'
- },
- {
- 'name': 'cache',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 true',
- 'desc': { 'zh-CN': '是否缓存用户数据', 'en-US': 'Whether to cache user data' },
- 'demoId': 'cache-users'
- },
- {
- 'name': 'cache-key',
- 'type': 'string',
- 'defaultValue': '该属性的默认值为 tiny-user',
- 'desc': { 'zh-CN': '设置缓存数据的 key 值', 'en-US': 'Set the key value of cached data.' },
- 'demoId': 'cache-users'
- },
- {
- 'name': 'delay',
- 'type': 'number',
- 'defaultValue': '该属性的默认值为 600 毫秒',
- 'desc': { 'zh-CN': '设置延时加载的时间', 'en-US': 'Set the loading delay time.' },
- 'demoId': 'delay-load'
- },
- {
- 'name': 'suggest-length',
- 'type': 'number',
- 'defaultValue': '该属性的默认值为 3',
- 'desc': { 'zh-CN': '设置输入指定长度完成后进行加载', 'en-US': 'Load after the input length is set.' },
- 'demoId': 'load-after-input-the-length'
- },
- {
- 'name': 'cache-fields',
- 'type': 'Array',
- 'defaultValue': '该属性的默认值为 []',
- 'desc': { 'zh-CN': '设置需要缓存的用户数据', 'en-US': 'Set the user data to be cached.' },
- 'demoId': 'cache-users'
- },
- {
- 'name': 'fetchW3Accounts',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '自定义批量查询用户服务', 'en-US': 'User-defined batch query service' },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'fetchSuggestUser',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '自定义输入查询服务', 'en-US': 'Customized input query service' },
- 'demoId': 'custom-service'
- },
- {
- 'name': 'placeholder',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置输入框占位文本', 'en-US': 'Set the placeholder text in the text box' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'collapse-tags',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 false',
- 'desc': {
- 'zh-CN': '多用户时是否折叠标签',
- 'en-US': 'Whether to collapse tags when there are multiple users'
- },
- 'demoId': 'multiple-users-tag'
- },
- {
- 'name': 'collapse-show-overflow-tooltip',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 true',
- 'desc': {
- 'zh-CN': '是否省略显示超出一行的数据并有tooltip提示',
- 'en-US': 'Whether to omit the data that exceeds one line and display a tooltip.'
- },
- 'demoId': 'collapse-show-overflow-tooltip'
- },
- {
- 'name': 'sortable',
- 'type': 'Function',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '自定义用户拖拽排序,该属性引用 sortablejs 插件进行排序',
- 'en-US': 'User-defined drag-and-drop sorting. This attribute references the sortablejs plug-in for sorting.'
- },
- 'demoId': 'custom-sort'
- },
- {
- 'name': 'size',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置用户组件尺寸', 'en-US': 'Set the user component size' },
- 'demoId': 'user-select-size'
- },
- {
- 'name': 'allow-copy',
- 'type': 'boolean',
- 'defaultValue': '该属性的默认值为 false,表示不能复制',
- 'desc': {
- 'zh-CN': '搜索单选场景,是否允许复制输入框的内容;属性会透传给内部的 Select 组件,参考 Select 示例',
- 'en-US':
- 'Indicates whether content in the text box can be copied in the single-choice search scenario. The attribute is transparently transferred to the internal Select component. For details, see the Select example.'
- },
- 'demoId': ''
- }
- ],
- 'events': [
- {
- 'name': 'error',
- 'type': '',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '输入未匹配到用户信息时触发',
- 'en-US': 'This event is triggered when no user information is matched.'
- },
- 'demoId': 'event-error'
- },
- {
- 'name': 'change',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '值发生变化时触发', 'en-US': 'This event is triggered when the value changes.' },
- 'demoId': 'event-change'
- }
- ],
- 'slots': [
- {
- 'name': 'options',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '选项文本', 'en-US': 'Option Text' },
- 'demoId': 'user-options'
- }
- ]
+ codeFiles: ['display-only.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/watermark/image-composition-api.vue b/examples/sites/demos/pc/app/watermark/image-composition-api.vue
index bd35c89cc..8e9f39667 100644
--- a/examples/sites/demos/pc/app/watermark/image-composition-api.vue
+++ b/examples/sites/demos/pc/app/watermark/image-composition-api.vue
@@ -21,6 +21,7 @@ const params = reactive({
},
rotate: -22,
gap: [100, 100],
+ offset: [20, 20],
zIndex: 9,
customClass: 'test',
interlaced: true
diff --git a/examples/sites/demos/pc/app/watermark/image.vue b/examples/sites/demos/pc/app/watermark/image.vue
index 80b9a16f5..b08404189 100644
--- a/examples/sites/demos/pc/app/watermark/image.vue
+++ b/examples/sites/demos/pc/app/watermark/image.vue
@@ -26,6 +26,7 @@ export default {
},
rotate: -22,
gap: [100, 100],
+ offset: [20, 20],
zIndex: 9,
customClass: 'test',
interlaced: true
diff --git a/examples/sites/demos/pc/app/watermark/webdoc/watermark.js b/examples/sites/demos/pc/app/watermark/webdoc/watermark.js
index 4e292ddc8..97f6ef97b 100644
--- a/examples/sites/demos/pc/app/watermark/webdoc/watermark.js
+++ b/examples/sites/demos/pc/app/watermark/webdoc/watermark.js
@@ -9,148 +9,30 @@ export default {
},
demos: [
{
- 'demoId': 'basic',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN':
'通过 content
属性设置水印的文字。通过 font
属性设置水印的样式
。',
'en-US':
'Set the text of the watermark through the content
attribute. Set the style of the watermark through the font
attribute. '
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'image',
- 'name': { 'zh-CN': '图片水印', 'en-US': 'Basic Usage Image' },
- 'desc': {
+ demoId: 'image',
+ name: {
+ 'zh-CN': '图片水印',
+ 'en-US': 'Basic Usage Image'
+ },
+ desc: {
'zh-CN': '通过 image
属性设置水印的图片。
',
'en-US': 'Set the watermark image through the image
property. '
},
- 'codeFiles': ['image.vue']
- }
- ],
- apis: [
- {
- 'name': 'watermark',
- 'type': 'component',
- 'props': [
- {
- 'name': 'width',
- 'type': 'number',
- 'defaultValue': '120',
- 'desc': {
- 'zh-CN': '水印的宽度, 最小宽度120px',
- 'en-US': 'The width of the watermark, minimum width 120'
- },
- 'demoId': 'basic'
- },
- {
- 'name': 'height',
- 'type': 'number',
- 'defaultValue': '64',
- 'desc': {
- 'zh-CN': '水印的高度, 最小高度64px',
- 'en-US': 'The height of the watermark, minimum height 120'
- },
- 'demoId': 'basic'
- },
- {
- 'name': 'rotate',
- 'type': 'number',
- 'defaultValue': '-22',
- 'desc': {
- 'zh-CN': '水印绘制时,旋转的角度,单位 °',
- 'en-US': 'When the watermark is drawn, the rotation Angle, unit ° '
- },
- 'demoId': 'basic'
- },
- {
- 'name': 'zIndex',
- 'type': 'number',
- 'defaultValue': '9',
- 'desc': {
- 'zh-CN': "追加的水印元素的 'z-index' ",
- 'en-US': 'The z-index of the appended watermark element'
- },
- 'demoId': 'basic'
- },
- {
- 'name': 'image',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '图片源,建议导出 2 倍或 3 倍图,优先级高(支持 base64 格式),此属性高于 content ',
- 'en-US': 'Image source, it is recommended to export 2x or 3x image, high priority, higher content'
- },
- 'demoId': 'image'
- },
- {
- 'name': 'content',
- 'type': 'string',
- 'defaultValue': '',
- 'desc': {
- 'zh-CN': '水印文字内容,此属性低于 image',
- 'en-US': 'Watermark text content, lower image'
- },
- 'demoId': 'basic'
- },
- {
- 'name': 'font',
- 'type': 'Font',
- 'defaultValue': '',
- 'typeAnchorName': 'Font',
- 'desc': {
- 'zh-CN': `水印文字样式`,
- 'en-US': 'Text style'
- },
- 'demoId': 'basic'
- },
- {
- 'name': 'gap',
- 'type': 'array',
- 'defaultValue': '[100, 100]',
- 'desc': {
- 'zh-CN': '水印之间的间距',
- 'en-US': 'The spacing between watermarks'
- },
- 'demoId': 'basic'
- },
- {
- 'name': 'offset',
- 'type': 'array',
- 'defaultValue': '[20, 20] ',
- 'desc': {
- 'zh-CN': '水印距离容器左上角的偏移量',
- 'en-US': 'The offset of the watermark from the upper left corner of the container. '
- },
- 'demoId': 'basic'
- },
- {
- 'name': 'interlaced',
- 'type': 'boolean',
- 'defaultValue': 'true',
- 'desc': {
- 'zh-CN': '水印是否交错',
- 'en-US': 'Whether the watermark is interlaced'
- },
- 'demoId': 'basic'
- }
- ],
- 'events': [],
- 'slots': []
- }
- ],
- types: [
- {
- name: 'Font',
- type: 'type',
- code: `type Font = {
- color:string,
- fontSize:number,
- fontWeight:string,
- fontFamily:string,
- fontStyle:string
- }`
+ codeFiles: ['image.vue']
}
]
}
diff --git a/examples/sites/demos/pc/app/wizard/webdoc/wizard.js b/examples/sites/demos/pc/app/wizard/webdoc/wizard.js
index cefd9efce..9df40e429 100644
--- a/examples/sites/demos/pc/app/wizard/webdoc/wizard.js
+++ b/examples/sites/demos/pc/app/wizard/webdoc/wizard.js
@@ -3,215 +3,99 @@ export default {
owner: '',
demos: [
{
- 'demoId': 'basic-usage',
- 'name': { 'zh-CN': '基本用法', 'en-US': 'Basic Usage' },
- 'desc': {
+ demoId: 'basic-usage',
+ name: {
+ 'zh-CN': '基本用法',
+ 'en-US': 'Basic Usage'
+ },
+ desc: {
'zh-CN':
'通过 data
设置流程节点信息,如:设置节点名称和状态;node-click
监听节点点击事件。',
'en-US':
'Set process node information throughdata
, such as setting node name and status; node-click
Listen for node click events.'
},
- 'codeFiles': ['basic-usage.vue']
+ codeFiles: ['basic-usage.vue']
},
{
- 'demoId': 'page-guide',
- 'name': { 'zh-CN': '页向导模式', 'en-US': 'Page Wizard Mode' },
- 'desc': {
+ demoId: 'page-guide',
+ name: {
+ 'zh-CN': '页向导模式',
+ 'en-US': 'Page Wizard Mode'
+ },
+ desc: {
'zh-CN':
'通过 page-guide
设置页向导模式,包含流程图区域、页面展示区域、功能按钮区域,用于导航当前页面与上一页面、下一页面的前后关系。',
'en-US':
'Set the page wizard mode throughpage-guide
, including the flowchart area, page display area, and function button area, to navigate the relationship between the current page and the previous or next page.'
},
- 'codeFiles': ['page-guide.vue']
+ codeFiles: ['page-guide.vue']
},
{
- 'demoId': 'vertical',
- 'name': { 'zh-CN': '垂直模式', 'en-US': 'Vertical Mode' },
- 'desc': {
+ demoId: 'vertical',
+ name: {
+ 'zh-CN': '垂直模式',
+ 'en-US': 'Vertical Mode'
+ },
+ desc: {
'zh-CN':
'通过 vertical
设置垂直模式,竖向显示流程节点信息及节点间关系,节点信息包含节点名称、内容、状态、完成时间。',
'en-US':
'Set vertical mode throughvertical
to vertically display process node information and relationships between nodes. Node information includes node name, content, status, and completion time.'
},
- 'codeFiles': ['vertical.vue']
+ codeFiles: ['vertical.vue']
},
{
- 'demoId': 'time-line-flow',
- 'name': { 'zh-CN': '时间线', 'en-US': 'Timeline' },
- 'desc': {
+ demoId: 'time-line-flow',
+ name: {
+ 'zh-CN': '时间线',
+ 'en-US': 'Timeline'
+ },
+ desc: {
'zh-CN':
'通过 time-line-flow
设置时间线,以时间点的方式竖向显示流程节点处理信息,包含节点名称、状态、完成时间、用户信息。',
'en-US':
'Set a timeline throughtime-line-flow
to vertically display process node processing information in a time point manner, including node name, status, completion time, and user information.'
},
- 'codeFiles': ['time-line-flow.vue']
+ codeFiles: ['time-line-flow.vue']
},
{
- 'demoId': 'slot-base',
- 'name': { 'zh-CN': '基本插槽', 'en-US': 'Basic slot' },
- 'desc': {
+ demoId: 'slot-base',
+ name: {
+ 'zh-CN': '基本插槽',
+ 'en-US': 'Basic slot'
+ },
+ desc: {
'zh-CN': '通过 base
作用域插槽自定义节点的名称。',
'en-US': 'Customize the name of the node through thebase
scope slot.'
},
- 'codeFiles': ['slot-base.vue']
+ codeFiles: ['slot-base.vue']
},
{
- 'demoId': 'slot-step-button',
- 'name': { 'zh-CN': '步骤插槽', 'en-US': 'Step Slot' },
- 'desc': {
+ demoId: 'slot-step-button',
+ name: {
+ 'zh-CN': '步骤插槽',
+ 'en-US': 'Step Slot'
+ },
+ desc: {
'zh-CN': '通过 stepbutton
插槽自定义页向导模式的步骤按钮和内容。',
'en-US':
'Customize the step buttons and content of the page wizard mode through thestepbutton
slot.'
},
- 'codeFiles': ['slot-step-button.vue']
+ codeFiles: ['slot-step-button.vue']
},
{
- 'demoId': 'btn-events',
- 'name': { 'zh-CN': '按钮事件', 'en-US': 'Button Event' },
- 'desc': {
- 'zh-CN': `页向导模式下:通过 btn-prev
监听“上一步”按钮点击事件;
- btn-next
监听“下一步”按钮点击事件;
- btn-save
监听“保存”按钮点击事件;
- btn-submit
监听“提交”按钮点击事件,流程需要走到最后一步才会显示此按钮。
`,
- 'en-US': `In page wizard mode: listen for the "Previous" button click event throughbtn-prev
- btn-next
Listen for the "Next" button click event
- btn-save
Listen for the "save" button click event
- btn-submit
Listen for the "submit" button click event, and the process needs to go to the last step to display this button
.`
+ demoId: 'btn-events',
+ name: {
+ 'zh-CN': '按钮事件',
+ 'en-US': 'Button Event'
},
- 'codeFiles': ['btn-events.vue']
- }
- ],
- apis: [
- {
- 'name': 'wizard',
- 'type': 'component',
- 'props': [
- {
- 'name': 'data',
- 'type': 'IDataItem[]',
- 'typeAnchorName': 'IDataItem',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '设置节点数据', 'en-US': 'Setting Node Data' },
- 'demoId': 'basic-usage'
- },
- {
- 'name': 'page-guide',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': {
- 'zh-CN': '设置页向导模式',
- 'en-US': 'Set Page Wizard Mode'
- },
- 'demoId': 'page-guide'
- },
- {
- 'name': 'time-line-flow',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '设置时间线', 'en-US': 'Set timeline' },
- 'demoId': 'time-line-flow'
- },
- {
- 'name': 'vertical',
- 'type': 'boolean',
- 'defaultValue': 'false',
- 'desc': { 'zh-CN': '设置为垂直模式', 'en-US': 'Set to vertical mode' },
- 'demoId': 'vertical'
- }
- ],
- 'events': [
- {
- 'name': 'btn-next',
- 'type': '(datas: IDataItem[]) => void',
- 'typeAnchorName': 'IDataItem',
- 'desc': {
- 'zh-CN': '页向导模式下,点击“下一步”按钮触发的回调事件',
- 'en-US': 'Callback event triggered by clicking the "Next" button in page wizard mode'
- },
- 'demoId': 'btn-events'
- },
- {
- 'name': 'btn-prev',
- 'type': '(datas: IDataItem[]) => void',
- 'typeAnchorName': 'IDataItem',
- 'desc': {
- 'zh-CN': '页向导模式下,点击“上一步”按钮触发的回调事件',
- 'en-US': 'Callback event triggered by clicking the "Previous" button in page wizard mode'
- },
- 'demoId': 'btn-events'
- },
- {
- 'name': 'btn-save',
- 'type': '(datas: IDataItem[]) => void',
- 'typeAnchorName': 'IDataItem',
- 'desc': {
- 'zh-CN': '页向导模式下,点击“保存”按钮触发的回调事件',
- 'en-US': 'Callback event triggered by clicking the "Save" button in page wizard mode'
- },
- 'demoId': 'btn-events'
- },
- {
- 'name': 'btn-submit',
- 'type': '(datas: IDataItem[]) => void',
- 'typeAnchorName': 'IDataItem',
- 'desc': {
- 'zh-CN': '页向导模式下,点击“下一步”导致最后一个节点的状态为 "doing" 时,点击“提交”按钮触发的回调事件',
- 'en-US':
- 'In page wizard mode, when clicking "Next" causes the status of the last node to be "doing", the callback event triggered by clicking the "Submit" button'
- },
- 'demoId': 'btn-events'
- },
- {
- 'name': 'node-click',
- 'type': '(node: IDataItem, index: number, event: Event) => void',
- 'typeAnchorName': 'IDataItem',
- 'desc': {
- 'zh-CN': '节点点击事件',
- 'en-US': 'Node click event'
- },
- 'demoId': 'basic-usage'
- }
- ],
- 'slots': [
- {
- 'name': 'base',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '基本插槽', 'en-US': 'Basic Slot' },
- 'demoId': 'slot-base'
- },
- {
- 'name': 'stepbutton',
- 'type': '',
- 'defaultValue': '',
- 'desc': { 'zh-CN': '页向导模式按钮插槽', 'en-US': 'Page Wizard Mode Button Slot' },
- 'demoId': 'slot-step-button'
- }
- ]
- }
- ],
- types: [
- {
- name: 'IDataItem',
- type: 'interface',
- code: `
-interface IDataItem {
- name: string
- status: string
- showNode?: boolean
- content?: string
- imgUrl?: string
- users?: string
- userName?: string
- roleNumber?: string
- date?: string
- values?: IDataItemValuesItem[]
-}
-
-interface IDataItemValuesItem {
- text: string
- value: string
-}`
+ desc: {
+ 'zh-CN':
+ '页向导模式下:通过 btn-prev
监听“上一步”按钮点击事件;
\n btn-next
监听“下一步”按钮点击事件;
\n btn-save
监听“保存”按钮点击事件;
\n btn-submit
监听“提交”按钮点击事件,流程需要走到最后一步才会显示此按钮。
',
+ 'en-US':
+ 'In page wizard mode: listen for the "Previous" button click event throughbtn-prev
\n btn-next
Listen for the "Next" button click event
\n btn-save
Listen for the "save" button click event
\n btn-submit
Listen for the "submit" button click event, and the process needs to go to the last step to display this button
.'
+ },
+ codeFiles: ['btn-events.vue']
}
]
}
diff --git a/examples/sites/demos/pc/menus.js b/examples/sites/demos/pc/menus.js
index f3ab8ae3b..33dc05d24 100644
--- a/examples/sites/demos/pc/menus.js
+++ b/examples/sites/demos/pc/menus.js
@@ -119,7 +119,8 @@ export const cmpMenus = [
{ 'nameCn': '时间选择器', 'name': 'TimePicker', 'key': 'time-picker' },
{ 'nameCn': '时间选择', 'name': 'TimeSelect', 'key': 'time-select' },
{ 'nameCn': '颜色选择器', 'name': 'ColorPicker', 'key': 'color-picker' },
- { 'nameCn': '颜色选择面板', 'name': 'ColorSelectPanel', 'key': 'color-select-panel' }
+ { 'nameCn': '颜色选择面板', 'name': 'ColorSelectPanel', 'key': 'color-select-panel' },
+ { 'nameCn': '查询生成器', 'name': 'QueryBuilder ', 'key': 'query-builder' }
]
},
{
@@ -298,8 +299,11 @@ export const cmpMenus = [
]
}
]
+
+const showBusiness = location.pathname.split('/')?.[2] === 'all'
+
// 对内文档开放业务组件
-if (!isOpen) {
+if (!isOpen || showBusiness) {
cmpMenus.splice(8, 0, {
'label': '业务组件',
'labelEn': 'Business Components',
diff --git a/examples/sites/demos/pc/overviewimage/calendar-view.svg b/examples/sites/demos/pc/overviewimage/calendar-view.svg
new file mode 100644
index 000000000..77060ae0f
--- /dev/null
+++ b/examples/sites/demos/pc/overviewimage/calendar-view.svg
@@ -0,0 +1,71 @@
+
+
\ No newline at end of file
diff --git a/examples/sites/demos/pc/overviewimage/color-picker.svg b/examples/sites/demos/pc/overviewimage/color-picker.svg
new file mode 100644
index 000000000..133a57c79
--- /dev/null
+++ b/examples/sites/demos/pc/overviewimage/color-picker.svg
@@ -0,0 +1,117 @@
+
+
\ No newline at end of file
diff --git a/examples/sites/demos/pc/overviewimage/color-select-panel.svg b/examples/sites/demos/pc/overviewimage/color-select-panel.svg
new file mode 100644
index 000000000..93a195b49
--- /dev/null
+++ b/examples/sites/demos/pc/overviewimage/color-select-panel.svg
@@ -0,0 +1,132 @@
+
+
\ No newline at end of file
diff --git a/examples/sites/demos/pc/overviewimage/divider.svg b/examples/sites/demos/pc/overviewimage/divider.svg
new file mode 100644
index 000000000..33a9cbb7d
--- /dev/null
+++ b/examples/sites/demos/pc/overviewimage/divider.svg
@@ -0,0 +1,79 @@
+
+
\ No newline at end of file
diff --git a/examples/sites/demos/pc/overviewimage/flowchart.svg b/examples/sites/demos/pc/overviewimage/flowchart.svg
new file mode 100644
index 000000000..7c7152e17
--- /dev/null
+++ b/examples/sites/demos/pc/overviewimage/flowchart.svg
@@ -0,0 +1,164 @@
+
+
\ No newline at end of file
diff --git a/examples/sites/demos/pc/overviewimage/qr-code.svg b/examples/sites/demos/pc/overviewimage/qr-code.svg
new file mode 100644
index 000000000..2f50224fc
--- /dev/null
+++ b/examples/sites/demos/pc/overviewimage/qr-code.svg
@@ -0,0 +1,113 @@
+
+
\ No newline at end of file
diff --git a/examples/sites/demos/pc/overviewimage/rich-text-editor.svg b/examples/sites/demos/pc/overviewimage/rich-text-editor.svg
new file mode 100644
index 000000000..986df3e6d
--- /dev/null
+++ b/examples/sites/demos/pc/overviewimage/rich-text-editor.svg
@@ -0,0 +1,72 @@
+
+
\ No newline at end of file
diff --git a/examples/sites/demos/pc/overviewimage/watermark.svg b/examples/sites/demos/pc/overviewimage/watermark.svg
new file mode 100644
index 000000000..d1661a83d
--- /dev/null
+++ b/examples/sites/demos/pc/overviewimage/watermark.svg
@@ -0,0 +1,70 @@
+
+
\ No newline at end of file
diff --git a/examples/sites/demos/pc/webdoc/theme-en.md b/examples/sites/demos/pc/webdoc/theme-en.md
index c72f6044d..b0742fbd7 100644
--- a/examples/sites/demos/pc/webdoc/theme-en.md
+++ b/examples/sites/demos/pc/webdoc/theme-en.md
@@ -48,20 +48,20 @@ resolve: {
#### The specific usage of theme initialization and dynamic theme switching is shown below, and the following code is added to the main.ts file.
```js
-import TinyThemeTool from' @opentiny/vue-theme/theme-tool.js'
+import TinyThemeTool from ' @opentiny/vue-theme/theme-tool.js'
// Infinite theme
-import {tinyInfinityTheme} from'@opentiny/vue-theme/theme'
+import { tinyInfinityTheme } from '@opentiny/vue-theme/theme'
// Initialize the infinite theme.
-const theme = new TinyThemeTool(tinyInfinityTheme,'tinyStyleSheetId')
+const theme = new TinyThemeTool(tinyInfinityTheme, 'tinyStyleSheetId')
// Customize the theme data format.
const tinyTestTheme = {
-id: 'tiny-test-theme', // Unique ID of a topic. Each topic must be unique.
-name: 'testTheme', // English name of the theme
-cnName:'Test Topic', // Chinese name of the topic
-data: {'ti-base-color':'#f2f2f3'} // Subject data
+ id: 'tiny-test-theme', // Unique ID of a topic. Each topic must be unique.
+ name: 'testTheme', // English name of the theme
+ cnName: 'Test Topic', // Chinese name of the topic
+ data: { 'ti-base-color': '#f2f2f3' } // Subject data
}
// Dynamic theme switching
diff --git a/examples/sites/demos/saas/menus.js b/examples/sites/demos/saas/menus.js
index 1295817ff..e9e7fa25c 100644
--- a/examples/sites/demos/saas/menus.js
+++ b/examples/sites/demos/saas/menus.js
@@ -2,10 +2,37 @@
import { docMenus, cmpMenus as pcCmpMenus } from '../pc/menus'
import { cmpMenus as mfCmpMenus } from '../mobile-first/menus'
+const noSaasComponents = [
+ 'ActionMenu',
+ 'Anchor',
+ 'ColorPicker',
+ 'ColorSelectPanel',
+ 'ConfigProvider',
+ 'CreditCard',
+ 'CreditCardForm',
+ 'DatePickerMobileFirst',
+ 'Divider',
+ 'IndexBar',
+ 'IndexBarAnchor',
+ 'Label',
+ 'Mask',
+ 'MindMap',
+ 'MultiSelect',
+ 'MultiSelectItem',
+ 'QrCode',
+ 'RichTextEditor',
+ 'TimelineItem',
+ 'Toast',
+ 'TopBox',
+ 'Watermark',
+ 'Wheel',
+ 'Skeleton'
+]
+
// mobile-first上所有分类,pc上都有,因此可以用pc端menu分类进行合并
const cmpMenus = pcCmpMenus.map((pcMenusitem) => {
const mfMenusItem = mfCmpMenus.find((i) => i.key === pcMenusitem.key)
- pcMenusitem.children = pcMenusitem.children.map((i) => ({ ...i, mode: ['saas'] }))
+ pcMenusitem.children = pcMenusitem.children.map((i) => ({ ...i, mode: ['pc'] }))
if (mfMenusItem?.children) {
mfMenusItem.children.forEach((mfMenusChild) => {
const matchChild = pcMenusitem.children.find((pcMenusChild) => pcMenusChild.key === mfMenusChild.key)
@@ -16,6 +43,7 @@ const cmpMenus = pcCmpMenus.map((pcMenusitem) => {
}
})
}
+ pcMenusitem.children = pcMenusitem.children.filter((item) => !noSaasComponents.includes(item.name))
return pcMenusitem
})
diff --git a/examples/sites/env/.env.saas b/examples/sites/env/.env.saas
index f6becd177..5dbb3d4df 100644
--- a/examples/sites/env/.env.saas
+++ b/examples/sites/env/.env.saas
@@ -1,6 +1,6 @@
# 1、声明一个变量
VITE_CONTEXT=/tiny-vue/
-VITE_BUILD_TARGET='inner'
+VITE_BUILD_TARGET='open'
VITE_TINY_THEME='saas'
# 官网应用类型:pc / mobile / mobile-first
VITE_APP_MODE='pc'
diff --git a/examples/sites/package.json b/examples/sites/package.json
index dceaffae6..5e31bd326 100644
--- a/examples/sites/package.json
+++ b/examples/sites/package.json
@@ -1,6 +1,6 @@
{
"name": "@opentiny/vue-docs",
- "version": "2.2.10",
+ "version": "2.2.13",
"license": "MIT",
"scripts": {
"start": "vite",
@@ -25,6 +25,7 @@
"@opentiny/vue-icon-saas": "workspace:~",
"@opentiny/vue-design-aurora": "workspace:~",
"@opentiny/vue-design-smb": "workspace:~",
+ "@opentiny/vue-design-saas": "workspace:~",
"@opentiny/vue-theme": "workspace:~",
"@opentiny/vue-theme-mobile": "workspace:~",
"@opentiny/vue-vite-import": "workspace:~",
diff --git a/examples/sites/playground/App.vue b/examples/sites/playground/App.vue
index b5e90d0aa..7f7c8e8a0 100644
--- a/examples/sites/playground/App.vue
+++ b/examples/sites/playground/App.vue
@@ -21,15 +21,35 @@ const VERSION = 'tiny-vue-version-3.13'
const LAYOUT = 'playground-layout'
const LAYOUT_REVERSE = 'playground-layout-reverse'
-const versions = ['3.13', '3.12', '3.11', '3.10', '3.9', '3.8']
-const latestVersion = localStorage.getItem(VERSION) || versions[0]
-const cdnHost = localStorage.getItem('setting-cdn')
-const getRuntime = (version) => `${cdnHost}/@opentiny/vue@${version}/runtime/`
-
const searchObj = new URLSearchParams(location.search)
const tinyMode = searchObj.get('mode')
-const tinyTheme = tinyMode === 'saas' ? 'aurora' : searchObj.get('theme')
+const tinyTheme = searchObj.get('theme')
const isMobileFirst = tinyMode === 'mobile-first'
+const isSaas = tinyTheme === 'saas'
+const isPreview = searchObj.get('openMode') === 'preview' // 是否多端弹窗预览
+
+const versions = ['3.13', '3.12', '3.11', '3.10', '3.9', '3.8']
+const latestVersion = isPreview ? versions[0] : localStorage.getItem(VERSION) || versions[0]
+const cdnHost = localStorage.getItem('setting-cdn')
+const getRuntime = (version) => {
+ if (isSaas) {
+ return import.meta.env.VITE_APP_BUILD_BASE_URL
+ }
+ return `${cdnHost}/@opentiny/vue@${version}/runtime/`
+}
+
+const changeImportSuffix = (imports, verison) => {
+ const newImports = {}
+ Object.keys(imports).forEach((key) => {
+ const url = imports[key]
+ if (url.startsWith(getRuntime(verison))) {
+ newImports[key] = url.replace('.mjs', '.js')
+ } else {
+ newImports[key] = url
+ }
+ })
+ return newImports
+}
const createImportMap = (version) => {
const imports = {
@@ -42,14 +62,15 @@ const createImportMap = (version) => {
'@opentiny/vue-renderless/': `${cdnHost}/@opentiny/vue-renderless@${version}/`,
'sortablejs': `${cdnHost}/sortablejs@1.15.0/modular/sortable.esm.js`
}
- if (['aurora', 'smb'].includes(tinyTheme)) {
+ if (['aurora', 'smb', 'saas'].includes(tinyTheme)) {
imports[`@opentiny/vue-design-${tinyTheme}`] = `${cdnHost}/@opentiny/vue-design-${tinyTheme}@${version}/index.js`
}
- if (isMobileFirst) {
+ if (isSaas) {
imports['@opentiny/vue-icon'] = `${getRuntime(version)}tiny-vue-icon-saas.mjs`
+ imports[`@opentiny/vue-design-saas`] = `${getRuntime(version)}tiny-vue-design-saas.js`
}
return {
- imports
+ imports: changeImportSuffix(imports, version)
}
}
@@ -57,7 +78,10 @@ const getTinyTheme = (version) => {
if (isMobileFirst) {
return `${getRuntime(version)}tailwind.css`
}
- let theme = tinyMode === 'saas' ? 'saas' : tinyTheme
+ if (isSaas) {
+ return `${getRuntime(version)}index.css`
+ }
+ let theme = tinyTheme
if (!['smb', 'default', 'aurora', 'saas'].includes(theme)) {
theme = 'default'
}
@@ -113,8 +137,8 @@ function setTinyDesign() {
if (isMobileFirst) {
useCode += 'app.provide("TinyMode", "mobile-first");\n'
}
- // 目前只有aurora和smb有design包
- if (['aurora', 'smb'].includes(tinyTheme)) {
+
+ if (['aurora', 'smb', 'saas'].includes(tinyTheme)) {
importCode += `import designConfig from '@opentiny/vue-design-${tinyTheme}';
import { design } from '@opentiny/vue-common';\n`
useCode += 'app.provide(design.configKey, designConfig);\n'
@@ -263,7 +287,7 @@ function share() {
OpenTiny Vue 版本:
-
+
diff --git a/examples/sites/src/router.js b/examples/sites/src/router.js
index a3ca3fbf6..1e7d3660a 100644
--- a/examples/sites/src/router.js
+++ b/examples/sites/src/router.js
@@ -12,20 +12,23 @@ const context = import.meta.env.VITE_CONTEXT
let routes = [
// 组件总览
{
- path: `${context}:lang/overview`,
+ path: `${context}:all?/:lang/overview`,
component: Layout,
+ name: 'overview',
children: [{ name: 'Overview', path: '', component: Overview, meta: { title: '组件总览 | TinyVue' } }]
},
// 文档
{
- path: `${context}:lang/:theme/docs/:docId`,
+ path: `${context}:all?/:lang/:theme/docs/:docId`,
component: Layout,
+ name: 'docs',
children: [{ name: 'Docs', path: '', component: Docs }]
},
// 组件
{
- path: `${context}:lang/:theme/components/:cmpId`,
+ path: `${context}:all?/:lang/:theme/components/:cmpId`,
component: Layout,
+ name: 'components',
children: [{ name: 'Components', path: '', component: Components }]
},
// 未匹配到目标地址时,进行路由重定向
diff --git a/examples/sites/src/tools/useTheme.js b/examples/sites/src/tools/useTheme.js
index 7ab04f346..0fd914235 100644
--- a/examples/sites/src/tools/useTheme.js
+++ b/examples/sites/src/tools/useTheme.js
@@ -5,6 +5,7 @@ import { hooks } from '@opentiny/vue-common'
import { Notify } from '@opentiny/vue'
import designSmbConfig from '@opentiny/vue-design-smb'
import designAuroraConfig from '@opentiny/vue-design-aurora'
+import designSaasConfig from '@opentiny/vue-design-saas'
import { appData } from './appData'
const CURRENT_THEME_KEY = 'tiny-current-theme'
@@ -41,6 +42,9 @@ const theme = new TinyThemeTool()
const lastThemeKey = localStorage.getItem(CURRENT_THEME_KEY)
const currThemeLabel = hooks.ref(lastThemeKey || 'tiny-default-theme')
const designConfig = computed(() => {
+ if (import.meta.env.VITE_TINY_THEME === 'saas') {
+ return designSaasConfig
+ }
return designConfigMap[currThemeLabel.value]
})
diff --git a/examples/sites/src/views/components/components.vue b/examples/sites/src/views/components/components.vue
index 485205a54..85481af11 100644
--- a/examples/sites/src/views/components/components.vue
+++ b/examples/sites/src/views/components/components.vue
@@ -270,7 +270,8 @@ export default defineComponent({
// 将请求合并起来,这样页面更新一次,页面刷新的时机就固定了
const promiseArr = [
fetchDemosFile(`${staticPath.value}/${getWebdocPath(state.cmpId)}/webdoc/${state.cmpId}.${lang}.md`),
- fetchDemosFile(`${staticPath.value}/${getWebdocPath(state.cmpId)}/webdoc/${state.cmpId}.js`)
+ fetchDemosFile(`${staticPath.value}/${getWebdocPath(state.cmpId)}/webdoc/${state.cmpId}.js`),
+ fetchDemosFile(`@demos/apis/${getWebdocPath(state.cmpId)}.js`)
]
if (faqMdConfig[state.cmpId]) {
promiseArr.push(
@@ -278,7 +279,7 @@ export default defineComponent({
)
}
- Promise.all(promiseArr).then(([mdData, jsData, faqData]) => {
+ Promise.all(promiseArr).then(([mdData, jsData, apiData, faqData]) => {
// 1、加载顶部md
state.cmpTopMd = marked(mdData)
@@ -295,6 +296,27 @@ export default defineComponent({
demos: $clone(json.demos || []), // 克隆一下,避免保存上次的isOpen
column: json.column || '1' // columns可能为空
}
+
+ if (apiData) {
+ // eslint-disable-next-line no-eval
+ const apiJson = eval('(' + apiData.slice(15) + ')')
+ // pc、mobile、mobile-first三种模式
+ const demoMode = templateModeState.isSaas ? templateModeState.mode : import.meta.env.VITE_APP_MODE
+ const demoKey = demoMode === 'mobile-first' ? 'mfDemo' : `${demoMode}Demo`
+ state.currJson.apis = apiJson.apis.map((item) => {
+ Object.keys(item).forEach((key) => {
+ const apiItem = item[key]
+ if (Array.isArray(apiItem)) {
+ item[key] = apiItem
+ .filter((i) => !i.mode || i.mode.includes(demoMode))
+ .map((filterItem) => ({ ...filterItem, demoId: filterItem[demoKey] }))
+ }
+ })
+ return item
+ })
+ state.currJson.types = apiJson.types
+ }
+
if (state.cmpId?.startsWith('grid-')) {
fetchDemosFile(`${staticDemoPath}/grid/webdoc/grid.js`).then((data) => {
// eslint-disable-next-line no-eval
diff --git a/examples/sites/src/views/components/demo.vue b/examples/sites/src/views/components/demo.vue
index 7e43562ce..697421976 100644
--- a/examples/sites/src/views/components/demo.vue
+++ b/examples/sites/src/views/components/demo.vue
@@ -179,10 +179,12 @@ export default defineComponent({
},
openPlayground(demo, open = true) {
const cmpId = router.currentRoute.value.params.cmpId
- const tinyTheme = currThemeLabel.value.split('-')[1]
- const url = `${import.meta.env.VITE_PLAYGROUND_URL}?cmpId=${cmpId}&fileName=${demo.codeFiles[0]}&apiMode=${
- apiModeState.apiMode
- }&mode=${templateModeState.mode}&theme=${tinyTheme}`
+ const tinyTheme = templateModeState.isSaas ? 'saas' : currThemeLabel.value.split('-')[1]
+ const openModeQuery = open ? '' : '&openMode=preview'
+ // TODO: 目前mf只有Options写法,后续再放开compositon
+ const url = `${import.meta.env.VITE_PLAYGROUND_URL}?cmpId=${cmpId}&fileName=${
+ demo.codeFiles[0]
+ }&apiMode=Options&mode=${templateModeState.mode}&theme=${tinyTheme}${openModeQuery}`
if (open) {
window.open(url)
diff --git a/examples/sites/src/views/layout/layout.vue b/examples/sites/src/views/layout/layout.vue
index 31521a8c3..3c39e587e 100644
--- a/examples/sites/src/views/layout/layout.vue
+++ b/examples/sites/src/views/layout/layout.vue
@@ -27,7 +27,7 @@
-
+
@@ -81,7 +81,7 @@
>
- 多端
+ 多端
{{ data.label }}
{{ data.mark.text }}
@@ -104,6 +104,7 @@
diff --git a/packages/vue/src/amount/index.ts b/packages/vue/src/amount/index.ts
index 5c2d08a80..9a68f062e 100644
--- a/packages/vue/src/amount/index.ts
+++ b/packages/vue/src/amount/index.ts
@@ -1,4 +1,4 @@
-import Amount from './src/pc.vue'
+import Amount from './src/index'
import '@opentiny/vue-theme/amount/index.less'
import { version } from './package.json'
diff --git a/packages/vue/src/amount/package.json b/packages/vue/src/amount/package.json
index ca17f2242..b4ff18e81 100644
--- a/packages/vue/src/amount/package.json
+++ b/packages/vue/src/amount/package.json
@@ -18,11 +18,16 @@
"@opentiny/vue-renderless": "workspace:~",
"@opentiny/vue-common": "workspace:~",
"@opentiny/vue-date-picker": "workspace:~",
+ "@opentiny/vue-date-picker-mobile-first": "workspace:~",
"@opentiny/vue-currency": "workspace:~",
"@opentiny/vue-button": "workspace:~",
"@opentiny/vue-input": "workspace:~",
"@opentiny/vue-popover": "workspace:~",
- "@opentiny/vue-icon": "workspace:~"
+ "@opentiny/vue-icon": "workspace:~",
+ "@opentiny/vue-filter-box": "workspace:~",
+ "@opentiny/vue-radio": "workspace:~",
+ "@opentiny/vue-radio-group": "workspace:~",
+ "@opentiny/vue-action-sheet": "workspace:~"
},
"license": "MIT"
-}
+}
\ No newline at end of file
diff --git a/packages/vue/src/amount/src/index.ts b/packages/vue/src/amount/src/index.ts
index 7d3d65c74..7022fe146 100644
--- a/packages/vue/src/amount/src/index.ts
+++ b/packages/vue/src/amount/src/index.ts
@@ -1,8 +1,25 @@
import { $props, $prefix, $setup, defineComponent } from '@opentiny/vue-common'
-import template from 'virtual-template?pc'
+import template from 'virtual-template?pc|mobile-first'
+
+const $constants = {
+ FILTER_OPTION: [
+ 'ui.amount.equalTo',
+ 'ui.amount.notEqualTo',
+ 'ui.amount.moreThan',
+ 'ui.amount.moreThanOrEqualTo',
+ 'ui.amount.lessThan',
+ 'ui.amount.lessThanOrEqualTo',
+ 'ui.amount.empty',
+ 'ui.amount.nonEmpty'
+ ]
+}
export const amountProps = {
...$props,
+ _constants: {
+ type: Object,
+ default: () => $constants
+ },
modelValue: {
type: [Number, String]
},
@@ -25,6 +42,10 @@ export const amountProps = {
type: Number,
default: 2
},
+ stringMode: {
+ type: Boolean,
+ default: false
+ },
rounding: {
type: Boolean,
default: true
@@ -73,11 +94,42 @@ export const amountProps = {
hideCurrency: {
type: Boolean,
default: false
+ },
+ displayOnly: {
+ type: Boolean,
+ default: false
+ },
+ hideIcon: {
+ type: Boolean,
+ default: false
+ },
+ numAllowEmpty: {
+ type: Boolean,
+ default: false
+ },
+ label: {
+ type: String,
+ default: ''
+ },
+ tip: String,
+ shape: String,
+ clearable: {
+ type: Boolean,
+ default: false
+ },
+ filter: {
+ type: Boolean,
+ default: false
+ },
+ blank: {
+ type: Boolean,
+ default: false
}
}
export default defineComponent({
name: $prefix + 'Amount',
+ componentName: 'Amount',
props: amountProps,
setup(props, context) {
return $setup({ props, context, template })
diff --git a/packages/vue/src/amount/src/mobile-first.vue b/packages/vue/src/amount/src/mobile-first.vue
new file mode 100644
index 000000000..3553fec19
--- /dev/null
+++ b/packages/vue/src/amount/src/mobile-first.vue
@@ -0,0 +1,311 @@
+
+
+
+ closeDetailEidtor(!event && state.editorPhase === 'selection')"
+ @click="openDetailEditor"
+ @close="toggleVisible"
+ >
+ closeDetailEidtor(!event && state.editorPhase === 'currency')"
+ >
+ closeDetailEidtor(!event && state.editorPhase === 'date')"
+ v-if="date || dateAllowEmpty"
+ >
+
+
+
+
+
+
+
+
+ {{ state.currency }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t(item) }}
+
+
+
+
+ {{ t('ui.amount.currency') }}
+
+
+
+ {{ t('ui.amount.date') }}
+
+
+
+ {{ t('ui.amount.amount') }}
+
+
+
+ {{ t('ui.base.confirm') }}
+
+
+
+
+
+
+ {{ state.currency }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/vue/src/amount/src/pc.vue b/packages/vue/src/amount/src/pc.vue
index d4f77d0a3..8b31d3315 100644
--- a/packages/vue/src/amount/src/pc.vue
+++ b/packages/vue/src/amount/src/pc.vue
@@ -1,18 +1,37 @@
-
+
+
+
-