-
Notifications
You must be signed in to change notification settings - Fork 73
feat:完善 tag、tab-input、tab、timeline 的 props和emits #2493
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
base: feature_wiki
Are you sure you want to change the base?
Conversation
packages/tab/demo/index.ts
Outdated
{ | ||
name: 'active', | ||
description: '选中的 tab', | ||
type: 'number|string', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
枚举使用 options
packages/tab/demo/index.ts
Outdated
description: ' 添加选项卡事件', | ||
params: [ | ||
{ | ||
e: 'MouseEvent', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里不对,应该是 name,type,link 可以参考packages/affix/demo/index.ts
packages/tab/demo/index.ts
Outdated
// 组件描述 | ||
const description = '选项卡切换组件。'; | ||
|
||
export default { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
导出的文件需要添加类型,参考 packages/affix/demo/index.ts
packages/tab/src/emits.ts
Outdated
'tab-change': (_name: string) => true, | ||
'update:active': (_name: string) => true, | ||
remove: (_index: number, _panel: unknown) => true, | ||
'remove-panel': (_index: number, _panel: unknown) => true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里不能用 unknown,需要标明类型
packages/tag-input/demo/index.ts
Outdated
{ | ||
name: 'list', | ||
description: '下拉菜单所需的数据列表', | ||
type: 'Array', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Array, 使用 ts 的写法
packages/timeline/demo/index.ts
Outdated
{ | ||
name: 'list', | ||
description: '时间轴数据源(必传)', | ||
type: 'Array', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的type需要配置成 ITimeLIneItem[],还有link
然后配置 types 里面配置 ITimeLIneItem 具体的类型
|
||
"@babel/compat-data@^7.22.20", "@babel/compat-data@^7.27.2", "@babel/compat-data@^7.27.7": | ||
version "7.28.0" | ||
resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.28.0.tgz#9fc6fd58c2a6a15243cd13983224968392070790" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lock 文件不上传
5f36085
to
aeae3c4
Compare
packages/tab/demo/index.ts
Outdated
description: '选项卡位置', | ||
type: 'string', | ||
options: ['top', 'left', 'right'], | ||
default: '--', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default 不对
packages/tab/demo/index.ts
Outdated
}, | ||
{ | ||
name: 'panel', | ||
type: 'TabPanelProps', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ITabPanelProps
packages/timeline/demo/index.ts
Outdated
{ | ||
name: 'nodeType', | ||
description: '时间轴节点渲染类型,缺省值为 template 默认使用 v-html ,填写 vnode 则支持 JSX 渲染', | ||
type: 'template | vnode', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
template 是什么类型
packages/timeline/demo/index.ts
Outdated
{ | ||
name: 'color', | ||
description: '节点颜色', | ||
type: 'blue | red | green | yellow | gray', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使用options
# Reviewed, transaction id: 61066
aeae3c4
to
114c0d3
Compare
|
||
const types = [ | ||
{ | ||
name: 'ITabPanelProps', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使用 children,然后写到 tab-panel 的 props 里面哦
No description provided.