0.3.10 • Published 5 years ago

mycustomui v0.3.10

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

TOC

Installation

NPM

$ npm install mycustomui --save

CDN

<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/mycustomui/lib/styles/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/mycustomui/lib/customui.umd.min.js"></script>

Quick Start

import Vue from 'vue';

import 'mycustomui/lib/styles/index.css';
import customUI from "mycustomui";

Vue.use(customUI);
...

// 示例:HelloWorld
<HelloWorld msg="Welcome" />


// 组件:LaSlider/SliderItem 走马灯
<LaSlider :arrow="true" @changeIndex="changeIndex">
  <SliderItem v-for="(item, index) in 5" :key="index">
    <h1>插入内容</h1>
  </SliderItem>
</LaSlider>
...
methods: {
  changeIndex(res) {
    console.log(res);
  }
}

// 方法:toast轻提示
this.$toast.warning('warning');

this.$toast({
  message: 'test',
  type: 'success',
  duration: 2000,
  animate: 1,
  onClose: function() {
    console.log('closed callback');
  }
});

Props

走马灯:LaSlider

LaSlider Attr

参数说明类型可选值默认值
height高度String--100%
initIndex初始状态激活项的索引,从 0 开始Number--0
loop循环切换Booleantrue/falsetrue
arrow切换箭头的显示Booleantrue/falsefalse
arrowColor切换箭头的色系Stringlight/deepdeep
indicator底部指示器Booleantrue/falsetrue
indicatorColor底部指示器色系Stringlight/deepdeep
autoplay自动切换Booleantrue/falsetrue
interval切换间隔Number--3000
direction切换方向Stringleft/rightright
touchRatio触发切换所需拖动比例Number0~10.3

LaSlider Methods

方法名说明参数示例
sliderPrev切换至上一项--this.$refsname.sliderNext()
sliderNext切换至下一项----
handleIndicator切换至指定项需要切换的索引,从 1 开始--

LaSlider Events

事件名称说明回调参数
changeIndex切换时触发,返回当前激活项的索引和原激活项的索引json

轻提示:toast

轻提示:toast Attr

参数说明类型可选值默认值
type提示类型(纯文本多文字提示选info)String'success', 'warning', 'loading', 'info'--
duration持续时间msNumber0 默认不关闭2500
message提示文本String----
fontSize文本字体大小String'max'--
animate显示动效Number1, 2, 31
onClose回调函数Function----

toast Methods

方法名说明参数示例
close主动关闭提示--this.$toast.close()

Demo

扫码查看在线示例

TODO list

  1. 补充组件库
  2. 组件按需引入
  3. 整理文档及demo
  4. 单元测试
0.3.10

5 years ago

0.3.9

5 years ago

0.3.8

5 years ago

0.3.7

5 years ago

0.3.6

5 years ago

0.3.5

5 years ago

0.3.3

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.5

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago