<template>
  <div>
    <p-card>
      <div slot="title" style="display: inline-block; align-items: center; cursor: pointer" @click="clickEvent('back')">
        <a-icon v-if="rightIcon" :type="rightIcon" />
        {{ title }}
        <a-icon v-if="leftIcon" :type="leftIcon" />
      </div>
      <div slot="extra">
        <slot name="buttonList" />
      </div>
      <div>
        <slot></slot>
      </div>
    </p-card>
  </div>
</template>

<script>
export default {
  components: {},
  props: {
    title: {
      type: String,
      default: '返回'
    },
    rightIcon: {
      type: String,
      default: 'arrow-left'
    },
    leftIcon: {
      type: String,
      default: ''
    },
  },
  computed: {},
  watch: {},
  data() {
    return {
    }
  },
  created() {},
  mounted() {},
  methods: {
    clickEvent(data) {
      this.$emit('clickEvent', data)
    }
  }
}
</script>

<style lang="less" scoped>
.extend-title {
  font-size: 14px;
  font-weight: bold;
  padding: 12px 0;
  border-bottom: 1px solid #e8e8e8;
  margin-bottom: 12px;
}
</style>
