0.0.6 • Published 5 months ago

auto-element v0.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

说明

auto-element 全面兼容 element-ui v2.15.14,该库主要用于大屏缩放方案页面缩放计算后,弹出层偏移的情况(例如 autofit.js 等)。

autofit.js 为例:

// 目前只支持 autofit 挂载至 body
autofit.init({
  el: 'body',
  ...
})
// 弹出层组件例如 el-select 
// popper-append-to-body 只能为 false(挂载至 body)

main.js

// offset 指定 autofit 挂载的dom,目前也只能支持 body
Vue.use(AutoElement, { offset: 'body' })

安装

npm install auto-element -S

使用

import Vue from 'vue'
import AutoElement from 'auto-element'

Vue.use(AutoElement, { offset: 'body' })

// or
import {
  Select,
  Button
  // ...
} from 'auto-element'

Vue.component(Select.name, Select)
Vue.component(Button.name, Button)

感谢

方案来自 !issue

thanks wanglei1020 LarryZhu-dev