[improvement] PullRefresh: optimize loading

This commit is contained in:
陈嘉涵
2019-05-13 20:12:43 +08:00
parent 0c641f7d63
commit a6b429cf58
3 changed files with 14 additions and 18 deletions

View File

@@ -67,23 +67,23 @@ export default sfc({
const { type, message } = this;
const style = STYLE.indexOf(type) !== -1 ? 'default' : type;
const Content = () => {
function Content() {
switch (style) {
case 'text':
return <div>{message}</div>;
case 'html':
return <div domPropsInnerHTML={message} />;
default:
return [
type === 'loading' ? (
<Loading color="white" type={this.loadingType} />
) : (
<Icon class={bem('icon')} name={type} />
),
isDef(message) && <div class={bem('text')}>{message}</div>
];
}
};
return [
type === 'loading' ? (
<Loading color="white" type={this.loadingType} />
) : (
<Icon class={bem('icon')} name={type} />
),
isDef(message) && <div class={bem('text')}>{message}</div>
];
}
return (
<transition name="van-fade">