今天在处理按钮显示的时候发现一个问题:
vue 通过new Date().getTime()获取时间戳返回的是13位数字,单位是毫秒;
php后台time()获取的时间戳是10位数字,单位秒;

所以在判断比较时需要将time()*1000 转换为毫秒再去比较

<el-button v-if="new Date(scope.row.end_time*1000).getTime()>new Date().getTime()"  size="mini" icon="edit" @click="editGroupsAction(scope.$index, scope.row)">编辑</el-button>
Logo

前往低代码交流专区

更多推荐