{"id":16019542,"url":"https://github.com/fjc0k/vue-merge-data","last_synced_at":"2026-05-17T09:41:43.357Z","repository":{"id":96343066,"uuid":"129476931","full_name":"fjc0k/vue-merge-data","owner":"fjc0k","description":"Intelligently merge data for Vue render functions.","archived":false,"fork":false,"pushed_at":"2018-05-17T07:44:15.000Z","size":255,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T16:05:42.369Z","etag":null,"topics":["data","merge-data","render-functions","vue"],"latest_commit_sha":null,"homepage":"https://npm.im/vue-merge-data","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/fjc0k.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-14T03:18:29.000Z","updated_at":"2020-03-24T15:28:10.000Z","dependencies_parsed_at":"2023-03-13T16:34:34.600Z","dependency_job_id":null,"html_url":"https://github.com/fjc0k/vue-merge-data","commit_stats":{"total_commits":27,"total_committers":1,"mean_commits":27.0,"dds":0.0,"last_synced_commit":"9fee6a20e583cdc282e01ae3dc5c7685ba42ace9"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fjc0k%2Fvue-merge-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fjc0k%2Fvue-merge-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fjc0k%2Fvue-merge-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fjc0k%2Fvue-merge-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fjc0k","download_url":"https://codeload.github.com/fjc0k/vue-merge-data/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247283294,"owners_count":20913548,"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":["data","merge-data","render-functions","vue"],"created_at":"2024-10-08T17:04:43.041Z","updated_at":"2025-10-19T03:08:41.916Z","avatar_url":"https://github.com/fjc0k.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vue-merge-data\n\n[![npm](https://img.shields.io/npm/v/vue-merge-data.svg?style=for-the-badge)](https://npm.im/vue-merge-data)\n[![npm downloads](https://img.shields.io/npm/dt/vue-merge-data.svg?style=for-the-badge)](https://npm.im/vue-merge-data)\n[![Travis](https://img.shields.io/travis/fjc0k/vue-merge-data.svg?style=for-the-badge)](https://travis-ci.org/fjc0k/vue-merge-data)\n[![minified size](https://img.shields.io/badge/minified%20size-976%20B-blue.svg?MIN\u0026style=for-the-badge)](https://github.com/fjc0k/vue-merge-data/blob/master/dist/vue-merge-data.min.js)\n[![minzipped size](https://img.shields.io/badge/minzipped%20size-562%20B-blue.svg?MZIP\u0026style=for-the-badge)](https://github.com/fjc0k/vue-merge-data/blob/master/dist/vue-merge-data.min.js)\n[![license](https://img.shields.io/github/license/fjc0k/vue-merge-data.svg?style=for-the-badge)](https://github.com/fjc0k/vue-merge-data/blob/master/LICENSE)\n\n\nIntelligently merge data for Vue render functions.\n\n```shell\nyarn add vue-merge-data\n```\n\nCDN: [jsDelivr](//www.jsdelivr.com/package/npm/vue-merge-data) | [UNPKG](//unpkg.com/vue-merge-data/) (Avaliable as `window.VueMergeData`)\n\n\n## Usage\n\nFirst, import it:\n\n```javascript\nimport mergeData from 'vue-merge-data'\n```\n\nThen, use it in Vue render functions:\n\n```javascript\n// Normal component\nexport default {\n  name: 'primary-button',\n  props: { mini: Boolean },\n  render(h) {\n    return h('base-button', mergeData(this.$vnode.data, {\n      attrs: {\n        type: 'primary',\n        mini: this.mini\n      },\n      on: {\n        click: () =\u003e {}\n      }\n    }), this.$slots.default)\n  }\n}\n\n// Functional component\nexport default {\n  name: 'primary-button',\n  functional: true,\n  props: { mini: Boolean },\n  render(h, { props, data, children }) {\n    return h('base-button', mergeData(data, {\n      attrs: {\n        type: 'primary',\n        mini: props.mini\n      },\n      on: {\n        click: () =\u003e {}\n      }\n    }), children)\n  }\n}\n```\n\n\n## Merging strategies\n\nProp(s) | Strategy | Example\n--|--|---\nstaticClass | append | target: `{ staticClass: 'button' }`\u003cbr /\u003esource: `{ staticClass: 'button--mini' }`\u003cbr /\u003eresult: `{ staticClass: 'button button--mini' }`\nattrs, domProps, scopedSlots, staticStyle, props, hook, transition | override | target: `{ attrs: { type: 'reset' } }`\u003cbr /\u003esource: `{ attrs: { type: 'submit' } }`\u003cbr /\u003eresult: `{ attrs: { type: 'submit' } }`\nclass, style, directives, on, nativeOn | expand | target: `{ class: 'button', on: { click: FN1 } }`\u003cbr /\u003esource: `{ class: { mini: true }, on: { click: FN2 } }`\u003cbr /\u003eresult: `{ class: ['button', { mini: true }], on: { click: [FN2, FN1] } }`\nothers: slot, key... | override | target: `{ slot: 'icon' }`\u003cbr /\u003esource: `{ slot: 'image' }`\u003cbr /\u003eresult: `{ slot: 'image' }`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffjc0k%2Fvue-merge-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffjc0k%2Fvue-merge-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffjc0k%2Fvue-merge-data/lists"}