1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <template>
- <n-card class="info-box">
- <template #cover>
- <img :src="cover" />
- </template>
- <!-- <div class="cover" :style="{ backgroundImage: `url(${cover})` }"></div> -->
- <div class="info-line">
- <div class="title">{{ title }}</div>
- <div class="time-line">
- <span> {{ time }}</span>
- <div class="see-more" @click="$router.push(`/info-detail/${id}`)">
- 查看
- </div>
- </div>
- </div>
- </n-card>
- </template>
- <script setup>
- defineOptions({
- name: "info-box",
- });
- defineProps({
- id: {
- type: [Number, String],
- default: () => NaN,
- },
- title: {
- type: [String, undefined],
- default: () => "",
- },
- cover: {
- type: [String, undefined],
- default: () => "",
- },
- time: {
- type: [String, undefined],
- default: () => "",
- },
- });
- </script>
- <style lang="scss" scoped>
- .n-card.info-box {
- padding: 10px;
- --n-padding-left: 0 !important;
- --n-padding-bottom: 0 !important;
- .cover {
- min-height: 250px;
- background-color: gray;
- }
- .title {
- font-size: 28px;
- }
- .info-line {
- display: flex;
- flex-direction: column;
- .time-line {
- width: 100%;
- flex: 1;
- display: flex;
- justify-content: space-between;
- .see-more {
- cursor: pointer;
- }
- }
- }
- }
- </style>
|