当前位置:网站首页>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 !!
边栏推荐
- Web3js development technology
- How to deal with the mismatch between subtitle files and video files
- js 原生对象加属性
- Two methods of rotation chart and automatic rotation
- MySQL - index
- Ucharts chart, pie chart, bar chart and line chart are used in uniapp
- [ES6] explain in detail the common objects and other methods of set and array (full version)
- JS native object plus attributes
- MySQL安装配置教程(超级详细)
- SQL injection
猜你喜欢

Redis 源码分析-数据结构及实现(字典dict)

Cityengine 3D pipe modeling tutorial

Installation and fast use of Mongo DB stand-alone version

redis 源码分析 跳表实现

CityEngine 三维管道建模教程

Baidu map realizes thermal map

Addition and removal of cesium geojson data

Excel calculates the remaining days of the month

Distributed storage fastdfs

面试官:大量请求 Redis 不存在的数据,从而影响数据库,该如何解决?
随机推荐
MySQL lock
Redis source code analysis 3 implementation of discontinuous traversal
【全网首发】JVM性能问题的自动分析
Base64 and file conversion
How to deal with the mismatch between subtitle files and video files
Cesium 綁定鼠標事件和移除鼠標事件
Pat class B 1002: write this number
UML(用例图,类图,对象图,包图)
Data visualization
MapBox 加载本地离线地形
Router loopback port experiment
2020-11-10
es6新增-let和const (var的缺点&let及const)
Two JS methods of rolling wheel loading and modal box dragging
[ES6] use multiple functions such as adding data, filtering and transmitting to the page to realize cases
SQL注入
实习项目3-更改所有者
Use echars to realize water drop, ring, segmentation, stacking, organization chart, map outline and other charts
Cesium geojson数据的添加与移除
ArcMap creates a constant grid and tessellates it into a new grid