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

[新功能需求] Swiper - list数组中指定对象的目标属性名 #410

Closed
PdxLook opened this issue Jul 6, 2024 · 3 comments · Fixed by #485
Closed

[新功能需求] Swiper - list数组中指定对象的目标属性名 #410

PdxLook opened this issue Jul 6, 2024 · 3 comments · Fixed by #485
Labels
feature 新特性

Comments

@PdxLook
Copy link
Contributor

PdxLook commented Jul 6, 2024

这个功能解决了什么问题?

const swiperList = ref([
'https://unpkg.com/wot-design-uni-assets/redpanda.jpg',
'https://unpkg.com/wot-design-uni-assets/capybara.jpg',
])
当数组为下列格式的时候,指定目标属性名 - image;减少不必要的数据处理
[
{
"title": "广告",
"image": "https://unpkg.com/wot-design-uni-assets/redpanda.jpg",
"url": "#"
},
{
"title": "广告图2",
"image": "https://unpkg.com/wot-design-uni-assets/redpanda.jpg",
"url": "#"
}
]

你期望的 API 是什么样子的?

<wd-swiper :list="swiperList" keyName="image"></wd-swiper>

@PdxLook PdxLook added the feature: need confirm 待确认的新特性 label Jul 6, 2024
@Moonofweisheng Moonofweisheng added feature 新特性 and removed feature: need confirm 待确认的新特性 labels Jul 8, 2024
@Moonofweisheng
Copy link
Owner

可以,计划添加valueKey支持此需求。

@PdxLook
Copy link
Contributor Author

PdxLook commented Jul 8, 2024

@Moonofweisheng
当支持valueKey的时候,click | 点击轮播项时触发 | (index: number,item),
点击时需要返回对应的index,和item内容了,以便获取item处理点击的后续事件。

Copy link

此 issue 已被自动锁定,因为关闭后没有任何近期活动。如果有相关 bug,请重新创建一个新 issue。

@github-actions github-actions bot locked and limited conversation to collaborators Aug 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature 新特性
Projects
None yet
2 participants