Vue组件和样式范围问题

时间:2018-08-16 10:41:53

标签: html css vue.js

我在Vue webpack-简单安装项目中有一个父组件和两个子组件,在两个子组件中我应用了作用域样式,问题是,其中一个我将位置设置为绝对,我想要这个行为以不影响其他同级组件,这是我的设置的说明性示例

import siblingOne from 'some path'
import siblingtwo from 'some path'

export default {
  components: {
    'app-sibling-one': siblingOne,
    'app-sibling-two': siblingTwo 
    }
  }
/* lets say we are in the sibling one component
also lets consider the main div inside the template tags have an id="one" and again i want the behavior of the positioning to be absolute because i have another layer thats setting on top of it 

*/
<style scoped>
#one {
position: absolute
background-color: lightgreen
}

   </style>
<div id="#app">
  <app-sibling-one></app-sibling-one>
  <app-sibling-two></app-sibling-two>
</div>

现在,我怎样才能使第二个兄弟姐妹不受第一个兄弟姐妹的风格的影响,谢谢?

0 个答案:

没有答案