2👍
The first parameter in the render
function h
which is nothing but a function usually called createElement
which contains information describing to Vue what kind of node it should render on the page.
This createElement
takes 3 arguments:
- The HTML tag name. This is required.
- An object contains the attributes you pass in normal template. This is optional.
- Children nodes as an array or a simple text node as a string. This is optional.
You did not return the h
function ,since the first argument is required and not provided in your first snippet of code, it did not work.
Reference – Render functions
To make your first snippet of code to work you to return the h
function with the 1st argument any tag name like you are doing in the second snippet.
- [Vuejs]-Quasar change suffix of email depending on option group
- [Vuejs]-Chart.js draw custom grid lines
Source:stackexchange.com