html52.com
我爱小程序-开发者交流社区

wxs template 场景下,重命名 wxs 模块的名称,变量依然生效,事件不生效

框架类型 问题类型 终端类型 微信版本 基础库版本
小程序 Bug 微信iOS客户端 * 2.24.2
<wxs module="wxsVar" src="./index.wxs" />
<template is="aaa" data="{{ dataFromWxs: wxsVar }}"></template>


<import src="./temp" />
<template name="aaa">
  <view bindtap="{{ dataFromWxs.click }}">测试来自 wxs 的事件</view>
  <view>测试来自swxs 的变量 {{ dataFromWxs.name }}</view> 
</template>

// index.wxs
module.exports = {
    click: function () {
        console.log(' ==== wxs click log ====')
    },
    name: '!!!!wxs变量!!!!'
}

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付