I'm trying to create a render function which renders an input field in Vue.
I can do this easily in a normal vue file with templates like so:
// NormalInput.vue
<template>
<input :value="value" />
</template>
<script>
export default {
name: "NormalInput",
props: {
value: null
}
};
</script>
Note that the above does indeed work correctly.
But when trying to convert the above code into a render function with the following code:
// RenderFunctionInput.js
export default {
name: "RenderFunctionInput",
props: {
value: null
},
render(createElement) {
return createElement("input", {
attrs: { value: this.value }
});
}
};
It seems reactive at first, but after editing the RenderFunctionInput manually, it stops being reactive. The Vue data seems to be updating but the actual value of the input does not.
You can view an example at https://codesandbox.io/embed/oooq7o2q16?module=%2Fsrc%2FApp.vue
Example screenshots:
I've created an example of the two components mentioned above. They are both using the same data value which is being incremented by 1 every 100 ms.
After typing in the NormalInput, it instantly gets overwritten by the :value="val" data. But when typing in the RenderFunctionInput, it stops incrementing and becomes detached from the data and becomes unreactive.


