I've been experimenting with creating functional components in Vue using the render method. Here's an example of how I attempted to do this:
import Vue from "vue"
const { render, staticRenderFns } = Vue.compile(`<div>Hello World</div>`)
Vue.component("HelloWorld", {
functional: true,
render,
staticRenderFns
})
After setting up my component, I tried using it in App.vue
:
<template>
<div id="app">
<HelloWorld />
</div>
</template>
<script>
export default {
data() {
return {
compiled: false
}
}
}
</script>
<style>
</style>
However, when testing this setup, I encountered the error message:
_c is not defined
.
I'm unsure what might be causing this issue, could there be a mistake in my approach?