Seeking assistance with Vuejs 2 (webpack-simple template) - I am looking for a way to compile my template before rendering it. Below is the code snippet in question:
App.vue
<template>
<div id="app">
<h1>{{ msg }}</h1>
</div>
</template>
<script>
export default {
name: 'app'
}
</script>
main.js
import Vue from 'vue'
import App from './App.vue'
const res = Vue.compile(App)
const vm = new Vue({
el: '#app',
data: {
msg: 'hello'
},
render: res.render,
staticRenderFns: res.staticRenderFns
})
Encountered the following error while starting the server:
__WEBPACK_IMPORTED_MODULE_0_vue___default.a.compile is not a function
I have also attempted using the vue-template-compiler plugin without success. Any guidance on how to resolve this issue would be greatly appreciated. Thank you.