Skip to content
Permalink
Browse files

pages and routes

  • Loading branch information...
jeffreybiles committed Oct 13, 2019
1 parent a637a4b commit cd4cc70f3df5df8ded3c35042a16e6e3cca9eb89
Showing with 111 additions and 1 deletion.
  1. +1 −1 nuxt.config.js
  2. +15 −0 pages/videos.vue
  3. +33 −0 pages/videos/_id.vue
  4. +15 −0 pages/videos/_id/edit.vue
  5. +15 −0 pages/videos/_id/index.vue
  6. +32 −0 pages/videos/index.vue
@@ -34,7 +34,7 @@ export default {
*/
buildModules: [
// Doc: https://github.com/nuxt-community/eslint-module
'@nuxtjs/eslint-module'
// '@nuxtjs/eslint-module'
],
/*
** Nuxt.js modules
@@ -0,0 +1,15 @@
<template>
<div>
<nuxt-child />
</div>
</template>

<script>
export default {
}
</script>

<style lang="scss" scoped>
</style>
@@ -0,0 +1,33 @@
<template>
<div>
<nuxt-child :video="video" />
</div>
</template>

<script>
export default {
data() {
return {
videos: [{
id: '16',
name: 'Intro to NuxtJS'
}, {
id: '1',
name: 'Intro to VueJS'
}, {
id: '71',
name: 'Advanced Techniques for Library X'
}]
}
},
computed: {
video() {
return this.videos.find(v => v.id == this.$route.params.id)
}
}
}
</script>

<style lang="scss" scoped>
</style>
@@ -0,0 +1,15 @@
<template>
<div>
<h1>Editing {{ video.name }} </h1>
</div>
</template>

<script>
export default {
props: ['video']
}
</script>

<style lang="scss" scoped>
</style>
@@ -0,0 +1,15 @@
<template>
<div>
We are in video {{ video.name }}
</div>
</template>

<script>
export default {
props: ['video']
}
</script>

<style lang="scss" scoped>
</style>
@@ -0,0 +1,32 @@
<template>
<div>
<nuxt-child />
<h1>Videos</h1>
<div v-for="video in videos" :key="video.id">
{{ video.name }}
</div>
</div>
</template>

<script>
export default {
data() {
return {
videos: [{
id: '16',
name: 'Intro to NuxtJS'
}, {
id: '1',
name: 'Intro to VueJS'
}, {
id: '71',
name: 'Advanced Techniques for Library X'
}]
}
},
}
</script>

<style lang="scss" scoped>
</style>

0 comments on commit cd4cc70

Please sign in to comment.
You can’t perform that action at this time.