[Vuejs]-The render function in Vue component doesn't render the content

0👍

Just don’t use arrow function syntax for your render function. The console says this is undefined if you do.

  render: function(createElement) {
    var a = this.ElementType.split(",");
    return createElement(
      a[0],
      {
        attrs: {
          id: a[3],
          style: "color: " + a[1] + ";font-size: " + a[2] + ";"
        }
      },
      this.$slots.default
    );
  },

https://codesandbox.io/s/lxl9yok3r7

Leave a comment