{"id":3834,"date":"2024-01-10T11:43:56","date_gmt":"2024-01-10T03:43:56","guid":{"rendered":"http:\/\/www.ponybai.com\/?p=3834"},"modified":"2023-12-02T13:56:03","modified_gmt":"2023-12-02T05:56:03","slug":"%e7%bb%84%e4%bb%b6%e5%8f%af%e8%ae%bf%e9%97%ae%e6%80%a7","status":"publish","type":"post","link":"http:\/\/www.ponybai.com\/?p=3834","title":{"rendered":"\u7ec4\u4ef6\u53ef\u8bbf\u95ee\u6027"},"content":{"rendered":"\n<p>\u8f85\u52a9\u8f6f\u4ef6\u548c\u8f85\u52a9\u6280\u672f\u4f7f\u6b8b\u969c\u7528\u6237\u80fd\u591f\u4f7f\u7528\u60a8\u6784\u5efa\u7684\u4ea7\u54c1\u3002\u5f00\u53d1\u7ec4\u4ef6\uff0c\u4ee5\u4fbf\u6240\u6709\u7528\u6237\u90fd\u80fd\u611f\u77e5\u3001\u7406\u89e3\u3001\u5bfc\u822a\u5e76\u4e0e\u4e4b\u4ea4\u4e92\u3002<\/p>\n\n\n\n<p>\u6211\u4eec\u5efa\u8bae\u60a8\u5728\u521b\u5efa\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u65f6\u9075\u5faa\u00a0WCAG \u8f85\u52a9\u529f\u80fd\u6307\u5357\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"component-accessibility-attributes\">\u7ec4\u4ef6\u8f85\u52a9\u529f\u80fd\u5c5e\u6027<\/h2>\n\n\n\n<p>\u82e5\u8981\u4f7f\u7ec4\u4ef6\u53ef\u7528\u4e8e\u5c4f\u5e55\u9605\u8bfb\u5668\u548c\u5176\u4ed6\u8f85\u52a9\u6280\u672f\uff0c\u8bf7\u5728\u7ec4\u4ef6\u4e0a\u4f7f\u7528 HTML \u5c5e\u6027\u3002HTML \u5c5e\u6027\u63cf\u8ff0\u5b83\u4eec\u6240\u5305\u542b\u7684 UI \u5143\u7d20\u3002\u8f85\u52a9\u529f\u80fd\u8f6f\u4ef6\u901a\u8fc7\u5927\u58f0\u6717\u8bfb\u5c5e\u6027\u6765\u89e3\u91ca UI \u5143\u7d20\u3002<\/p>\n\n\n\n<p>\u8f85\u52a9\u529f\u80fd\u7684\u4e00\u4e2a\u5173\u952e\u90e8\u5206\u662f\u5c5e\u6027\u7684\u4f7f\u7528\u3002\u5c4f\u5e55\u9605\u8bfb\u5668\u5411\u7528\u6237\u8bfb\u51fa\u5c5e\u6027\u503c\u3002\u5f53\u60a8\u4f7f\u7528\u5177\u6709\u5c5e\u6027\u7684 Lightning Web \u7ec4\u4ef6\u65f6\uff0c\u8bf7\u59cb\u7ec8\u6307\u5b9a\u4e00\u4e2a\u503c\u3002\u4f8b\u5982\uff0c\u7ec4\u4ef6\u5177\u6709\u5c5e\u6027\u3002<code>title<\/code><code>title<\/code><code>title<\/code><code>lightning-button<\/code><code>title<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- parent.html --&gt;\n&lt;template&gt;\n  &lt;lightning-button title=\"Log In\" label=\"Log In\" onclick={login}&gt;&lt;\/lightning-button&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<p>\u8be5\u6a21\u677f\u521b\u5efa\u5982\u4e0b\u6240\u793a\u7684 HTML \u8f93\u51fa\uff0c\u4f9b\u5c4f\u5e55\u9605\u8bfb\u5668\u5411\u7528\u6237\u8bfb\u51fa\u201c\u767b\u5f55\u201d\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- Generated HTML --&gt;\n&lt;lightning-button&gt;\n  &lt;button title=\"Log In\"&gt;Log In&lt;\/button&gt;\n&lt;\/lightning-button&gt;<\/code><\/pre>\n\n\n\n<p>\u521b\u5efa Lightning Web \u7ec4\u4ef6\u65f6\uff0c\u5982\u679c\u60a8\u5e0c\u671b\u5c4f\u5e55\u9605\u8bfb\u5668\u5411\u7528\u6237\u5927\u58f0\u6717\u8bfb\u503c\uff0c\u8bf7\u4f7f\u7528 to \u516c\u5f00\u516c\u5171\u5c5e\u6027\u3002<code>@api<\/code><code>title<\/code><\/p>\n\n\n\n<p>\u5f53\u60a8\u901a\u8fc7\u5c06\u67d0\u4e2a\u5c5e\u6027\u516c\u5f00\u4e3a\u516c\u5171\u5c5e\u6027\u6765\u63a7\u5236\u8be5\u5c5e\u6027\u65f6\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8be5\u5c5e\u6027\u5c06\u4e0d\u518d\u663e\u793a\u5728 HTML \u8f93\u51fa\u4e2d\u3002\u82e5\u8981\u5c06\u503c\u4f5c\u4e3a\u5c5e\u6027\u4f20\u9012\u5230\u5448\u73b0\u7684 HTML\uff08\u4ee5\u53cd\u6620\u5c5e\u6027\uff09\uff0c\u8bf7\u4e3a\u5c5e\u6027\u5b9a\u4e49 getter \u548c setter \u5e76\u8c03\u7528\u8be5\u65b9\u6cd5\u3002<code>setAttribute()<\/code><\/p>\n\n\n\n<p>\u60a8\u8fd8\u53ef\u4ee5\u5728 setter \u4e2d\u6267\u884c\u64cd\u4f5c\u3002\u4f7f\u7528\u79c1\u6709\u5c5e\u6027\u6765\u4fdd\u5b58\u8ba1\u7b97\u503c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ myComponent.js\nimport { LightningElement, api } from \"lwc\";\n\nexport default class MyComponent extends LightningElement {\n  privateTitle;\n  @api\n  get title() {\n    return this.privateTitle;\n  }\n\n  set title(value) {\n    this.privateTitle = value.toUpperCase();\n    this.setAttribute(\"title\", this.privateTitle);\n  }\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- parent.html --&gt;\n&lt;template&gt;\n  &lt;c-my-component title=\"Hover Over the Component to See Me\"&gt;&lt;\/c-my-component&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/* Generated HTML *\/\n&lt;c-my-component title=\"HOVER OVER THE COMPONENT TO SEE ME\"&gt;\n  &lt;div&gt;Reflecting Attributes Example&lt;\/div&gt;\n&lt;\/c-my-component&gt;<\/code><\/pre>\n\n\n\n<p>\u6709\u5173\u4f7f\u7528 \u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605\u5c06 JavaScript \u5c5e\u6027\u53cd\u6620\u5230 HTML \u5c5e\u6027\u3002<code>setAttribute()<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ARIA \u5c5e\u6027<\/h2>\n\n\n\n<p>\u82e5\u8981\u63d0\u4f9b\u66f4\u9ad8\u7ea7\u7684\u8f85\u52a9\u529f\u80fd\uff0c\u4f8b\u5982\u5c4f\u5e55\u9605\u8bfb\u5668\u8bfb\u51fa\u6309\u94ae\u7684\u5f53\u524d\u72b6\u6001\uff0c\u8bf7\u4f7f\u7528\u00a0ARIA\u00a0\u5c5e\u6027\u3002\u8fd9\u4e9b\u5c5e\u6027\u4e3a\u652f\u6301 ARIA \u6807\u51c6\u7684\u5c4f\u5e55\u9605\u8bfb\u5668\u63d0\u4f9b\u4e86\u66f4\u8be6\u7ec6\u7684\u4fe1\u606f\u3002<\/p>\n\n\n\n<p>\u60a8\u53ef\u4ee5\u5c06 ARIA \u5c5e\u6027\u4e0e HTML \u6a21\u677f\u4e2d\u7684\u5c5e\u6027\u76f8\u5173\u8054\u3002\u5728\u7ec4\u4ef6\u7684\u6a21\u677f\u6587\u4ef6\u4e2d\uff0c\u503c\u5fc5\u987b\u662f\u552f\u4e00\u7684\uff0c\u4ee5\u4fbf\u5c4f\u5e55\u9605\u8bfb\u5668\u53ef\u4ee5\u5c06 ARIA \u5c5e\u6027\uff08\u5982 \u3001\uff09\u4e0e\u7279\u5b9a\u5143\u7d20\u76f8\u5173\u8054\u3002<code>id<\/code><code>id<\/code><code>aria-describedby<\/code><code>aria-details<\/code><code>aria-owns<\/code><\/p>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u5448\u73b0\u6a21\u677f\u65f6\uff0c\u503c\u53ef\u80fd\u4f1a\u8f6c\u6362\u4e3a\u5168\u5c40\u552f\u4e00\u503c\u3002\u4e0d\u8981\u5728 CSS \u6216 JavaScript \u4e2d\u4f7f\u7528\u9009\u62e9\u5668\uff0c\u56e0\u4e3a\u5b83\u4e0e\u8f6c\u6362\u540e\u7684 .\u8bf7\u6539\u7528\u5143\u7d20\u7684\u5c5e\u6027\u6216\u7c7b\u4f3c \u7684\u5c5e\u6027\u3002<code>id<\/code><code>id<\/code><code>id<\/code><code>class<\/code><code>data-*<\/code><code>data-id<\/code><\/p>\n\n\n\n<p>\u8ba9\u6211\u4eec\u770b\u4e00\u4e9b\u4ee3\u7801\u3002\u8be5\u5c5e\u6027\u544a\u8bc9\u5c4f\u5e55\u9605\u8bfb\u5668\u5728\u6309\u4e0b\u6309\u94ae\u65f6\u8bf4\u51fa\u8be5\u6309\u94ae\u3002\u4f7f\u7528\u7ec4\u4ef6\u65f6\uff0c\u60a8\u53ef\u4ee5\u7f16\u5199\uff1a<code>aria-pressed<\/code><code>lightning-button<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- parent.html --&gt;\n&lt;template&gt;\n  &lt;lightning-button\n    title=\"Log In\"\n    label=\"Log In\"\n    onclick={login}\n    aria-label=\"Log In\"\n    aria-pressed\n  &gt;&lt;\/lightning-button&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<p>\u8be5\u7ec4\u4ef6\u5c06 ARIA \u5c5e\u6027\u5b9a\u4e49\u4e3a\u516c\u5171\u5c5e\u6027\uff0c\u5e76\u4f7f\u7528\u5b57\u6bb5\u6765\u83b7\u53d6\u548c\u8bbe\u7f6e\u516c\u5171\u5c5e\u6027\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- lightning-button.html --&gt;\n&lt;template&gt;\n  &lt;button\n    title=\"Log In\"\n    label=\"Log In\"\n    onclick={login}\n    aria-label={innerLabel}\n    aria-pressed={pressed}\n  &gt;&lt;\/button&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<p>\u7ec4\u4ef6 JavaScript \u4f7f\u7528 camel-case \u5c5e\u6027\u6620\u5c04\u6765\u83b7\u53d6\u548c\u8bbe\u7f6e \u4e2d\u7684\u503c\u3002<code>lightning-button.js<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ lightning-button.js\nimport { LightningElement, api } from \"lwc\";\nexport default class LightningButton extends LightningElement {\n  innerLabel;\n\n  @api\n  get ariaLabel() {\n    return this.innerLabel;\n  }\n\n  set ariaLabel(newValue) {\n    this.innerLabel = newValue;\n  }\n\n  pressed;\n\n  @api\n  get ariaPressed() {\n    return this.pressed;\n  }\n\n  set ariaPressed(newValue) {\n    this.pressed = newValue;\n  }\n}<\/code><\/pre>\n\n\n\n<p>\u751f\u6210\u7684 HTML \u4e3a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;lightning-button&gt;\n  &lt;button\n    title=\"Log In\"\n    label=\"Log In\"\n    onclick={login}\n    aria-label=\"Log In\"\n    aria-pressed=\"true\"\n  &gt;&lt;\/button&gt;\n&lt;\/lightning-button&gt;<\/code><\/pre>\n\n\n\n<p>\u652f\u6301 ARIA \u7684\u5c4f\u5e55\u9605\u8bfb\u5668\u8bfb\u53d6\u6807\u7b7e\u5e76\u6307\u793a\u6309\u94ae\u5df2\u6309\u4e0b\u3002<\/p>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>ARIA \u5c5e\u6027\u5728\u8bbf\u95ee\u5668\u51fd\u6570\u4e2d\u4f7f\u7528\u9a7c\u5cf0\u5927\u5c0f\u5199\u3002\u4f8b\u5982\uff0c\u53d8\u4e3a .\u5b8c\u6574\u7684\u6620\u5c04\u5217\u8868\u4f4d\u4e8e\u00a0GitHub \u5b58\u50a8\u5e93 lwc\/packages\/@lwc\/template-compiler\/src\/parser\/constants.ts\u00a0\u4e2d\u3002<code>aria-labelariaLabel<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u9ed8\u8ba4 ARIA \u503c<\/h2>\n\n\n\n<p>\u7ec4\u4ef6\u4f5c\u8005\u53ef\u80fd\u5e0c\u671b\u5728\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u4e0a\u5b9a\u4e49\u9ed8\u8ba4\u7684 ARIA \u5c5e\u6027\uff0c\u5e76\u4e14\u4ecd\u5141\u8bb8\u7ec4\u4ef6\u4f7f\u7528\u8005\u6307\u5b9a\u5c5e\u6027\u503c\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u7ec4\u4ef6\u4f5c\u8005\u5728\u7ec4\u4ef6\u7684\u5143\u7d20\u4e0a\u5b9a\u4e49\u9ed8\u8ba4\u7684 ARIA \u503c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ lightning-button.js sets \"Log In\" as the default label\nimport { LightningElement } from \"lwc\";\nexport default class LightningButton extends LightningElement {\n  connectedCallback() {\n    this.template.ariaLabel = \"Log In\";\n  }\n}<\/code><\/pre>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u5728 \u4e2d\u5b9a\u4e49\u5c5e\u6027\u3002\u4e0d\u8981\u5728 \u4e2d\u5b9a\u4e49\u5c5e\u6027\u3002<code>connectedCallback()<\/code><code>constructor()<\/code><\/p>\n\n\n\n<p>\u5f53\u60a8\u4f7f\u7528\u7ec4\u4ef6\u5e76\u63d0\u4f9b\u503c\u65f6\uff0c\u5c06\u663e\u793a\u63d0\u4f9b\u7684\u503c\u3002<code>aria-label<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- parent.html --&gt;\n&lt;template&gt;\n  &lt;lightning-button\n    title=\"Log In\"\n    label=\"Submit\"\n    onclick={login}\n    aria-label=\"Submit\"\n    aria-pressed\n  &gt;&lt;\/lightning-button&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<p>\u751f\u6210\u7684 HTML \u4e3a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;lightning-button&gt;\n  &lt;button title=\"Log In\" label=\"Submit\" aria-label=\"Submit\" aria-pressed=\"true\"&gt;&lt;\/button&gt;\n&lt;\/lightning-button&gt;<\/code><\/pre>\n\n\n\n<p>\u800c\u4e14\uff0c\u5982\u679c\u672a\u63d0\u4f9b\u503c\uff0c\u5219\u4f1a\u663e\u793a\u9ed8\u8ba4\u503c\u3002<code>aria-label<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- parent.html --&gt;\n&lt;template&gt;\n  &lt;lightning-button title=\"Log In\" label=\"Log In\" onclick={login}&gt;&lt;\/lightning-button&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<p>\u751f\u6210\u7684 HTML \u4e3a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;lightning-button&gt;\n  &lt;button title=\"Log In\" label=\"Log In\" onclick={login} aria-label=\"Log In\"&gt;&lt;\/button&gt;\n&lt;\/lightning-button&gt;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u9759\u6001\u503c<\/h2>\n\n\n\n<p>\u5982\u679c\u60a8\u521b\u5efa\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u5e76\u4e14\u4e0d\u5e0c\u671b\u5c5e\u6027\u7684\u503c\u53d1\u751f\u66f4\u6539\uff0c\u8be5\u600e\u4e48\u529e\uff1f\u4e00\u4e2a\u5f88\u597d\u7684\u4f8b\u5b50\u662f\u5c5e\u6027\u3002\u60a8\u4e0d\u5e0c\u671b\u7ec4\u4ef6\u4f7f\u7528\u8005\u66f4\u6539\u4e3a \u3002\u6309\u94ae\u5c31\u662f\u6309\u94ae\u3002<code>role<\/code><code>button<\/code><code>tab<\/code><\/p>\n\n\n\n<p>\u60a8\u59cb\u7ec8\u5e0c\u671b\u751f\u6210\u7684 HTML \u5177\u6709 be \uff0c\u5982\u672c\u4f8b\u6240\u793a\u3002<code>role<\/code><code>button<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;lightning-button&gt;\n  &lt;div title=\"Log In\" label=\"Log In\" onclick={login} role=\"button\"&gt;&lt;\/div&gt;\n&lt;\/lightning-button&gt;<\/code><\/pre>\n\n\n\n<p>\u4e3a\u4e86\u9632\u6b62\u4f7f\u7528\u8005\u66f4\u6539\u5c5e\u6027\u7684\u503c\uff0c\u53ea\u9700\u8fd4\u56de\u4e00\u4e2a\u5b57\u7b26\u4e32\u3002\u6b64\u793a\u4f8b\u59cb\u7ec8\u8fd4\u56de\u8be5\u503c\u3002<code>\"button\"<\/code><code>role<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ lightning-button.js\nimport { LightningElement, api } from \"lwc\";\nexport default class LightningButton extends LightningElement {\n  set role(value) {}\n\n  @api\n  get role() {\n    return \"button\";\n  }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u6765\u81ea\u4e0d\u540c\u6a21\u677f\u7684\u94fe\u63a5 ID \u548c ARIA \u5c5e\u6027<\/h2>\n\n\n\n<p>\u540c\u4e00\u6a21\u677f\u4e2d\u7684 ID \u548c ARIA \u5c5e\u6027\u4f1a\u81ea\u52a8\u94fe\u63a5\u3002\u5982\u679c\u5c5e\u6027\u4f4d\u4e8e\u4e0d\u540c\u7684\u6a21\u677f\u4e2d\uff0c\u5219\u5fc5\u987b\u624b\u52a8\u94fe\u63a5\u5b83\u4eec\u3002<\/p>\n\n\n\n<p>\u5728\u672c\u673a\u5f71\u5b50 DOM \u4e2d\uff0c\u60a8\u65e0\u6cd5\u5728\u5355\u72ec\u6a21\u677f\u4e2d\u7684\u5143\u7d20\u4e4b\u95f4\u94fe\u63a5 ID \u548c ARIA \u5c5e\u6027\u3002<\/p>\n\n\n\n<p>\u8981\u4f7f\u7528 ID \u548c ARIA \u5c5e\u6027\u5c06\u4e24\u4e2a\u5143\u7d20\u94fe\u63a5\u5728\u4e00\u8d77\uff0c\u8bf7\u4f7f\u7528 light DOM \u5c06\u5b83\u4eec\u653e\u7f6e\u5728\u540c\u4e00\u4e2a\u9634\u5f71\u6839\u4e2d\u3002\u8bf7\u53c2\u9605\u00a0Light DOM\u00a0\u4e2d\u7684<strong>\u8f85\u52a9\u529f\u80fd<\/strong>\u90e8\u5206\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"handle-focus\">\u5904\u7406\u7126\u70b9<\/h2>\n\n\n\n<p>\u8981\u4f7f\u6b8b\u969c\u4eba\u58eb\u80fd\u591f\u8bbf\u95ee\u60a8\u7684\u7ec4\u4ef6\uff0c\u8bf7\u5bf9\u5b83\u4eec\u8fdb\u884c\u7f16\u7a0b\uff0c\u4ee5\u5904\u7406\u54ea\u4e2a\u5143\u7d20\u5177\u6709\u7126\u70b9\u5e76\u53ef\u4ee5\u63a5\u6536\u8f93\u5165\u3002<\/p>\n\n\n\n<p>Web \u6d4f\u89c8\u5668\u53ef\u901a\u8fc7\u952e\u76d8\u4f7f\u7528 Tab \u952e\u8fdb\u884c\u5b8c\u5168\u5bfc\u822a\u3002\u51fa\u4e8e\u8f85\u52a9\u529f\u80fd\u76ee\u7684\uff0c\u4f9d\u8d56\u952e\u76d8\u5bfc\u822a\u7684\u7528\u6237\u9700\u8981\u89c6\u89c9\u63d0\u793a\u6765\u67e5\u770b\u54ea\u4e2a\u5143\u7d20\u5177\u6709\u7126\u70b9\u3002\u89c6\u529b\u4f4e\u4e0b\u7684\u4eba\u4e5f\u4f7f\u7528\u5c4f\u5e55\u9605\u8bfb\u5668\u6765\u6d4f\u89c8\u7f51\u9875\u3002\u5c4f\u5e55\u9605\u8bfb\u5668\u5927\u58f0\u6717\u8bfb\u9875\u9762\u4e0a\u7684\u5143\u7d20\uff0c\u5305\u62ec\u5177\u6709\u7126\u70b9\u7684\u5143\u7d20\u3002\u4f5c\u4e3a\u5f00\u53d1\u4eba\u5458\uff0c\u60a8\u9700\u8981\u786e\u4fdd\u5f53\u7528\u6237\u6309 Tab \u952e\u6d4f\u89c8\u9875\u9762\u65f6\uff0c\u6d4f\u89c8\u5668\u4f1a\u5c06\u7126\u70b9\u79fb\u5230\u4e0b\u4e00\u4e2a\u903b\u8f91\u5143\u7d20\u3002<\/p>\n\n\n\n<p>\u5f53\u7528\u6237\u6309 Tab \u952e\u6d4f\u89c8\u9875\u9762\u65f6\uff0c\u4ea4\u4e92\u5143\u7d20\uff08\u5982 \u3001 \u3001 \u548c \u63a5\u6536\uff09\u4f1a\u81ea\u52a8\u83b7\u5f97\u7126\u70b9\u3002\u672c\u673a\u4e0d\u53ef\u805a\u7126\u7684\u5143\u7d20\uff08\u5982 \u6216 \uff09\u53ef\u7528\u4e8e\u63a5\u6536\u952e\u76d8\u7126\u70b9\u3002<code>&lt;a&gt;<\/code><code>&lt;button&gt;<\/code><code>&lt;input&gt;<\/code><code>&lt;textarea&gt;<\/code><code>&lt;div&gt;<\/code><code>&lt;span&gt;<\/code><code>tabindex=\"0\"<\/code><\/p>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u4ec5\u652f\u6301 \u548c tabindex \u503c\u3002\u5206\u914d\u610f\u5473\u7740\u5143\u7d20\u805a\u7126\u5728\u6807\u51c6\u987a\u5e8f\u952e\u76d8\u5bfc\u822a\u4e2d\u3002\u5206\u914d\u5b83\u4f1a\u4ece\u987a\u5e8f\u952e\u76d8\u5bfc\u822a\u4e2d\u5220\u9664\u8be5\u5143\u7d20\u3002\u6709\u5173\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605\u952e\u76d8\u8f85\u52a9\u529f\u80fd\u3002<code>0-1tabindex=\"0\"tabindex=\"-1\"<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u9009\u9879\u5361\u5bfc\u822a\u671f\u95f4\u7684\u7126\u70b9\u884c\u4e3a<\/h2>\n\n\n\n<p>\u5bf9\u4e8e\u81ea\u5b9a\u4e49\u7ec4\u4ef6\uff0c\u7126\u70b9\u4f1a\u8df3\u8fc7\u7ec4\u4ef6\u5bb9\u5668\u5e76\u79fb\u52a8\u5230\u7ec4\u4ef6\u5185\u90e8\u7684\u5143\u7d20\u3002<\/p>\n\n\n\n<p>\u8ba9\u6211\u4eec\u770b\u4e00\u4e9b\u4ee3\u7801\u3002<\/p>\n\n\n\n<p>\u5728\u6b64\u793a\u4f8b\u4e2d\uff0c\u5f53\u7528\u6237\u6309 Tab \u952e\u65f6\uff0c\u7126\u70b9\u4f1a\u4ece \u6309\u94ae\u5143\u7d20\u79fb\u52a8\u5230 \u4e2d\u7684\u8f93\u5165\u5143\u7d20\uff0c\u4ece\u800c\u8df3\u8fc7\u81ea\u8eab\u3002<code>parent<\/code><code>child<\/code><code>child<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- parent.html --&gt;\n&lt;template&gt;\n  &lt;button&gt;Button&lt;\/button&gt;\n  &lt;c-child&gt;&lt;\/c-child&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- child.html --&gt;\n&lt;template&gt;\n  &lt;span\n    &gt;Tabbing to the custom element moves focus to the input, skipping the component itself.&lt;\/span\n  &gt;\n  &lt;br \/&gt;&lt;input type=\"text\" \/&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/developer.salesforce.com\/1\/content-asset\/immutable\/s\/17013859630000000\/salesforcedocslwc\/content\/media\/handle_focus_input.png\" alt=\"\u9009\u62e9\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u7684\u4ee3\u7801\u8f93\u51fa\u3002\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u5c06\u7126\u70b9\u5e94\u7528\u4e8e\u5b50\u7ec4\u4ef6<\/h2>\n\n\n\n<p>\u82e5\u8981\u5411\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u6dfb\u52a0\u7126\u70b9\uff0c\u8bf7\u4f7f\u7528\u8be5\u5c5e\u6027\u3002\u5728\u7236\u6a21\u677f\u4e2d\uff0c\u6211\u4eec\u5c06\u5b50\u7ec4\u4ef6\u8bbe\u7f6e\u4e3a\u5c06\u5b50\u7ec4\u4ef6\u672c\u8eab\u6dfb\u52a0\u5230\u5bfc\u822a\u5e8f\u5217\u4e2d\u3002<code>tabindex<\/code><code>tabindex<\/code><code>0<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- parent.html --&gt;\n&lt;template&gt;\n  &lt;button&gt;Button&lt;\/button&gt;\n  &lt;c-child tabindex=\"0\"&gt;&lt;\/c-child&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- child.html --&gt;\n&lt;template&gt;\n  &lt;span&gt;Tabbing to the custom element moves focus to the whole component.&lt;\/span&gt;\n  &lt;br \/&gt;&lt;input type=\"text\" \/&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ child.js\nimport { LightningElement } from \"lwc\";\n\nexport default class Child extends LightningElement {}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/developer.salesforce.com\/1\/content-asset\/immutable\/s\/17013859630000000\/salesforcedocslwc\/content\/media\/handle_focus_component.png\" alt=\"\u9009\u62e9\u6574\u4e2a\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u7684\u4ee3\u7801\u8f93\u51fa\u3002\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u5728\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u4e2d\u59d4\u6d3e\u7126\u70b9<\/h2>\n\n\n\n<p>\u521b\u5efa\u5305\u542b\u53ef\u805a\u7126\u5143\u7d20\u7684\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u65f6\uff0c\u60a8\u53ef\u80fd\u4f1a\u53d1\u73b0\u81ea\u5df1\u9700\u8981\u7ba1\u7406\u9009\u9879\u5361\u7d22\u5f15\u6216\u624b\u52a8\u5c06\u7126\u70b9\u8bbe\u7f6e\u5728\u8fd9\u4e9b\u5143\u7d20\u4e0a\u3002\u8981\u81ea\u52a8\u7ba1\u7406\u7126\u70b9\uff0c\u8bf7\u8bbe\u7f6e\u4e3a \u3002<code>delegatesFocus<\/code><code>true<\/code><\/p>\n\n\n\n<p>\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u5e26\u6709\u6309\u94ae\u7684\u81ea\u5b9a\u4e49\u7ec4\u4ef6\uff0c\u5176\u884c\u4e3a\u7c7b\u4f3c\u4e8e\u672c\u673a HTML \u6309\u94ae\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- coolButton.html --&gt;\n&lt;template&gt;\n  &lt;button&gt;Focus!&lt;\/button&gt;\n&lt;\/template&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ coolButton.js\nimport { LightningElement } from \"lwc\";\n\nexport default class CoolButton extends LightningElement {\n  static delegatesFocus = true;\n}<\/code><\/pre>\n\n\n\n<p>\u4f7f\u7528\u53ef\u5b9e\u73b0\u4ee5\u4e0b\u60c5\u51b5\u3002<code>delegatesFocus<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4f7f\u7528 \u5c06\u7126\u70b9\u6dfb\u52a0\u5230\u672c\u673a\u6309\u94ae HTML \u5143\u7d20\u3002<code>coolButton.focus()<\/code><\/li>\n\n\n\n<li>\u5982\u679c\u5355\u51fb\u9634\u5f71 DOM \u4e2d\u7684\u67d0\u4e2a\u8282\u70b9\uff0c\u5e76\u4e14\u8be5\u8282\u70b9\u4e0d\u662f\u53ef\u805a\u7126\u533a\u57df\uff0c\u5219\u7b2c\u4e00\u4e2a\u53ef\u805a\u7126\u533a\u57df\u5c06\u53d8\u4e3a\u7126\u70b9\u3002\u8fd9\u7c7b\u4f3c\u4e8e\u5355\u51fb\u6807\u7b7e\u5e76\u5c06\u7126\u70b9\u8df3\u8f6c\u5230\u8f93\u5165\u65f6\u3002<\/li>\n\n\n\n<li>\u5f53\u5f71\u5b50 DOM \u4e2d\u7684\u8282\u70b9\u83b7\u5f97\u7126\u70b9\u65f6\uff0c\u9664\u4e86\u7126\u70b9\u5143\u7d20\u4e4b\u5916\uff0cCSS \u9009\u62e9\u5668\u8fd8\u4f1a\u5e94\u7528\u4e8e\u4e3b\u673a\u3002<code>:focus<\/code><\/li>\n<\/ul>\n\n\n\n<p>\u6ce8\u610f<\/p>\n\n\n\n<p>\u4e0d\u8981\u4f7f\u7528 with\uff0c\u56e0\u4e3a\u5b83\u4f1a\u504f\u79bb\u7126\u70b9\u987a\u5e8f\u3002<code>tabindex<\/code><code>delegatesFocus<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"mobile-ready-components\">\u79fb\u52a8\u5c31\u7eea\u7ec4\u4ef6<\/h2>\n\n\n\n<p>Lightning Web \u7ec4\u4ef6\u652f\u6301\u5728\u684c\u9762\u548c\u79fb\u52a8\u8bbe\u5907\u4e0a\u4f7f\u7528\u7ec4\u4ef6\u3002\u5728\u684c\u9762\u4e0a\uff0c\u652f\u6301\u5404\u79cd Web \u6d4f\u89c8\u5668\u3002\u5728\u79fb\u52a8\u8bbe\u5907\u4e0a\uff0c\u652f\u6301\u7684\u73af\u5883\u5305\u62ec Salesforce \u5206\u5e03\u5f0f\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u3002\u8fd9\u4e24\u79cd\u73af\u5883\u4e4b\u95f4\u7684\u5dee\u5f02\u4e0d\u4ec5\u4ec5\u662f\u5c4f\u5e55\u5c3a\u5bf8;\u6709\u65b0\u7684\u9650\u5236\uff0c\u4e5f\u6709\u79fb\u52a8\u7aef\u7684\u6269\u5c55\u529f\u80fd\u3002\u82e5\u8981\u6784\u5efa\u5728\u79fb\u52a8\u4f53\u9a8c\u4e2d\u8868\u73b0\u826f\u597d\u7684\u7ec4\u4ef6\uff0c\u8bf7\u9075\u5faa\u6211\u4eec\u7684\u79fb\u52a8\u5c31\u7eea\u7ec4\u4ef6\u6307\u5357\u3002<\/p>\n\n\n\n<p>\u300a\u79fb\u52a8\u548c\u79bb\u7ebf\u5f00\u53d1\u4eba\u5458\u6307\u5357\u300b\u4e2d\u63d0\u4f9b\u4e86\u5b8c\u6574\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u8be5\u6307\u5357\u662f\u6267\u884c\u79fb\u52a8\u5f00\u53d1\u65f6\u672c\u6307\u5357\u7684\u91cd\u8981\u914d\u5957\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8f85\u52a9\u8f6f\u4ef6\u548c\u8f85\u52a9\u6280\u672f\u4f7f\u6b8b\u969c\u7528\u6237\u80fd\u591f\u4f7f\u7528\u60a8\u6784\u5efa\u7684\u4ea7\u54c1\u3002\u5f00\u53d1\u7ec4\u4ef6\uff0c\u4ee5\u4fbf\u6240\u6709\u7528\u6237\u90fd\u80fd\u611f\u77e5\u3001\u7406\u89e3\u3001\u5bfc\u822a\u5e76\u4e0e\u4e4b\u4ea4\u4e92\u3002<br \/>\n\u6211\u4eec\u5efa\u8bae\u60a8\u5728\u521b\u5efa\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u65f6\u9075\u5faa WCAG \u8f85\u52a9\u529f\u80fd\u6307\u5357\u3002<\/p>\n","protected":false},"author":1,"featured_media":3835,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[233],"tags":[244],"class_list":["post-3834","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-lightning-web-","tag-244"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u7ec4\u4ef6\u53ef\u8bbf\u95ee\u6027 - \u767d\u767d\u968f\u7b14<\/title>\n<meta name=\"description\" content=\"\u8f85\u52a9\u8f6f\u4ef6\u548c\u8f85\u52a9\u6280\u672f\u4f7f\u6b8b\u969c\u7528\u6237\u80fd\u591f\u4f7f\u7528\u60a8\u6784\u5efa\u7684\u4ea7\u54c1\u3002\u5f00\u53d1\u7ec4\u4ef6\uff0c\u4ee5\u4fbf\u6240\u6709\u7528\u6237\u90fd\u80fd\u611f\u77e5\u3001\u7406\u89e3\u3001\u5bfc\u822a\u5e76\u4e0e\u4e4b\u4ea4\u4e92\u3002\u6211\u4eec\u5efa\u8bae\u60a8\u5728\u521b\u5efa\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u65f6\u9075\u5faa WCAG \u8f85\u52a9\u529f\u80fd\u6307\u5357\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.ponybai.com\/?p=3834\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7ec4\u4ef6\u53ef\u8bbf\u95ee\u6027 - \u767d\u767d\u968f\u7b14\" \/>\n<meta property=\"og:description\" content=\"\u8f85\u52a9\u8f6f\u4ef6\u548c\u8f85\u52a9\u6280\u672f\u4f7f\u6b8b\u969c\u7528\u6237\u80fd\u591f\u4f7f\u7528\u60a8\u6784\u5efa\u7684\u4ea7\u54c1\u3002\u5f00\u53d1\u7ec4\u4ef6\uff0c\u4ee5\u4fbf\u6240\u6709\u7528\u6237\u90fd\u80fd\u611f\u77e5\u3001\u7406\u89e3\u3001\u5bfc\u822a\u5e76\u4e0e\u4e4b\u4ea4\u4e92\u3002\u6211\u4eec\u5efa\u8bae\u60a8\u5728\u521b\u5efa\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u65f6\u9075\u5faa WCAG \u8f85\u52a9\u529f\u80fd\u6307\u5357\u3002\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.ponybai.com\/?p=3834\" \/>\n<meta property=\"og:site_name\" content=\"\u767d\u767d\u968f\u7b14\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-10T03:43:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-02T05:56:03+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.ponybai.com\/wp-content\/uploads\/2023\/12\/access.png\" \/>\n\t<meta property=\"og:image:width\" content=\"652\" \/>\n\t<meta property=\"og:image:height\" content=\"293\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"ponybai\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"ponybai\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/www.ponybai.com\/?p=3834#article\",\"isPartOf\":{\"@id\":\"http:\/\/www.ponybai.com\/?p=3834\"},\"author\":{\"name\":\"ponybai\",\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883\"},\"headline\":\"\u7ec4\u4ef6\u53ef\u8bbf\u95ee\u6027\",\"datePublished\":\"2024-01-10T03:43:56+00:00\",\"dateModified\":\"2023-12-02T05:56:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/www.ponybai.com\/?p=3834\"},\"wordCount\":77,\"publisher\":{\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883\"},\"keywords\":[\"\u7ec4\u4ef6\u53ef\u8bbf\u95ee\u6027\"],\"articleSection\":[\"Lightning Web \u7ec4\u4ef6\u5f00\u53d1\u4eba\u5458\u6307\u5357\"],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.ponybai.com\/?p=3834\",\"url\":\"http:\/\/www.ponybai.com\/?p=3834\",\"name\":\"\u7ec4\u4ef6\u53ef\u8bbf\u95ee\u6027 - \u767d\u767d\u968f\u7b14\",\"isPartOf\":{\"@id\":\"http:\/\/www.ponybai.com\/#website\"},\"datePublished\":\"2024-01-10T03:43:56+00:00\",\"dateModified\":\"2023-12-02T05:56:03+00:00\",\"description\":\"\u8f85\u52a9\u8f6f\u4ef6\u548c\u8f85\u52a9\u6280\u672f\u4f7f\u6b8b\u969c\u7528\u6237\u80fd\u591f\u4f7f\u7528\u60a8\u6784\u5efa\u7684\u4ea7\u54c1\u3002\u5f00\u53d1\u7ec4\u4ef6\uff0c\u4ee5\u4fbf\u6240\u6709\u7528\u6237\u90fd\u80fd\u611f\u77e5\u3001\u7406\u89e3\u3001\u5bfc\u822a\u5e76\u4e0e\u4e4b\u4ea4\u4e92\u3002\u6211\u4eec\u5efa\u8bae\u60a8\u5728\u521b\u5efa\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u65f6\u9075\u5faa WCAG \u8f85\u52a9\u529f\u80fd\u6307\u5357\u3002\",\"breadcrumb\":{\"@id\":\"http:\/\/www.ponybai.com\/?p=3834#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.ponybai.com\/?p=3834\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.ponybai.com\/?p=3834#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"http:\/\/www.ponybai.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7ec4\u4ef6\u53ef\u8bbf\u95ee\u6027\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.ponybai.com\/#website\",\"url\":\"http:\/\/www.ponybai.com\/\",\"name\":\"\u767d\u767d\u968f\u7b14\",\"description\":\"Salesforce\u5b98\u65b9\u8bb2\u5e08\",\"publisher\":{\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.ponybai.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883\",\"name\":\"ponybai\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/www.ponybai.com\/wp-content\/uploads\/2025\/03\/cropped-Ihsans-WeChatQR.jpg\",\"contentUrl\":\"http:\/\/www.ponybai.com\/wp-content\/uploads\/2025\/03\/cropped-Ihsans-WeChatQR.jpg\",\"width\":248,\"height\":248,\"caption\":\"ponybai\"},\"logo\":{\"@id\":\"http:\/\/www.ponybai.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/121.37.188.161\"],\"url\":\"http:\/\/www.ponybai.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u7ec4\u4ef6\u53ef\u8bbf\u95ee\u6027 - \u767d\u767d\u968f\u7b14","description":"\u8f85\u52a9\u8f6f\u4ef6\u548c\u8f85\u52a9\u6280\u672f\u4f7f\u6b8b\u969c\u7528\u6237\u80fd\u591f\u4f7f\u7528\u60a8\u6784\u5efa\u7684\u4ea7\u54c1\u3002\u5f00\u53d1\u7ec4\u4ef6\uff0c\u4ee5\u4fbf\u6240\u6709\u7528\u6237\u90fd\u80fd\u611f\u77e5\u3001\u7406\u89e3\u3001\u5bfc\u822a\u5e76\u4e0e\u4e4b\u4ea4\u4e92\u3002\u6211\u4eec\u5efa\u8bae\u60a8\u5728\u521b\u5efa\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u65f6\u9075\u5faa WCAG \u8f85\u52a9\u529f\u80fd\u6307\u5357\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.ponybai.com\/?p=3834","og_locale":"zh_CN","og_type":"article","og_title":"\u7ec4\u4ef6\u53ef\u8bbf\u95ee\u6027 - \u767d\u767d\u968f\u7b14","og_description":"\u8f85\u52a9\u8f6f\u4ef6\u548c\u8f85\u52a9\u6280\u672f\u4f7f\u6b8b\u969c\u7528\u6237\u80fd\u591f\u4f7f\u7528\u60a8\u6784\u5efa\u7684\u4ea7\u54c1\u3002\u5f00\u53d1\u7ec4\u4ef6\uff0c\u4ee5\u4fbf\u6240\u6709\u7528\u6237\u90fd\u80fd\u611f\u77e5\u3001\u7406\u89e3\u3001\u5bfc\u822a\u5e76\u4e0e\u4e4b\u4ea4\u4e92\u3002\u6211\u4eec\u5efa\u8bae\u60a8\u5728\u521b\u5efa\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u65f6\u9075\u5faa WCAG \u8f85\u52a9\u529f\u80fd\u6307\u5357\u3002","og_url":"http:\/\/www.ponybai.com\/?p=3834","og_site_name":"\u767d\u767d\u968f\u7b14","article_published_time":"2024-01-10T03:43:56+00:00","article_modified_time":"2023-12-02T05:56:03+00:00","og_image":[{"width":652,"height":293,"url":"http:\/\/www.ponybai.com\/wp-content\/uploads\/2023\/12\/access.png","type":"image\/png"}],"author":"ponybai","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"ponybai","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.ponybai.com\/?p=3834#article","isPartOf":{"@id":"http:\/\/www.ponybai.com\/?p=3834"},"author":{"name":"ponybai","@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883"},"headline":"\u7ec4\u4ef6\u53ef\u8bbf\u95ee\u6027","datePublished":"2024-01-10T03:43:56+00:00","dateModified":"2023-12-02T05:56:03+00:00","mainEntityOfPage":{"@id":"http:\/\/www.ponybai.com\/?p=3834"},"wordCount":77,"publisher":{"@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883"},"keywords":["\u7ec4\u4ef6\u53ef\u8bbf\u95ee\u6027"],"articleSection":["Lightning Web \u7ec4\u4ef6\u5f00\u53d1\u4eba\u5458\u6307\u5357"],"inLanguage":"zh-Hans"},{"@type":"WebPage","@id":"http:\/\/www.ponybai.com\/?p=3834","url":"http:\/\/www.ponybai.com\/?p=3834","name":"\u7ec4\u4ef6\u53ef\u8bbf\u95ee\u6027 - \u767d\u767d\u968f\u7b14","isPartOf":{"@id":"http:\/\/www.ponybai.com\/#website"},"datePublished":"2024-01-10T03:43:56+00:00","dateModified":"2023-12-02T05:56:03+00:00","description":"\u8f85\u52a9\u8f6f\u4ef6\u548c\u8f85\u52a9\u6280\u672f\u4f7f\u6b8b\u969c\u7528\u6237\u80fd\u591f\u4f7f\u7528\u60a8\u6784\u5efa\u7684\u4ea7\u54c1\u3002\u5f00\u53d1\u7ec4\u4ef6\uff0c\u4ee5\u4fbf\u6240\u6709\u7528\u6237\u90fd\u80fd\u611f\u77e5\u3001\u7406\u89e3\u3001\u5bfc\u822a\u5e76\u4e0e\u4e4b\u4ea4\u4e92\u3002\u6211\u4eec\u5efa\u8bae\u60a8\u5728\u521b\u5efa\u81ea\u5b9a\u4e49\u7ec4\u4ef6\u65f6\u9075\u5faa WCAG \u8f85\u52a9\u529f\u80fd\u6307\u5357\u3002","breadcrumb":{"@id":"http:\/\/www.ponybai.com\/?p=3834#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.ponybai.com\/?p=3834"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.ponybai.com\/?p=3834#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"http:\/\/www.ponybai.com\/"},{"@type":"ListItem","position":2,"name":"\u7ec4\u4ef6\u53ef\u8bbf\u95ee\u6027"}]},{"@type":"WebSite","@id":"http:\/\/www.ponybai.com\/#website","url":"http:\/\/www.ponybai.com\/","name":"\u767d\u767d\u968f\u7b14","description":"Salesforce\u5b98\u65b9\u8bb2\u5e08","publisher":{"@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.ponybai.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/935c7592c850c65e1e5eba4530dbf883","name":"ponybai","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/image\/","url":"http:\/\/www.ponybai.com\/wp-content\/uploads\/2025\/03\/cropped-Ihsans-WeChatQR.jpg","contentUrl":"http:\/\/www.ponybai.com\/wp-content\/uploads\/2025\/03\/cropped-Ihsans-WeChatQR.jpg","width":248,"height":248,"caption":"ponybai"},"logo":{"@id":"http:\/\/www.ponybai.com\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/121.37.188.161"],"url":"http:\/\/www.ponybai.com\/?author=1"}]}},"_links":{"self":[{"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/posts\/3834","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3834"}],"version-history":[{"count":1,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/posts\/3834\/revisions"}],"predecessor-version":[{"id":3836,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/posts\/3834\/revisions\/3836"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=\/wp\/v2\/media\/3835"}],"wp:attachment":[{"href":"http:\/\/www.ponybai.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3834"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ponybai.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}