[Vuejs]-Vue2 js pass some values from input of one route to another route or share data property from one route to another route

0👍

You want to pass data through routes. You can see how to achieve that in vue’s documentation https://router.vuejs.org/en/essentials/passing-props.html

0👍

You can do something like the following in app.vue:

<template>
  <router-view :items="items"></router-view>
</template>
<script>
export default {
  name: 'app',
  data() {
    return {
      items: 6
    }
  },
}
</script>

and in the Check.vue component:

<template>
  <div>{{items}}</div>
</div>
</template>
<script>
export default {
  name: 'FrontEndCheck',
  props: ['items'],
}
</script>

In other words you can apply the logic of component props to the router-view (as it is a component). It works in my app.

Leave a comment