• element ui 日历


    <!DOCTYPE html>
    <html lang="en">
    
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>日历</title>
        <script src="vue.js"></script>
        <script src="jquery-3.4.1.js"></script>
        <!-- element ui组件 -->
        <link rel="stylesheet" href="index.css">
        <script src="index.js"></script>
    </head>
    
    <body>
        <div id="app">
            <el-calendar>
                <!-- 这里使用的是 2.5 slot 语法,对于新项目请使用 2.6 slot 语法-->
                <template slot="dateCell" slot-scope="{date, data}">
                    <p>
                        <!--这里原本有动态绑定的class,去掉-->
                        {{ data.day.split('-').slice(1).join('-') }}<br /> {{dealMyDate(data.day)}}
                    </p>
                </template>
            </el-calendar>
        </div>
    </body>
    <script>
        // console.log(data);
        var vm;
        $(function () {
            vm = new Vue({
                el: '#app',
                data: {
                    input2:'',
                    resDate: [
                        { "date": "2020-12-01", "content": "放假" },
                        { "date": "2020-12-02", "content": "去交电费" },
                        { "date": "2020-12-03", "content": "去学习vue" }
                    ]
                },
                mounted:function(){},
                methods: {
                    // 日历
                    dealMyDate(v) {
                        console.log(v)
                        let len = this.resDate.length
                        let res = ""
                        for (let i = 0; i < len; i++) {
                            if (this.resDate[i].date == v) {
                                res = this.resDate[i].content
                                console.log(this.resDate[i].content);
                                break
                            }
                        }
                        return res
                    }
                }
            })
        })
    </script>
    
    </html>

  • 相关阅读:
    Oracle 创建dblink
    好的博客
    Java项目导出war包 security alert:integrity check error”
    tomcat7.0 处理问题
    项目支持Servlet3.0的新特性
    oracle replace函数
    JavaWeb项目连接Oracle数据库
    LeetCode OJ
    LeetCode OJ
    LeetCode OJ
  • 原文地址:https://www.cnblogs.com/sheep-fu/p/14113870.html
Copyright © 2020-2023  润新知