Files
frontend-app/uni_modules/uview-plus/components/u-tooltip/props.js
T
2026-07-23 14:31:06 +08:00

90 lines
2.8 KiB
JavaScript
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.
import { defineMixin } from '../../libs/vue'
import TooltipDefaultProps from './tooltip'
import { registerComponentProps } from '../../libs/config/props.js'
const defProps = registerComponentProps(TooltipDefaultProps)
export const props = defineMixin({
props: {
// 需要显示的提示文字
text: {
type: [String, Number],
default: () => defProps.tooltip.text
},
// 点击复制按钮时,复制的文本,为空则使用text值
copyText: {
type: [String, Number],
default: () => defProps.tooltip.copyText
},
// 文本大小
size: {
type: [String, Number],
default: () => defProps.tooltip.size
},
// 字体颜色
color: {
type: String,
default: () => defProps.tooltip.color
},
// 弹出提示框时,文本的背景色
bgColor: {
type: String,
default: () => defProps.tooltip.bgColor
},
// 弹出提示框的背景色
popupBgColor: {
type: String,
default: () => defProps.tooltip.popupBgColor
},
// 弹出提示的方向,top-上方,bottom-下方,left-左方,right-右方
direction: {
type: String,
default: () => defProps.tooltip.direction
},
// 弹出提示的z-index,nvue无效
zIndex: {
type: [String, Number],
default: () => defProps.tooltip.zIndex
},
// 是否显示复制按钮
showCopy: {
type: Boolean,
default: () => defProps.tooltip.showCopy
},
// 扩展的按钮组
buttons: {
type: Array,
default: () => defProps.tooltip.buttons
},
// 是否显示透明遮罩以防止触摸穿透
overlay: {
type: Boolean,
default: () => defProps.tooltip.overlay
},
// 是否显示复制成功或者失败的toast
showToast: {
type: Boolean,
default: () => defProps.tooltip.showToast
},
// 触发方式,可选值:longpress/click
triggerMode: {
type: String,
default: () => defProps.tooltip.triggerMode
},
// 强制定位
forcePosition: {
type: Object,
default: () => defProps.tooltip.forcePosition
},
// 是否显示,triggerMode为manual时使用
show: {
type: Boolean,
default: () => defProps.tooltip.show
},
// 是否开启单例模式,开启该属性的tooltip同一页面同时只显示一个
singleton: {
type: Boolean,
default: () => defProps.tooltip.singleton
}
}
})