@cgj/k-view
Version:
``` npm i @cgj/k-view ```
102 lines (75 loc) • 2.2 kB
Markdown
# `|` A high quality UI Toolkit built on Vue.js
[](https://www.npmjs.org/package/@cgj/k-view)
[](https://travis-ci.org/SoldierAb/k-view)
[](https://packagephobia.now.sh/result?p=@cgj/k-view)
[](http://npm-stat.com/charts.html?package=@cgj/k-view)

## Install
```shell
npm i @cgj/k-view -S
```
## Quick Start
```javascript
import KView from '@cgj/k-view'
import '@cgj/k-view/lib/kview/style.css'
Vue.use(KView);
// or
import {
Loading,
Tree
// ...
} from '@cgj/k-view'
Vue.use(Loading);
Vue.use(Tree);
```
## Language Support
```html
<template>
<k-provider :locale="locale">
<router-view />
</k-provider>
</template>
<script>
import Vue from "vue"
import Provider from "@cgj/k-view/lib/provider"
Vue.use(Provider)
// import enUS from "@cgj/k-view/lib/locale/lang/en-US"; // Use by default
import zhCN from "@cgj/k-view/lib/locale/lang/zh-CN";
export default{
data(){
return {
locale:zhCN
}
}
}
<script>
```
## On demand
With the help of [babel-plugin-kimport](https://github.com/SoldierAb/babel-plugin-kimport), we can import components we actually need, making the project smaller than otherwise.
First, install [babel-plugin-kimport](https://www.npmjs.com/package/babel-plugin-kimport):
```bash
npm i -D babel-plugin-kimport
```
Then edit babel.config.js:
```javascript
module.exports = {
[
[
'kimport',
{
libraryName: '@cgj/k-view',
camel2DashComponentName: true,
},
'k-view'
],
],
};
```
## Browser Support
Modern browsers and Internet Explorer 10+.
## Development
Skip this part if you just want to use K-VIEW.
## Changelog
Detailed changes for each release are documented in the [release notes](https://github.com/SoldierAb/k-view/releases).
## LICENSE
[MIT](LICENSE)