diff --git a/docs/markdown/changelog.en-US.md b/docs/markdown/changelog.en-US.md index 90d396e0e..b651dec3f 100644 --- a/docs/markdown/changelog.en-US.md +++ b/docs/markdown/changelog.en-US.md @@ -16,6 +16,19 @@ Vant follows [Semantic Versioning 2.0.0](https://semver.org/lang/zh-CN/). ## Details +### [v3.0.9](https://github.com/youzan/vant/compare/v3.0.8...v3.0.9) + +`2021-03-08` + +**Feature** + +- AddressList: add tag slots [#8292](https://github.com/youzan/vant/issues/8292) + +**Bug Fixes** + +- fix custom theme not work [#8301](https://github.com/youzan/vant/issues/8301) +- fix failed to install component in TypeScript [#8308](https://github.com/youzan/vant/issues/8308) + ### [v3.0.8](https://github.com/youzan/vant/compare/v3.0.7...v3.0.8) `2021-03-07` diff --git a/docs/markdown/changelog.zh-CN.md b/docs/markdown/changelog.zh-CN.md index 83394abb2..0020d61a4 100644 --- a/docs/markdown/changelog.zh-CN.md +++ b/docs/markdown/changelog.zh-CN.md @@ -16,6 +16,19 @@ Vant 遵循 [Semver](https://semver.org/lang/zh-CN/) 语义化版本规范。 ## 更新内容 +### [v3.0.9](https://github.com/youzan/vant/compare/v3.0.8...v3.0.9) + +`2021-03-08` + +**Feature** + +- AddressList: 新增 tag 插槽 [#8292](https://github.com/youzan/vant/issues/8292) + +**Bug Fixes** + +- 修复主题定制不生效的问题 [#8301](https://github.com/youzan/vant/issues/8301) +- 修复在 TS 下使用 app.use 注册组件报错的问题 [#8308](https://github.com/youzan/vant/issues/8308) + ### [v3.0.8](https://github.com/youzan/vant/compare/v3.0.7...v3.0.8) `2021-03-07` diff --git a/src/address-list/AddressListItem.tsx b/src/address-list/AddressListItem.tsx index 4042d45d7..c2003019c 100644 --- a/src/address-list/AddressListItem.tsx +++ b/src/address-list/AddressListItem.tsx @@ -56,7 +56,7 @@ export default defineComponent({ const renderTag = () => { if (slots.tag) { - return slots.tag({ ...props.address }); + return slots.tag(props.address); } if (props.address.isDefault && props.defaultTagText) { return ( diff --git a/src/address-list/README.md b/src/address-list/README.md index 8b951650b..b6d2ab11b 100644 --- a/src/address-list/README.md +++ b/src/address-list/README.md @@ -108,12 +108,12 @@ export default { ### Slots -| Name | Description | SlotProps | -| ----------- | --------------------------------- | --------------- | -| default | Custom content after list | - | -| top | Custom content before list | - | -| item-bottom | Custom content after list item | _item: Address_ | -| tag | Custom tag conetent for list item | _item: Address_ | +| Name | Description | SlotProps | +| ------------ | ------------------------------ | --------------- | +| default | Custom content after list | - | +| top | Custom content before list | - | +| item-bottom | Custom content after list item | _item: Address_ | +| tag `v3.0.9` | Custom tag of list item | _item: Address_ | ### Less Variables diff --git a/src/address-list/README.zh-CN.md b/src/address-list/README.zh-CN.md index 126306f2b..acd3080a6 100644 --- a/src/address-list/README.zh-CN.md +++ b/src/address-list/README.zh-CN.md @@ -112,12 +112,12 @@ export default { ### Slots -| 名称 | 说明 | 参数 | -| ----------- | -------------------- | --------------- | -| default | 在列表下方插入内容 | - | -| top | 在顶部插入内容 | - | -| item-bottom | 在列表项底部插入内容 | _item: Address_ | -| tag | 列表项标签内容自定义 | _item: Address_ | +| 名称 | 说明 | 参数 | +| ------------ | -------------------- | --------------- | +| default | 在列表下方插入内容 | - | +| top | 在顶部插入内容 | - | +| item-bottom | 在列表项底部插入内容 | _item: Address_ | +| tag `v3.0.9` | 自定义列表项标签内容 | _item: Address_ | ### 样式变量 diff --git a/src/address-list/test/__snapshots__/index.spec.ts.snap b/src/address-list/test/__snapshots__/index.spec.ts.snap index 6f7b81140..dc094928e 100644 --- a/src/address-list/test/__snapshots__/index.spec.ts.snap +++ b/src/address-list/test/__snapshots__/index.spec.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`should render tag slot correctly 1`] = ` +exports[`should render tag slot correctly 1`] = `
{ expect(wrapper.emitted('click-item')![0]).toEqual([list[0], 0]); }); -test('should render tag slot correctly', () => { +test('should render tag slot correctly', () => { const wrapper = mount(AddressList, { slots: { tag: () => 'Custom Tag',