V
V
vitaliy_novenkiy2018-10-14 17:03:02
Vue.js
vitaliy_novenkiy, 2018-10-14 17:03:02

Vue-router how to link to new page?

Good afternoon. The router navigates to another component page (URl changes), but the new page is not displayed.
index.html

<section id="app-pro">     
      <router-view></router-view>
</section>

main.js
import AppPro from './AppPro.vue'
import PageSmeta from './components/PageSmeta.vue'

Vue.use(VueRouter)

Vue.component('PageSmeta', PageSmeta);

const routes = [
  { path: '/pagesmeta', component: PageSmeta}
]

const router = new VueRouter({
  routes
})

new Vue({
  el: '#app-pro',
  render: h => h(AppPro),
  router
}).$mount('#app-pro')

AppPro.vue
<router-link to="/pagesmeta">Smeta Router</router-link>

PageSmeta.vue
<template>
  <h1>Smeta</h1>
</template>

Answer the question

In order to leave comments, you need to log in

5 answer(s)
0
0xD34F, 2018-10-14
@vitaliy_novenkiy

<section id="app-pro">     
      <router-view></router-view>
</section>

new Vue({
  el: '#app-pro',
  render: h => h(AppPro),
  router
}).$mount('#app-pro')

Do you even understand what you wrote here? The question is rhetorical - of course not, you don't understand. Open the documentation and read - what is render , el and $mount . Pay special attention to this fragment:
The function in the option rendertakes precedence over the render-function compiled from the option templateand over the HTML template located at the mount point specified in the option el.

D
Daniel, 2015-07-17
@lycorp

For .owl-carousel, change the width, for example, to 90%, place it in the center (margin: 0 auto) and tweak the left/right of owl-prev/owl-next.
Also, so that the design does not change (the buttons will remain in the same place, and the carousel will decrease), you can increase the size of the hfblock, wrap all its contents in an additional div, which already has a width set.

A
Alexander, 2015-07-17
@mais64

The buttons are not visible because they have negative values ​​left: -48px; and right: -48px;

A
al3ch5, 2015-07-18
@al3ch5

What site are you doing?

M
Max Kulikov, 2015-07-18
@maks843

Like media queries, right?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question