ksc-fe / kpc

A UI Components Library for Intact, Vue, React and Angular.
https://design.ksyun.com/
MIT License
362 stars 53 forks source link

希望组件库可以把dayjs暴露出来,允许从组件库导出dayjs #987

Closed qinfeng0214 closed 6 months ago

qinfeng0214 commented 6 months ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 项目中其他地方也需要使用dayjs,需要安装dayjs,打包的时候不确定是不是会打包两份dayjs Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

Javey commented 6 months ago

只要依赖的版本一致,就不会打包两份 "dayjs": "^1.10.7"

qinfeng0214 commented 6 months ago

只要依赖的版本一致,就不会打包两份 "dayjs": "^1.10.7"

组件库可以暴露出来dayjs吗?这样就能保证不会打包2份dayjs,目前我使用的是dayjs v1.11.10。 像下面这样: import { dayjs } from '@king-design/vue'

Javey commented 6 months ago

@warrior-bing 在components/datepicker/index.ts添加export { dayjs };,把dayjs暴露出来