1 Star 0 Fork 9

[SVIP]/博客

forked from mumu/博客 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
index.vue 3.94 KB
一键复制 编辑 原始数据 按行查看 历史
wulinlin 提交于 2024-10-24 13:56 +08:00 . fix:update
<template>
<div id="container">
<div class="header my-animation-slide-top">
<!-- 背景图片 -->
<el-image
class="my-el-image poem-image"
style="position: absolute"
v-once
:src="require('@/assets/images/LearningDocument.jpg')"
fit="cover"
>
<div slot="error" class="image-slot"></div>
</el-image>
<div class="title">
<span class="fs-26 p-tb-15 fw-800">{{ articleDetail.title }}</span>
<div class="ai-center flex">
<span
class="Article-tag tag-item ai-center flex"
@click="clickTagOrClassification('2', articleDetail.classification)"
>
<svg
class="icon"
aria-hidden="true"
style="width: 18px; height: 18px; margin-right: 3px"
>
<use xlink:href="#icon-biaoqian"></use></svg
>{{ articleDetail.classification }}</span
>
<span class="tag-item ai-center flex">
<svg
class="icon"
aria-hidden="true"
style="width: 18px; height: 18px; margin-right: 3px"
>
<use xlink:href="#icon-naozhong"></use></svg
>发表于{{ articleDetail.publishDate }}
</span>
<span class="tag-item ai-center flex">
<svg
class="icon"
aria-hidden="true"
style="width: 20px; height: 20px; margin-right: 3px"
>
<use xlink:href="#icon-xingyue"></use>
</svg>
更新{{ articleDetail.updateDate }}
</span>
<span class="tag-item ai-center flex">
<svg
class="icon"
aria-hidden="true"
style="width: 20px; height: 20px; margin-right: 3px"
>
<use xlink:href="#icon-huanjiaowenzhang"></use></svg
>阅读量:{{ articleDetail.readingQuantity }}
</span>
</div>
</div>
</div>
<iframe
v-if="articleDetail.iframeUrl"
:src="articleDetail.iframeUrl"
width="100%"
:height="height"
></iframe>
<component v-else :is="CurrentComponent.component"></component>
</div>
</template>
<script>
export default {
data() {
return {
htmlSrc: "",
CurrentComponent: {
name: "",
component: null,
},
// 文章列表
articleList: this.$store.getters.articleList,
// 当前文章详情
articleDetail: null,
height: document.documentElement.clientHeight - 300 - 5 + "px;",
};
},
watch: {
$route: {
handler: function (route) {
let name = route.query && route.query.name;
let id = route.query && route.query.id;
console.log("name,id", name, id);
if (name) {
this.CurrentComponent = {
name: name,
component(resolve) {
require(["./" + name + "/index.vue"], resolve);
},
};
}
console.log("this.articleList", this.articleList);
for (const i in this.articleList) {
this.articleList[i].categoryList.map((category) => {
if (category.list) {
category.list.map((article) => {
if (article.id == id) {
this.articleDetail = i;
}
});
}
});
}
},
immediate: true,
},
},
mounted() {
const that = this;
window.onresize = function temp() {
that.height = document.documentElement.clientHeight - 300 - 5 + "px;";
};
},
methods: {
// 头部 标签 点击 跳转更多
clickTagOrClassification(typeId, detailsName) {
this.$router.push({
path: `/CaseCenter/index`,
query: { typeId, detailsName },
});
},
},
};
</script>
<style lang="scss" scoped>
#container {
height: 100%;
width: 100%;
.header {
height: 300px;
width: 100%;
font-family: "楷体";
color: #fff;
.my-el-image {
width: 100%;
height: 100%;
}
.title {
display: flex;
justify-content: center;
position: relative;
height: calc(100%);
flex-direction: column;
align-items: center;
// animation: zoomIn 0.8s ease-in-out;
padding: 0 50px;
.tag-item {
background: #ffffff61;
padding: 5px 10px;
border-radius: 5px;
margin-right: 20px;
}
.title-name {
padding-top: 55px;
}
}
.content {
padding: 30px 0;
font-size: 22px;
}
}
}
</style>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lvjinhui/blog.git
git@gitee.com:lvjinhui/blog.git
lvjinhui
blog
博客
8cdf6d98ef5b00b58f202d013174fb1ad2c86012

搜索帮助