Vue.JS duplicates my classes and somehow built staff in a different places

Viewed 18

I faced with an issue, that when I serve my Vue.JS application it duplicates and changes a bit my classes. That is the code I have:

<template>
  <div class="hello">
    <header class="restaurantHeader">
      <h2 class="restaurantTitle">{{ restTitleMsg }}</h2>
    </header>
    <main>
      <h3 class="restaurantSubtitle">{{ restSubtitleMsg }}</h3>
    </main>
  </div>
</template>

<script>
export default {
  name: 'menuPage',
  props: {
    restTitleMsg: String,
    restSubtitleMsg: String
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
header.restaurantHeader {
  background: #cce;
    background: rgba( 159, 159, 207, 0.65);
    height: 70px;
    position: fixed;
    top: 0; right: 10%; left: 10%;
  z-index: 2;
}
</style>

It should have a fixed header and scrollable content under it. It looks how it should be, but when I use a code inspector, I could see some duplicates and messed classes: That's how it looks like

As per my understanding it should be something, like this: That's how it should be

In my App.vue (where I built the project) code there are also nothing, that could run these duplicates:

<template>
  <div id="app">
    <menuPage restTitleMsg="Welcome to Bernadotte Restaurant"/>
    <menuPage restSubtitleMsg="Please make a choice from our delicious dishes below:"/>
    <img alt="Vue logo" src="./assets/logo.png">
  </div>
</template>

<script>
import menuPage from './components/menuPage/mainContent.vue'

export default {
  name: 'App',
  components: {
    menuPage
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin: 0 auto;
  max-width: 980px;
  padding: 20px;
  box-sizing: border-box;
}
</style>

So if anyone knows, how to fix this problem, I will really appreciate it! It is not looking trivial for me, that's why I am here :)

0 Answers
Related