
REACT_react过滤器如何处理
发布日期:2021-05-18 11:21:15
浏览次数:22
分类:原创文章
本文共 569 字,大约阅读时间需要 1 分钟。
<div id="example"></div> <script type="text/babel"> class Hello extends React.Component{ constructor() { super(); this.state = { date: 1595426683 }; }; getDate(date){ var d=new Date(date*1000); return d.getFullYear()+'-'+(d.getMonth()+1)+'-'+d.getDate(); } render () { return ( <div> <h1>北京时间:{ this.getDate(this.state.date)}</h1> </div> ); } }; ReactDOM.render( <Hello/>, document.getElementById('example') ); </script>
发表评论
最新留言
做的很好,不错不错
[***.243.131.199]2025年04月27日 04时34分12秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
vue 权限管理 主题切换(8)
2019-03-17
spring
2019-03-17
inno setup 一些技巧
2019-03-17
Qt 在Excel文件中Chart绘图
2019-03-17
TCP 详解
2019-03-17
U3D时间
2019-03-17
U3D资源加载
2019-03-17
01-webpack5理解及配置
2019-03-17
JavaScript作用域和作用域链
2019-03-17
webpack的安装和使用
2019-03-17
centos安装python3.x
2019-03-17
14栈和队列的应用-数制的转换
2019-03-17
Vue.js学习-15-v-for循环数组内容
2019-03-17
研发效能工具集
2019-03-17
2020 祥云杯misc 到点了
2019-03-17
Linux——系统安全及应用(开关机安全机制、系统弱口令检测、NMAP)
2019-03-17