mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[bugfix] Tab: active block disappeared when delete tab (#372)
* [Improvement] CouponCell text adjust * fix: Coupon test cases * [bugfix] SubmitBar i18n not work * [bugfix] Tab: active block disappeared when delete tab * [bugfix] Toast number message
This commit is contained in:
parent
bbdf135724
commit
df2911eed0
@ -20,7 +20,7 @@
|
||||
<div
|
||||
v-else
|
||||
class="van-tabs__nav"
|
||||
:class="`van-tabs__nav--${this.type}`"
|
||||
:class="`van-tabs__nav--${type}`"
|
||||
>
|
||||
<div class="van-tabs__nav-bar" :style="navBarStyle" v-if="type === 'line'"></div>
|
||||
<div
|
||||
@ -101,6 +101,11 @@
|
||||
} else {
|
||||
this.isInitEvents = false;
|
||||
}
|
||||
|
||||
const activeExist = val.some(tab => tab.index === this.curActive);
|
||||
if (!activeExist) {
|
||||
this.curActive = val[0].index || 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -28,7 +28,7 @@ const createInstance = () => {
|
||||
const Toast = (options = {}) => {
|
||||
createInstance();
|
||||
|
||||
options = typeof options === 'string' ? { message: options } : options;
|
||||
options = typeof options === 'object' ? options : { message: options };
|
||||
options = { ...defaultOptions, ...options };
|
||||
Object.assign(instance, options);
|
||||
|
||||
@ -45,7 +45,7 @@ const Toast = (options = {}) => {
|
||||
|
||||
const createMethod = type => (options = {}) => Toast({
|
||||
type,
|
||||
message: typeof options === 'string' ? options : options.message,
|
||||
message: typeof options === 'object' ? options.message : options,
|
||||
...options
|
||||
});
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
<template v-if="displayStyle === 'default'">
|
||||
<van-loading v-if="type === 'loading'" color="white" />
|
||||
<van-icon v-else class="van-toast__icon" :name="type" />
|
||||
<div v-if="message" class="van-toast__text">{{ message }}</div>
|
||||
<div v-if="message !== undefined" class="van-toast__text">{{ message }}</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="van-toast__overlay" :class="{ 'van-toast__overlay--mask': mask }" v-if="forbidClick || mask" />
|
||||
@ -34,7 +34,7 @@ export default {
|
||||
|
||||
props: {
|
||||
mask: Boolean,
|
||||
message: String,
|
||||
message: [String, Number],
|
||||
forbidClick: Boolean,
|
||||
type: {
|
||||
type: String,
|
||||
|
Loading…
x
Reference in New Issue
Block a user