<template>
  <div id="top">
    <el-row>
      <el-col :span="24" class="main">
        <el-col :span="24" class="one">
          <el-col :span="20" class="left">
            {{ topText }}
          </el-col>
          <el-col :span="4" class="right" v-if="userMore">
            <el-link :underline="false" @click="more">MORE</el-link>
          </el-col>
        </el-col>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'top',
  props: {
    topText: { type: String },
    userMore: { type: Boolean, default: true },
  },
  components: {},
  data: function () {
    return {};
  },
  created() {},
  methods: {
    more() {
      this.$emit('more');
    },
  },
  computed: {
    ...mapState(['user']),
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
  watch: {
    test: {
      deep: true,
      immediate: true,
      handler(val) {},
    },
  },
};
</script>

<style lang="less" scoped>
.main {
  .one {
    height: 40px;
    line-height: 40px;
    overflow: hidden;
    border-bottom: 1px solid #ccc;
    .left {
      font-weight: bold;
      font-size: 16px;
    }
    .right {
      text-align: right;
      .el-link {
        font-weight: bold;
      }
    }
  }
}
</style>
