Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: noticeBar文档补全 #701

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 68 additions & 1 deletion packages/vantui/types/notice-bar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,89 @@ import { FunctionComponent, ReactNode } from 'react'
import { ITouchEvent, ViewProps } from '@tarojs/components'

export interface NoticeBarProps extends ViewProps {
/**
* @description 通知文本内容
* @default ""
*/
text?: ReactNode
/**
* @description 通知栏模式,可选值为 closeable link
* @default ""
*/
mode?: 'closeable' | 'link'
/**
* @description 当mode为link类型时候的url
*/
url?: string
openType?: any
/**
* @description 当mode为link类型时候的跳转方式
* @default navigate
*/
openType?:
| 'navigate'
| 'redirect'
| 'switchTab'
| 'reLaunch'
| 'navigateBack'
| 'exit'

/**
* @description 动画延迟时间 (s)
* @default 1
*/
delay?: number
/**
* @description 滚动速率 (px/s)
* @default 60
*/
speed?: number
/**
* @description 是否在长度溢出时滚动播放
* @default false
*/
scrollable?: boolean
/**
* @description 左侧图标名称或图片链接,可选值见 Icon 组件
*/
leftIcon?: string
/**
* @description 文本颜色
* @default #ed6a0c
*/
color?: string
/**
* @description 滚动条背景颜色
* @default #fffbe8
*/
backgroundColor?: string
/**
* @description 滚动条背景
*/
background?: string
/**
* @description 是否开启文本换行,只在禁用滚动时生效
* @default false
*/
wrapable?: boolean
/**
* @description
*/
children?: ReactNode
/**
* @description 自定义左侧图标
*/
renderLeftIcon?: ReactNode
/**
* @description 自定义右侧图标
*/
renderRightIcon?: ReactNode
/**
* @description 点击通知栏时触发
*/
onClick?: (event: ITouchEvent) => any
/**
* @description 关闭通知栏时触发
*/
onClose?: (event: ITouchEvent) => any
/**
* @description 微信端使用时, 所在元素层级太深,需要设置元素层级不是很深的父元素的className(‘.xx’)或id(#xx), 支持当前组件获取rect信息
Expand Down
Loading