File tree Expand file tree Collapse file tree 1 file changed +51
-0
lines changed
Expand file tree Collapse file tree 1 file changed +51
-0
lines changed Original file line number Diff line number Diff line change 3232打开[ AssistsX] ( https://www.pgyer.com/SqGaCx8C ) ,点击立即安装,选择** 扫描局域网** ,点击对应扫描到插件的 ** +** 号即可完成插件添加
3333
3434<img src =" https://github.com/user-attachments/assets/d0f24763-266e-4e3c-bd64-a63be9e6c68c " width =" 250 " />
35+
36+ # 快速开始
37+ ## 1. 创建项目
38+ - 创建vite模版项目` npm create vite@latest assistsx-helloword -- --template vue `
39+ - 安装assistsx依赖` npm install assistsx@latest `
40+ ## 2. 创建插件配置
41+ 在目录` public ` 下创建文件` assistsx_plugin_config.json ` 文件,将以下` json ` 复制粘贴到文件中
42+ ```
43+ {
44+ "name": "AssistsX示例",
45+ "version": "1.0.0",
46+ "description": "AssistsX示例",
47+ "isShowOverlay": true,
48+ "needScreenCapture": true,
49+ "packageName": "com.assistsx.example",
50+ "main": "index.html",
51+ "icon": "vite.svg",
52+ "overlayTitle": "AssistsX示例"
53+ }
54+ ```
55+ ## 3. 编写脚本插件
56+ 写一个最简单的,点击微信搜索进入搜索页面
57+ ``` agsl
58+ const handleClick = () => {
59+ AssistsX.findById("com.tencent.mm:id/jha")[0].click()
60+ }
61+ ```
62+
63+ 增加一个测试按钮调用这个方法
64+ ``` agsl
65+ <button type="button" @click="handleClick">测试按钮</button>
66+ ```
67+
68+ ## 4. 加载插件
69+ 1 . 我们使用局域网加载插件,加载插件前需要配置项目允许局域网访问,在文件` vite.config.js ` 添加以下配置
70+ ```
71+ export default defineConfig({
72+ plugins: [vue()],
73+ server: {
74+ host: '0.0.0.0', // 允许局域网访问
75+ port: 5173
76+ },
77+ })
78+ ```
79+ 2 . 打开AssistsX,扫描局域网插件添加
80+
81+ <img src =" https://github.com/user-attachments/assets/d0f24763-266e-4e3c-bd64-a63be9e6c68c " width =" 250 " />
82+
83+ 3 . 测试插件:点击开始,打开微信消息列表,点击测试按钮
84+
85+ <img src =" https://github.com/user-attachments/assets/e6e59149-ed78-42de-81a7-c3476b5472e6 " width =" 250 " />
You can’t perform that action at this time.
0 commit comments