miniprogram-to-uniapp插件踩坑
- 使用了依赖包的小程序转换uniapp后运行会报错。
- 转换后使用selectComponent或者selectAllComponents方法获取的子组件,子组件内的方法会导致获取不到,解决:使用this.$refs来替代。
- 转换后,小程序lifetimes attached里的代码被放到了mounted事件里,导致生命周期执行顺序有问题,pageLifetimes show事件里的内容会先于lifetimes attached事件里的代码执行,转换后需要手动将attached事件里的代码从mounted挪到beforeMount。
- 转换后img标签里有些图片路径需要修改。
- props里定义属性,type属性只能是(String、Number、Function、Boolean、Object、Array、Symbol),例如Object类型不能写成{}。
- import路径需要加./,否则转换后会报错。