Skip to content

Instantly share code, notes, and snippets.

@PinkiNice
Created January 23, 2019 13:55
Show Gist options
  • Save PinkiNice/905d3ac9f1dc4c0e8cf5c73276669a50 to your computer and use it in GitHub Desktop.
Save PinkiNice/905d3ac9f1dc4c0e8cf5c73276669a50 to your computer and use it in GitHub Desktop.
Pass slots to child component Vue.js
//https://github.com/vuejs/vue/pull/7765#issuecomment-401985464
Vue.prototype._b = (function(bind) {
return function(data, tag, value, asProp, isSync) {
if (value && value.$scopedSlots) {
data.scopedSlots = value.$scopedSlots;
delete value.$scopedSlots;
}
return bind.apply(this, arguments);
};
})(Vue.prototype._b);
/*
After that use as:
<child v-bind="{$scopedSlots}">
</child>
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment