mirror of
https://github.com/dataease/dataease.git
synced 2026-05-23 22:08:34 +08:00
refactor: 文件命名标准化
This commit is contained in:
47
frontend/src/components/backButton/index.vue
Normal file
47
frontend/src/components/backButton/index.vue
Normal file
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<i
|
||||
class="el-icon-arrow-left back-button"
|
||||
@click="jump"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'BackButton',
|
||||
props: {
|
||||
// eslint-disable-next-line vue/require-default-prop
|
||||
path: String,
|
||||
// eslint-disable-next-line vue/require-default-prop
|
||||
name: String,
|
||||
// eslint-disable-next-line vue/require-default-prop
|
||||
to: Object
|
||||
},
|
||||
methods: {
|
||||
jump() {
|
||||
const { path, name, to } = this
|
||||
if (path) {
|
||||
this.$router.push(path)
|
||||
}
|
||||
if (name) {
|
||||
this.$router.push({ name: this.name })
|
||||
}
|
||||
if (to) {
|
||||
this.$router.push(to)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
.back-button {
|
||||
cursor: pointer;
|
||||
margin-right: 18px;
|
||||
font-weight: 600;
|
||||
|
||||
&:active {
|
||||
transform: scale(0.85);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user