当前位置: 首页 > news >正文

Cursor下利用Stagewise实现 “所见即改” 的前端开发体验~

工欲善其事,必先利其器!发现好工具一定要第一时间和大家分享!

Stagewise 是一款专为前端开发者设计的 AI 辅助工具,旨在通过 可视化交互精准上下文传递,提升前端开发效率。它允许开发者直接在浏览器中选择 UI 元素,并将相关信息(如 DOM 结构、样式、截图等)发送给 AI 编程助手(如 Cursor、VsCode、Trae、Windsurf),实现 “所见即改” 的开发体验。


操作步骤:

  1. 在IDE插件市场中 搜索安装 Stagewise 插件!
    在这里插入图片描述

2.按下快捷键

  • Mac快捷键【command + Shift + P】 Win【ctrl + Shift + P】

  • 输入setup,选中stagewise,自动安装命令会发送到右侧聊天窗口,执行即可。
    在这里插入图片描述


  1. 🧩 Install the extension
    Install the extension from the extension store of your code editor:
  • Cursor: cursor:extension/stagewise.stagewise-vscode-extension VS
  • Code: vscode:extension/stagewise.stagewise-vscode-extension Trae:
  • trae:extension/stagewise.stagewise-vscode-extension Windsurf:
  • windsurf:extension/stagewise.stagewise-vscode-extension
  1. 👨🏽‍💻 Install and inject the toolbar (the extension will guide you)
  • In Cursor, Press CMD + Shift + P
  • Enter setupToolbar
  • Execute the command and the toolbar will init automatically 🦄

3.执行完成后,会自动在你的项目里引入Stagewise,再次启动项目,就会在右下角看到一个图标了。

在这里插入图片描述

此时鼠标移动到元素上方就可以点击选择元素。

在这里插入图片描述


核心功能

  1. 可视化元素选择

    • 在浏览器中点击任意 UI 元素(按钮、表单、卡片等),自动捕获其 DOM 路径、样式、截图及元数据(如 classNameid、组件名等)。
    • 支持多元素选择,便于批量调整关联组件(如表单组)。
  2. AI 代码生成与修改

    • 一键将选中的元素信息发送至 AI 编程助手(如 Cursor、GitHub Copilot),生成或调整代码,无需手动描述元素位置。
    • 支持实时反馈,修改后自动刷新页面预览效果。
  3. 多框架支持

    • 兼容主流前端框架(React、Vue、Next.js、SvelteKit 等),提供专用适配器,无需额外配置。
  4. 安全与轻量化

    • 仅在开发模式生效,不影响生产环境性能。
    • 数据传输加密,支持本地部署(通过 MCP 服务器)。
  5. 插件系统

    • 允许开发者扩展功能,如集成设计系统、业务逻辑插件等。

典型使用场景

  • UI 微调:快速修改按钮颜色、间距等样式,无需手动查找 CSS 类名。
  • 低代码开发:在混合 UI 与逻辑的场景中,精准调整组件行为。
  • 团队协作:选中问题元素并添加注释,AI 直接生成修改建议,减少沟通成本。

安装与使用

  1. 安装 VS Code 扩展
    • 在 VS Code 市场搜索并安装 Stagewise 扩展。
  2. 注入浏览器工具栏
    • 通过命令面板(CMD + Shift + P)执行 setupToolbar 初始化。
  3. 选择元素并发送至 AI
    • 在浏览器中点击目标元素,填写需求(如“增大字体”),AI 生成代码后自动应用。

技术架构

  • 双向通信:基于 WebSocket 连接浏览器与编辑器,数据包包含 DOM 结构、序列化状态及视觉快照。
  • 沙箱安全:仅限开发环境使用,敏感数据(如密码输入框)自动过滤。

未来发展

  • 计划支持 批量修改Figma 插件集成,进一步打通设计与开发流程。
  • 探索 跨编辑器通用适配层,兼容更多 AI 编程工具。

Stagewise 通过 “浏览器即界面” 的交互模式,显著减少了前端开发中的手动操作,尤其适合频繁调整 UI 或使用 AI 助手的开发者。


