mirror of
https://github.com/youzan/vant.git
synced 2025-12-22 01:07:29 +08:00
[new feature] Loading: add default slot
This commit is contained in:
@@ -2,6 +2,7 @@ import { use } from '../utils';
|
||||
import { prevent } from '../utils/event';
|
||||
import { deepClone } from '../utils/deep-clone';
|
||||
import { pickerProps } from './shared';
|
||||
import { BLUE } from '../utils/color';
|
||||
import Loading from '../loading';
|
||||
import PickerColumn from './PickerColumn';
|
||||
|
||||
@@ -170,13 +171,7 @@ export default sfc({
|
||||
return (
|
||||
<div class={bem()}>
|
||||
{Toolbar}
|
||||
{this.loading ? (
|
||||
<div class={bem('loading')}>
|
||||
<Loading />
|
||||
</div>
|
||||
) : (
|
||||
h()
|
||||
)}
|
||||
{this.loading ? <Loading class={bem('loading')} color={BLUE} /> : h()}
|
||||
<div class={bem('columns')} style={columnsStyle} onTouchmove={prevent}>
|
||||
{columns.map((item, index) => (
|
||||
<PickerColumn
|
||||
|
||||
@@ -43,12 +43,11 @@
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: rgba(255, 255, 255, .9);
|
||||
|
||||
circle {
|
||||
stroke: @blue;
|
||||
}
|
||||
}
|
||||
|
||||
&__loading .van-loading,
|
||||
|
||||
@@ -98,9 +98,7 @@ exports[`renders demo correctly 1`] = `
|
||||
</div>
|
||||
<div>
|
||||
<div class="van-picker">
|
||||
<div class="van-picker__loading">
|
||||
<div class="van-loading van-loading--circular" style="color:#c9c9c9;"><span class="van-loading__spinner van-loading__spinner--circular"><svg viewBox="25 25 50 50" class="van-loading__circular"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span></div>
|
||||
</div>
|
||||
<div class="van-loading van-loading--circular van-picker__loading"><span class="van-loading__spinner van-loading__spinner--circular" style="color:#1989fa;"><svg viewBox="25 25 50 50" class="van-loading__circular"><circle cx="50" cy="50" r="20" fill="none"></circle></svg></span></div>
|
||||
<div class="van-picker__columns" style="height:220px;">
|
||||
<div class="van-picker-column column1" style="height:220px;">
|
||||
<ul style="transition:0ms;transform:translate3d(0, 88px, 0);line-height:44px;">
|
||||
|
||||
Reference in New Issue
Block a user