zoukankan      html  css  js  c++  java
  • mint-ui Picker的使用

    <template>
      <div v-bind:style="{minHeight:clientHeight + 'px'}" id="recive-min-body">
        <mt-header title="我的赞">
          <mt-button icon="back" slot="left" @click.native="goBack">返回</mt-button>
        </mt-header>
        <form>
          <h3 class="recive-min-input">请填写以下信息:</h3> 
          <mt-field label="你要点赞给" placeholder="巩一杰"  @click.native="handleClick"></mt-field>
          <!-- <mt-field label="使用数量" placeholder="1张"></mt-field> -->
          <mt-popup
          v-model="popupVisible"
          position="bottom"
          modal=false>
          <mt-picker v-bind:style="{clientWidth + 'px',padding: 20 + 'px'}" :slots="slots" @change="onValuesChange"></mt-picker>
          </mt-popup>
          <mt-field label="点赞理由" placeholder="点赞理由要规范" type="textarea" rows="4"></mt-field>
          <div class="recive-buttonBox">
                <mt-button type="primary" class="recive-button"  @click.native="reciveTestSubmit">确定</mt-button>
          </div>
        </form>
      </div>
    </template>
    <style scoped>
      #recive-min-body {
        background-color: #f5f5f5;
      }
      .picker-item {
        padding: 30px;
      }
      .recive-min-input {
        margin-top: 10px;
      }
      form h3 {
        margin: 0;
        padding: 10px !important;
        font-weight: normal;
        font-size: 15px;
      }
      .recive-buttonBox {
            margin: 0 20px;
        }
      .recive-button {
             100%;
            border-radius: 7px;
            margin-top: 20px;
        }
    </style>
    <script>
    export default {
      data () {
        return {
          clientWidth: document.documentElement.clientWidth,
          clientHeight: document.documentElement.clientHeight,
          popupVisible:false,
          slots:  
              [  
              {  
                flex: 1,  
                values: ['大一', '大二', '大三'],  
                className: 'slot1',  
                textAlign: 'left'  
              }, {  
                divider: true,  
                content: '-',  
                className: 'slot2'  
              }, {  
                flex: 1,  
                values: ['1', '2', '3'],  
                className: 'slot3',  
                textAlign: 'right'  
              }  
            ], 
          ids: ""
        }
      },
      watch: {
        values:function(val,oldval){
             console.log(val,oldval);
        }
      },
      methods:{
        goBack: function() {
          this.$router.push({ path: '/home/mine' });
        },
        handleClick: function() {
          this.popupVisible = true;
        },
        onValuesChange(picker, values) {
          if (values[0]=='大一') {
            picker.setSlotValues(1, ['1','2','3']);
          }else if (values[0]=='大二') {
            picker.setSlotValues(1, ['a','b','c']);
          }else if (values[0]=='大三') {
            picker.setSlotValues(1, ['4','5','6']);
          };
        }
      },
      mounted(){
        // this.ids = filters.ytox(this.$route.params.ids)
      }
    }
    </script>
    

      

    效果图:

  • 相关阅读:
    iOS开发---业务逻辑
    iOS 蓝牙功能 bluetooth
    iOS 企业版 安装失败 原因
    iOS 生命周期 -init、viewDidLoad、viewWillAppear、viewDidAppear、viewWillDisappear、viewDidDisappear 区别和用途
    iOS 7 修改默认布局从status bar 底部开始
    企业打包时不能安装原因
    UISegmentedControl 功能简单 分析
    ios 推送 证书配置
    ios 获取手机设备信息
    创建quickstart报错
  • 原文地址:https://www.cnblogs.com/-rainbow-/p/8968451.html
Copyright © 2011-2022 走看看