当前位置: 首页 > 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.dtcms.com/a/300580.html

相关文章:

  • Java全栈面试实战:从JVM到AI的技术演进之路
  • 数据结构--优先级队列(堆)
  • 【网络协议安全】任务15:DHCP与FTP服务全配置
  • 点击劫持:潜藏在指尖的安全陷阱
  • Python异步下载实战:asyncio + aiohttp 性能碾压同步请求
  • 算法竞赛阶段二-数据结构(37)数据结构循环链表模拟实现
  • ios UIAppearance 协议
  • CodeBLEU:面向代码合成的多维度自动评估指标——原理、演进与开源实践
  • 笔记本键盘的启用和禁用
  • Python Pandas.cut函数解析与实战教程
  • ASP.NET Core 高并发万字攻防战:架构设计、性能优化与生产实践
  • 「mysql」Mac osx彻底删除mysql
  • 21.OSPF路由协议·多区域
  • 通过v4l2,采集视频,FFmpeg编码压缩封装视频(三)
  • 【模电笔记】—— 波形发生电路(波形振荡器)
  • Keil MDK 嵌入式开发问题:Error: L6218E: Undefined symbol HAL_TIM_PWM_ConfigChannel
  • C++编程入门:从基础到复合类型
  • 逆向入门(43)程序逆向篇-tsrh-crackme
  • SpringBoot 整合 Langchain4j AIService 深度使用详解
  • maven命令详解
  • 栈----5.柱状图中最大的矩形
  • 多模态视觉语言模型FILA-细粒度分辨率融合策略
  • 前缀和-560.和为k的子数组-力扣(LeetCode)
  • 望言OCR视频字幕提取2025终极评测:免费版VS专业版提全方位对比(含免费下载)
  • 3D芯片香港集成:技术突破与产业机遇全景分析
  • sealos 方式安装k8s5节点集群
  • CentOS 9 配置国内 YUM 源
  • Flutter开发实战之CI/CD与发布流程
  • Java AI面试实战:Spring AI与RAG技术落地
  • MySQL - 主从复制与读写分离