Merge branch 'develop' into main
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# full-skies
|
||||
Ce projet a pour but d'exploiter [l'API Le Système Solaire](https://api.le-systeme-solaire.net/) et de proposer une interface simple pour selectionner des favoris.
|
||||
|
||||
Il a été conçu lors d'un module d'apprentissage de Nuxt/Vue à MyDigitalSchool.
|
||||
- [Dependencies](#dependencies)
|
||||
- [How to install](#how-to-install)
|
||||
## Dependencies
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
# ASSETS
|
||||
|
||||
**This directory is not required, you can delete it if you don't want to use it.**
|
||||
|
||||
This directory contains your un-compiled assets such as LESS, SASS, or JavaScript.
|
||||
|
||||
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked).
|
||||
@@ -1,7 +0,0 @@
|
||||
# LAYOUTS
|
||||
|
||||
**This directory is not required, you can delete it if you don't want to use it.**
|
||||
|
||||
This directory contains your Application Layouts.
|
||||
|
||||
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts).
|
||||
44
layouts/error.vue
Normal file
44
layouts/error.vue
Normal file
@@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<section class="error bg-image">
|
||||
<div class="splash">
|
||||
<h2 class="heading-1">
|
||||
<span v-if="error.statusCode === 404">Page non trouvée</span>
|
||||
<span v-else>Une erreur est survenue</span>
|
||||
<span>:(</span>
|
||||
</h2>
|
||||
<p>{{ error.message }}</p>
|
||||
<div>
|
||||
<nuxt-link :to="'/'">
|
||||
<AtomsFSButton>Retourner à la page d'accueil</AtomsFSButton>
|
||||
</nuxt-link>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
layout: 'error',
|
||||
props: {
|
||||
error: {
|
||||
type: Object,
|
||||
default: () => { return {} }
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.error {
|
||||
position: relative;
|
||||
min-height: inherit;
|
||||
padding: 0 10%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
|
||||
&:after {
|
||||
background-image: url("/celestials_bg-min.jpg");
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,8 +0,0 @@
|
||||
# MIDDLEWARE
|
||||
|
||||
**This directory is not required, you can delete it if you don't want to use it.**
|
||||
|
||||
This directory contains your application middleware.
|
||||
Middleware let you define custom functions that can be run before rendering either a page or a group of pages.
|
||||
|
||||
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware).
|
||||
@@ -1,6 +0,0 @@
|
||||
# PAGES
|
||||
|
||||
This directory contains your Application Views and Routes.
|
||||
The framework reads all the `*.vue` files inside this directory and creates the router of your application.
|
||||
|
||||
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing).
|
||||
@@ -53,22 +53,14 @@ import { fetchCelestial } from '@/api/le-systeme-solaire'
|
||||
export default {
|
||||
name: 'Celestial',
|
||||
|
||||
data () {
|
||||
return {
|
||||
celestial: false
|
||||
async asyncData ({ params, error }) {
|
||||
const slug = params.slug
|
||||
try {
|
||||
const celestial = await fetchCelestial(slug)
|
||||
return { celestial }
|
||||
} catch (err) {
|
||||
error(err)
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
// Fetches from API...
|
||||
fetchCelestial(this.$route.params.slug)
|
||||
.then((res) => {
|
||||
this.celestial = res
|
||||
return this.celestial
|
||||
})
|
||||
// .catch((err) => {
|
||||
// console.error(err)
|
||||
// })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
# PLUGINS
|
||||
|
||||
**This directory is not required, you can delete it if you don't want to use it.**
|
||||
|
||||
This directory contains Javascript plugins that you want to run before mounting the root Vue.js application.
|
||||
|
||||
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/plugins).
|
||||
@@ -1,11 +0,0 @@
|
||||
# STATIC
|
||||
|
||||
**This directory is not required, you can delete it if you don't want to use it.**
|
||||
|
||||
This directory contains your static files.
|
||||
Each file inside this directory is mapped to `/`.
|
||||
Thus you'd want to delete this README.md before deploying to production.
|
||||
|
||||
Example: `/static/robots.txt` is mapped as `/robots.txt`.
|
||||
|
||||
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#static).
|
||||
@@ -1,9 +0,0 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import Logo from '@/components/Logo.vue'
|
||||
|
||||
describe('Logo', () => {
|
||||
test('is a Vue instance', () => {
|
||||
const wrapper = mount(Logo)
|
||||
expect(wrapper.vm).toBeTruthy()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user