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>
    

      

    效果图:

  • 相关阅读:
    校验XX是否在有效期内
    Thymleaf js直接获取后台传过来的对象或者对象的属性以及map
    H5新特性之data-*
    Thymleaf中th:each标签遍历list如何获取index
    SpringBoot图片上传(三)——调用文件上传项目的方法(同时启动两个项目)
    根据状态码,展示不同的文本,两种方法简单讨论
    列表前台验空的必要性
    thymleaf模板截取日期的年月日,去掉时分秒
    javaWeb锁屏的简单实现
    svn上check下来的项目,用idea打开,菜单栏没有svn工具解决办法
  • 原文地址:https://www.cnblogs.com/-rainbow-/p/8968451.html
Copyright © 2011-2022 走看看