0

On fresh project my app doesn't found the root element withe VueJS (2.5.13) on expressJs server.

my index.html:

<html>
    <head>
        <title>Test</title>
    </head>
    <body>
        <div id="app"></div>
        <script src="dist/index.js"></script>
    </body>
</html>

my js entry point:

import Vue from 'vue'
import App from './App'

new Vue({
   render: h => h(App)
}).$mount('#app')

And my very basy App.vue:

<template>
    <div>
        Hello the world
    </div>
</template>
<script>
    export default {
        name: 'app'
    }
</script>
<style>
</style>

I use babel-loader and webpack. I doesn't understand why Vue doesn't found #appid.

thx for your help

darkiron
  • 1,174
  • 1
  • 10
  • 20

1 Answers1

0
 <template>
   <div id="app"> <----- id="app"
     Hello the world
   </div>
 </template>

Try adding id="app" to your div in the App.vue

AND

new Vue({
  el: '#app', <-------- el: '#app'
  render: h => h(App)
})
Testy
  • 1
  • 3