@codingfly/remax-design
TypeScript icon, indicating that this package has built-in type declarations

1.5.2 • Public • Published

@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>;
};

🌰 示例

示例

Readme

Keywords

none

Package Sidebar

Install

npm i @codingfly/remax-design

Weekly Downloads

3

Version

1.5.2

License

MIT

Unpacked Size

3.71 MB

Total Files

1539

Last publish

Collaborators

  • magic-boom