现在是在 js 里面转好,有没有办法直接在 wxml 里面使用?
|
zcf0508Jul 13, 2022
1
在 methods 里把 dayjs 相关的方法暴露出去就可以了
|
|
magewu1223llJul 13, 2022
2
把包下下来 放进你的项目里
|
|
3
@zcf0508 老哥,怎么操作的,直接在 js 里面暴露然后再 wxml 里面调用?
<tag value="{{ dayjs(mydatetime).format('YYYY-MM-DD HH:mm:ss') }}" /> 像上面这样写,没有效果啊。 |
|
zcf0508Jul 13, 2022
4
methods:{
dayjsformat(datetime,format):{ return dayjs(datetime).format(format) } } |