1.0.0 • Published 10 months ago

op-components v1.0.0

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

kts-components

Getting Started

如果要查看业务组件,比如部门信息,请先设置 token

import React from 'react';
import { Input } from 'antd';
import SdkConfig from './src/sdk';
const onResetSchema = e => {
  console.log(e.target.value);
  SdkConfig.token = e.target.value;
};
export default () => (
  <div>
    <Input onChange={onResetSchema} placeholder="设置token" />
  </div>
);

Install dependencies,

$ npm i kts-components

Start the dev server,

$ npm start

Build documentation,

$ npm run docs:build

Build library via father-build,

$ npm run build

常见错误

regeneratorRuntime is not defined

1.npm i @babel/polyfill 2.在 config/polyfill.js 下加入这行代码 require("@babel/polyfill"); 3.自应用需要传递 sdk 给组件,导入{SdkConfig} from 'kts-components';SdkConfig.instance.sdk = sdk;

2.An accessor cannot be declared in ambient context 在 tsconfig.json 中加入此行 "compilerOptions": { "skipLibCheck": true } 3.无法发布 npm 源不对,处理:npm config set registry https://registry.npmjs.org/ -- 有些非官方源个人可能无权发布,比如淘宝镜像需要 admin 权限 ##更新 1.3.1 支持外部 JSX.element 通过 extra 参数放进去。