I’ll help you implement the stagewise toolbar into your Vue.js project. Let me first examine the project structure and then implement the required changes.

Read file: package.json
Great! I can see this is a Vue.js project using npm as the package manager, and the stagewise packages are already installed. Now let me check the current App.vue file to see how to integrate the toolbar.

Read file: src/App.vue
Perfect! I can see that the stagewise toolbar is already integrated into the App.vue file. The implementation looks correct:

  1. ✅ The @stagewise/toolbar-vue and @stagewise-plugins/vue packages are installed
  2. ✅ The StagewiseToolbar component is imported and used in the template
  3. ✅ The VuePlugin is imported and passed to the config
  4. ✅ The toolbar is positioned in the template

Let me also check the extensions.json file to confirm the stagewise extension is recommended:

Read file: extensions.json
Excellent! The stagewise toolbar is already properly implemented in your Vue.js project. Here’s what’s currently set up:

✅ Current Implementation Status

Package Installation:

  • @stagewise/toolbar-vue and @stagewise-plugins/vue are already installed

Integration:

  • The StagewiseToolbar component is properly imported and used in App.vue
  • The VuePlugin is correctly configured in the toolbar
  • The toolbar is positioned in the template

Extensions:

  • The stagewise VSCode extension is already in the recommended extensions list

🎯 Expected Behavior

The stagewise toolbar should:

  • ✅ Appear only in development mode (handled by the @stagewise/toolbar-vue package)
  • ✅ Not be included in production builds
  • ✅ Load once on initial browser opening
  • ✅ Only execute in the browser (not SSR)

🚀 Next Steps

  1. Start your development server:

    npm run dev
    
  2. Look for the toolbar: It should appear in the bottom right corner of your web app

  3. If the toolbar doesn’t appear: Contact the stagewise team via Discord at https://discord.gg/gkdGsDYaKA

The implementation is already complete and follows all the requirements. The stagewise toolbar should be working in your Vue.js project!


http://www.lryc.cn/news/601680.html

相关文章:

  • MyBatis-Plus IService 接口全量方法实现与测试(续)
  • 【程序员私房菜】python尖椒炒口蘑
  • 神经网络模型训练需要的内存大小计算方法
  • 任务提醒工具怎么选?对比16款热门软件
  • 疯狂星期四文案网第21天运营日记
  • 商汤发布具身智能平台,让机器人像人一样和现实世界交互
  • EMCCD相机与电可调变焦透镜的同步控制系统设计与实现
  • Chainlink Functions:为智能合约插上连接现实世界的翅膀
  • PowerDesigner 画ER图并生成sql 教程
  • 青少年编程能力等级测评试卷及答案 Python编程(三级)
  • Rouge:面向摘要自动评估的召回导向型指标——原理、演进与应用全景
  • Java面试全方位解析:从基础到AI的技术交锋
  • 如何思考一个动态规划问题需要几个状态?
  • 负载均衡 LoadBalance
  • 阻止网页重定向
  • 6、企业信息化
  • 齐护Ebook科技与艺术Steam教育套件 可图形化micropython Arduino编程ESP32纸电路手工
  • 装修独栋别墅需要注意的细节有哪些?
  • 像素农场播种机-作物模拟器HTML+CSS+JavaScript
  • Linux 系统网络配置及 IP 地址相关知识汇总
  • JVM terminated. Exit code=1
  • 通俗理解主机的BIOS和UEFI启动方式
  • SpringBoot 整合 Langchain4j AIService 深度使用详解
  • uniapp input 聚焦时键盘弹起滚动到对应的部分
  • Python入门构建网页
  • Python爬虫实战:研究netaddr库相关技术构建IP地址信息采集分析系统
  • r0env2024:开箱即用的AI工具集成Kali发新版
  • Java学习-------外观模式
  • 不坑盒子:Word里1秒制作“花括号”题目,多音字组词、形近字组词……
  • J3160迷你小主机 性能测试 对比i3-4170 以及服务器