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

按需引入Carousel组件,没有效果 #271

Closed
1 task done
shanlh opened this issue Nov 21, 2018 · 6 comments
Closed
1 task done

按需引入Carousel组件,没有效果 #271

shanlh opened this issue Nov 21, 2018 · 6 comments
Labels

Comments

@shanlh
Copy link

shanlh commented Nov 21, 2018

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.1.8

Environment

macOS Mojave 10.14.1; Chrome 70.0.3538.77; Vue 2.5.17

Reproduction link

Edit on CodeSandbox

Steps to reproduce

https://codesandbox.io/s/v8j37m6km3
如上按需引用Carousel组件

What is expected?

可以正常render

What is actually happening?

没有正常render


我是在nuxt中按需加载发现的问题,在CodeSandbox中也能复现:

经过问题排查,在/components/carousel/index.jsx中找到:

const SlickCarousel = require('../vc-slick/src').default

发现赋值SlickCarousel成了undefined,导致不能正常render。
如果 import SlickCarousel from '../vc-slick/src' 这样写好像可以,但不确定会不会因为import在打包过程中将代码提前,引起注释中提到的matchMedia not present, legacy browsers require a polyfill问题。

@tangjinzhou
Copy link
Member

https://github.com/ant-design/babel-plugin-import
you can set libraryDirectory to es.

@tangjinzhou
Copy link
Member

lib下组件问题将在下个版本修复

@shanlh
Copy link
Author

shanlh commented Nov 22, 2018

好的谢谢!在nuxt中暂时用plugin引入es的carousel解决了

@tangjinzhou
Copy link
Member

1.1.9已修复

@shanlh
Copy link
Author

shanlh commented Nov 26, 2018

好了,谢谢!

@github-actions
Copy link

github-actions bot commented Apr 2, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants