<!--
 * @Description: 
 * @Author: zhangwei
 * @Date: 2019-06-25 15:49:15
 * @LastEditTime: 2019-06-28 10:56:11
 * @LastEditors: zhangwei
 -->
<template>
  <div>
    <div v-for="(item,index) in items"
         :key="index">
       <div class="cItem" @click="onClickItem(item)">{{item.title}}</div>
    </div>
  </div>
</template>

<script>
    import YxDay from "../../../../utils/dayjs/index"

    export default {
        data() {
            return {
                items: [{
                    name: 'time1',
                    title: '获取当前时和分'
                }, {
                    name: 'time2',
                    title: '获取当前日期'
                }, ],
            }
        },

        components: {},

        methods: {
            onClickItem(item) {
                if (item.name == 'time1') {
                    item.title = "获取当前时和分:" + YxDay.getCurDayByFormat(YxDay.FORMAT_HHMM)
                } else if (item.name == 'time2') {
                    item.title = "获取当前日期:" + YxDay.getCurDayByFormat(YxDay.FORMAT_YYYYMMDD)
                }
            }
        },

        created() {
            // let app = getApp()
        }
    }
</script>

<style scoped>
    .cItem {
        width: 100%;
        line-height: 40px;
        padding-left: 10px;
        border-bottom: solid 1px #959595;
    }
</style>