{"id":16347690,"url":"https://github.com/privatenumber/vue-v","last_synced_at":"2025-03-23T00:32:55.304Z","repository":{"id":56195113,"uuid":"301931449","full_name":"privatenumber/vue-v","owner":"privatenumber","description":"Tiny component to render Vue.js vNodes in the template.","archived":false,"fork":false,"pushed_at":"2020-11-21T08:09:15.000Z","size":132,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-03-18T16:04:16.002Z","etag":null,"topics":["render","util","vnode","vue"],"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/privatenumber.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}},"created_at":"2020-10-07T05:00:48.000Z","updated_at":"2023-03-15T09:18:46.000Z","dependencies_parsed_at":"2022-08-15T14:30:55.878Z","dependency_job_id":null,"html_url":"https://github.com/privatenumber/vue-v","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privatenumber%2Fvue-v","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privatenumber%2Fvue-v/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privatenumber%2Fvue-v/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privatenumber%2Fvue-v/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/privatenumber","download_url":"https://codeload.github.com/privatenumber/vue-v/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245040235,"owners_count":20551297,"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":["render","util","vnode","vue"],"created_at":"2024-10-11T00:44:50.781Z","updated_at":"2025-03-23T00:32:54.943Z","avatar_url":"https://github.com/privatenumber.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vue-v [![Latest version](https://badgen.net/npm/v/vue-v)](https://npm.im/vue-v) [![Monthly downloads](https://badgen.net/npm/dm/vue-v)](https://npm.im/vue-v) [![Install size](https://packagephobia.now.sh/badge?p=vue-v)](https://packagephobia.now.sh/result?p=vue-v) [![Bundle size](https://badgen.net/bundlephobia/minzip/vue-v)](https://bundlephobia.com/result?p=vue-v)\n\nTiny component to render Vue.js vNodes in the template.\n\n```html\n\u003cv :nodes=\"vnodes\" /\u003e\n```\n\n## 🙋‍♂️ Why?\n- **🎩 Render vNodes** without converting your component to use a [render function](https://vuejs.org/v2/guide/render-function.html)!\n- **🔥 Declarative API** render multiple vNodes anywhere in your template!\n- **🐥 Tiny** `250 B` minzipped!\n\n## 🚀 Install\n```sh\nnpm i vue-v\n```\n\n## 👨🏻‍🏫 Basic usage\n\n```vue\n\u003ctemplate\u003e\n    \u003cdiv\u003e\n        \u003cv :nodes=\"$slot.default\" /\u003e\n    \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport V from 'vue-v';\n\nexport default {\n    components: {\n        V\n    }\n};\n\u003c/script\u003e\n```\n\n## 💁‍♀️ FAQ\n\n### When would I use this?\nWhen you have vNodes that you want to render in a specific part of your template without having to use a [render function](https://vuejs.org/v2/guide/render-function.html).\n\nFor example, you might want to render just the text from the default `\u003cslot /\u003e`:\n\n```vue\n\u003ctemplate\u003e\n    \u003cdiv\u003e\n        \u003c!-- Only render the text from \u003cslot /\u003e --\u003e\n        \u003cv :nodes=\"textNodes()\" /\u003e\n    \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport V from 'vue-v';\n\nexport default {\n    components: {\n        V\n    },\n\n    methods: {\n        // Can't use computed property because slots aren't reactive\n        textNodes() {\n            return (this.$slots.default || []).filter(vnode =\u003e !vnode.tag);\n        }\n    }\n};\n\u003c/script\u003e\n```\n\n### How can I add a class, attribute, or event handler to the vNodes?\n\nYou can use [vNode Syringe](https://github.com/privatenumber/vue-vnode-syringe) to overwrite attributes, props, and event-listeners.\n\nFor example, if you want to overwrite the class, and add a `click` handler:\n\n```vue\n\u003ctemplate\u003e\n    \u003cdiv\u003e\n        \u003cvnode-syringe\n            class!=\"overwrite-class\"\n            @click=\"onClick\"\n        \u003e\n            \u003cv :nodes=\"vnodes\" /\u003e\n        \u003c/vnode-syringe\u003e\n    \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport V from 'vue-v';\nimport vnodeSyringe from 'vue-vnode-syringe';\n\nexport default {\n    components: {\n        V,\n        vnodeSyringe\n    },\n\n    ...,\n\n    methods: {\n        onClick() {\n            ...\n        }\n    }\n};\n\u003c/script\u003e\n```\n\n## 👨‍👩‍👧 Related\n- [vue-proxi](https://github.com/privatenumber/vue-proxi) - 💠 Tiny proxy component\n- [vue-subslot](https://github.com/privatenumber/vue-subslot) - 💍 Pick 'n choose what you want from a slot passed into your Vue component\n- [vue-pseudo-window](https://github.com/privatenumber/vue-pseudo-window) - 🖼 Declaratively interface window/document in your Vue template\n- [vue-vnode-syringe](https://github.com/privatenumber/vue-vnode-syringe) - 🧬Mutate your vNodes with vNode Syringe 💉\n- [vue-frag](https://github.com/privatenumber/vue-frag) - 🤲 Directive to return multiple root elements\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprivatenumber%2Fvue-v","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprivatenumber%2Fvue-v","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprivatenumber%2Fvue-v/lists"}