1.0.7 • Published 2 years ago

fmy-ui v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

使用

  1. 安装
npm i fmy-ui
  1. 在vue2.x工程项目的main.js导入并注册
// 全部导入
import fmyUi from 'fmy-ui'
import 'fmy-ui/style/index.css'
Vue.use(fmyUi)

// 按需导入
import {FLoadMore,FTab,...} from 'fmy-ui'
import 'fmy-ui/style/index.css'
Vue.use(FLoadMore)
Vue.use(FLoadMore)
...
  1. 在页面/组件中直接以标签形式使用
// tab组件集
<template>
  <div>
    <FTabs :currentIndex="curIndex" @changeIndex="changeIndex">
      <f-tab label="首页" index="1">
        <div>内容1</div>
      </f-tab>
      <f-tab label="购物车" index="2">
        <div>内容2</div>
      </f-tab>
      <f-tab label="我的" index="3">
        <div>内容3</div>
      </f-tab>
    </FTabs>
  </div>
</template>

<script>
export default {
  name: 'FTabTest',
  data() {
    return {
      curIndex: "1"
    }
  },
  methods:{
    changeIndex(index) {
      this.curIndex = index
    }
  }
}
</script>
<style scoped>
</style>

文档

tab 组件集

FTabs Attributes

参数说明类型可选值默认值
currentIndex当前选中的tabstring/number-"1"

FTabs Events

事件名说明回调参数
changeIndex切换tb时触发value:string/number

FTabs Slots

name说明
default插槽内容为多个切换的FTab组件导航

FTab Attributes

参数说明类型可选值默认值
indextab的唯一索引string/number-""
labeltab标签名string”“

FTab Slots

name说明
default插槽内容为每个FTab对应显示的content

lazyloadmore 滚动懒加载组件

FLazyLoadMore Attributes

参数说明类型可选值默认值
allList要渲染的整个列表数据array-[]
size一屏要渲染的dom列表数number-10

FLazyLoadMore Slots

name说明
default插槽内容一般为一些列表展示的瀑布流组件

virtualscroll 虚拟滚动组件

FVirtualScroll Attributes

参数说明类型可选值默认值
dataList请求回的整个列表数据array-[]
viewH外部可视区容器高度number-500
itemH滚动列表单项高度number-60

FVirtualScroll Slots

name说明
default插槽内容滚动列表的单项item组件,通过作用域插槽传itemDataObj为列表每一个的数据对象

scroloadmore 滚动加载组件(配合后端分页)

FScroLoadMore Attributes

参数说明类型可选值默认值
partList当前已请求回来的列表array-[]
size一屏要渲染的列表数number-10
curPage当前请求的最新页码number-1
total数据列表总数number-0

FScroLoadMore Events

事件名说明回调参数
curPageChange滚动触底时触发curPage:要加载的下一页页码

FScroLoadMore Slots

name说明
default插槽内容一般为一些列表展示的瀑布流组件,作用域插槽可获取列表数据partList在父组件中自定义渲染结构

pagination 分页加载组件(配合后端分页)

FPagination Attributes

参数说明类型可选值默认值
curPage当前页的页码(可选)number-1
pageSize一页要请求的数据量,也是渲染的dom列表数number-10
total总数据量number-0
continues分页器的连续页码数量(一般传奇数,可选)number-5

FPagination Events

事件名说明回调参数
getCurPage点击分页器进行任意切换页码操作时触发curpagenum:点击切换的页码数

zoom 放大镜组件

FZoom Attributes

参数说明类型可选值默认值
zoomImg放大镜显示的图片string-http://i1.sanwen.net/doc/1701/821-1F119101459.png

tabbar组件集

FTabbar Slots

name说明
default插槽内容为多个切换的FTabbarItem

FTabbarItem Attributes

参数说明类型可选值默认值
path路由跳转路径string-必传
activeColortabbarItem文字选中时的颜色string-"rgba(72, 104, 245, 0.702)"

FTabbarItem Slots

name说明
item-icontabbarItem默认图标
item-icon-activetabbarItem激活选中时的图标
item-texttabbarItem的文字

swiper轮播图/跑马灯 组件集

FSwiper Attributes

参数说明类型可选值默认值
swiperH轮播图组件高度number-160
showIndicator是否显示指示器booleantrue/falsetrue
indiActiveColor指示器激活样式string-rgba(72, 104, 245, 0.702)
showArrow是否显示方向键booleantrue/falsetrue
interval自动轮播间隔时间number-3000(ms)
animDuration轮播切换过渡效果number-300(ms)
moveRatio手指滑动轮播图片超过swiper宽度的多少占比后,松手能放映下一张number-1/4(0.25)

FSwiper Events

事件名说明回调参数
transitionEnd轮播完成触发(包括自动&手动轮播)index:number(表示当前轮播图索引)

FSwiper Slots

name说明
default插槽内容为轮播图轮播内容(即包含的FSwiperItem)

FSwiperItem Slots

name说明
default插槽内容为每一屏轮播的图片内容
1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago