mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[improvement] PullRefresh: optimize loading
This commit is contained in:
parent
c5d3a95157
commit
3efdcdd28c
@ -10,9 +10,7 @@
|
||||
position: relative;
|
||||
z-index: -1;
|
||||
display: inline-block;
|
||||
box-sizing: border-box;
|
||||
width: 30px;
|
||||
|
||||
// compatible for 1.x, users may set width or height in root element
|
||||
max-width: 100%;
|
||||
height: 30px;
|
||||
|
@ -151,10 +151,9 @@ export default sfc({
|
||||
const Status = this.slots(status) || [
|
||||
TEXT_STATUS.indexOf(status) !== -1 && <div class={bem('text')}>{text}</div>,
|
||||
status === 'loading' && (
|
||||
<div class={bem('loading')}>
|
||||
<Loading />
|
||||
<span>{text}</span>
|
||||
</div>
|
||||
<Loading class={bem('loading')} size="16">
|
||||
{text}
|
||||
</Loading>
|
||||
)
|
||||
];
|
||||
|
||||
|
@ -20,18 +20,4 @@
|
||||
line-height: 50px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&__loading {
|
||||
.van-loading {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
span,
|
||||
.van-loading {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,9 +24,7 @@ exports[`change head content when pulling down 3`] = `
|
||||
<div class="van-pull-refresh">
|
||||
<div class="van-pull-refresh__track" style="transition: 300ms; transform: translate3d(0,50px, 0);">
|
||||
<div class="van-pull-refresh__head">
|
||||
<div class="van-pull-refresh__loading">
|
||||
<div class="van-loading van-loading--circular"><span class="van-loading__spinner van-loading__spinner--circular" style="color: rgb(201, 201, 201);"><svg viewBox="25 25 50 50" class="van-loading__circular"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span></div><span>加载中...</span>
|
||||
</div>
|
||||
<div class="van-loading van-loading--circular van-pull-refresh__loading"><span class="van-loading__spinner van-loading__spinner--circular" style="color: rgb(201, 201, 201); width: 16px; height: 16px;"><svg viewBox="25 25 50 50" class="van-loading__circular"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span><span class="van-loading__text">加载中...</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -36,9 +34,7 @@ exports[`change head content when pulling down 4`] = `
|
||||
<div class="van-pull-refresh">
|
||||
<div class="van-pull-refresh__track" style="transition: 300ms; transform: translate3d(0,50px, 0);">
|
||||
<div class="van-pull-refresh__head">
|
||||
<div class="van-pull-refresh__loading">
|
||||
<div class="van-loading van-loading--circular"><span class="van-loading__spinner van-loading__spinner--circular" style="color: rgb(201, 201, 201);"><svg viewBox="25 25 50 50" class="van-loading__circular"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span></div><span>加载中...</span>
|
||||
</div>
|
||||
<div class="van-loading van-loading--circular van-pull-refresh__loading"><span class="van-loading__spinner van-loading__spinner--circular" style="color: rgb(201, 201, 201); width: 16px; height: 16px;"><svg viewBox="25 25 50 50" class="van-loading__circular"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span><span class="van-loading__text">加载中...</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user