|
|
|
|
@ -1,26 +1,36 @@
|
|
|
|
|
<template>
|
|
|
|
|
<!-- 特色内容组件容器,设置id用于标识 -->
|
|
|
|
|
<div id="feature">
|
|
|
|
|
<!-- 引入水平文章组件,并并添加类名用于样式定制 -->
|
|
|
|
|
<horizontal-article class="home-horizontal-article" />
|
|
|
|
|
<!-- 插槽:用于插入额外的特色内容,增强组件灵活性 -->
|
|
|
|
|
<slot />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
// 导入Vue的defineComponent用于定义组件
|
|
|
|
|
import { defineComponent } from 'vue'
|
|
|
|
|
// 导入水平文章组件
|
|
|
|
|
import HorizontalArticle from '@/components/ArticleCard/src/HorizontalArticle.vue'
|
|
|
|
|
|
|
|
|
|
// 定义Feature组件
|
|
|
|
|
export default defineComponent({
|
|
|
|
|
name: 'Feature',
|
|
|
|
|
components: { HorizontalArticle },
|
|
|
|
|
name: 'Feature', // 组件名称
|
|
|
|
|
components: { HorizontalArticle }, // 注册子组件
|
|
|
|
|
setup() {
|
|
|
|
|
// 组件逻辑设置,此处无额外逻辑
|
|
|
|
|
return {}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
// 针对水平文章组件在特色内容区域的样式定制
|
|
|
|
|
.home-horizontal-article {
|
|
|
|
|
.feature-content {
|
|
|
|
|
p {
|
|
|
|
|
// 文本溢出处理:超出4行显示省略号
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
display: -webkit-box;
|
|
|
|
|
@ -29,4 +39,4 @@ export default defineComponent({
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
</style>
|