Share common component & filter data

This commit is contained in:
Unknown
2019-06-17 17:13:04 +02:00
parent 4c311a8dbb
commit 21ccb787f6
14 changed files with 283 additions and 27 deletions

View File

@@ -0,0 +1,19 @@
<template lang="pug">
div
h1 {{ resources.title }}
.cards
template(v-for='resource in resources.resources')
Card(:title='resource.title' :desc='resource.desc' :url='resource.url')
</template>
<script>
import Card from './Card'
export default {
props: ["resources"],
components: {
Card
},
}
</script>

View File

@@ -1,27 +0,0 @@
<template lang="pug">
div
h1 {{ category.title }}
.cards
template(v-for='resource in category.resources')
Card(:title='resource.title' :desc='resource.desc' :url='resource.url')
</template>
<script>
import store from '../store.json'
import Card from '../components/Card'
export default {
data () {
return {
categoryTitle: this.$route.params.category,
categories: store,
}
},
computed: {
category() {
return this.categories.find(category => category.title.toLowerCase() === this.categoryTitle.toLowerCase())
}
},
components: { Card, },
}
</script>

View File

@@ -0,0 +1,22 @@
<template lang="pug">
CategoryPage(:resources="resources")
</template>
<script>
import CategoryPage from '../../components/CategoryPage'
import store from '../../store.json'
export default {
data() {
return {
resources: store.find(x => x.title.toLowerCase() === 'communities')
}
},
components: {
CategoryPage
}
}
</script>
<style lang="scss" scoped>
</style>

22
pages/css/index.vue Normal file
View File

@@ -0,0 +1,22 @@
<template lang="pug">
CategoryPage(:resources="resources")
</template>
<script>
import CategoryPage from '../../components/CategoryPage'
import store from '../../store.json'
export default {
data() {
return {
resources: store.find(x => x.title.toLowerCase() === 'css')
}
},
components: {
CategoryPage
}
}
</script>
<style lang="scss" scoped>
</style>

22
pages/daily/index.vue Normal file
View File

@@ -0,0 +1,22 @@
<template lang="pug">
CategoryPage(:resources="resources")
</template>
<script>
import CategoryPage from '../../components/CategoryPage'
import store from '../../store.json'
export default {
data() {
return {
resources: store.find(x => x.title.toLowerCase() === 'daily')
}
},
components: {
CategoryPage
}
}
</script>
<style lang="scss" scoped>
</style>

22
pages/design/index.vue Normal file
View File

@@ -0,0 +1,22 @@
<template lang="pug">
CategoryPage(:resources="resources")
</template>
<script>
import CategoryPage from '../../components/CategoryPage'
import store from '../../store.json'
export default {
data() {
return {
resources: store.find(x => x.title.toLowerCase() === 'design')
}
},
components: {
CategoryPage
}
}
</script>
<style lang="scss" scoped>
</style>

22
pages/frontend/index.vue Normal file
View File

@@ -0,0 +1,22 @@
<template lang="pug">
CategoryPage(:resources="resources")
</template>
<script>
import CategoryPage from '../../components/CategoryPage'
import store from '../../store.json'
export default {
data() {
return {
resources: store.find(x => x.title.toLowerCase() === 'frontend')
}
},
components: {
CategoryPage
}
}
</script>
<style lang="scss" scoped>
</style>

22
pages/fullstack/index.vue Normal file
View File

@@ -0,0 +1,22 @@
<template lang="pug">
CategoryPage(:resources="resources")
</template>
<script>
import CategoryPage from '../../components/CategoryPage'
import store from '../../store.json'
export default {
data() {
return {
resources: store.find(x => x.title.toLowerCase() === 'fullstack')
}
},
components: {
CategoryPage
}
}
</script>
<style lang="scss" scoped>
</style>

22
pages/general/index.vue Normal file
View File

@@ -0,0 +1,22 @@
<template lang="pug">
CategoryPage(:resources="resources")
</template>
<script>
import CategoryPage from '../../components/CategoryPage'
import store from '../../store.json'
export default {
data() {
return {
resources: store.find(x => x.title.toLowerCase() === 'general')
}
},
components: {
CategoryPage
}
}
</script>
<style lang="scss" scoped>
</style>

22
pages/html/index.vue Normal file
View File

@@ -0,0 +1,22 @@
<template lang="pug">
CategoryPage(:resources="resources")
</template>
<script>
import CategoryPage from '../../components/CategoryPage'
import store from '../../store.json'
export default {
data() {
return {
resources: store.find(x => x.title.toLowerCase() === 'html')
}
},
components: {
CategoryPage
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,22 @@
<template lang="pug">
CategoryPage(:resources="resources")
</template>
<script>
import CategoryPage from '../../components/CategoryPage'
import store from '../../store.json'
export default {
data() {
return {
resources: store.find(x => x.title.toLowerCase() === 'javascript')
}
},
components: {
CategoryPage
}
}
</script>
<style lang="scss" scoped>
</style>

22
pages/php/index.vue Normal file
View File

@@ -0,0 +1,22 @@
<template lang="pug">
CategoryPage(:resources="resources")
</template>
<script>
import CategoryPage from '../../components/CategoryPage'
import store from '../../store.json'
export default {
data() {
return {
resources: store.find(x => x.title.toLowerCase() === 'php')
}
},
components: {
CategoryPage
}
}
</script>
<style lang="scss" scoped>
</style>

22
pages/server/index.vue Normal file
View File

@@ -0,0 +1,22 @@
<template lang="pug">
CategoryPage(:resources="resources")
</template>
<script>
import CategoryPage from '../../components/CategoryPage'
import store from '../../store.json'
export default {
data() {
return {
resources: store.find(x => x.title.toLowerCase() === 'server')
}
},
components: {
CategoryPage
}
}
</script>
<style lang="scss" scoped>
</style>

22
pages/tools/index.vue Normal file
View File

@@ -0,0 +1,22 @@
<template lang="pug">
CategoryPage(:resources="resources")
</template>
<script>
import CategoryPage from '../../components/CategoryPage'
import store from '../../store.json'
export default {
data() {
return {
resources: store.find(x => x.title.toLowerCase() === 'tools')
}
},
components: {
CategoryPage
}
}
</script>
<style lang="scss" scoped>
</style>