0.1.5 • Published 4 years ago

sz-ui v0.1.5

Weekly downloads
104
License
-
Repository
-
Last release
4 years ago

Szui组件库搭建中 ... 感谢您的测试 我们会让您的编程更简洁、高效

合作人

舒榆衡 徐子笙 赵恒 李勇 于景尧 王涛 关瑞 伍浙江 张奋强

安装方法

npm i sz-ui

使用方法

// 引入sz-ui组件
import Szui from 'sz-ui'
// 引入css文件
import  'sz-ui/dist/sz-ui.css'
// 使用sz-ui
Vue.use(Szui)

Components

1. sz-Sweiper 轮播图

// 按需导入
import {Sweiper} from '../packages'
import  'sz-ui/dist/sz-ui.css'
Vue.use(Sweiper)

1.使用方法

<template>
  <sz-Sweiper :model="images" width="700" height="400" :time="1" auto>
    <template v-slot:default="{data:data}">
      {{data}}
      <img :src="data.src" width="100%" height="100%" />
    </template>
  </sz-Sweiper>
</template>

<script>
export default {
  data() {
    return {
      // 轮播图数据
      images: [
        {
          src: "http://www.shuyuhng.top:9999/img/aa.bdab5332.jpg"
        },
        {
          src: "http://www.shuyuhng.top:9999/img/aa.bdab5332.jpg"
        },
        {
          src: "http://www.shuyuhng.top:9999/img/aa.bdab5332.jpg"
        },
        {
          src: "http://www.shuyuhng.top:9999/img/aa.bdab5332.jpg"
        }
      ]
    };
  }
};
</script>

配置

属性配置

参数说明选填类型可选值默认值
model基础数据Array--------
width轮播图宽度Number/String----700
height轮播图高度Number/String-----400
type轮播图类型Stringinfinite/default/fade/stackdefault
time每次滚动时间Number----0.8
auto是否自动播放Booleantrue/falsefalse
autoTime自动播放的时间Number----3000
noIndicator是否显示指示器Booleantrue/falsefalse
noBtn是否显示按钮Booleantrue/falsefalse
bottomBtnClass给指示器绑定类名String--------
slide是否支持滑动Booleantrue/falsefalse

slot插槽

插槽名称说明
default轮播图内容
left-btn左边的按钮
right-btn右边的按钮

2. sz-Slide 滑动监听

// 按需导入
import {Slide} from '../packages'
import  'sz-ui/dist/sz-ui.css'
Vue.use(Slide)

使用方法

<template>
   <sz-Slide @direction="direction">
      <div style="width:700px;height:400px;background-color:green;">
      </div>
    </sz-Slide>
</template>

<script>
export default {
 methods: {
    direction(direction) {
      switch (direction) {
        case "left":
          console.log("左滑");
          break;
        case "right":
          console.log("右滑");
          break;
        case "up":
          console.log("上滑");
          break;
        case "down":
          console.log("下滑");
          break;
        default:
          break;
      }
    },
  }
};
</script>

配置

属性配置

参数说明选填类型可选值默认值
sensitivity灵敏度 例如检测滑动20pxNumber/String----40

slot插槽

插槽名称说明
default默认内容

方法

方法名称说明返回值
direction检测滑动的方向direction(direction) {} / String
move滑动的关键数据move(moveData) {} / Object
0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago