Files
2026-02-07 23:14:57 +08:00

112 lines
1.9 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Component({
options: {
multipleSlots: true
},
properties: {
//info, success, warn, waiting,clear
type: {
type: String,
value: ''
},
//背景色如果设置type对应颜色失效
background: {
type: String,
value: ''
},
//padding值
padding: {
type: String,
value:'20rpx 32rpx'
},
//margin-top值单位rpx
marginTop: {
type: String,
optionalTypes: [Number],
value: 0
},
//margin-bottom值单位rpx
marginBottom: {
type: String,
optionalTypes: [Number],
value: 0
},
//圆角
radius: {
type: String,
value: '16rpx'
},
//icon颜色
iconColor: {
type: String,
value: '#fff'
},
//icon字体大小px
iconSize: {
type: Number,
value: 22
},
closable: {
type: Boolean,
value: false
},
closeColor: {
type: String,
value: '#fff'
},
//关闭icon字体大小px
closeSize: {
type: Number,
value: 22
},
//是否自定义左侧内容,默认图标失效
isLeft: {
type: Boolean,
value: false
},
//内容是否与图标之间有间隔isLeft为true时生效
spacing: {
type: Boolean,
value: false
},
title: {
type: String,
value: ''
},
color: {
type: String,
value: '#fff'
},
size: {
type: String,
value: '14px'
},
desc: {
type: String,
value: ''
},
descColor: {
type: String,
value: '#fff'
},
descSize: {
type: String,
value: '12px'
},
//描述文字单行展示,超出隐藏
single: {
type: Boolean,
value: false
}
},
methods: {
leftClick() {
this.triggerEvent('leftClick', {})
},
onClick() {
this.triggerEvent('click', {})
},
close() {
this.triggerEvent('close', {})
}
}
})