chore(Divider): use tsx

This commit is contained in:
chenjiahan 2020-10-09 19:56:33 +08:00
parent 861a77ce44
commit aaec78d54d
2 changed files with 9 additions and 6 deletions

View File

@ -61,11 +61,11 @@ app.use(Divider);
### Props ### Props
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
| ---------------- | -------------------------------- | --------- | -------- | | ---------------- | --------------------------------- | --------- | -------- |
| dashed | 是否使用虚线 | _boolean_ | `false` | | dashed | 是否使用虚线 | _boolean_ | `false` |
| hairline | 是否使用 0.5px 线 | _boolean_ | `true` | | hairline | 是否使用 0.5px 线 | _boolean_ | `true` |
| content-position | 内容位置,可选值为`left` `right` | _string_ | `center` | | content-position | 内容位置,可选值为 `left` `right` | _string_ | `center` |
### Slots ### Slots

View File

@ -1,7 +1,10 @@
import { PropType } from 'vue';
import { createNamespace } from '../utils'; import { createNamespace } from '../utils';
const [createComponent, bem] = createNamespace('divider'); const [createComponent, bem] = createNamespace('divider');
export type DividerContentPosition = 'left' | 'center' | 'right';
export default createComponent({ export default createComponent({
props: { props: {
dashed: Boolean, dashed: Boolean,
@ -10,7 +13,7 @@ export default createComponent({
default: true, default: true,
}, },
contentPosition: { contentPosition: {
type: String, type: String as PropType<DividerContentPosition>,
default: 'center', default: 'center',
}, },
}, },