前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >vue2.0实现银行卡类型种类的选择

vue2.0实现银行卡类型种类的选择

作者头像
王小婷
发布2019-02-21 16:11:40
7420
发布2019-02-21 16:11:40
举报
文章被收录于专栏:编程微刊编程微刊

功能效果:vue2.0实现银行卡类型种类的选择

图片.png

参考代码如下:

代码语言:javascript
复制
<template>
    <div class="app">
      <header>
      </header>
        <div class="details">   
            <div @click="memberRank">
                <span>卡类型</span>
               
                <span>{{name}}</span>
                <i class="el-icon-arrow-right"></i>
            </div>
        </div>
      
          <mt-actionsheet :actions="actions2" v-model="sheetVisible2" cancel-text="">

          </mt-actionsheet>
    </div>
</template>
<script>



export default {
  data() {
    return {
      
      actions2: [],  //底部弹出提示框
      sheetVisible2: false,//透明遮罩背景
      name: "普卡"//默认数值
    };
  },
  computed: {
    
  },
  components: {
  
  },
  methods: {
    // 点击显示会员等级
    memberRank() {
      this.sheetVisible2 = true;
    },
    
    //赋值到框里
    commonCard() {
      this.name = "普卡";
    },
    silverCard() {
      this.name = "银卡";
    },
    goldCard() {
      this.name = "金卡";
    },
    
   
  },
  mounted() {//移动但底部弹出选项
    this.actions2 = [
      {
        name: "普卡",
        method: this.commonCard
      },
      {
        name: "银卡",
        method: this.silverCard
      },
      {
        name: "金卡",
        method: this.goldCard
      }
    ];
  }
};
</script>
<style scoped>

header {
  height: 1.5rem;
  width: 100%;
  background-image: linear-gradient(-134deg, #f62241 0%, #f62241 100%);
  position: relative;
}


.details {
  background: white;
  margin-top: 0.3rem;
  height: auto;
}

.details div span:nth-child(2):not(.phoneNum) {
  position: absolute;
  left: 4rem;
}
.details div {
  clear: both;
  border-bottom: 0.025rem solid rgba(0, 0, 0, 0.02);
  height: 1.5rem;
  line-height: 1.5rem;
  font-size: 0.48rem;
  color: rgba(0, 0, 0, 0.7);
  margin-left: 0.5rem;
}
</style>
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018.08.03 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档