node 项目案例

 

 

生成package.json 文件

 

 

// 引入  router模块
const getRouter = require('router');
// 获取路由对象
const router = getRouter();
 
 

 

 

 

 安装日期处理时间 插件

 
// 引入处理日期的第三方模块
const dateformat = require('dateformat');
 
//处理日期格式的方法
template.defaults.imports.dateformat = dateformat;
 
 
 <th>{{dateformat($value.enterDate,'yyyy-mm-dd')}}</th>
 
 
      <th>{{dateformat($value.createtime,'yyyy-mm-dd  HH:mm:ss')}}</th>
 
 
原文地址:https://www.cnblogs.com/ericblog1992/p/13093600.html