vue写作者展示详情页面应有作者的基本信息介绍、画作介绍等信息
时间: 2023-12-02 18:03:28 浏览: 21
好的,这是一个关于vue写作者展示详情页面的建议,可以根据你的需求作出一些调整。
首先,你需要创建一个作者详情页面组件,可以使用Vue Router来管理路由。在这个组件中,你可以将作者的基本信息、画作介绍等信息进行呈现。
作者基本信息可以包括作者的姓名、出生日期、国籍、经历等,可以将这些信息放在一个卡片组件中展示。画作介绍可以包括作品的名称、创作时间、风格、主题等,可以使用一个列表来展示。
此外,你还可以在这个页面上添加一些其他的功能,例如展示作者的作品集、评论区等,以增加页面的互动性。
最后,要注意页面的美观和易用性,可以使用一些UI框架如Element UI、Vuetify等来进行组件的布局和设计。
相关问题
vue写个有作者的基本信息介绍、画作介绍等信息的列表
好的,这是一个关于vue写有作者基本信息介绍和画作介绍的列表的建议,你可以根据自己的需求进行一些调整。
首先,你可以创建一个包含作者基本信息和画作介绍的数据数组,例如:
```javascript
data() {
return {
artists: [
{
name: 'Vincent van Gogh',
nationality: 'Dutch',
birthDate: '1853-03-30',
deathDate: '1890-07-29',
bio: 'Vincent Willem van Gogh was a Dutch post-impressionist painter who is among the most famous and influential figures in the history of Western art.',
paintings: [
{
title: 'The Starry Night',
year: '1889',
medium: 'Oil on canvas',
size: '73.7 cm × 92.1 cm',
image: 'https://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg/1280px-Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg'
},
{
title: 'Irises',
year: '1889',
medium: 'Oil on canvas',
size: '71 cm × 93 cm',
image: 'https://upload.wikimedia.org/wikipedia/commons/thumb/3/3e/Van_Gogh_-_Irises_-_Google_Art_Project.jpg/1280px-Van_Gogh_-_Irises_-_Google_Art_Project.jpg'
}
]
},
// ...
]
}
}
```
然后,你可以使用`v-for`指令循环渲染列表,并使用`<template>`标签来分组展示作者基本信息和画作介绍,例如:
```html
<template v-for="(artist, index) in artists">
<!-- Artist basic info -->
<div class="artist-info" :key="'artist-' + index">
<h2>{{ artist.name }}</h2>
<div class="nationality">{{ artist.nationality }}</div>
<div class="birth-date">{{ artist.birthDate }}</div>
<div class="death-date">{{ artist.deathDate }}</div>
<p class="bio">{{ artist.bio }}</p>
</div>
<!-- Artist paintings -->
<div class="artist-paintings" :key="'paintings-' + index">
<h3>Paintings</h3>
<ul>
<li v-for="(painting, index) in artist.paintings" :key="'painting-' + index">
<div class="painting-image">
<img :src="painting.image" :alt="painting.title">
</div>
<div class="painting-info">
<h4>{{ painting.title }}</h4>
<div class="year">{{ painting.year }}</div>
<div class="medium">{{ painting.medium }}</div>
<div class="size">{{ painting.size }}</div>
</div>
</li>
</ul>
</div>
</template>
```
最后,你可以根据需要添加一些样式来美化列表的外观,例如:
```css
.artist-info {
margin-bottom: 20px;
}
.artist-info h2 {
margin: 0;
font-size: 24px;
}
.artist-info .nationality {
font-size: 18px;
color: #666;
}
.artist-info .bio {
margin-top: 10px;
line-height: 1.5;
}
.artist-paintings {
margin-bottom: 40px;
}
.artist-paintings h3 {
margin: 0;
font-size: 20px;
}
.artist-paintings ul {
list-style: none;
margin: 0;
padding: 0;
}
.artist-paintings li {
display: flex;
align-items: center;
margin-bottom: 20px;
}
.artist-paintings li:last-child {
margin-bottom: 0;
}
.painting-image {
margin-right: 20px;
width: 200px;
height: 200px;
overflow: hidden;
}
.painting-image img {
width: 100%;
height: 100%;
object-fit: cover;
}
.painting-info h4 {
margin: 0;
font-size: 18px;
}
.painting-info div {
font-size: 14px;
color: #666;
margin-bottom: 5px;
}
```
这样,你就可以在页面上展示一个包含作者基本信息和画作介绍的列表了。
用vue写出vantcard商品信息,点击能跳转到商品详情页面
以下是一个基于Vue框架和Vant组件库的示例代码,使用Vant的Card组件展示商品信息,点击Card可以跳转到商品详情页面:
```vue
<template>
<div>
<van-card
v-for="item in goodsList"
:key="item.id"
:thumb="item.thumb"
:title="item.name"
:price="item.price"
:num="item.num"
@click="gotoGoodsDetail(item.id)"
>
<template #tag>
<van-tag
v-for="(tag, index) in item.tags"
:key="index"
type="danger"
>
{{ tag }}
</van-tag>
</template>
</van-card>
</div>
</template>
<script>
export default {
data() {
return {
goodsList: [
{
id: 1,
name: "商品1",
thumb: "https://dummyimage.com/300x300/ccc/000",
price: 100,
num: 10,
tags: ["标签1", "标签2"],
},
{
id: 2,
name: "商品2",
thumb: "https://dummyimage.com/300x300/ccc/000",
price: 200,
num: 5,
tags: ["标签1", "标签3"],
},
{
id: 3,
name: "商品3",
thumb: "https://dummyimage.com/300x300/ccc/000",
price: 300,
num: 2,
tags: ["标签2", "标签3"],
},
],
};
},
methods: {
gotoGoodsDetail(id) {
// 跳转到商品详情页面,参数为商品id
this.$router.push(`/goods/${id}`);
},
},
};
</script>
```
在上述代码中,我们使用了Vant的Card组件展示了商品信息,并为其绑定了点击事件。点击Card时会调用gotoGoodsDetail方法进行路由跳转,跳转到商品详情页面,其中参数为商品id。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)