Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vue-loader
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pi-plusplus
fork-from-github
vue-loader
Commits
a158e84f
Unverified
Commit
a158e84f
authored
Oct 26, 2020
by
项鸿伟
Committed by
GitHub
Oct 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs(cn): Update scoped-css.md (#1746) [ci skip]
parent
b1665abb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
scoped-css.md
docs/zh/guide/scoped-css.md
+1
-1
No files found.
docs/zh/guide/scoped-css.md
View file @
a158e84f
...
...
@@ -70,6 +70,6 @@
## 还有一些要留意
-
**Scoped 样式不能代替 class**
。考虑到浏览器渲染各种 CSS 选择器的方式,当
`p { color: red }`
是 scoped 时 (即与特性选择器组合使用时) 会慢很多倍。如果你使用 class 或者 id 取而代之,比如
`.example { color: red }`
,性能影响就会消除。
你可以在
[
这块试验田
](
https://stevesouders.com/efws/css-selectors/csscreate.php
)
中测试它们的不同。
-
**Scoped 样式不能代替 class**
。考虑到浏览器渲染各种 CSS 选择器的方式,当
`p { color: red }`
是 scoped 时 (即与特性选择器组合使用时) 会慢很多倍。如果你使用 class 或者 id 取而代之,比如
`.example { color: red }`
,性能影响就会消除。
-
**在递归组件中小心使用后代选择器!**
对选择器
`.a .b`
中的 CSS 规则来说,如果匹配
`.a`
的元素包含一个递归子组件,则所有的子组件中的
`.b`
都将被这个规则匹配。
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment