0.0.6 • Published 2 years ago

fed-material-ui-web v0.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

快捷指令

  • add:comp 按模版快速添加组件

组件设计约定

基于 antdv 开发,为了与 antdv 的生态保持兼容性,覆盖 antd 的样式必须要使用 .@{ant-prefix} 变量来生成类名,在 js 中使用如下代码来配置实现。

使用说明

1. 组件变量

需要手动注入变量 ant-prefix vite下

defineConfig({
  // ...
  css: {
    preprocessorOptions: {
      less: {
        modifyVars: 0
          '@ant-prefix': 'ant'
        },
        javascriptEnabled: true
      }
    }
  }
  // ...
})

2. 开发模式下组件调试

可以直接将引入修改为 src 目录下具体组件 如过调试组件使用了 jsx ,项目需要安装 jsx 支持插件

vue-cli: @vue/babel-plugin-jsx

yarn add @vue/babel-plugin-jsx -D

// babel 配置:
{
  "plugins": ["@vue/babel-plugin-jsx"]
}

vite: vitejs/plugin-vue-jsx

yarn add vitejs/plugin-vue-jsx -D

// vite.config.js
import vueJsx from '@vitejs/plugin-vue-jsx'

export default {
  plugins: [
    vueJsx({
      // options are passed on to @vue/babel-plugin-jsx
    })
  ]
}