基于Vue的待办demo

主要的目录结构

在这里插入图片描述

页面视图
  • 登录注册
  • 主页面
    • 添加待办
    • 总结
    • 月视图
重点展示主页面

实现点击左侧栏切换有侧视图。待办、总结、月视图写在了组件里,通过子路由来切换。

待办页面

在这里插入图片描述

待办代码
<template>
    <div class="all">
        <div class="top">
            <HeadBar />
        </div>
        <div class="down">
            <div class="left">
                <div class="hoz_menu">
                    <div class="data1">
                        <div class="num1">5</div>
                        <div class="todo_all">待办</div>
                    </div>
                    <div class="data2">
                        <div class="num2">30</div>
                        <div class="summ_all">总结</div>
                    </div>
                </div>
                <hr size="1px" style='background-color:whitesmoke; height:1px; border:none;'>
                <div class="ver_menu">
                    <router-link to="/TodayToDo" class="link" @click.native="refresh">
                        <div class="todo">今日待办</div>
                    </router-link>
                    <hr size="1px" style='background-color:whitesmoke; height:1px; border:none;'>
                    <router-link to="/TodaySummary" class="link" @click.native="refresh">
                        <div class="summary">今日总结</div>
                    </router-link>
                    <hr size="1px" style='background-color:whitesmoke; height:1px; border:none;'>
                    <router-link to="/MonthView" class="link" @click.native="refresh">
                        <div class="other">月视图</div>
                    </router-link>
                    <hr size="1px" style='background-color:whitesmoke; height:1px; border:none;'>
                </div>
            </div>
            <div class="right">
                <router-view></router-view>
            </div>
        </div>
    </div>
</template>

<script>
import HeadBar from "@/components/HeadBar.vue";
export default {
    components: {
        HeadBar
    },
    data() {
        return {

        };
    },
    methods: {
        refresh:function(){
      this.$router.go(0);  
    }
    },
    mounted() {},
}
</script>
<style scoped>
.all{
    display: flex;
    flex-direction: column;
    background-color: #F5F6F7;
    
}
.top{
    height: 48px;
}
.down{
    flex: 1;
    display: flex;
    justify-content: center;
    margin-top: 12px;
}
.left{
    background-color: white;
    width: 230px;
    height: 250px;
    margin: 0 10px;
    border: solid 0.5px whitesmoke;
    display: flex;
    flex-direction: column;
}
.right{
    background-color: white;
    width: 850px;
    height: 880px;
    border: solid 0.5px whitesmoke;
}
.hoz_menu{
    background-color:white;
    height: 100px;
    display: flex;
    align-items:center;
    justify-content:center;
}
.todo_all{
    margin: 0 10px;
}
.summ_all{
    margin: 0 10px;
}
.num1{
    text-align: center;
}
.num2{
    text-align: center;
}
.todo{
    height: 50px;
    background-color: white;
    display: flex;
    align-items:center;
    justify-content:center;
}
.summary{
    height: 50px;
    background-color: white;
    display: flex;
    align-items:center;
    justify-content:center;
}
.other{
    height: 50px;
    background-color: white;
    display: flex;
    align-items:center;
    justify-content:center;
}
a{
    text-decoration-line: none;
    color: black;
}
.router-link-active{
    text-decoration: none;
}
</style>
总结页面

在这里插入图片描述

月视图页面

在这里插入图片描述

月视图代码
<template>
        <el-calendar v-model="value" id="calendar">
            <template
            slot="dateCell"
            slot-scope="{data}">
                <div :class="data.isSelected ? 'is-selected' : ''" @click="calClick(data)">
                    <div class="calendar-day">{{ data.day.split('-').slice(2).join('-') }}</div>
                    <div v-for="(item,index) in calendarData" :key="index">
                        <div v-if="(item.years).indexOf(data.day.split('-').slice(0)[0])!=-1 && (item.months).indexOf(data.day.split('-').slice(1)[0])!=-1 && (item.days).indexOf(data.day.split('-').slice(2).join('-'))!=-1">
                            <el-tooltip :content="item.things" placement="right">
                                <div class="mark">{{item.things}}</div>
                            </el-tooltip>
                        </div>
                        <div v-else></div>
                    </div>
                </div>
            </template>
        </el-calendar>
</template>

<script>

export default {
    name: "calendar",
        data(){
            return {
                formData:{
                    data:'',
                    content: ''
                },
                calendarData: [
                { years: ['2021'], months: ['04', '11'],days: ['14'],things: '杂志' },
                { years: ['2021'], months: ['04', '12'], days: ['02'],things: 'wanglihong' },
                { years: ['2021'], months: ['04'], days: ['02'],things: '晚会' },
                { years: ['2021'], months: ['04'], days: ['02'],things: '杂志预售' },
                { years: ['2021'], months: ['04'], days: ['15'],things: '开播' }
            ],
                value: new Date()
            }
        }, 
        methods: {
            calClick(item){
                console.log(item)
                this.formData.data = item.day
            },
        }
}
</script>
<style lang='scss'>

.is-selected{
    color: #1989FA;
}
.mark{
    color: #1989FA;
    font-size: 10px;
}
.el-calendar-table .el-calendar-day {
    height: 120px;
}
</style>

目前只实现的静态页面,整体demo还在继续中。

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值