1.2.0 • Published 5 years ago

ego-ui v1.2.0

Weekly downloads
8
License
ISC
Repository
-
Last release
5 years ago

ego-ui

An ui depend on vue

兼容性

  • 支持所有的现代浏览器和 IE9+。

  • 对于 IE 系列浏览器,需要提供 babel-polyfill 的支持(组件不提供,请自行添加)。

快速上手

你可以引入整个 ego-ui,或是根据需要仅引入部分组件。我们先介绍如何引入完整的 ego-ui。

完整引入 ego-ui

# vue项目中添加依赖
yarn add ego-ui
// 在入口文件中使用
import Vue from 'vue'
import EgoUi from 'ego-ui'
import 'ego-ui/lib/theme-default/index.css'

Vue.use(EgoUi)

那么接下来即可在 Vue 挂载的节点下使用该 ui 组件了

按需引入(推荐)

目前按需引入不能和其他 ui 框架共存

# vue项目中添加依赖
yarn add ego-ui

# 添加 babel-plugin-component
yarn add babel-plugin-component -D

安装完 ego-uibabel-plugin-component 后,在.babelrc中添加配置:

{
  plugins: [
    [
      'component',
      {
        libraryName: 'ego-ui',
        styleLibraryName: 'theme-default'
      }
    ]
  ]
}

接下来,如果你只希望引入部分组件,比如 ButtonSelect,那么需要在 main.js 中写入以下内容:

import Vue from 'vue'
import { Button, Select } from 'ego-ui'
import App from './App.vue'

Vue.use(Button)
Vue.use(Select)

new Vue({
  el: '#app',
  render: h => h(App)
})

使用姿势

引入 ui 组件后并通过vue注册组件后,在vue挂载的节点下即可使用组件。 组件以dy-为前缀的命名方式。

// main.js
import Vue from 'vue'
import EgoUi from 'ego-ui'
import 'ego-ui/lib/theme-default/index.css'

import App fromm './App.vue'
// 全局注册
Vue.use(EgoUi)

new Vue({
  el: '#app',
  render: h => h(App)
})
// App.vue
<template>
  <div id="app">
    <dy-button type="primary">按钮</dy-button>
    <dy-input v-model="value" placeholder="请输入..." />
  </div>
</template>
1.2.0

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago