mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-23 15:09:16 +08:00
[new feature] Toast: add className prop (#2680)
This commit is contained in:
parent
d20b7fdcbf
commit
ca4e476ddd
@ -97,7 +97,7 @@ export default {
|
|||||||
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
|------|------|------|------|------|
|
|------|------|------|------|------|
|
||||||
| name | 标识符 | 任意类型 | - | - |
|
| name | 标识符 | 任意类型 | - | - |
|
||||||
| shape | 形状,可选值为 `square` | `String` | `round` | 1.5.8 |
|
| shape | 形状,可选值为 `square` | `String` | `round` | 1.6.0 |
|
||||||
| disabled | 是否为禁用状态 | `Boolean` | `false` | - |
|
| disabled | 是否为禁用状态 | `Boolean` | `false` | - |
|
||||||
| label-disabled | 是否禁用文本内容点击 | `Boolean` | `false` | 1.1.13 |
|
| label-disabled | 是否禁用文本内容点击 | `Boolean` | `false` | 1.1.13 |
|
||||||
| label-position | 文本位置,可选值为 `left` | `String` | `right` | 1.1.13 |
|
| label-position | 文本位置,可选值为 `left` | `String` | `right` | 1.1.13 |
|
||||||
|
@ -10,6 +10,7 @@ export default sfc({
|
|||||||
mixins: [Popup],
|
mixins: [Popup],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
className: String,
|
||||||
forbidClick: Boolean,
|
forbidClick: Boolean,
|
||||||
message: [String, Number],
|
message: [String, Number],
|
||||||
type: {
|
type: {
|
||||||
@ -89,7 +90,7 @@ export default sfc({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<transition name="van-fade">
|
<transition name="van-fade">
|
||||||
<div vShow={this.value} class={bem([style, this.position])}>
|
<div vShow={this.value} class={[bem([style, this.position]), this.className]}>
|
||||||
{Content()}
|
{Content()}
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
@ -105,3 +105,4 @@ toast2.clear();
|
|||||||
| forbidClick | Whether to forbid click background | `Boolean` | `false` |
|
| forbidClick | Whether to forbid click background | `Boolean` | `false` |
|
||||||
| loadingType | Loading icon type, can be set to `spinner` | `String` | `circular` |
|
| loadingType | Loading icon type, can be set to `spinner` | `String` | `circular` |
|
||||||
| duration | Toast duration(ms), won't disappear if value is 0 | `Number` | `3000` |
|
| duration | Toast duration(ms), won't disappear if value is 0 | `Number` | `3000` |
|
||||||
|
| className | Custom className | `String | Array | Object` | - |
|
||||||
|
@ -8,6 +8,7 @@ const defaultOptions = {
|
|||||||
message: '',
|
message: '',
|
||||||
value: true,
|
value: true,
|
||||||
duration: 3000,
|
duration: 3000,
|
||||||
|
className: '',
|
||||||
position: 'middle',
|
position: 'middle',
|
||||||
loadingType: 'circular',
|
loadingType: 'circular',
|
||||||
forbidClick: false,
|
forbidClick: false,
|
||||||
|
1
types/toast.d.ts
vendored
1
types/toast.d.ts
vendored
@ -8,6 +8,7 @@ export type ToastOptions = {
|
|||||||
mask?: boolean;
|
mask?: boolean;
|
||||||
position?: string;
|
position?: string;
|
||||||
duration?: number;
|
duration?: number;
|
||||||
|
className?: any;
|
||||||
forbidClick?: boolean;
|
forbidClick?: boolean;
|
||||||
loadingType?: string;
|
loadingType?: string;
|
||||||
message?: ToastMessage;
|
message?: ToastMessage;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user