mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
types(Loading): use tsx
This commit is contained in:
parent
fe7e2faf6c
commit
71d014d691
@ -7,7 +7,7 @@ import { useRoute, routeProps } from '../composition/use-route';
|
|||||||
|
|
||||||
// Components
|
// Components
|
||||||
import Icon from '../icon';
|
import Icon from '../icon';
|
||||||
import Loading from '../loading';
|
import Loading, { LoadingType } from '../loading';
|
||||||
|
|
||||||
const [createComponent, bem] = createNamespace('button');
|
const [createComponent, bem] = createNamespace('button');
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ export default createComponent({
|
|||||||
disabled: Boolean,
|
disabled: Boolean,
|
||||||
iconPrefix: String,
|
iconPrefix: String,
|
||||||
loadingText: String,
|
loadingText: String,
|
||||||
loadingType: String,
|
loadingType: String as PropType<LoadingType>,
|
||||||
tag: {
|
tag: {
|
||||||
type: String as PropType<keyof HTMLElementTagNameMap>,
|
type: String as PropType<keyof HTMLElementTagNameMap>,
|
||||||
default: 'button',
|
default: 'button',
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { computed } from 'vue';
|
import { computed, PropType } from 'vue';
|
||||||
import { createNamespace, addUnit, getSizeStyle } from '../utils';
|
import { createNamespace, addUnit, getSizeStyle } from '../utils';
|
||||||
|
|
||||||
const [createComponent, bem] = createNamespace('loading');
|
const [createComponent, bem] = createNamespace('loading');
|
||||||
|
|
||||||
const SpinIcon = [];
|
const SpinIcon: JSX.Element[] = [];
|
||||||
for (let i = 0; i < 12; i++) {
|
for (let i = 0; i < 12; i++) {
|
||||||
SpinIcon.push(<i />);
|
SpinIcon.push(<i />);
|
||||||
}
|
}
|
||||||
@ -14,6 +14,8 @@ const CircularIcon = (
|
|||||||
</svg>
|
</svg>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export type LoadingType = 'circular' | 'spinner';
|
||||||
|
|
||||||
export default createComponent({
|
export default createComponent({
|
||||||
props: {
|
props: {
|
||||||
size: [Number, String],
|
size: [Number, String],
|
||||||
@ -21,7 +23,7 @@ export default createComponent({
|
|||||||
vertical: Boolean,
|
vertical: Boolean,
|
||||||
textSize: [Number, String],
|
textSize: [Number, String],
|
||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String as PropType<LoadingType>,
|
||||||
default: 'circular',
|
default: 'circular',
|
||||||
},
|
},
|
||||||
},
|
},
|
Loading…
x
Reference in New Issue
Block a user