1.0.7 • Published 1 year ago

easier-ui v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

特性

  • 具有toast,loading,dialog三种场景
  • 相对其他主流ui框架体积较小,适合不想自己手写却有这种交互需求的简单页面

安装

npm i easier-ui

引入

import easierUI from 'easier-ui'
import 'easier-ui/easier-ui.css'

Vue.use(easierUI)

基础用法

<template>
  <div id="app">
  <ea-dialog
      :show="visible"
      @close="cancel"
    >
      ddd
    </ea-dialog>
    <router-view></router-view>
  </div>
</template>
<script>
export default {
  name: 'App',
  components: {
  },
  data () {
    return {
      visible: true
    }
  },
  mounted () {
    // this.$eaLoading.show()
    
    this.$eaToast('333')
    this.$eaToast({
        message: '2222'
    })
  },
  methods: {
    cancel () {
      this.visible = false
    }
  }
}
</script>
<style>
  html,
  body,
  #app{
    height: 100%;
    padding: 0;
    margin: 0;
  }
</style>

Loading

调用方法:

this.$eaLoading.show()  // 展示
this.$eaLoading.hide() // 隐藏
options配置项
参数说明类型默认值
messageloadingt提示文字String——
bgColor背景颜色String——
opacity背景不透明度Number0.6

Toast

调用方法:

this.$eaToast('xxxxx')
// 或者
this.$eaToast({
    message: 'xxxx',
    duration: 2000
})
options配置项
参数说明类型默认值
messagetoast提示文字String——
durationtoast停留时间Number2000(毫秒)
offsetY偏移量Number50

Dialog组件

调用方法:

<template>
    <div id="app">
        <ea-dialog
            :show="visible"
            @close="cancel"
        >
            <!-- your content -->
        </ea-dialog>
    </div>
</template>
属性
参数说明类型默认值
show是否显示Booleanfalse
closeShow关闭按钮是否显示Booleantrue
width关闭按钮是否显示number(or)string50%
appendToBody是否追加到body节点Booleanfalse
方法
参数说明类型默认值
close关闭按钮回调函数Function——
1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago