Code Monkey home page Code Monkey logo

elm-secondary's Introduction

基于elementUI的二次封装

包括表格、表单、分页、树状下拉、省市区联动

在线文档地址

https://guixianleng.github.io/elm-secondary/

安装

推荐使用 npm 的方式安装,它能更好地和 webpack 打包工具配合使用。

 npm i @poly/elm-ui -S

引入 @poly/elm-ui

在main.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

栗子:

...
@Component({
  name: 'ElmPagination'
})

注册组件也需要获取组件名options.name

...
ElmPagination.install = function(Vue) {
  Vue.component(ElmPagination.options.name, ElmPagination)
}

全局按需加载注册组件也需要options.name

...
const install = function(Vue) {
  components.forEach(component => {
    Vue.component(component.options.name, component)
  })
}

本地预览

yarn install

运行

yarn serve

elm-secondary's People

Contributors

guixianleng avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

skylingfly

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.