当前位置:网站首页>Parent components plus scoped sometimes affect child components
Parent components plus scoped sometimes affect child components
2022-07-19 05:24:00 【K I S】
Parent component plus scoped Sometimes it also affects sub components
In writing today vue When the parent component is added scoped when , Without using /deep/ It will also affect the style of sub components , The details are as follows .
Parent component
<template> <div id="app"> <div class="app_top"> <h1>Vue- practice </h1> <hr> </div> <!-- Child components Left--> <Left></Left> </div> </template> <style lang="less" scoped> .content_left{ text-align: center; } </style>Child components Left
<template> <div class="content_left"> Myleft </div> </template>This parent component is not used /deep/ In the time sub component "Myleft" Not centered , But the fact is that "Myleft" The center shows .

reason
Debugging in the browser found , When the parent component is added scoped It will not only add to its own elements "data-v-xxx" Custom properties for , At the same time, it will also add "data-v-xxx" Custom properties for .


The end !!
边栏推荐
- 面试官:大量请求 Redis 不存在的数据,从而影响数据库,该如何解决?
- Base64 and file conversion
- UML(用例图,类图,对象图,包图)
- 线上软件测试培训机构柠檬班与iTest.AI平台达成战略合作
- Redis source code analysis 2 iterator
- js 原生对象加属性
- Rk356x u-boot Institute (command section) 3.4 usage of MEM memory related commands
- ES6 real case deconstruction (multidimensional array object) new case:
- 字幕文件与视频文件对不上的处理方式
- es6新增-数组部分
猜你喜欢

Round robin schedule problem

Excel计算本月剩余天数

基于libco的协程实现6 libcurl的同步接口的实现方案

性能瓶颈查找-火焰图分析

Nacos configuration management

mysql的事务

How to deal with the mismatch between subtitle files and video files

Redis source code analysis - data structure and Implementation (Dictionary dict)

分布式存储-fastdfs

Wechat applet obtains the week, morning, noon and evening of month, year and day
随机推荐
Two methods of obtaining URL parameters and various methods of obtaining location objects
SQL注入
Excel imports long data and changes to 000 at the end
What are the B domain, m domain and O domain
使用js中的(offset,page)实现登录效果
Pointer advanced simple summary
[ES6] explain in detail the common objects and other methods of set and array (full version)
Submit the uniapp form (input, radio, picker) to get the parameter value
路由器loopback口实验
Opendds QoS and custom QoS (timing, timingqospolicy)
循环赛制日程表问题
Excel calculates the remaining days of the month
Easypoi excel multi sheet import
ES6 real case deconstruction (multidimensional array object) new case:
vlookup函数的使用方法及实例
Wechat applet obtains the week, morning, noon and evening of month, year and day
Wechat applet learning notes
软件测试就业前景怎样 人才需求大,岗位稳定性强
OpenDDS的QoS和自定义QoS(校时TimingQosPolicy)
2020-10-22