Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guixianleng/elm-secondary
element二次封装(表格,表单,tree-select)
https://github.com/guixianleng/elm-secondary
cascader element-ui form table
Last synced: about 10 hours ago
JSON representation
element二次封装(表格,表单,tree-select)
- Host: GitHub
- URL: https://github.com/guixianleng/elm-secondary
- Owner: guixianleng
- Created: 2020-04-28T06:20:04.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-12T15:17:26.000Z (about 2 years ago)
- Last Synced: 2024-04-16T09:22:13.738Z (9 months ago)
- Topics: cascader, element-ui, form, table
- Language: Vue
- Homepage: https://guixianleng.github.io/elm-secondary/
- Size: 3.26 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## 基于elementUI的二次封装
包括表格、表单、分页、树状下拉、省市区联动### 在线文档地址
https://guixianleng.github.io/elm-secondary/### 安装
推荐使用 npm 的方式安装,它能更好地和 webpack 打包工具配合使用。```shell
npm i @poly/elm-ui -S
```### 引入 @poly/elm-ui
在main.js写入以下内容:```js
import Vue from 'vue';
import ElmUI from '@poly/elm-ui';
import App from './App.vue';
import '@poly/elm-ui/lib/elm-ui.css';Vue.use(ElmUI);
new Vue({
el: '#app',
render: h => h(App)
});
```### 组件库踩坑
封装组件的时候因为使用了ts进行封装的,组件一定要带上`name`栗子:
```js
...
@Component({
name: 'ElmPagination'
})
```
注册组件也需要获取组件名`options.name`
```js
...
ElmPagination.install = function(Vue) {
Vue.component(ElmPagination.options.name, ElmPagination)
}
```
全局按需加载注册组件也需要`options.name`
```js
...
const install = function(Vue) {
components.forEach(component => {
Vue.component(component.options.name, component)
})
}
```### 本地预览
```
yarn install
```### 运行
```
yarn serve
```