@codingfly/remax-design
优雅、简洁的 Remax 组件库
💫 特性
- 基于
Remax
开发 UI 组件 - 支持
微信
支付宝
钉钉
小程序多端适配运行 - 支持按需引入
- 支持 TypeScript
📦 安装
yarn add @codingfly/remax-design -D
🎀 使用
按需加载
安装babel-plugin-import
插件
$ yarn add babel-plugin-import -D
修改babel.config.js
文件
// babel.config.js
module.exports = {
plugins: [
+ [
+ 'import',
+ {
+ libraryDirectory: 'es',
+ libraryName: '@codingfly/remax-design'
+ },
+ '@codingfly/remax-design'
+ ]
]
};
定制主题
修改remax.config.js
文件
module.exports = {
...
- plugins: [less()],
+ plugins: [
+ less({
+ lessOptions: {
+ modifyVars: { '@brand-primary': '#2780d9' },
+ javascriptEnabled: true
+ }
+ })
+ ]
...
};
修改app.tsx
文件
+import { ConfigProvider } from '@codingfly/remax-design';
const App = (props) => {
- return props.children;
+ return <ConfigProvider brandPrimary={'#2780d9'}>{props.children}</ConfigProvider>;
};