mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 10:44:59 +00:00
[improvement] optimize sfc type definitions (#2778)
This commit is contained in:
@@ -2,16 +2,23 @@ import { use } from '../utils';
|
||||
import { inherit } from '../utils/functional';
|
||||
|
||||
// Types
|
||||
import { FunctionalComponent } from '../utils/use/sfc';
|
||||
import { CreateElement, RenderContext } from 'vue/types';
|
||||
import { DefaultSlots } from '../utils/use/sfc';
|
||||
|
||||
export type LoadingProps = {
|
||||
size?: string;
|
||||
type?: string;
|
||||
color?: string;
|
||||
};
|
||||
|
||||
const [sfc, bem] = use('loading');
|
||||
const DEFAULT_COLOR = '#c9c9c9';
|
||||
|
||||
const Loading: FunctionalComponent<LoadingProps> = function (
|
||||
h,
|
||||
props,
|
||||
slots,
|
||||
ctx
|
||||
function Loading(
|
||||
h: CreateElement,
|
||||
props: LoadingProps,
|
||||
slots: DefaultSlots,
|
||||
ctx: RenderContext<LoadingProps>
|
||||
) {
|
||||
const { color, size, type } = props;
|
||||
|
||||
@@ -44,13 +51,7 @@ const Loading: FunctionalComponent<LoadingProps> = function (
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export type LoadingProps = {
|
||||
size?: string;
|
||||
type?: string;
|
||||
color?: string;
|
||||
};
|
||||
}
|
||||
|
||||
Loading.props = {
|
||||
size: String,
|
||||
|
Reference in New Issue
Block a user