<template>
  <div class="salutatory">
    <el-tabs v-model="activeName">
      <el-tab-pane label="普通欢迎语" :name="1">
        <salutatory :type="activeName" v-if="activeName == 1" />
      </el-tab-pane>
      <el-tab-pane label="特殊欢迎语" :name="2">
        <salutatory :type="activeName" v-if="activeName == 2" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import salutatory from './salutatory.vue';
export default {
  components: {
    salutatory
  },
  data() {
    return {
      activeName: 1
    };
  },
  mounted() {
    if (sessionStorage.getItem('activeName')) {
      this.activeName = Number(sessionStorage.getItem('activeName'));
    }
  },
  destroyed() {
    sessionStorage.setItem('activeName', 1);
  },
  watch: {
    activeName(val) {
      sessionStorage.setItem('activeName', val);
    }
  }
};
</script>

<style type="text/scss" lang="scss" scoped></style>
