当前位置:网站首页>Display the remaining valid days according to the valid period
Display the remaining valid days according to the valid period
2022-06-12 08:37:00 【Month to month better】

<v-simple-table
class="table-wrapper"
style="position: relative; width: 100%"
>
<template v-slot:default>
<thead>
<tr>
<th> name </th>
<th> The period of validity </th>
<th> operation </th>
</tr>
</thead>
<tbody v-if="lists.length > 0">
<tr v-for="item in lists" :key="item.id">
<td>{
{
item.name }}</td>
<td>
<v-icon
v-if="vailDays(item.expiry)"
size="22"
color="#4caf50"
>
mdi-check-decagram
</v-icon>
<v-icon v-else size="22" color="#f44336"
>mdi-close-octagon</v-icon
>
{
{
item.expiry }}
<span
>({
{
vailDays(item.extracted.expiry)
? ` The remaining ${
vailDays(item.expiry)} God `
: " Has expired "
}})</span
>
</td>
<td>
<span
class="btn-style"
> see </span
>
<span class="ml-4 btn-style"
> Delete </span
>
</td>
</tr>
</tbody>
<tbody v-else>
<tr class="text-center">
<td colspan="8" style="width: 100%; color: #7b7b7b">
{
{
loading ? " Temporarily no data " : " Data loading " }}
</td>
</tr>
</tbody>
</template>
</v-simple-table>
import {
vailDays, isErrData } from "./util/dealData";
export default {
name: "License",
data() {
return {
vailDays,
errMsg,
loading: true,
lists:[
{
id:1,name:"a",expiry: 1634256000},
{
id:2,name:"b",expiry: 1656288000}
]
};
},
}
util/dealData.js
// The period of validity
function vailDays(expire) {
let curTime = Math.floor(new Date().getTime());
let vaildTime = Math.floor((expire * 1000 - curTime) / (1000 * 3600 * 24));
if (vaildTime > 0 || vaildTime === 0) {
return vaildTime;
}
}
export {
vailDays};
边栏推荐
- 深拷贝与浅拷贝的区别
- 2022.6.11-----leetcode. nine hundred and twenty-six
- Configuration and principle of MSTP
- What is the MES system? What is the operation process of MES system?
- 数据库基础——规范化、关系模式
- 报错:清除网站内搜索框中的历史记录?
- [new planning]
- Audio and video related links
- Hands on learning and deep learning -- simple implementation of softmax regression
- [open source project] easycmd command graphical software
猜你喜欢

JVM学习笔记:三 本地方法接口、执行引擎

JVM learning notes: garbage collection mechanism

Asp Net project add log function

Engineers learn music theory (I) try to understand music
![[GUI development] browsing function implementation model of image processing software](/img/37/2162a6047682b9cfc9b8b7c2488068.jpg)
[GUI development] browsing function implementation model of image processing software

svg中viewbox图解分析

Oracle installation details (verification)

MPLS的原理与配置

What kind of sparks will be generated when the remote sensing satellite meets the Beidou navigation satellite?

(p17-p18) define the basic type and function pointer alias by using, and define the alias for the template by using and typedef
随机推荐
Webrtc series - mobile terminal hardware coding supports simulcast
[advanced pointer III] implement C language quick sorting function qsort & callback function
Hands on deep learning -- activation function and code implementation of multi-layer perceptron
Vscode download slow solution
ctfshow web 1-2
Detailed explanation of private, public and interface attributes in cmake
Hands on learning and deep learning -- a brief introduction to softmax regression
Why should enterprises implement MES? What are the specific operating procedures?
FDA reviewers say Moderna covid vaccine is safe and effective for children under 5 years of age
三国杀周边--------猪国杀题解
Record the first step pit of date type
Figure neural network makes Google maps more intelligent
Centos8 installing MySQL 8.0 (upper)
ctfshow web3
MES helps enterprises to transform intelligently and improve the transparency of enterprise production
Hands on learning and deep learning -- Realization of linear regression from scratch
【新规划】
Hands on deep learning -- image classification dataset fashion MNIST
MYSQL中的调用存储过程,变量的定义,
JVM学习笔记:垃圾回收机制