0.0.2 • Published 3 years ago

tok-ui v0.0.2

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

tok前端 react 组件库

安装

npm install tok-ui
yarn add tok-ui

按需引入

// .babelrc or babel-loader option
{
  "plugins": [
    ["import", {
      "libraryName": "tok-ui",
      "libraryDirectory": "es",
      "style": true
    }]
  ]
}

主题配置

const styleVariables = {
  'xy-primary-color': '#1890FF', // 全局主色
};
// sass-loader中:
{
loader: require.resolve('sass-loader'),
options: {
  data: Object.keys(styleVariables)
    .map(k => `$${k}: ${styleVariables[k]};`)
    .join('\n')
}

使用

import { Upload } from 'tok-ui';

const App = () => {
  return (
    <Upload.Image
      cropper={{
        ratio: '4:3',
      }}
    />
  );
};