'Nuxtjs deleting all from layouts/default.vue
I am following tutorial where guy put his header component into layouts/default.vue component. I did same except mine was inside nuxt folder, so nuxt/layouts/default.vue... I guess its just older version of nuxt but, problem is that everyting i put there, component and styles are deleted after refresing my app, all that is left was default template with component. I dont know what is happening. This is code from default.vue
<template>
<div class="container">
<AppHeader/>
<nuxt/>
</div>
</template>
<script>
import AppHeader from "@/components/AppHeader";
export default {
components: {
AppHeader
}
};
</script>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 1rem;
line-height: 1.6;
background: #f4f4f4;
}
a {
color: #666;
text-decoration: none;
}
ul {
list-style: none;
}
.container {
max-width: 800px;
margin: 2rem auto;
overflow: hidden;
padding: 1rem 2rem;
background: #fff;
}
</style>
EDIT: My actual question is how do i put global components in nuxt, navbar for example? Am i doing something wrong above?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
