mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
parent
9752c832d2
commit
f635a9c490
@ -3,7 +3,6 @@
|
|||||||
.van-notify {
|
.van-notify {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 110;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: @notify-padding;
|
padding: @notify-padding;
|
||||||
font-size: @notify-font-size;
|
font-size: @notify-font-size;
|
||||||
|
@ -18,6 +18,10 @@ VantComponent({
|
|||||||
duration: {
|
duration: {
|
||||||
type: Number,
|
type: Number,
|
||||||
value: 3000
|
value: 3000
|
||||||
|
},
|
||||||
|
zIndex: {
|
||||||
|
type: Number,
|
||||||
|
value: 110
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name="slide-down"
|
name="slide-down"
|
||||||
show="{{ show }}"
|
show="{{ show }}"
|
||||||
custom-class="van-notify"
|
custom-class="van-notify"
|
||||||
custom-style="background-color:{{ backgroundColor }}; color: {{ color }};"
|
custom-style="background-color:{{ backgroundColor }}; color: {{ color }}; z-index: {{ zIndex }};"
|
||||||
>
|
>
|
||||||
<view wx:if="{{ safeAreaInsetTop }}" class="van-notify__safe-top" style="padding-top: {{ statusBarHeight }}px"></view>
|
<view wx:if="{{ safeAreaInsetTop }}" class="van-notify__safe-top" style="padding-top: {{ statusBarHeight }}px"></view>
|
||||||
{{ text }}
|
{{ text }}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { isObj } from '../common/utils';
|
import { isObj } from '../common/utils';
|
||||||
|
|
||||||
type NotifyOptions = {
|
interface NotifyOptions {
|
||||||
text: string;
|
text: string;
|
||||||
color?: string;
|
color?: string;
|
||||||
backgroundColor?: string;
|
backgroundColor?: string;
|
||||||
@ -8,7 +8,8 @@ type NotifyOptions = {
|
|||||||
selector?: string;
|
selector?: string;
|
||||||
context?: any;
|
context?: any;
|
||||||
safeAreaInsetTop?: boolean;
|
safeAreaInsetTop?: boolean;
|
||||||
};
|
zIndex?: number;
|
||||||
|
}
|
||||||
|
|
||||||
const defaultOptions = {
|
const defaultOptions = {
|
||||||
selector: '#van-notify',
|
selector: '#van-notify',
|
||||||
@ -16,10 +17,10 @@ const defaultOptions = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function parseOptions(text: NotifyOptions | string): NotifyOptions {
|
function parseOptions(text: NotifyOptions | string): NotifyOptions {
|
||||||
return isObj(text) ? text as NotifyOptions : { text } as NotifyOptions;
|
return isObj(text) ? (text as NotifyOptions) : ({ text } as NotifyOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getContext() {
|
function getContext(): Page.PageInstance {
|
||||||
const pages = getCurrentPages();
|
const pages = getCurrentPages();
|
||||||
return pages[pages.length - 1];
|
return pages[pages.length - 1];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user