|
A high quality UI Toolkit built on Vue.js
Install
npm i @cgj/k-view -S
Quick Start
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
<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, we can import components we actually need, making the project smaller than otherwise.
First, install babel-plugin-kimport:
npm i -D babel-plugin-kimport
Then edit babel.config.js:
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.