zoukankan      html  css  js  c++  java
  • vue van-tabs 设置默认选项

     <van-tabs type="card" animated swipeable sticky color:red   v-model="detail.postname">
                  <van-tab v-for="(item,index) in tabs" :title="item.title"  :key="item.name" :name="item.name"  >
                    <img :src="item.content" />
                  </van-tab>
    
               </van-tabs>
    

      

     tabs: [
            {    name: '生产岗',    title: '生产岗',    content: '../../static/img/role_scg.png'
            },
            {    name: '营销岗',    title: '营销岗',    content: '../../static/img/role_yxg.png'
            },
            {    name: '服务岗',    title: '服务岗',    content: '../../static/img/role_fwg.png'
            },
            {    name: '研发岗',    title: '研发岗',    content: '../../static/img/role_yfg.png'
            },
            {    name: '管理岗',    title: '管理岗',    content: '../../static/img/role_glg.png'
            },
          ],
    

     查找了很多,后来发现很简单,设置了

    v-model就可以设置默认选项
  • 相关阅读:
    Git 操作
    SVN
    一维数组
    常见的数学方法
    常用事件
    function函数
    while;do while; for循环
    JS中的变量提升
    关于js的单双引号嵌套问题
    db.collection is not a function
  • 原文地址:https://www.cnblogs.com/janeaiai/p/13468892.html
Copyright © 2011-2022 走看看