diff --git a/docs/component/fab.md b/docs/component/fab.md index 554b815c..b3a921d5 100644 --- a/docs/component/fab.md +++ b/docs/component/fab.md @@ -2,8 +2,6 @@ 悬浮动作按钮组件,按下可显示一组动作按钮。 - - :::warning 因为`uni-app`组件无法监听点击自己以外的地方,为了在点击页面其他地方时,可以自动关闭 `fab` ,建议使用组件库的 `useQueue` hook(会关闭所有 dropmenu、popover、toast、swipeAction、fab),在页面的根元素上监听点击事件的冒泡。 @@ -36,14 +34,9 @@ import { useToast } from '@/uni_modules/wot-design-uni' const { show: showToast } = useToast() const type = ref<'primary' | 'success' | 'info' | 'warning' | 'error' | 'default'>('primary') -const position = ref<'left-top' - | 'right-top' - | 'left-bottom' - | 'right-bottom' - | 'left-center' - | 'right-center' - | 'top-center' - | 'bottom-center'>('left-bottom') +const position = ref<'left-top' | 'right-top' | 'left-bottom' | 'right-bottom' | 'left-center' | 'right-center' | 'top-center' | 'bottom-center'>( + 'left-bottom' +) const direction = ref<'top' | 'right' | 'bottom' | 'left'>('top') const disabled = ref(false) ``` @@ -90,7 +83,6 @@ const active = ref(false) 通过`trigger`插槽自定义触发器,`expandable`控制点击触发器是否展开/收起动作按钮菜单。 - ```html ``` + ```ts const handleClick = () => { console.log('点击了') } - ``` ## Attributes -| 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 | -| -------------- | ----------------------------------------------------- | ------------ |-------------------------------------------------------------------------------------------------------------------------------------------| ---------------------------------------------- | ---------------- | -| v-model:active | 是否激活 | boolean | - | false | 0.1.57 | -| type | 类型 | FabType | 'primary' | 'success' | 'info' | 'warning' | 'error' | 'default' | 'primary' | 0.1.57 | -| position | 悬浮按钮位置 | FabPosition | 'left-top' | 'right-top' | 'left-bottom' | 'right-bottom' | left-center | right-center | top-center | bottom-center | 'right-bottom' | 0.1.57 | -| draggable | 按钮能否拖动 | boolean | | false | 1.2.19 | -| direction | 悬浮按钮菜单弹出方向 | FabDirection | 'top' | 'right' | 'bottom' | 'left' | 'top' | 0.1.57 | -| disabled | 是否禁用 | boolean | - | false | 0.1.57 | -| inactiveIcon | 悬浮按钮未展开时的图标 | string | - | 'add' | 0.1.57 | -| activeIcon | 悬浮按钮展开时的图标 | string | - | 'close' | 0.1.57 | -| zIndex | 自定义悬浮按钮层级 | number | - | 99 | 0.1.57 | -| gap | 自定义悬浮按钮与可视区域边缘的间距 | FabGap | - | \{ top: 16, left: 16, right: 16, bottom: 16 \} | 1.2.26 | -| customStyle | 自定义样式 | string | - | '' | 0.1.57 | -| expandable | 用于控制点击时是否展开菜单,设置为 false 时触发 click | boolean | - | true | 1.3.11 | +| 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 | +| -------------- | ----------------------------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------- | -------- | +| v-model:active | 是否激活 | boolean | - | false | 0.1.57 | +| type | 类型 | FabType | 'primary' | 'success' | 'info' | 'warning' | 'error' | 'default' | 'primary' | 0.1.57 | +| position | 悬浮按钮位置 | FabPosition | 'left-top' | 'right-top' | 'left-bottom' | 'right-bottom' | left-center | right-center | top-center | bottom-center | 'right-bottom' | 0.1.57 | +| draggable | 按钮能否拖动 | boolean | | false | 1.2.19 | +| direction | 悬浮按钮菜单弹出方向 | FabDirection | 'top' | 'right' | 'bottom' | 'left' | 'top' | 0.1.57 | +| disabled | 是否禁用 | boolean | - | false | 0.1.57 | +| inactiveIcon | 悬浮按钮未展开时的图标 | string | - | 'add' | 0.1.57 | +| activeIcon | 悬浮按钮展开时的图标 | string | - | 'close' | 0.1.57 | +| zIndex | 自定义悬浮按钮层级 | number | - | 99 | 0.1.57 | +| gap | 自定义悬浮按钮与可视区域边缘的间距 | FabGap | - | \{ top: 16, left: 16, right: 16, bottom: 16 \} | 1.2.26 | +| custom-style | 自定义样式 | string | - | '' | 0.1.57 | +| expandable | 用于控制点击时是否展开菜单,设置为 false 时触发 click | boolean | - | true | 1.3.11 | ## Events -| 事件名称 | 说明 | 参数 | 最低版本 | -| -------- | -------------------------------------------- | ---- | ---------------- | -| click | expandable 设置为 false 时,点击悬浮按钮触发 | — | 1.3.11 | +| 事件名称 | 说明 | 参数 | 最低版本 | +| -------- | -------------------------------------------- | ---- | -------- | +| click | expandable 设置为 false 时,点击悬浮按钮触发 | — | 1.3.11 | + +## Methods + +| 方法名 | 说明 | 参数 | 最低版本 | +| ------ | -------- | ---- | -------- | +| open | 展开菜单 | - | 0.1.57 | +| close | 收起菜单 | - | 0.1.57 | ## Slot -| name | 说明 | 最低版本 | -| ------- | -------------------------------------------------------------- | ---------------- | -| trigger | 触发器插槽,用于自定义点击按钮,使用此插槽时组件不会抛出 click | 1.3.11 | +| name | 说明 | 最低版本 | +| ------- | -------------------------------------------------------------- | -------- | +| default | 动作按钮,通常放置多个按钮 | 0.1.57 | +| trigger | 触发器插槽,用于自定义点击按钮,使用此插槽时组件不会抛出 click | 1.3.11 | ## 外部样式类 diff --git a/docs/component/resize.md b/docs/component/resize.md index 1431a06c..3f0eb5b2 100644 --- a/docs/component/resize.md +++ b/docs/component/resize.md @@ -1,6 +1,6 @@ # Resize 监听元素尺寸变化 -当组件包裹的文档流尺寸发生变化时,触发 `size` 事件。一般用于监听 dom 内容更新时导致的 dom 尺寸位置的变化,重新获取 dom 尺寸和位置,进行内容展示的计算操作。 +当组件包裹的文档流尺寸发生变化时,触发 `resize` 事件。一般用于监听 dom 内容更新时导致的 dom 尺寸位置的变化,重新获取 dom 尺寸和位置,进行内容展示的计算操作。 ## 基本用法 @@ -30,8 +30,22 @@ function handleResize(detail: Record) { } ``` +## Attributes + +| 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 | +|-----|------|-----|-------|--------|---------| +| custom-style | 自定义根节点样式 | string | - | - | - | +| custom-class | 自定义根节点样式类 | string | - | - | - | +| custom-container-class | 自定义容器样式类 | string | - | - | - | + ## Events | 事件名称 | 说明 | 参数 | 最低版本 | |--------|------|-----|---------| | resize | 尺寸发生变化时触发 | `{width: number, height: number, top: number, right: number, bottom: number, left: number}` | - | + +## Slots + +| 插槽名称 | 说明 | 最低版本 | +|---------|------|---------| +| default | 需要监听尺寸变化的内容 | - | diff --git a/docs/component/root-portal.md b/docs/component/root-portal.md index b535ad70..46991fb5 100644 --- a/docs/component/root-portal.md +++ b/docs/component/root-portal.md @@ -56,9 +56,16 @@ version: 1.11.0 } ``` +## Attributes + +该组件无属性配置。 + +## Events + +该组件无事件。 ## Slots | 名称 | 说明 | 最低版本 | | ------- | ---------------------------- | -------- | -| default | 默认插槽,用于渲染传送内容 | - | \ No newline at end of file +| default | 默认插槽,用于渲染传送内容 | 1.11.0 | \ No newline at end of file diff --git a/docs/component/text.md b/docs/component/text.md index 595439e8..5c93ec7c 100644 --- a/docs/component/text.md +++ b/docs/component/text.md @@ -71,7 +71,7 @@ ## lines -设置 `lines` 属性,文本显示的行数,如果设置,超出此行数,将会显示省略号。最大值为5。 +设置 `lines` 属性,文本显示的行数,如果设置,超出此行数,将会显示省略号。最大值为 5。 ```html @@ -90,14 +90,7 @@ 设置 `prefix` `suffix` 插槽。 ```html - +