爱意满满的作品展示区。
you222

[Chrome 插件] 写了一个针对 React 项目本地开发时,点击页面上对应元素即可跳转到编辑器对应组件位置的 Chrome 插件

  •  2
     
  •   you222 · Jan 11, 2023 · 3918 views
    This topic created in 1407 days ago, the information mentioned may be changed or developed.

    安装地址:react1s

    github 地址:react1s

    Option+Click 页面上对应元素即可跳转到编辑器对应组件行列

    预览图如下: demo

    17 replies  •  2023-01-12 08:52:51 +08:00
    no13bus
    no13bus
    Jan 11, 2023
    1
    好神奇,这是啥原理
    djs
    djs
    Jan 11, 2023
    2
    这个好呀,先 mark 下
    you222
    you222
    OP
    Jan 11, 2023
    3
    随着 React 项目越来越大,在本地开发时经常会遇到这样一个场景,想改页面上的一个功能,但是比较难去找到这个功能在编辑器中对应的页面 & 组件的位置。这时候使用本插件可以支持一键点击页面元素跳转到编辑器对应文件的行数。
    cation
    cation
    Jan 11, 2023
    4
    赞一个, 有些是动态展示的 dom 不知道能不能支持。
    you222
    you222
    OP
    Jan 11, 2023❤️1
    5
    @no13bus 主要是通过 babel-plugin-transform-react-jsx-source 这个 babel 插件去拿到 dom 节点的文件信息来实现跳转打开到对应的位置
    you222
    you222
    OP
    Jan 11, 2023
    6
    @cation 可以定位到动态展示的 dom 的父节点那一行的位置
    shuxge1223
    shuxge1223
    Jan 11, 2023
    7
    好像在 producthunt 看到类似的项目 是你吗
    sunjourney
    sunjourney
    Jan 11, 2023❤️1
    8
    LocatorJS 专门做这个的
    looppppp
    looppppp
    Jan 11, 2023
    9
    太强了,赞赞赞
    chenzhe
    chenzhe
    PRO
    Jan 11, 2023
    10
    很好用,赞赞赞。
    rookiebulls
    rookiebulls
    Jan 11, 2023 via iPhone
    11
    刚好能解决我现在老项目碰到的问题,试用一下
    zhuangpipi
    zhuangpipi
    Jan 11, 2023
    12
    确实好用
    bury
    bury
    Jan 11, 2023
    13
    看起来很不错!
    angith
    angith
    Jan 11, 2023
    14
    牛皮
    randomstream
    randomstream
    Jan 11, 2023
    15
    记得好像 Vue 那边也有人做过了?
    zthxxx
    zthxxx
    Jan 11, 2023
    16
    楼主做的挺好的,比这个的实现简洁 https://github.com/zthxxx/react-dev-inspector
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4300 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 48ms · UTC 08:22 · PVG 16:22 · LAX 00:22 · JFK 03:22
    ♥ Do have faith in what you're doing.