Files
foton-laws-system-front/src/pages/home1/components/empennage/index.vue
T
2021-09-16 17:36:13 +08:00

81 lines
1.5 KiB
Vue

<!-- 尾部链接 -->
<template>
<div class="link">
<ul>
<li v-for="(link, index) in linkList" v-if="index<5" :key="index">
<a v-if="link.name.length>13" @click="openLinkUrl(link.url)" v-html="link.name.substring(0,13)+'...'" :title="link.name"></a>
<a v-else @click="openLinkUrl(link.url)" v-html="link.name" :title="link.name"></a>
</li>
<li>
<router-link to="/linkManage">更多链接></router-link>
</li>
</ul>
</div>
</template>
<script>
export default {
name: 'Empennage',
components: {},
mixins: [],
data() {
return {
linkList: [],
}
},
computed: {},
watch: {},
mounted() {
this.getLink();
},
methods: {
// 跳转链接
openLinkUrl (linkUri) {
let getHttp = linkUri.substring(0, 7)
let getHttps = linkUri.substring(0, 8)
if (getHttp === 'http://' || getHttps === 'https://') {
window.open(linkUri)
} else {
window.open('https://' + linkUri)
}
},
// 获取链接数据
getLink () {
this.$http.get('sarUrl/tsUrl', {
}, {
_this: this,
loading: 'Loading'
}, res=> {
this.linkList = res.data
})
}
},
}
</script>
<style lang="less" scoped>
.link {
height: 100%;
ul {
display: flex;
height: 100%;
text-align: center;
user-select: none;
li {
flex: 1;
a {
color: #ffffff;
&:hover {
color: #e9ca32;
text-decoration: underline;
}
}
}
}
}
</style>