{"id":17041370,"url":"https://github.com/davestewart/vue-source","last_synced_at":"2025-04-12T14:33:14.508Z","repository":{"id":141850631,"uuid":"109306870","full_name":"davestewart/vue-source","owner":"davestewart","description":"Identifies Vue components in DevTools Elements panel via HTML comments","archived":false,"fork":false,"pushed_at":"2021-04-14T13:46:45.000Z","size":29,"stargazers_count":43,"open_issues_count":5,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T09:12:54.226Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davestewart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-11-02T19:02:20.000Z","updated_at":"2023-08-23T06:22:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"db2ebf11-c667-4cd2-8f51-10adaafa096d","html_url":"https://github.com/davestewart/vue-source","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davestewart%2Fvue-source","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davestewart%2Fvue-source/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davestewart%2Fvue-source/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davestewart%2Fvue-source/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davestewart","download_url":"https://codeload.github.com/davestewart/vue-source/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248581361,"owners_count":21128155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T09:12:16.684Z","updated_at":"2025-04-12T14:33:14.475Z","avatar_url":"https://github.com/davestewart.png","language":"JavaScript","funding_links":[],"categories":["叫研发工具组","Components \u0026 Libraries","Dev Tools","Dev Tools [🔝](#readme)"],"sub_categories":["检查","Dev Tools","Inspect"],"readme":"# Vue Source\n\n## Overview\n\nVue Source is a global Vue mixin which identifies components in source code by adding HTML comments:\n\n![inspector](https://user-images.githubusercontent.com/132681/32379406-5c3b5528-c0a5-11e7-9eaf-50483e9a306d.png)\n\n\nThe plugin has various optional features:\n\n- render comments as class names, tags, or file paths\n- manual or automatic activation based on environment variable\n- attach JavaScript references to DOM comments\n- inspect in Vue Devtools v4\n\n## Installation and usage\n\nDownload via NPM:\n\n```\nnpm install vue-source --save\n```\n\nImport and run from your main application file:\n\n```js\nimport VueSource from 'vue-source'\n\nVue.use(VueSource)\n```\n\nThe default settings are:\n\n- render comments as class names\n- activate in development, but not in production\n- attach component and file references to rendered comments\n\n\n## Settings\n\nYou can pass settings to `Vue.use()` to change Vue Source's behaviour:\n\n```js\nimport Vue from 'vue'\nimport VueSource from 'vue-source'\n\nVue.use(VueSource, {\n  type: 'file',\n  active: true,\n  debug: true\n})\n```\n\n### Type\n\nRender comment as class name, file path, or source code tag:\n\n\u003e  `type` : `('class'|'file'|'tag')`\n\nClass names:\n\n![comment-class](https://user-images.githubusercontent.com/132681/36078037-9105de14-0f69-11e8-829c-761143a3c1c8.png)\n\nFile paths:\n\n![comment-file](https://user-images.githubusercontent.com/132681/32379421-64c238ec-c0a5-11e7-96d0-1953ee64242c.png)\n\nTags:\n\n![comment-component](https://user-images.githubusercontent.com/132681/32379414-6133e022-c0a5-11e7-9194-cc72a1dc558d.png)\n\nWhere files don't exist (i.e router links) the plugin will attempt to render classes or tags instead.\n\n\n### Active\n\nActivate or disable at startup:\n\n\u003e  `active` : `('auto'|true|false|expression)`\n\nPass:\n\n- `'auto'` (the default) which checks `process.env.NODE_ENV` to run in anything except `production`\n- `true` to always enable\n- `false` to always disable\n- any other expression which evaluates to `true/false` to choose whether to enable\n\n### Debug\n\nAttach references to the rendered comment:\n\n\u003e `debug` : `(true|false)`\n\nBy default, the plugin attaches the following references to the DOM comment:\n\n\n- `vm`: the Vue instance\n- `tag`: the markup tag\n- `file`: the source file path\n- `class`: the source class name\n- `inspect()`: a function to inspect the component in Vue's DevTools (v4 feature)\n\nTo access these references in your browser's Vue Devtools:\n\n1. inspect the HTML comment in the Elements panel\n2. reference it in the Console via `$0`\n\n![debug](https://user-images.githubusercontent.com/132681/32379425-68121008-c0a5-11e7-8e4f-055d3684bc46.png)\n\nSet `debug` to `false` if you want to disable this functionality.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavestewart%2Fvue-source","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavestewart%2Fvue-source","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavestewart%2Fvue-source/lists"}