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

【前端Skill】点击目标元素定位跳转IDE中的源代码

参考:https://juejin.cn/post/7326002010084311079

快手开源项目:

https://github.com/zh-lx/code-inspector

目前在umi项目中用到

记录一下umi项目中如何使用

安装

npm i code-inspector-plugin -D --registry=https://registry.npmmirror.com/

配置

注意:动态引入时,要用解构的方式

Object [Module] {
  CodeInspectorPlugin: [Function: y],
  codeInspectorPlugin: [Function: y]
}

export default defineConfig({…..chainWebpack(memo) {if (process.env.NODE_ENV === 'development') {// 调试环境 动态引入code-inspector-pluginconst { codeInspectorPlugin } = require('code-inspector-plugin');memo.plugin('code-inspector-plugin').use(codeInspectorPlugin({bundler: 'webpack',}));}},……
});

使用

按住 shift + option + 点击目标元素

插件实现原理解析

详见:

https://blog.csdn.net/xgangzai/article/details/145526596

https://juejin.cn/post/7288238328381587475#heading-4

code-inspector 源码浅析 - 技术栈


http://www.mrgr.cn/news/99326.html

相关文章:

  • VS Code + GitHub:高效开发工作流指南
  • 前端基础之《Vue(7)—生命周期》
  • aws服务(四)文件存储服务S3 介绍使用代码集成
  • 鸿蒙NEXT开发键盘工具类(ArkTs)
  • Mac idea WordExcel等文件git modify 一直提示修改状态
  • 【MySQL数据库入门到精通-02 SQL分类以及DDL操作】
  • n8n 中文系列教程_05.如何在本机部署/安装 n8n(详细图文教程)
  • git比较不同分支的不同提交文件差异
  • Java--数组的应用
  • 深入理解设计模式之模板方法模式
  • 数仓面试内容
  • Spring AI MCP
  • 字符串拼接问题的最佳解决方案
  • MetaGPT智能体框架深度解析:记忆模块设计与应用实践
  • C语言高频面试题——常量指针与指针常量区别
  • 堆栈溢出 StackOverflowError 排查
  • 辛格迪客户案例 | 浙江高跖医药委托生产质量管理协同(OWL MAH)项目
  • vue3 + element-plus中el-dialog对话框滚动条回到顶部
  • 存储器综合:内存条
  • [SpringBoot]配置文件(1)