Answer the question
In order to leave comments, you need to log in
The priority of styles after assembly has changed. How to fix?
<script>
import 'normalize.css/normalize.css'
import 'materialize-css/dist/css/materialize.min.css'
import 'materialize-css/dist/js/materialize.min.js'
import sidebar from './components/sidebar'
import main from './components/main'
export default {
computed: {
lists () {
return this.$store.getters.lists
}
},
components: {
sidebar,
mymain: main
}
}
</script>
<style lang="scss">
...................
.btn {
margin-right: 20px;
height: 27px;
padding: 0px 8px;
line-height: 27px;
&:hover{
background-color: #ff9d45;
}
&:last-child {
margin-right: 0;
}
&-edit {
background-color: #2979ff;
}
&-delete {
background-color: #e53935;
}
&-complete {
background-color: #00c853;
}
}
Please tell me how to solve the problem. Answer the question
In order to leave comments, you need to log in
If I correctly understood your "problem", then it is solved very simply. It is enough to set the scoped
attribute in the block with styles - https://vue-loader.vuejs.org/guide/scoped-css.html .
This way you will limit the scope for the styles of this component to only this component . And when assembling, there will be no problems with style priorities.
Here is a comparison of how to style a component in React.js and Vue.js (Component-Scoped CSS section) - https://vuejs.org/v2/guide/comparison.html .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question