foxitdog / wx2ali Goto Github PK
View Code? Open in Web Editor NEW微信小程序转阿里小程序
微信小程序转阿里小程序
微信小程序是require的方式引用外部文件的,支付宝这边是import方式,建议对这个进行转换。包括module.export到export default这样的转换也希望能支持一下
还有组件嵌套组件的情况
需要将全局npm下的wx2ali.text文件复制到use/local/bin下
const userCity = wx.getStorageSync('userinfo')
应该转换为
const userCity = my.getStorageSync({key:'userCity'}).data;
现在转成了
const userCity = my.getStorageSync({key:'userCity'});缺少了data
page
文件夹内的*_list 会在 app.json
内的变为*_items<import src="../../wxParse/wxParse.wxml"/>
没有变成 <import src="../../wxParse/wxParse.axml"/>
绑定事件,没有改为驼峰形式
java太麻烦了,可以有node版本的吗
源代码 if (wx.getStorageSync('buyType')=='buy'){}
转换结果 if(my.getStorageSync({key:'buyType')=='group'}){}
源代码 that.setData({ id: options.id, scrollHeight: wx.getStorageSync('scrollHeight')});
转换结果 that.setData({ id: options.id, scrollHeight: my.getStorageSync({key:'scrollHeight')}})
第86,87行:
(^||\s+\W)iconPath(\W)--->$1icon$2
(^||\s+\W)iconPath(\W)--->$1icon$2
Parse Error: ReferenceError: Unknown plugin "transform-object-rest-spread" specified in "base" at 0, attempted to resolve relative to "/Users/levent/coding/AntProjects/MegoTest"
at /usr/local/lib/node_modules/wx2ali/node_modules/babel-core/lib/transformation/file/options/option-manager.js:180:17
at Array.map ()
at Function.normalisePlugins (/usr/local/lib/node_modules/wx2ali/node_modules/babel-core/lib/transformation/file/options/option-manager.js:158:20)
at OptionManager.mergeOptions (/usr/local/lib/node_modules/wx2ali/node_modules/babel-core/lib/transformation/file/options/option-manager.js:234:36)
at OptionManager.init (/usr/local/lib/node_modules/wx2ali/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
at File.initOptions (/usr/local/lib/node_modules/wx2ali/node_modules/babel-core/lib/transformation/file/index.js:212:65)
at new File (/usr/local/lib/node_modules/wx2ali/node_modules/babel-core/lib/transformation/file/index.js:135:24)
at Pipeline.transform (/usr/local/lib/node_modules/wx2ali/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
at Object.module.exports.replace (/usr/local/lib/node_modules/wx2ali/lib/JSApiPropReplace.js:10:19)
at wx2ant (/usr/local/lib/node_modules/wx2ali/index.js:370:27)
如果存储的是一个简单类型,wx.getLocaStorage的返回值为一个string,而支付宝则为Object({data: '',success: true }),建议优化下,否则转换后会出现大量取值错误。
如题,例如在xx.wxml中存在这类的
@import "../../../css/common.wxss";
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.