I am new in Vue.js,I have tried to render data to home page but nothing displayed despite of no error.Here is my code
// app.js从'./components/Home'导入Home;
const routes = [{ name: 'home',path: '/home',component: Home},];
const router = new VueRouter({ mode: 'history', routes: routes});
const app = new Vue(Vue.util.extend({ router },{data: {message:'Hello Vue!'}}, Home)).$mount('#app');
// Home.vue
{{消息}}
为了呈现您提供的HTML内容,您必须告诉vue的起点。这样做是这样的
您的代码
import Home from './components/Home';
const routes = [{ name: 'home',path: '/home',component: Home},];
const router = new VueRouter({ mode: 'history', routes: routes});
const app = new Vue(Vue.util.extend({ router },{data: {message:'Hello Vue!'}}, Home)).$mount('#app');
HTML
<div id="app">
<p>{{ message }}</p>
</div>