<template>
  <div class="view-title clearfix">
    <div class="pull-left">{{titleText}}</div>
    <div class="pull-right add-address" @click="addAddress">
      <i class="el-icon-circle-plus"></i>新增地址
    </div>
  </div>
</template>

<script>
  export default {
    props: {
      titleText: {
        type: String,
        default: '地址管理'
      }
    },
    methods: {
      addAddress() {
        this.$emit('addAddress')
      }
    }
  }
</script>

<style scoped type="text/scss" lang="scss">
  .view-title {
    margin: 35px 12px 20px 12px;
    .pull-left {
      height: 19px;
      color: #333;
      font-size: 16px;
      border-left: 3px solid #0d5ffe;
      padding-left: 3px;
      font-weight: bold;
    }
    .add-address {
      font-size: 14px;
      color: #64c9bb;
      border: 1px solid #64c9bb;
      border-radius: 3px;
      padding: 6px 8px;
      margin-top: -10px;
      cursor: pointer;
      &:hover {
        color: #0d5ffe;
        border: 1px solid #0d5ffe;
        i {
          color: #0d5ffe;
        }
      }
      i {
        font-size: 14px;
        color: #64c9bb;
        margin-right: 4px;
      }
    }
  }
</style>
