All files / src/components/u-create-element.vue index.vue

66.66% Statements 4/6
25% Branches 1/4
0% Functions 0/1
66.66% Lines 4/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21      7x     7x 7x                          
<script>
export default {
    name: 'u-create-element',
    functional: true,
    props: {
        tag: { type: String, required: true },
        data: Object,
        children: null,
    },
    render(h, context) {
        // @TODO: 应该细化合并
        const data = Object.assign({}, context.props.data, context.data);
        return h(
            context.props.tag,
            data,
            context.children || context.props.children,
        );
    },
};
</script>