uniapp目前已经支持vue3语法了,对于想将微信小程序代码迁移到uniapp vue3的小伙伴来说,迁移的工作量无疑是比较大的。本人开发了自动转换工具可以自动实现代码转换,并且保证了可读性。
基本原理:
wxml-compiler:wxml → posthtml-parser → AST → transform → new AST → posthtml-render → vue3/uniapp3 template
wxjs-compiler:wxjs → @babel/parser → AST → transform → new AST → @babel/generator → vue3/uniapp3 script
自动转换工具:小雨web馆