<!-- 
  * 底部操作按钮
  * 可配合 组件一起使用
  * 也可以单独使用
-->
<template>
  <div class="button-bottom">
    <el-button v-if="!hideSave" type="primary" @click="$emit('submit')"> {{ saveText }}</el-button>
    <el-button v-if="!hideCancel" @click="$emit('close')"> {{ cancelText }}</el-button>
  </div>
</template>

<script setup>
import { defineProps, defineEmits } from 'vue'

defineProps({
  hideSave: {
    type: Boolean,
    default: false
  },
  saveText: {
    type: String,
    default: '保存'
  },
  hideCancel: {
    type: Boolean,
    default: false
  },
  cancelText: {
    type: String,
    default: '取消'
  }
})
defineEmits(['submit', 'close'])
</script>

<style lang="less">
.button-bottom {
  width: 100%;
  height: 64px;
  background: #ffffff;
  border-top: 1px solid var(--el-border-color);
  // position: absolute;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  z-index: 10;
  // padding: 0 var(--el-card-padding);
}
</style>
