# csit-core

> 基于vue、ant-design-vue的组件库

Latest version **0.3.1** (published 2022-01-27) · 0 weekly downloads

## Install

```sh
npm install csit-core
pnpm add csit-core
yarn add csit-core
bun add csit-core
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2022-01-27 |
| First published | 2021-12-09 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 6.2 MB |
| Known vulnerabilities | 0 (+24 in 2 direct dependencies) |
| Install scripts | no |
| Author | lilu |
| Maintainers | zhaocheng00 |

## Links

- npm: https://www.npmjs.com/package/csit-core
- npm.io page: https://npm.io/package/csit-core

## Dependencies (7)

- [vue](https://npm.io/package/vue.md) ^2.6.11
- [vuex](https://npm.io/package/vuex.md) ^3.6.2
- [axios](https://npm.io/package/axios.md) ^0.24.0
- [core-js](https://npm.io/package/core-js.md) ^3.6.5
- [vue-router](https://npm.io/package/vue-router.md) ^3.5.3
- [k-form-design](https://npm.io/package/k-form-design.md) ^3.7.91
- [ant-design-vue](https://npm.io/package/ant-design-vue.md) ^1.7.8

## Recent versions

- 0.3.1 (latest) — 2022-01-27
- 0.3.0 — 2022-01-27
- 0.2.9 — 2022-01-27
- 0.2.8 — 2022-01-27
- 0.2.7 — 2022-01-27
- 0.2.6 — 2022-01-27
- 0.2.5 — 2022-01-26
- 0.2.4 — 2022-01-26
- 0.2.3 — 2022-01-26
- 0.2.2 — 2022-01-26
- 0.2.1 — 2022-01-26
- 0.2.0 — 2022-01-26
- 0.1.9 — 2022-01-26
- 0.1.8 — 2022-01-25
- 0.1.7 — 2022-01-25
- … 6 more at https://npm.io/package/csit-core/versions

## README

# csit-npm-form

## Project setup
```
yarn install
```

### Compiles and hot-reloads for development
```
yarn serve
```

### Compiles and minifies for production
```
yarn build
```

### Lints and fixes files
```
yarn lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

### 一、组件库
package.json

"lib": "vue-cli-service build --target lib --name csit-core --dest lib packages/index.js"
"main": "lib/csit-core.umd.min.js"

vue.config.js

const path = require('path')
function resolve(dir) {
  return path.join(__dirname, dir)
}
module.exports = {
  pages: {
    index: {
      entry: 'examples/main.js',
      template: 'public/index.html',
      filename: 'index.html'
    }
  },
  // 扩展 webpack 配置，使 packages 加入编译
  chainWebpack: config => {
    config.module
      .rule('js')
      .include
      .add('/packages')
      .end()
      .use('babel')
      .loader('babel-loader')
  },
  configureWebpack: {
    resolve: {
      alias: {
        '@': resolve('packages')
      }
    }
  },
}

组件下 index.js
// 导入组件，组件必须声明 name
import UserSelect from './src'

// 为组件提供 install 安装方法，供按需引入
UserSelect.install = function (Vue) {
  Vue.component(UserSelect.name, UserSelect)
}

// 导出组件
export default UserSelect

全局 index.js

// 导入UserSelect组件
import UserSelect from './UserSelect'

import { setConfig } from '@/utils/request'
// 组件列表
const components = [
  UserSelect
]

// 定义 install 方法，接收 Vue 作为参数。如果使用 use 注册插件，那么所有的组件都会被注册
const install = function (Vue) {
  // 判断是否安装
  if (install.installed) return
  // 遍历注册全局组件
  components.map(component => Vue.component(component.name, component))
}

// 判断是否是直接引入文件
if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue)
}

export default {
  // 导出的对象必须具有 install，才能被 Vue.use() 方法安装
  install,
  // 以下是具体的组件列表
  UserSelect,
  setConfig
}

---
_Source: https://npm.io/package/csit-core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
