Skip to content

Instantly share code, notes, and snippets.

@wonderful-panda
Created October 10, 2016 13:56
Show Gist options
  • Select an option

  • Save wonderful-panda/76aebdf62fa485632a6632af1511850b to your computer and use it in GitHub Desktop.

Select an option

Save wonderful-panda/76aebdf62fa485632a6632af1511850b to your computer and use it in GitHub Desktop.
Vue2.0 renderタグを提供するコンポーネント
import * as Vue from "vue";
export default {
name: "Render",
functional: true,
props: {
method: { required: true, type: Function },
args: { type: Array }
},
render(h: typeof Vue.prototype.$createElement, context: Vue.RenderContext): Vue.VNode {
const method: Function = context.props.method;
const args: any[] = context.props.args;
return method.apply(this, args) as Vue.VNode;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment