mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-21 22:09:16 +08:00
types(Popup): add PopupInstance prop (#10062)
* types(Popup): add PopupInstance prop * docs: update
This commit is contained in:
parent
0002f1b1af
commit
56b210156e
@ -35,13 +35,8 @@ import { POPUP_TOGGLE_KEY } from '../composables/on-popup-reopen';
|
||||
import { Icon } from '../icon';
|
||||
import { Overlay } from '../overlay';
|
||||
|
||||
export type PopupPosition = 'top' | 'left' | 'bottom' | 'right' | 'center' | '';
|
||||
|
||||
export type PopupCloseIconPosition =
|
||||
| 'top-left'
|
||||
| 'top-right'
|
||||
| 'bottom-left'
|
||||
| 'bottom-right';
|
||||
// Types
|
||||
import type { PopupPosition, PopupCloseIconPosition } from './types';
|
||||
|
||||
const popupProps = extend({}, popupSharedProps, {
|
||||
round: Boolean,
|
||||
|
@ -151,7 +151,12 @@ Use `teleport` prop to specify mount location.
|
||||
The component exports the following type definitions:
|
||||
|
||||
```ts
|
||||
import type { PopupProps, PopupPosition, PopupCloseIconPosition } from 'vant';
|
||||
import type {
|
||||
PopupProps,
|
||||
PopupPosition,
|
||||
PopupInstance,
|
||||
PopupCloseIconPosition,
|
||||
} from 'vant';
|
||||
```
|
||||
|
||||
## Theming
|
||||
|
@ -157,7 +157,12 @@ export default {
|
||||
组件导出以下类型定义:
|
||||
|
||||
```ts
|
||||
import type { PopupProps, PopupPosition, PopupCloseIconPosition } from 'vant';
|
||||
import type {
|
||||
PopupProps,
|
||||
PopupPosition,
|
||||
PopupInstance,
|
||||
PopupCloseIconPosition,
|
||||
} from 'vant';
|
||||
```
|
||||
|
||||
## 主题定制
|
||||
|
@ -3,8 +3,9 @@ import _Popup from './Popup';
|
||||
|
||||
export const Popup = withInstall(_Popup);
|
||||
export default Popup;
|
||||
export type { PopupProps } from './Popup';
|
||||
export type {
|
||||
PopupProps,
|
||||
PopupPosition,
|
||||
PopupInstance,
|
||||
PopupCloseIconPosition,
|
||||
} from './Popup';
|
||||
} from './types';
|
||||
|
12
packages/vant/src/popup/types.ts
Normal file
12
packages/vant/src/popup/types.ts
Normal file
@ -0,0 +1,12 @@
|
||||
import type { ComponentPublicInstance } from 'vue';
|
||||
import type { PopupProps } from './Popup';
|
||||
|
||||
export type PopupPosition = 'top' | 'left' | 'bottom' | 'right' | 'center' | '';
|
||||
|
||||
export type PopupCloseIconPosition =
|
||||
| 'top-left'
|
||||
| 'top-right'
|
||||
| 'bottom-left'
|
||||
| 'bottom-right';
|
||||
|
||||
export type PopupInstance = ComponentPublicInstance<PopupProps>;
|
Loading…
x
Reference in New Issue
Block a user