How to use the h function from vue

Find comprehensive JavaScript vue.h code examples handpicked from public code repositorys.

5
6
7
8
9
10
11
12
13
  const children = null;
  const slots = {};
  if (children) {
    slots.default = () => h(SlotWrapper, { value: children });
  }
  const app = createSSRApp({ render: () => h(Component.default, props, slots) });
  const html = await renderToString(app);
  return { html, css: undefined };
};
fork icon38
star icon441
watch icon6

+ 11 other calls in file

76
77
78
79
80
81
82
83
84
85
        }
        else {
            makeShadow(el.value);
        }
    });
    return () => vue.h(props.tag, { ref: el }, [
        static_.value ? slots.default() : vue.h(props.slotTag, { id: props.slotId, class: props.slotClass }, [slots.default()])
    ]);
},
install,
fork icon7
star icon0
watch icon0

+ 7 other calls in file

-2
fork icon1
star icon36
watch icon2

+ 3 other calls in file

91
92
93
94
95
96
97
98
99
100
name: 'ElLoading',
setup() {
    return componentSetupConfig;
},
render() {
    const spinner = vue.h('svg', {
        class: 'circular',
        viewBox: '25 25 50 50',
    }, [
        vue.h('circle', { class: 'path', cx: '50', cy: '50', r: '20', fill: 'none' }),
fork icon1
star icon2
watch icon1

+ 11 other calls in file

94
95
96
97
98
99
100
101
102
103
    const marginLeft = parseInt(autoLabelWidth, 10) - computedWidth.value;
    if (marginLeft) {
        style.marginLeft = marginLeft + 'px';
    }
}
return vue.h('div', {
    ref: el,
    class: ['el-form-item__label-wrap'],
    style,
}, (_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots));
fork icon1
star icon2
watch icon1

+ 3 other calls in file

2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
}));
return () => {
    const children = slots.default && slots.default(link);
    return props.custom
        ? children
        : vue.h('a', {
            'aria-current': link.isExactActive
                ? props.ariaCurrentValue
                : null,
            href: link.href,
fork icon0
star icon0
watch icon1

+ 23 other calls in file

619
620
621
622
623
624
625
626
627
628
// console.log(data, attributes, config)
if (isRaw && content) {
    attributes.innerHTML = content;
}
// Ignore empty string content
const vnode = vue.h(finalTag, attributes, content || undefined);
return {
    to: data.to,
    vnode
};
fork icon0
star icon0
watch icon1

+ 11 other calls in file

2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
    code = out;
  }
}
code = code.replace(/\n$/, '') + '\n';
if (!lang) {
  return vue.h(script$5, null, function () {
    return vue.h('code', {
      innerHTML: escaped ? code : escape(code, true)
    });
  });
fork icon0
star icon0
watch icon1

+ 149 other calls in file