NervJS / taro

开放式跨端跨框架解决方案,支持使用 React/Vue/Nerv 等框架来开发微信/京东/百度/支付宝/字节跳动/ QQ 小程序/H5/React Native 等应用。 https://taro.zone/
https://docs.taro.zone/
Other
35.37k stars 4.78k forks source link

jsx语法在微信小程序里面报错 #5850

Open hulkyuan opened 4 years ago

hulkyuan commented 4 years ago

jsx语法在微信小程序里面报错this.createListItem is not a function 找不到,除非方法里面没有jsx语法,否则提示方法找不到。taro版本2.0.7 微信开发工具是macOs最新版本的v1.02 "dependencies": { "@tarojs/components": "2.0.7", "@tarojs/components-qa": "2.0.7", "@tarojs/router": "2.0.7", "@tarojs/taro": "2.0.7", "@tarojs/taro-alipay": "2.0.7", "@tarojs/taro-h5": "2.0.7", "@tarojs/taro-qq": "2.0.7", "@tarojs/taro-quickapp": "2.0.7", "@tarojs/taro-swan": "2.0.7", "@tarojs/taro-tt": "2.0.7", "@tarojs/taro-weapp": "2.0.7", "@tarojs/taro-rn": "2.0.7", "babel-runtime": "^6.26.0", "regenerator-runtime": "0.11.1", "nervjs": "^1.5.5", "nerv-devtools": "^1.5.5", "moment": "2.24.0", "query-string": "^6.9.0" }, "devDependencies": { "@types/react": "^16.4.6", "@types/webpack-env": "^1.13.6", "@tarojs/mini-runner": "2.0.7", "@tarojs/webpack-runner": "2.0.7", "babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-jsx-stylesheet": "^0.6.5", "babel-plugin-transform-object-rest-spread": "^6.26.0", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-env": "^1.6.1", "babel-eslint": "^8.2.3", "eslint": "^5.16.0", "eslint-config-taro": "2.0.7", "eslint-plugin-react": "^7.8.2", "eslint-plugin-react-hooks": "^1.6.1", "eslint-plugin-import": "^2.12.0", "stylelint": "9.3.0", "stylelint-config-taro-rn": "2.0.7", "stylelint-taro-rn": "2.0.7", "eslint-plugin-taro": "2.0.7" } `createListItem = () => { return (

22
);

}`

taro-bot[bot] commented 4 years ago

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~