You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- index.wxml -->
<wxs module="timeFormat">
function timeFormat(time) {
if (time !== undefined) {
var timeNum = getDate(time)
var y = timeNum.getFullYear()
var M = timeNum.getMonth() + 1
var d = timeNum.getDate()
var h = timeNum.getHours() + ''
var m = timeNum.getMinutes() + ''
if (h.length === 1) { h = '0' + h }
if (m.length === 1) { m = '0' + m }
return y + '年' + M + '月' + d + '日 ' + h + ':' + m
}
}
module.exports = timeFormat
</wxs>
<view></view>
步骤3:
格式化
期望的表现:
<!-- index.wxml -->
<wxs module="timeFormat">
function timeFormat(time) {
if (time !== undefined) {
var timeNum = getDate(time)
var y = timeNum.getFullYear()
var M = timeNum.getMonth() + 1
var d = timeNum.getDate()
var h = timeNum.getHours() + ''
var m = timeNum.getMinutes() + ''
if (h.length === 1) {
h = '0' + h
}
if (m.length === 1) {
m = '0' + m
}
return y + '年' + M + '月' + d + '日 ' + h + ':' + m
}
}
module.exports = timeFormat
</wxs>
<view></view>
实际的表现:
<!-- index.wxml -->
<wxs module="timeFormat">
function timeFormat(time) { if (time !== undefined) { var timeNum = getDate(time) var y = timeNum.getFullYear() var M = timeNum.getMonth() + 1 var d =
timeNum.getDate() var h = timeNum.getHours() + '' var m = timeNum.getMinutes() + '' if (h.length === 1) { h = '0' + h } if (m.length === 1) { m = '0' + m }
return y + '年' + M + '月' + d + '日 ' + h + ':' + m } } module.exports = timeFormat
</wxs>
<view></view>
插件运行环境
插件版本: v2.4.12
VSCode版本: v1.80.1
操作系统(非必须): win10
是否可以把wxs标签当做script标签进行格式化?
The text was updated successfully, but these errors were encountered:
如何复现:
步骤1:
步骤2:
步骤3:
格式化
期望的表现:
实际的表现:
插件运行环境
插件版本
: v2.4.12VSCode版本
: v1.80.1操作系统(非必须)
: win10是否可以把wxs标签当做script标签进行格式化?
The text was updated successfully, but these errors were encountered: