Closed harrydengchao closed 5 years ago
欢迎提交 Issue~
如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏
如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。
Good luck and happy coding~
个人感觉,这问题目前无解。因此自己改为了,用到这个场景的页面,用微信小程序写。没有用到这个场景的部分,用 Taro 写。
目前确实无解
感谢您的回复
在你的Taro component页面加一个<view style={{display: none}} onClick={你要添加的方法}/> 目的是让你的方法被编绎
@febobo 感谢你的回复。 如上你的方案,我理解的是,只能在 Taro component 中编译方法。 无法解决向 Taro component 中引用的 wechat template 传递方法的问题。 不知道我理解的正确否?
@harrydengchao 你就当成数据传过去, 参考 wxparse事件处理
问题描述
Taro 代码与微信小程序代码混写# 怎么向微信小程序的 template组件传入 bindtap 方法呢?
<import src="xx/xx/a.wxml">
<template is="a" />
复现步骤
期望行为 在 Taro 中向 微信小程序 template 传入 handleInput 方法,使得 a.wxml 中的 bindtap 事件可以正确响应
报错信息
Component "pages/index/index" does not have a method "handleInput" to handle event "tap".
系统信息
补充信息 [可选] [根据你的调查研究,出现这个问题的原因可能在哪里?]