# kpc
**Repository Path**: wisdom-and-wisdom/kpc
## Basic Information
- **Project Name**: kpc
- **Description**: 同时支持Intact/Vue/React/Angular框架的前端组件库
- **Primary Language**: JavaScript
- **License**: MIT
- **Default Branch**: master
- **Homepage**: https://design.ksyun.com/
- **GVP Project**: No
## Statistics
- **Stars**: 1
- **Forks**: 14
- **Created**: 2020-12-08
- **Last Updated**: 2022-06-28
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
[](https://github.com/ksc-fe/kpc/actions?query=workflow%3A%22Node.js+CI%22)
[](https://codecov.io/gh/ksc-fe/kpc/branch/master)
[](https://cdn.jsdelivr.net/npm/kpc/dist/)
[](https://cdn.jsdelivr.net/npm/kpc/dist/)
[](https://www.npmjs.com/package/kpc)
[](https://www.npmjs.com/package/kpc)
[English](./README.md) | 简体中文
## 特性
* 支持多框架 [Intact][1] / [Vue][2] / [React][3] / [Angular][4]
* 完全可自定义的主题系统
* 360°全方位定位系统
* 声明式表单验证
* 完善的[文档](https://ksc-fe.github.io/kpc/)和精心的设计
* 90%单元测试覆盖率
## 浏览器支持
| [
](http://godban.github.io/browsers-support-badges/)IE / Edge | [
](http://godban.github.io/browsers-support-badges/)Firefox | [
](http://godban.github.io/browsers-support-badges/)Chrome | [
](http://godban.github.io/browsers-support-badges/)Safari | [
](http://godban.github.io/browsers-support-badges/)Opera |
| --------- | --------- | --------- | --------- | --------- |
| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions
## Vue
### 安装
```shell
npm install kpc-vue --save
```
### 使用
```js
```
## React
### 安装
```shell
npm install kpc-react --save
```
### 使用
```jsx
import React from 'react';
import {Button} from 'kpc-react';
class App extends React.Component {
render() {
return
}
}
```
## Intact
### 安装
```shell
npm install kpc --save
```
### 使用
```js
import {Button} from 'kpc';
```
## Angular [详情][5]
### 安装
```shell
npm install kpc-angular -S
```
### 配置`webpack.config.js`
Angular CLI 初始化的项目必须使用`@angular-builders/custom-webapck`来配置webpack
```js
const path = require('path');
module.exports = function(config) {
config.module.rules.find(rule => {
if (rule.test.toString() === '/\\.css$/') {
rule.exclude.push(path.resolve(__dirname, 'node_modules/kpc-angular'));
return true;
}
});
return config;
};
```
### 使用
`src/app/app.module.ts`
```ts
import { KpcBrowserModule, KpcModule } from 'kpc-angular';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
KpcBrowserModule,
AppRoutingModule,
KpcModule,
],
providers: [],
bootstrap: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule { }
```
```ts
import { Component, ViewEncapsulation } from '@angular/core';
import { MessageComponent } from 'kpc-angular';
@Component({
selector: 'app-root',
template: `
Hello World
`,
style: `
.k-button {
margin: 10px;
}
`,
encapsulation: ViewEncapsulation.None,
})
export class AppComponent {
onClick() {
MessageComponent.success('Welcome to kpc world!');
}
}
```
## 即时反馈
欢迎加入QQ群反馈问题和获得即时帮助,QQ群:529739732
[](https://shang.qq.com/wpa/qunwpa?idkey=a9ef1aa7e7befbd3eaa61a3f2c3f7ab17436dbd317f6d02c9a643e0049e52cad)

## 链接
* [KPC 官方文档](https://design.ksyun.com)
* [Intact MVVM框架][1]
* [Vdt 模板引擎](http://javey.github.io/vdt.js/)
* [Intact-Vue 兼容层](https://github.com/Javey/intact-vue)
* [Intact-React 兼容层](https://github.com/ksc-fe/intact-react)
* [Intact-Angular 兼容层](https://github.com/ksc-fe/intact-angular)
## 开发
> 需要`node@10`以及`npm@6.9`以上
```shell
git clone https://github.com/ksc-fe/kpc.git
cd kpc
npm install
npm run dev:doc
# 测试
npm run test
# 更新测试快照
npm run snapshot
# 部署文档
npm run deploy:doc
# 发版
npm run release
```
## 许可
MIT
[1]: http://javey.github.io/intact/
[2]: https://vuejs.org/
[3]: https://reactjs.org/
[4]: https://angular.io/
[5]: https://design.ksyun.com/docs/angular/