<template>
  <el-button size="default" @click="goBack">返回</el-button>
</template>

<script setup>
import { useRouter } from "vue-router";
const router = useRouter();
const props = defineProps({
  href: {
    type: Object,
    default: null,
  },
});
const goBack = () => {
  if (props.href) {
    router.push(props.href);
  } else {
    router.go(-1);
  }
};
</script>

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