index.vue 808 Bytes
<template>
    <el-button class="venus-back-button"
               type="text"
               :style="{ width: `${size}px`, height: `${size}px` }"
               @click="handleBack">
        <i class="el-icon-back" :style="{ fontSize: `${size * 0.6}px` }"></i>
    </el-button>
</template>

<script>
export default {
	name: "VenusBackButton",
	props: {
		size: {
			type: Number,
			default: 32,
		},
	},
	methods: {
		handleBack() {
			this.$router.back();
		},
	},
};
</script>

<style scoped lang="scss">
.venus-back-button {
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition:
		color 200ms,
		background-color 200ms;
	color: #303133;
	background-color: white;
	border-radius: 6px;
	&:hover {
		color: #2a58ad;
		background-color: rgba(245, 245, 245);
	}
}
</style>