0👍
I have found a solution, there is no way to directly compile the Vue object in the js file.
But you can extract the template of the Chinese Vue object in index.js into the App.vue file:
<template>
<div>
<h1>Hello World.</h1>
</div>
</template>
index.js imports App.vue.:
import Vue from 'vue'
import App from './App.vue'
Vue.config.productionTip = false
new Vue({
// Load the precompiled template with render .
render: h => h(App)
}).$mount('#app')
- [Vuejs]-How should I understand in a vuejs template <Menu as="<div"
- [Vuejs]-Check URL $route param value using v-if in vue js
Source:stackexchange.com