这是一个AutoX.js工程化项目,支持开发环境热更新
npm install
- 修改项目信息 (project/production/project.json)
npm run dev
- Autox.js输入电脑ip连接电脑 - 项目仅运行
- 修改 autox/bridge.ts - 体验热更新
npm run build
- Autox.js输入电脑ip连接电脑 - 项目自动保存到手机
- 项目路径为 autox/build/production
// autox/bridge.ts
module.exports = [
{
name: 'getDeviceBattery',
callback: (data: string, cb: (data: string) => void) => {
console.log("received web count :" + data);
toast(data);
cb(device.getBattery().toFixed(2));
}
}
]
// vue
$autox.callHandler("getDeviceBattery", count.value.toString(), (data: string) => {
battery.value = data
});
See the LICENSE file for more details.