codecamp

一键搬家工具

Introduction:

帮助微信小程序的开发者快速迁移到字节跳动小程序


开发者工具入口

  1. 登录开发者工具
  2. 在项目列表页选择按钮“一键搬家”

图片名称


NPM

官方源:

https://www.npmjs.com/package/wx-to-tt

  1. 安装可以局部安装或者全局安装npm i wx-to-tt -g
  2. wx2tt 微信小程序目录 source-directory <可选: 生成字节跳动小程序的目录,默认为 source-directory_tt> <可选: 生成日志的目录, source-directory_tt>wx2tt ./wxProjects/demowx2tt ./wxProjects/demo ./ttProjects/demo
  3. 单文件入口转换:wx2tt 微信小程序文件 <可选: 生成字节小程序的目录或文件路径,默认为 source-file-dir_tt/source-file-name> <可选: 生成日志的目录, 默认为 source-file-dir_tt/log.txt>wx2tt ./wxProjects/demo.wxml ./ttProjects/tt-demo.ttml
  4. 可查看转换日志


Feature

  1. parse, traverse, transform, generate
  2. 文件后缀替换,.wxml -> .ttml, .wxss -> .ttss
  3. API 前缀替换,wx -> tt
  4. 支持命令行
  5. 针对字节系 APP, 输出各宿主不支持的的组件与 API
真机调试
代码检测工具
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

字节跳动小程序 介绍

字节跳动小程序 开发

字节跳动小程序开发框架

字节跳动小程序开发框架基础说明

字节跳动小程序开发框架基础功能

字节跳动小程序开发框架逻辑层

无标题文章

无标题目录

API

无标题文章

无标题文章

无标题文章

无标题文章

无标题文章

无标题目录

无标题目录

无标题文章

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }