I have a simple BootstrapVue table.
The css is defined in App.vue. Here's the code for App.vue.
<template>
<div id="app">
<!-- <img alt="Vue logo" src="./assets/logo.png"> -->
<TestTable msg="testing"/>
</div>
</template>
<script>
import TestTable from './components/TestTable.vue'
export default {
name: 'App',
components: {
TestTable
}
}
</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-top: 60px;
}
</style>
Here's the code for TestTable.vue.
<template>
<div>
<b-table striped hover :items="items"></b-table>
</div>
</template>
<script>
export default {
data() {
return {
items: [
{ age: 40, first_name: 'Dickerson', last_name: 'Macdonald' },
{ age: 21, first_name: 'Larsen', last_name: 'Shaw' },
{ age: 89, first_name: 'Geneva', last_name: 'Wilson' },
{ age: 38, first_name: 'Jami', last_name: 'Carney' }
]
}
}
}
</script>
The margin-top: 60px is defined in App.vue. I want to modify TableTest.vue such that it overrides the margin top in the CSS in App.vue. I want margin-top: 0px for TableTest.vue.
I am using Vue v2.6 and Bootstrap-vue.