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

feat: n-image adds showPreview methods #6746

Closed

Conversation

zhengdaonian
Copy link
Contributor

@zhengdaonian zhengdaonian commented Feb 10, 2025

feat: n-image 允许通过调用showPreview 方法来触发大图预览

close #5763
close #6479
close #6695

Copy link

vercel bot commented Feb 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
naive-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 11, 2025 1:39am

@jahnli jahnli changed the title feat: n-image adds showPreview methods, closes [#6695](https://git… feat: n-image adds showPreview methods Feb 10, 2025
@zhengdaonian
Copy link
Contributor Author

我看有人的需求好像是image-preview这个组件要单独使用,这个要做吗?

@jahnli
Copy link
Collaborator

jahnli commented Feb 11, 2025

I think someone's requirement seems to be image-preview. This component should be used alone. Do you want to do this?

Welcome PR

@799189288
Copy link

799189288 commented Feb 11, 2025

感觉你写的这个不是单纯的独立api,类似于vant中的showImagePreview,这种传一个图片url数组比较合适。你这种获取instance去调用自定义的show方法,那我为啥不直接模拟点击instance.click()。

@zhengdaonian
Copy link
Contributor Author

你要的是独立image-preview,这个showPreview是给部分人要按钮打开图片预览,两个东西。

@799189288
Copy link

你要的是独立image-preview,这个showPreview是给部分人要按钮打开图片预览,两个东西。

我意思你的showPreview, 就是instance.click()。写复杂了

@zhengdaonian
Copy link
Contributor Author

组件内部能实现的,组件内部实现好一点,参考elementplus的showPreview,总有人需要的

@799189288
Copy link

组件内部能实现的,组件内部实现好一点,参考elementplus的showPreview,总有人需要的

OK,你这样说也没问题。但其实业务方面更需要的是刚刚提到的独立组件, 不然就得,把NImage手动去隐藏, 然后再去模拟点击。很是麻烦

@zhengdaonian
Copy link
Contributor Author

我有看到有那个image-preview单独使用的需求,arco.design有相近的功能,这两天加班的时候做一下

@799189288
Copy link

799189288 commented Feb 11, 2025

我有看到有那个image-preview单独使用的需求,arco.design有相近的功能,这两天加班的时候做一下

搞个

<NPreviewProvider></NPreviewProvider>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants