IDuxFE / idux

🚀 A UI Component Library for Vue3.x
https://idux.site
MIT License
548 stars 141 forks source link

[comp:upload] 期望引入upload组件时可以提供一个完整的样式文件引入 #1058

Open thinkingOfBetty opened 2 years ago

thinkingOfBetty commented 2 years ago

What problem does this feature solve?

在项目中单独引入upload组件时还需要额外引入progress、button、icon这三个组件的样式,这对使用者来说,成本比较高

What does the proposed API look like?

期望引入upload组件时可以提供一个完整的样式文件引入

idux-bot[bot] commented 2 years ago

Translation of this issue:

[Comp: UPLOAD] It is expected that you can provide a complete style file to introduce when introducing an upload component

What PROBLEM DOES This Feature Solve?

When introducing UPLOAD components separately in the project, you also need to introduce additional three components of Progress, Button, and Icon. For users, the cost is relatively high.

What does the proposed api look like?

It is expected that when the upload component is introduced, a complete style file can be provided to introduce

Perfecto23 commented 2 years ago

1

Perfecto23 commented 2 years ago

按需加载可以参考idux文档配置插件:https://idux.site/docs/getting-started/zh#%E6%8C%89%E9%9C%80%E5%8A%A0%E8%BD%BD 然后不需要再文件中引入任何idux的组件和样式了

// vite.config
import { IduxResolver } from 'unplugin-vue-components/resolvers'
import Components from 'unplugin-vue-components/vite'

export default {
  plugins: [
    /* ... */
    Components({
      resolvers: [IduxResolver()],
      // 可以通过指定 `importStyle` 来按需加载 css 或 less 代码
      // 别忘了移除掉 idux.ts 中的样式导入代码
      // resolvers: [IduxResolver({ importStyle: 'css' })],
    }),
  ]
}