0

This is my very beginning with Vue with Symfony. Problem is nothing is displayed in my page, I was expecting Hello to be print. I did all my configurations. I have created folder vue

Inside vue I have following 2 files.

App.vue

<template>
    <div id="app">
        <h1>Hello</h1>
    </div>
</template>

index.js

import Vue from "vue";
import App from "./App";

new Vue({
  components: { App },
  template: "<App/>"
}).$mount("#app");

I have in my webpack.config.js

.addEntry('app', './assets/vue/index.js')

I did anything wrong here ?

1 Answer 1

1

You are mounting the Vue instance to something existing in the DOM with id app. But the component inside App.vue also contains a div with id app. Try to mount to anything else on the page that Symfony creates (you can't mount on body or html). I'm sure that page does not contain anything with id app.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks Ferry, First time with Vue so getting difficulties

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.