feat(CollapseItem): add lazy-render prop (#10270)

This commit is contained in:
neverland 2022-02-09 10:14:21 +08:00 committed by GitHub
parent 0cb6382b9c
commit 73af4437de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 3 deletions

View File

@ -20,7 +20,7 @@ Vant follows [Semantic Versioning 2.0.0](https://semver.org/lang/zh-CN/).
`2022-02-07`
- Vant 3 对应的 npm tag 切换为 `latest`
- switch default npm tag to `latest`
### [v3.4.3](https://github.com/compare/v3.4.2...v3.4.3)

View File

@ -20,7 +20,7 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。
`2022-02-07`
- switch default npm tag to `latest`
- Vant 3 对应的 npm tag 切换为 `latest`
### [v3.4.3](https://github.com/compare/v3.4.2...v3.4.3)

View File

@ -35,6 +35,7 @@ const collapseItemProps = extend({}, cellSharedProps, {
isLink: truthProp,
disabled: Boolean,
readonly: Boolean,
lazyRender: truthProp,
});
export type CollapseItemProps = ExtractPropTypes<typeof collapseItemProps>;
@ -62,7 +63,7 @@ export default defineComponent({
const expanded = computed(() => parent.isExpanded(name.value));
const show = ref(expanded.value);
const lazyRender = useLazyRender(show);
const lazyRender = useLazyRender(() => show.value || !props.lazyRender);
const onTransitionEnd = () => {
if (!expanded.value) {

View File

@ -138,6 +138,7 @@ export default {
| disabled | Whether to disabled collapse | _boolean_ | `false` |
| readonly `v3.0.12` | Whether to be readonly | _boolean_ | `false` |
| is-link | Whether to show link icon | _boolean_ | `true` |
| lazy-render `v3.4.5` | Whether to lazy render util opened | _boolean_ | `true` |
| title-class | Title className | _string_ | - |
| value-class | Value className | _string_ | - |
| label-class | Label className | _string_ | - |

View File

@ -154,6 +154,7 @@ export default {
| is-link | 是否展示标题栏右侧箭头并开启点击反馈 | _boolean_ | `true` |
| disabled | 是否禁用面板 | _boolean_ | `false` |
| readonly `v3.0.12` | 是否为只读状态,只读状态下无法操作面板 | _boolean_ | `false` |
| lazy-render `v3.4.5` | 是否在首次展开时才渲染面板内容 | _boolean_ | `true` |
| title-class | 左侧标题额外类名 | _string_ | - |
| value-class | 右侧内容额外类名 | _string_ | - |
| label-class | 描述信息额外类名 | _string_ | - |