Created
October 10, 2016 13:56
-
-
Save wonderful-panda/76aebdf62fa485632a6632af1511850b to your computer and use it in GitHub Desktop.
Vue2.0 renderタグを提供するコンポーネント
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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