创建项目
头部
头部当中有两个按钮,然后根据设计稿可知,本留言墙中有4个按钮,所以可以自己封装一个按钮组件
按钮组件的博客
components/TopNav.vue
<template>
<div class="topNav">
<div class="left">
<img src="@/assets/img/logo.svg" alt="" />
<span class="title">ZEMOZ</span>
</div>
<div class="center">
<my-button-vue type="primary">留言墙</my-button-vue>
<my-button-vue type="default">照片墙</my-button-vue>
</div>
<div class="right">
<div class="user-head"></div>
</div>
</div>
</template>
<script>
import MyButtonVue from "./MyButtoon/MyButton.vue";
export default {
components: {
MyButtonVue,
},
};
</script>
<style lang="scss" scoped>
.topNav {
width: 100%;
// max-width: 1500px; 这里加了这句话以后,页面缩放会很怪
height: 52px;
background: rgba(255, 255, 255, 0.8);
box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.1);
//