<wxs> 某些页面无法调用?
发布于 6 年前 作者 yongxiao 2717 次浏览 来自 问答

页面组件使用wxs,但是只有一个页面调用了

// common.wxs
var checkTime = function (time{
    var reg = getRegExp("/-/""g");
    return time.replace(reg, ".");
}

module.exports = {
    checkTime: checkTime
}
 // template.wxml
<wxs src="../../utils/common.wxs" module="tools" />
<view class="time" hover-class="none" hover-stop-propagation="false">
       {{tools.checkTime(start_time)}}-{{tools.checkTime(end_time)}}
</view>

在三个页面调用了template.wxml但是只有一个页面生效了

回到顶部