diff --git a/src/popover/Popover.tsx b/src/popover/Popover.tsx index 688b7b69d..cb7076ff9 100644 --- a/src/popover/Popover.tsx +++ b/src/popover/Popover.tsx @@ -72,6 +72,7 @@ export default defineComponent({ show: Boolean, overlay: Boolean, duration: [Number, String], + iconPrefix: String, overlayClass: unknownProp, overlayStyle: Object as PropType, closeOnClickAction: truthProp, @@ -101,7 +102,6 @@ export default defineComponent({ type: [String, Object] as PropType, default: 'body', }, - iconPrefix: String, }, emits: ['select', 'touchstart', 'update:show'], diff --git a/src/popover/README.md b/src/popover/README.md index 04f2d411d..e159aaca4 100644 --- a/src/popover/README.md +++ b/src/popover/README.md @@ -224,7 +224,7 @@ export default { | close-on-click-outside | Whether to close when clicking outside | _boolean_ | `true` | | close-on-click-overlay `v3.0.10` | Whether to close when clicking overlay | _boolean_ | `true` | | teleport | Return the mount node for Popover | _string \| Element_ | `body` | -| icon-prefix | Icon className prefix | _string_ | `van-icon` | +| icon-prefix `v3.0.17` | Icon className prefix | _string_ | `van-icon` | ### Data Structure of Action diff --git a/src/popover/README.zh-CN.md b/src/popover/README.zh-CN.md index ca559bc24..2d7c1dede 100644 --- a/src/popover/README.zh-CN.md +++ b/src/popover/README.zh-CN.md @@ -234,7 +234,7 @@ export default { | close-on-click-outside | 是否在点击外部元素后关闭菜单 | _boolean_ | `true` | | close-on-click-overlay `v3.0.10` | 是否在点击遮罩层后关闭菜单 | _boolean_ | `true` | | teleport | 指定挂载的节点,[用法示例](#/zh-CN/popup#zhi-ding-gua-zai-wei-zhi) | _string \| Element_ | `body` | -| icon-prefix | 图标类名前缀,同 Icon 组件的 [class-prefix 属性](#/zh-CN/icon#props) | _string_ | `van-icon` | +| icon-prefix `v3.0.17` | 图标类名前缀,同 Icon 组件的 [class-prefix 属性](#/zh-CN/icon#props) | _string_ | `van-icon` | ### Action 数据结构 diff --git a/src/popover/test/__snapshots__/index.spec.tsx.snap b/src/popover/test/__snapshots__/index.spec.tsx.snap index 2c1910f27..e26af7a0b 100644 --- a/src/popover/test/__snapshots__/index.spec.tsx.snap +++ b/src/popover/test/__snapshots__/index.spec.tsx.snap @@ -13,6 +13,25 @@ exports[`should allow to custom the className of action 1`] = ` exports[`should change icon class prefix when using icon-prefix prop 1`] = ` + +
+
+
+ +
+
`; exports[`should locate to reference element when showed 1`] = ` diff --git a/src/popover/test/index.spec.tsx b/src/popover/test/index.spec.tsx index a22d59b48..19c8de91a 100644 --- a/src/popover/test/index.spec.tsx +++ b/src/popover/test/index.spec.tsx @@ -192,8 +192,9 @@ test('should change icon class prefix when using icon-prefix prop', () => { const wrapper = mount(Popover, { props: { show: true, - icon: 'success', + teleport: null, iconPrefix: 'my-icon', + actions: [{ icon: 'success', text: 'foo' }], }, });