commit
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
<!-- 尾部链接 -->
|
||||
<template>
|
||||
<div class="link">
|
||||
<div class="title">友情链接</div>
|
||||
<ul>
|
||||
<li v-for="(link, index) in linkList" v-if="index<5" :key="index" @click="openLinkUrl(link.url)">
|
||||
<a v-if="link.name.length>13" v-html="link.name.substring(0,13)+'...'" :title="link.name"></a>
|
||||
<a v-else 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 {
|
||||
display: flex;
|
||||
border-radius: 3px;
|
||||
height: 100%;
|
||||
.title {
|
||||
padding-left: 10px;
|
||||
width: 80px;
|
||||
}
|
||||
ul {
|
||||
width: calc(~'100% - 80px');
|
||||
display: flex;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
user-select: none;
|
||||
li {
|
||||
border-right: 1px solid #f4f4f4;
|
||||
flex: 1;
|
||||
a {
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
li:hover {
|
||||
background: #5ea9f6;
|
||||
a {
|
||||
color: #e9ca32;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user