Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zh-CN: create Glossary/Shim #23323

Merged
merged 3 commits into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions files/zh-cn/glossary/shim/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: 垫片
slug: Glossary/Shim
l10n:
sourceCommit: ada5fa5ef15eadd44b549ecf906423b4a2092f34
---

{{GlossarySidebar}}

**垫片**(shim)是用于修正已经存在的代码行为的一段代码,通常通过添加新的 API 来实现解决问题。它与 {{Glossary("polyfill")}} 不同:后者通过实现一个新的不受浏览器原生支持的 API 来解决问题。

## 参见

- 维基百科上的[垫片](<https://zh.wikipedia.org/wiki/垫片_(程序设计)>)