父组件修改子组件的样式
父组件:
Father.vue
<template>
<Child />
</template>
子组件:
Child.vue
<template>
<div class='child '>
<input placeholder='Enter your name'>
</div>
</template>
<script>
export default {
}
</script>
如果你想在父组件中修改子组件的样式,在父页面有scope的情况下用deep来控制样式
<style scope>
.child /deep/ input{
background:red;
}
</style>
在父页面没有scope的情况下
<style >
.child input{
background:red;
}
</style>
还没有评论,来说两句吧...