index.vue 1.27 KB
Newer Older
renhanxue's avatar
renhanxue committed
1
<template>
renhanxue's avatar
renhanxue committed
2 3 4 5 6 7 8
  <div>
    <div class="update-user-container">
      <div class="header">
        <div class="tab">
          <div v-for="(item,index) in options" :key="item.id" class="tab-item" :class="tabIndex === index ? 'tab-active' : ''" @click="radioChange(item.value,index)">
            {{ item.name }}
          </div>
renhanxue's avatar
renhanxue committed
9 10
        </div>
      </div>
renhanxue's avatar
renhanxue committed
11 12
      <base-info v-if="tabIndex === 0" />
      <password v-if="tabIndex === 1" />
renhanxue's avatar
renhanxue committed
13 14 15 16 17 18 19 20
    </div>
  </div>
</template>

<script>
import baseInfo from '../updateUser/components/baseInfo.vue'
import Password from '../updateUser/components/password.vue'
export default {
yanzhongrong's avatar
yanzhongrong committed
21
  components: { baseInfo, Password },
renhanxue's avatar
renhanxue committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
  data() {
    return {
      options: [{
        name: '修改基本信息',
        value: 1
      },
      {
        name: '修改密码',
        value: 2
      }],
      tabIndex: 0

    }
  },
  methods: {
    radioChange(val, index) {
      this.tabIndex = index
    }
  }
}
</script>
<style lang="scss" scoped>
renhanxue's avatar
renhanxue committed
44

renhanxue's avatar
renhanxue committed
45 46
.header {
    display: flex;
renhanxue's avatar
renhanxue committed
47
    justify-content: center;
renhanxue's avatar
renhanxue committed
48
    margin-bottom: 30px;
renhanxue's avatar
renhanxue committed
49 50 51 52
    .tab {
      display: flex;
      cursor: pointer;
      .tab-item {
renhanxue's avatar
renhanxue committed
53 54
        margin: 0 50px;
        padding-bottom: 10px;
renhanxue's avatar
renhanxue committed
55 56
      }
      .tab-active {
renhanxue's avatar
renhanxue committed
57 58
        color: #038ed7;
        border-bottom: 1px solid #038ed7;
renhanxue's avatar
renhanxue committed
59 60 61 62
      }
    }
  }
</style>