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-16 12:46:26 +08:00
|
|
|
|
<a :href="currentRouteMeta.isLink" target="_blank" rel="opener" class="flex-margin"
|
|
|
|
|
>{{ $t(currentRouteMeta.title) }}:{{ currentRouteMeta.isLink }}</a
|
2021-07-07 20:16:31 +08:00
|
|
|
|
>
|
2021-03-15 12:44:58 +08:00
|
|
|
|
</div>
|
2021-01-25 15:39:59 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-07-16 12:46:26 +08:00
|
|
|
|
import { defineComponent, toRefs, reactive, computed, watch } 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: {},
|
|
|
|
|
});
|
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-16 12:46:26 +08:00
|
|
|
|
// 监听路由的变化,设置内容
|
|
|
|
|
watch(
|
|
|
|
|
() => route.path,
|
|
|
|
|
() => {
|
|
|
|
|
state.currentRouteMeta = route.meta;
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
immediate: true,
|
|
|
|
|
}
|
|
|
|
|
);
|
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>
|