管理员选择器

import userChoose from "@/views/my-components/lili/user-choose";
export default {
.......
    components: {
    userChoose
  },
.......
  data() {
    return {
      type: 0,
      loading: false, 
            //存储选择的管理员
      selectUsers: []
      }
  } 
}


......
    <!--代码中使用-->
  <user-choose text="选择发送用户" @on-change="handleSelectUser" ref="user"></user-choose>
......

会员选择器

import memberChoose from "@/views/my-components/lili/member-choose";
export default {
.......
    components: {
    memberChoose
  },
.......
  data() {
    return {
            //存储选择的管理员
      selectUsers: []
      }
  } 
}


......
    <!--代码中使用-->
  <member-choose text="选择发送用户" @on-change="handleSelectMember"></member-choose>
......

sku选择器

<template>
  <sku-choose @on-change="handleSelectMember"  :initData="xxx" :createName="createName" ></sku-choose>
<!--on-change 选择器选择内容变更,这里传递调用段需要的参数, initData 初始化参数用于参数回显,createName 用于自定义函数,定义选择器下方名称-->
</template>

<script>

  import skuChoose from "@/views/my-components/lili/sku-choose";
  export default {
    components: {
      skuChoose
    },
    name: 'specList',
    data() {
      return {
        /**要传递的对象,告知选择器以选择的商品*/
        xxx:[{"id":"285642960844886016","createBy":"admin","createTime":"2020-06-18 03:35:30","updateBy":null,"updateTime":null,"delFlag":0,"goodsId":"285642953370636288","goodsName":"测试商品","sn":"1111","quantity":123,"price":123,"weight":123,"sellerId":"682265633886208","sellerName":"admin","categoryPath":"260546277689790464,260545982180102144,260563099466076160","thumbnail":"http://nskj.oss-cn-beijing.aliyuncs.com/137679ec3cb84fd69528de507ae11345.jpg_1x1","freightTemplateId":null,"point":null,"isPromotion":null,"promotionPrice":null,"specName":"颜色:黄色;","_index":4,"_rowKey":11}]
      }
    },
    methods: {
      /** 数据改变之后 抛出数据 */
      handleSelectMember(v) {
        console.log(v)
      },
      /** 如果需要对以选择框 商品名称自定义,则调用此方法,否则不必传递,显示方会显示 GoodsName*/
      createName(item){
        return item.id+item.goodsName;
      }
    }
  }
</script>

results matching ""

    No results matching ""