I have a Vue component which has a custom render method. The method is not getting called however.
<template>
<div class="guide"></div>
</template>
<script>
export default {
name: 'guide',
render: function(createElement){
return createElement('div', 'this will never get called?'),
},
};
</script>
I've looked through the documentation on single file components but it makes no reference to any caveats regarding render(). Is there another way to call this method?
As ABDEL-RHMAN suggested, removing the template will cause the code to work; the <template>
causes the render method to be ignored. Working example:
<script>
export default {
name: 'guide',
render: function(createElement){
return createElement('div', 'this will get called?'),
},
};
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With