types(SubmitBar): add SubmitBarTextAlign type

This commit is contained in:
chenjiahan 2021-11-09 14:23:35 +08:00
parent ecd2fb4f13
commit f95567ade7
4 changed files with 7 additions and 10 deletions

View File

@ -127,7 +127,7 @@ export default {
The component exports the following type definitions:
```ts
import type { SubmitBarProps } from 'vant';
import type { SubmitBarProps, SubmitBarTextAlign } from 'vant';
```
## Theming

View File

@ -134,7 +134,7 @@ export default {
组件导出以下类型定义:
```ts
import type { SubmitBarProps } from 'vant';
import type { SubmitBarProps, SubmitBarTextAlign } from 'vant';
```
## 主题定制

View File

@ -1,9 +1,4 @@
import {
PropType,
CSSProperties,
defineComponent,
ExtractPropTypes,
} from 'vue';
import { PropType, defineComponent, ExtractPropTypes } from 'vue';
import {
truthProp,
makeStringProp,
@ -17,6 +12,8 @@ import { Button, ButtonType } from '../button';
const [name, bem, t] = createNamespace('submit-bar');
export type SubmitBarTextAlign = 'left' | 'right';
const submitBarProps = {
tip: String,
label: String,
@ -25,7 +22,7 @@ const submitBarProps = {
loading: Boolean,
currency: makeStringProp('¥'),
disabled: Boolean,
textAlign: String as PropType<CSSProperties['textAlign']>,
textAlign: String as PropType<SubmitBarTextAlign>,
buttonText: String,
buttonType: makeStringProp<ButtonType>('danger'),
buttonColor: String,

View File

@ -3,4 +3,4 @@ import _SubmitBar from './SubmitBar';
export const SubmitBar = withInstall(_SubmitBar);
export default SubmitBar;
export type { SubmitBarProps } from './SubmitBar';
export type { SubmitBarProps, SubmitBarTextAlign } from './SubmitBar';