2021-01-25 15:39:59 +08:00
|
|
|
|
<template>
|
2021-07-14 21:02:28 +08:00
|
|
|
|
<div class="layout-view-bg-white flex layout-view-link" :style="{ height: `calc(100vh - ${setLinkHeight}` }">
|
2021-07-07 20:16:31 +08:00
|
|
|
|
<a href="https://element-plus.gitee.io/#/zh-CN/component/installation" target="_blank" class="flex-margin"
|
|
|
|
|
>{{ currentRouteMeta.title }}:{{ currentRouteMeta.isLink }}</a
|
|
|
|
|
>
|
2021-03-15 12:44:58 +08:00
|
|
|
|
</div>
|
2021-01-25 15:39:59 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-07-14 21:02:28 +08:00
|
|
|
|
import { defineComponent, toRefs, reactive, onMounted, computed } from 'vue';
|
2021-07-07 20:16:31 +08:00
|
|
|
|
import { useRoute } from 'vue-router';
|
|
|
|
|
import { useStore } from '/@/store/index';
|
2021-01-25 15:39:59 +08:00
|
|
|
|
export default defineComponent({
|
2021-03-15 12:44:58 +08:00
|
|
|
|
name: 'layoutLinkView',
|
2021-07-07 20:16:31 +08:00
|
|
|
|
setup() {
|
|
|
|
|
const route = useRoute();
|
|
|
|
|
const store = useStore();
|
|
|
|
|
const state = reactive({
|
|
|
|
|
currentRouteMeta: {},
|
|
|
|
|
});
|
|
|
|
|
// 初始化获取当前路由 meta
|
|
|
|
|
const initGetMeta = () => {
|
|
|
|
|
state.currentRouteMeta = route.meta;
|
|
|
|
|
};
|
2021-07-14 21:02:28 +08:00
|
|
|
|
// 设置 link 的高度
|
|
|
|
|
const setLinkHeight = computed(() => {
|
2021-07-07 20:16:31 +08:00
|
|
|
|
let { isTagsview } = store.state.themeConfig.themeConfig;
|
2021-07-14 21:02:28 +08:00
|
|
|
|
if (isTagsview) return `114px`;
|
|
|
|
|
else return `80px`;
|
|
|
|
|
});
|
2021-07-07 20:16:31 +08:00
|
|
|
|
// 页面加载时
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
initGetMeta();
|
2021-03-15 12:44:58 +08:00
|
|
|
|
});
|
|
|
|
|
return {
|
2021-07-14 21:02:28 +08:00
|
|
|
|
setLinkHeight,
|
2021-07-07 20:16:31 +08:00
|
|
|
|
...toRefs(state),
|
2021-03-15 12:44:58 +08:00
|
|
|
|
};
|
|
|
|
|
},
|
2021-01-25 15:39:59 +08:00
|
|
|
|
});
|
2021-03-15 12:44:58 +08:00
|
|
|
|
</script>
|