Python脚本,一键转换
Github地址:https://github.com/DWmelon/py-transfer-BdToWxpython
具有Python环境,可在命令行中使用Python命令git
1. 转换工具 - mypy.pygithub
命令行输入: python mypy.py微信
2. 查找关键词工具 - findFileHaveX.py工具
命令行输入: python findFileHaveX.pyflex
查看 mypy.py 源代码,能够很直观知道作了哪些修改,也就是你能够本身更新转换规则,欢迎一块儿维护this
Component({ properties: { item: { //错误,需写明type、value等字段 } }, data: { }, methods: { } })
<text class="{{(selectCourse[index1*3+index2]==1?'row_item_select':'row_item_unselect'}}">{{item}}</text> #(selectCourse 多了一个左括号
Setting data field "score" to undefined is invalid.
setData({}) 方法不容许赋 undefined
#js中经过id获取组件 this.selectComponent("score") //错误 this.selectComponent("#score") //正确
#xml中for循环
s-for="majorList" / s-for="{{majorList}}" //百度均可以
wx:for="{{majorList}}" //微信必须加{{}}
//banner显示问题,事实上这个是日常都应该注意的细节 .banner { display: flex; flex:1; # flex-direction: column; //百度不写正常,微信不写不显示 margin-top: 30rpx; }
userInfo = res.data.data.user_info; //百度编译经过并能正常赋值,相似Python
userInfo = res.data.data.user_info; //微信编译不经过,需加let/var定义变量