youdi_m

0.0.8 • Public • Published

youdi_m 常用组件和mixins


1. 安装和使用

  yarn add youdi_m
  import YoudiM from 'youdi_m'
  Vue.use(YoudiM);

2. 上拉加载下拉刷新

  data() {
        return {
            list: [],
            loading: false,
            finished: false,
            refreshing: false,
            totalSize: -1,
            pageIndex: 1,
            pageSize: 10,
        }
 },
 封装的方法 onRefresh  onLoad
 在项目中的组件尽量不要在重新定义上面的方法变量
 
 
 使用方法:
 <van-pull-refresh v-model="refreshing" @refresh="refresh">
        <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="loadData">
          <div v-for="(item,index) in list" :key="index" :item="item">
           
          </div>
        </van-list>
      </van-pull-refresh>
 
//payList 获取数据的方法
async loadData() {
      await this.onLoad(payList, this.filterParams);
    },
refresh() {
  this.refreshing = true;
  this.onRefresh(payList, this.filterParams);
},

3. 过滤器使用

// v-restinput 表示允许的最多的小数位数 默认为2
 <input type="number" v-model="ceshi" v-restinput="2" />

4. 预览组件使用

 <my-img-preview url="https://img.yzcdn.cn/vant/apple-2.jpg"></my-img-preview>
 #url 默然的url
 #isPreview  是否支持预览
 #preList 需要预览的图片列表
 #imgStyle 图片的样式

Readme

Keywords

none

Package Sidebar

Install

npm i youdi_m

Weekly Downloads

1

Version

0.0.8

License

none

Unpacked Size

427 kB

Total Files

8

Last publish

Collaborators

  • xyf_coco