mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-21 22: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 | 标识符 | 任意类型 | - | - |
|
||||
| shape | 形状,可选值为 `square` | `String` | `round` | 1.5.8 |
|
||||
| shape | 形状,可选值为 `square` | `String` | `round` | 1.6.0 |
|
||||
| disabled | 是否为禁用状态 | `Boolean` | `false` | - |
|
||||
| label-disabled | 是否禁用文本内容点击 | `Boolean` | `false` | 1.1.13 |
|
||||
| label-position | 文本位置,可选值为 `left` | `String` | `right` | 1.1.13 |
|
||||
|
@ -10,6 +10,7 @@ export default sfc({
|
||||
mixins: [Popup],
|
||||
|
||||
props: {
|
||||
className: String,
|
||||
forbidClick: Boolean,
|
||||
message: [String, Number],
|
||||
type: {
|
||||
@ -89,7 +90,7 @@ export default sfc({
|
||||
|
||||
return (
|
||||
<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()}
|
||||
</div>
|
||||
</transition>
|
||||
|
@ -104,4 +104,5 @@ toast2.clear();
|
||||
| mask | Whether to show mask | `Boolean` | `false` |
|
||||
| forbidClick | Whether to forbid click background | `Boolean` | `false` |
|
||||
| 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: '',
|
||||
value: true,
|
||||
duration: 3000,
|
||||
className: '',
|
||||
position: 'middle',
|
||||
loadingType: 'circular',
|
||||
forbidClick: false,
|
||||
|
1
types/toast.d.ts
vendored
1
types/toast.d.ts
vendored
@ -8,6 +8,7 @@ export type ToastOptions = {
|
||||
mask?: boolean;
|
||||
position?: string;
|
||||
duration?: number;
|
||||
className?: any;
|
||||
forbidClick?: boolean;
|
||||
loadingType?: string;
|
||||
message?: ToastMessage;
|
||||
|
Loading…
x
Reference in New Issue
Block a user