前端
我如云影君如梦
这个作者很懒,什么都没留下…
展开
-
render函数使用moment.js 格式化时间
iview table column 中使用 moment组件将 后端传入的时间戳格式化为 yyyy-MM-dd HH:mm:ss 1.引入moment.js npm install moment.js 2.main.js中全局引入: /*引入moment*/ import moment from 'moment' Vue.prototype.$moment = moment; 然后就可以 用 this.$moment() 对日期时间进行格式化了 3.iview table co.原创 2021-08-09 16:28:14 · 292 阅读 · 0 评论 -
iview table 表格字段 render 渲染Badge组件
iview table 组件中 对应的 某个column 字段: { title: '数据对接状态', key: 'fixSwitch', align: 'center', width: 120, render: (h, params) => { let newText = params.row.fixSwitch; if (newText === 0) { return h('div', [ h('Badge', { ..原创 2021-03-09 15:42:52 · 935 阅读 · 0 评论