Files
mini-yu/uni_modules/tdesign-uniapp/components/message/props.ts
lingxiao865 c5af079d8c first commit
2026-02-10 08:05:03 +08:00

102 lines
3.3 KiB
TypeScript
Raw 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.

/* eslint-disable */
/**
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */
import type { TdMessageProps } from './type';
export default {
/** 文本对齐方式 */
align: {
type: String,
default: 'left' as TdMessageProps['align'],
validator(val: TdMessageProps['align']): boolean {
if (!val) return true;
return ['left', 'center'].includes(val);
},
},
/** 关闭按钮,可以自定义。值为 true 显示默认关闭按钮,值为 false 不显示关闭按钮。值类型为 string ,如:'user',则显示组件内置图标。值类型为 object ,则会透传至 icon 组件 */
closeBtn: {
type: [String, Boolean, Object],
default: false as TdMessageProps['closeBtn'],
},
/** 用于自定义消息弹出内容 */
content: {
type: String,
},
/** 消息内置计时器,计时到达时会触发 duration-end 事件。单位:毫秒。值为 0 则表示没有计时器 */
duration: {
type: Number,
default: 3000,
},
/** 两条 `message` 之间的间距 */
gap: {
type: [String, Number, Boolean],
default: 12 as TdMessageProps['gap'],
},
/** 消息提醒前面的图标,可以自定义。值为 true 则根据 theme 显示对应的图标,值为 false 则不显示图标。值为 true 显示默认关闭按钮,值为 false 不显示关闭按钮。值类型为 string ,如:'info',则显示组件内置图标。值类型为 object ,则会透传至 icon 组件 */
icon: {
type: [String, Boolean, Object],
default: true as TdMessageProps['icon'],
},
/** 链接名称。值为字符串表示链接名称,值为 `Object` 类型,表示透传至 `Link` */
link: {
type: [String, Object],
},
/** 跑马灯效果。speed 指速度控制loop 指循环播放次数,值为 -1 表示循环播放,值为 0 表示不循环播放delay 表示延迟多久开始播放 */
marquee: {
type: [Boolean, Object],
default: false as TdMessageProps['marquee'],
},
/** 相对于 placement 的偏移量,默认单位 rpx。示例[-10, 20] 或 ['10rpx', '8rpx'] */
offset: {
type: Array,
},
/** 是否保持仅显示一条信息 */
single: {
type: Boolean,
default: true,
},
/** 消息组件风格 */
theme: {
type: String,
default: 'info' as TdMessageProps['theme'],
validator(val: TdMessageProps['theme']): boolean {
if (!val) return true;
return ['info', 'success', 'warning', 'error'].includes(val);
},
},
/** 是否显示,隐藏时默认销毁组件 */
visible: {
type: Boolean,
default: undefined,
},
/** 是否显示,隐藏时默认销毁组件,非受控属性 */
defaultVisible: Boolean,
/** 元素层级,样式默认为 15000 */
zIndex: {
type: Number,
default: 15000,
},
/** 已废弃。当操作按钮存在时,用户点击操作按钮时触发 */
onActionBtnClick: {
type: Function,
default: () => ({}),
},
/** 当关闭按钮存在时,用户点击关闭按钮触发 */
onCloseBtnClick: {
type: Function,
default: () => ({}),
},
/** 计时结束后触发 */
onDurationEnd: {
type: Function,
default: () => ({}),
},
/** 当`link`链接存在时,点击链接文本时触发 */
onLinkClick: {
type: Function,
default: () => ({}),
},
};