Vue中使用for循环绑定值

<el-form-item>
    <div v-for="(item,index) in absDate" :key="index" :label="item.date" style="float:left;padding-right:10px;">
        <p>{{item.date}}</p>
        <p style="color:red;">{{item.AM}}</p>
        <p style="color:red;">{{item.PM}}</p>
    </div>
</el-form-item>
return {
    //缺勤日历
    absDate: [
        {
            date: "2020-11-01",
            AM: "上班签到",
            PM: '下班签到'
        },
        {
            date: "2020-11-03",
            AM: "上班签到",
            PM: ''
        },
        {
            date: "2020-11-04",
            AM: "",
            PM: '下班签到'
        }],
}

 

posted @ 2020-11-06 10:08  算盘  阅读(1049)  评论(0编辑  收藏  举报