{"id":92689,"date":"2026-08-10T22:48:46","date_gmt":"2026-08-10T14:48:46","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/92689.html"},"modified":"2026-08-10T22:48:46","modified_gmt":"2026-08-10T14:48:46","slug":"ai-%e8%be%85%e5%8a%a9-ui-%e7%94%9f%e6%88%90%e4%b8%8e%e8%ae%be%e8%ae%a1%e7%b3%bb%e7%bb%9f%e8%87%aa%e5%8a%a8%e5%8c%96%e5%ae%9e%e8%b7%b5%ef%bc%9a%e5%88%ab%e8%ae%a9%e6%bc%94%e7%a4%ba%e6%95%88%e6%9e%9c","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/92689.html","title":{"rendered":"AI \u8f85\u52a9 UI \u751f\u6210\u4e0e\u8bbe\u8ba1\u7cfb\u7edf\u81ea\u52a8\u5316\u5b9e\u8df5\uff1a\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60"},"content":{"rendered":"<h2>AI \u8f85\u52a9 UI \u751f\u6210\u4e0e\u8bbe\u8ba1\u7cfb\u7edf\u81ea\u52a8\u5316\u5b9e\u8df5&#xff1a;\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60<\/h2>\n<p>\u6f14\u793a\u91cc&#xff0c;\u7ed9\u5927\u8bed\u8a00\u6a21\u578b\u4e00\u53e5\u63cf\u8ff0&#xff0c;\u5f88\u5feb\u5c31\u80fd\u5f97\u5230\u4e00\u4e2a\u80fd\u770b\u7684 React \u5361\u7247\u3002\u4f46\u80fd\u6e32\u67d3\u4e0d\u7b49\u4e8e\u80fd\u7ef4\u62a4\u3002\u751f\u6210\u4ee3\u7801\u5e38\u89c1\u7684\u95ee\u9898\u662f\u5c42\u7ea7\u8fc7\u6df1\u3001\u5185\u8054\u6837\u5f0f\u8fc7\u591a&#xff0c;\u4ee5\u53ca\u7ed5\u5f00\u73b0\u6709 Token\u3002<\/p>\n<h4>\u5148\u628a\u201c\u80fd\u751f\u6210\u201d\u62c6\u6210\u53ef\u68c0\u67e5\u7684\u6761\u4ef6<\/h4>\n<p>\u628a\u751f\u6210\u4ee3\u7801\u63a5\u5165\u9879\u76ee\u4e4b\u524d&#xff0c;\u5148\u5728\u72ec\u7acb\u9884\u89c8\u9875\u68c0\u67e5 DOM \u6570\u91cf\u3001\u6700\u5927\u5d4c\u5957\u6df1\u5ea6\u3001\u5185\u8054\u6837\u5f0f\u548c Token \u4f7f\u7528\u60c5\u51b5\u3002\u4e0b\u9762\u7684\u811a\u672c\u53ef\u4f5c\u4e3a\u672c\u5730\u8bca\u65ad\u8d77\u70b9&#xff1b;\u9608\u503c\u5e94\u6309\u7ec4\u4ef6\u7c7b\u578b\u548c\u9879\u76ee\u57fa\u7ebf\u8bbe\u5b9a\u3002<\/p>\n<p># \u8bca\u65ad\u547d\u4ee4&#xff1a;\u4f7f\u7528 puppeteer \u6293\u53d6\u751f\u6210\u9875\u9762\u7684 DOM \u8282\u70b9\u6570\u4e0e\u5c42\u7ea7\u6df1\u5ea6<br \/>\nnode &#8211;eval &#034;<br \/>\nconst puppeteer &#061; require(&#039;puppeteer&#039;);<br \/>\n(async () &#061;&gt; {<br \/>\n  const browser &#061; await puppeteer.launch();<br \/>\n  const page &#061; await browser.newPage();<br \/>\n  await page.goto(&#039;http:\/\/localhost:3000\/generated-ui-preview&#039;);<br \/>\n  const metrics &#061; await page.evaluate(() &#061;&gt; {<br \/>\n    const all &#061; document.querySelectorAll(&#039;*&#039;);<br \/>\n    let maxDepth &#061; 0;<br \/>\n    all.forEach(el &#061;&gt; {<br \/>\n      let depth &#061; 0, p &#061; el;<br \/>\n      while (p.parentElement) { depth&#043;&#043;; p &#061; p.parentElement; }<br \/>\n      if (depth &gt; maxDepth) maxDepth &#061; depth;<br \/>\n    });<br \/>\n    return { totalNodes: all.length, maxDepth };<br \/>\n  });<br \/>\n  console.log(&#039;DOM Total Nodes:&#039;, metrics.totalNodes);<br \/>\n  console.log(&#039;Max Hierarchy Depth:&#039;, metrics.maxDepth);<br \/>\n  await browser.close();<br \/>\n})();<br \/>\n&#034;<\/p>\n<p>\u8f93\u51fa\u53ea\u7528\u4e8e\u5b9a\u4f4d\u7ed3\u6784\u95ee\u9898\u3002\u82e5\u4e00\u4e2a\u672c\u5e94\u7b80\u5355\u7684\u7ec4\u4ef6\u51fa\u73b0\u5927\u91cf\u5305\u88f9\u8282\u70b9&#xff0c;\u5c31\u56de\u5230\u7ec4\u4ef6\u8fb9\u754c\u548c\u5e03\u5c40\u89c4\u5219&#xff0c;\u800c\u4e0d\u662f\u7ee7\u7eed\u53e0 Prompt\u3002<\/p>\n<hr \/>\n<h4>\u8ba9\u6a21\u578b\u9075\u5b88\u5df2\u6709\u7ec4\u4ef6\u548c Token<\/h4>\n<p>\u6a21\u578b\u4e0d\u4f1a\u5929\u7136\u77e5\u9053\u9879\u76ee\u7684\u7ec4\u4ef6\u8fb9\u754c&#xff0c;\u4e5f\u4e0d\u4f1a\u4e3b\u52a8\u9075\u5b88 Token \u547d\u540d\u3002\u5b83\u751f\u6210 style&#061;{{ padding: &#039;13px&#039;, color: &#039;#3a86ff&#039; }} \u8fd9\u7c7b\u4ee3\u7801\u65f6&#xff0c;\u7b49\u4e8e\u7ed5\u8fc7\u4e86\u65e2\u6709\u7684\u6837\u5f0f\u7ea6\u675f\u3002\u63d0\u793a\u8bcd\u53ef\u4ee5\u63d0\u4f9b\u65b9\u5411&#xff0c;\u63d0\u4ea4\u524d\u4ecd\u8981\u7528\u89c4\u5219\u6821\u9a8c\u3002<\/p>\n<hr \/>\n<h4>\u7528 AST \u6821\u9a8c\u628a\u5173<\/h4>\n<p>\u4e0b\u56fe\u5c55\u793a\u4e86\u6211\u4eec\u5728 CI\/CD \u6d41\u6c34\u7ebf\u4e2d\u52a0\u5165\u7684\u786e\u5b9a\u6027 UI \u6cbb\u7406\u67b6\u6784\u3002\u6a21\u578b\u751f\u6210\u539f\u59cb\u4ee3\u7801\u540e&#xff0c;\u7edd\u4e0d\u76f4\u63a5\u5199\u5165\u4ee3\u7801\u5e93\u6216\u6e32\u67d3\u5230\u5ba2\u6237\u7aef&#xff0c;\u800c\u662f\u5f3a\u5236\u7ecf\u8fc7 AST \u6821\u9a8c\u5f15\u64ce\u4e0e Token \u5339\u914d\u5668\u3002<\/p>\n<p>flowchart TD<br \/>\n    UserPrompt[&#034;\u81ea\u7136\u8bed\u8a00 Prompt \/ \u89c6\u89c9\u7a3f\u8f93\u5165&#034;] &#8211;&gt; LLMEngine[&#034;LLM \u4ee3\u7801\u751f\u6210\u5f15\u64ce&#034;]<br \/>\n    LLMEngine &#8211;&gt; RawCode[&#034;\u539f\u59cb\u751f\u6210\u4ee3\u7801 (React\/JSX)&#034;]<br \/>\n    RawCode &#8211;&gt; ASTParser[&#034;AST \u8bed\u6cd5\u6811\u89e3\u6790\u5668 (Babel Parser)&#034;]<\/p>\n<p>    ASTParser &#8211;&gt; CheckDepth{&#034;DOM \u6df1\u5ea6 &lt;&#061; 6\u5c42?&#034;}<br \/>\n    CheckDepth &#8212; \u5426 &#8211;&gt; RejectRule[&#034;\u62d2\u7edd\u5e76\u89e6\u53d1\u9000\u56de\u91cd\u8bd5 \/ \u964d\u7ea7\u6a21\u677f&#034;]<br \/>\n    CheckDepth &#8212; \u662f &#8211;&gt; CheckToken{&#034;\u7b26\u5408 Design Token \u89c4\u8303?&#034;}<\/p>\n<p>    CheckToken &#8212; \u5426 &#8211;&gt; TokenFixer[&#034;Token \u5f3a\u884c\u6620\u5c04\u4e0e\u786c\u7f16\u7801\u66ff\u6362\u5668&#034;]<br \/>\n    CheckToken &#8212; \u5426 &#8211;&gt; FixFail{&#034;\u81ea\u52a8\u4fee\u526a\u5931\u8d25?&#034;}<br \/>\n    FixFail &#8212; \u662f &#8211;&gt; RejectRule<\/p>\n<p>    TokenFixer &#8211;&gt; StandardCode[&#034;\u6807\u51c6\u5408\u89c4\u7ec4\u4ef6\u4ee3\u7801&#034;]<br \/>\n    CheckToken &#8212; \u662f &#8211;&gt; StandardCode<br \/>\n    StandardCode &#8211;&gt; Bundler[&#034;Vite \/ Webpack \u7f16\u8bd1\u4ea7\u7269&#034;]<br \/>\n    RejectRule &#8211;&gt; SafeFallback[&#034;\u9884\u8bbe\u5b89\u5168\u8bbe\u8ba1\u7ec4\u4ef6 (Design Fallback)&#034;]<\/p>\n<hr \/>\n<h4>\u4e00\u4e2a\u53ef\u843d\u5730\u7684 TypeScript \u68c0\u67e5\u5668<\/h4>\n<p>\u4e3a\u4e86\u628a\u4e0a\u8ff0\u903b\u8f91\u843d\u5b9e\u5230\u5de5\u7a0b\u4e2d&#xff0c;\u6211\u4eec\u57fa\u4e8e &#064;babel\/parser \u548c &#064;babel\/traverse \u5199\u4e86\u4e00\u4e2a Node.js \u68c0\u67e5\u5de5\u5177\u3002\u5b83\u53ef\u4ee5\u5728\u6784\u5efa\u671f\u62e6\u622a DOM \u8fc7\u6df1\u3001\u786c\u7f16\u7801\u989c\u8272\u503c\u4ee5\u53ca\u65e0\u610f\u4e49\u5916\u5c42\u5305\u88f9\u3002<\/p>\n<p>import * as parser from &#039;&#064;babel\/parser&#039;;<br \/>\nimport traverse from &#039;&#064;babel\/traverse&#039;;<br \/>\nimport * as t from &#039;&#064;babel\/types&#039;;<\/p>\n<p>interface ASTValidationResult {<br \/>\n  valid: boolean;<br \/>\n  maxDepth: number;<br \/>\n  hardcodedColors: string[];<br \/>\n  errors: string[];<br \/>\n}<\/p>\n<p>const APPROVED_TOKENS &#061; new Set([<br \/>\n  &#039;var(&#8211;primary-color)&#039;,<br \/>\n  &#039;var(&#8211;neutral-100)&#039;,<br \/>\n  &#039;var(&#8211;spacing-md)&#039;,<br \/>\n]);<\/p>\n<p>export function validateGeneratedUI(code: string): ASTValidationResult {<br \/>\n  const result: ASTValidationResult &#061; {<br \/>\n    valid: true,<br \/>\n    maxDepth: 0,<br \/>\n    hardcodedColors: [],<br \/>\n    errors: [],<br \/>\n  };<\/p>\n<p>  try {<br \/>\n    const ast &#061; parser.parse(code, {<br \/>\n      sourceType: &#039;module&#039;,<br \/>\n      plugins: [&#039;jsx&#039;, &#039;typescript&#039;],<br \/>\n    });<\/p>\n<p>    let currentDepth &#061; 0;<\/p>\n<p>    traverse(ast, {<br \/>\n      JSXElement: {<br \/>\n        enter(path) {<br \/>\n          currentDepth&#043;&#043;;<br \/>\n          if (currentDepth &gt; result.maxDepth) {<br \/>\n            result.maxDepth &#061; currentDepth;<br \/>\n          }<br \/>\n          if (currentDepth &gt; 8) {<br \/>\n            result.errors.push(&#096;DOM \u6df1\u5ea6\u8d85\u8fc7\u9650\u5236: \u8fbe\u5230 ${currentDepth} \u5c42&#096;);<br \/>\n          }<br \/>\n        },<br \/>\n        exit() {<br \/>\n          currentDepth&#8211;;<br \/>\n        },<br \/>\n      },<br \/>\n      JSXAttribute(path) {<br \/>\n        \/\/ \u4e13\u95e8\u5ba1\u8ba1 style \u5185\u8054\u5c5e\u6027\u4e2d\u7684\u786c\u7f16\u7801 Hex \u989c\u8272<br \/>\n        if (path.node.name.name &#061;&#061;&#061; &#039;style&#039;) {<br \/>\n          const attrVal &#061; path.node.value;<br \/>\n          if (t.isJSXExpressionContainer(attrVal) &amp;&amp; t.isObjectExpression(attrVal.expression)) {<br \/>\n            attrVal.expression.properties.forEach((prop) &#061;&gt; {<br \/>\n              if (t.isObjectProperty(prop) &amp;&amp; t.isStringLiteral(prop.value)) {<br \/>\n                const val &#061; prop.value.value;<br \/>\n                if (\/^#([0-9a-fA-F]{3}){1,2}$\/.test(val)) {<br \/>\n                  result.hardcodedColors.push(val);<br \/>\n                  result.errors.push(&#096;\u4e0d\u5408\u89c4\u786c\u7f16\u7801\u989c\u8272: ${val}&#096;);<br \/>\n                }<br \/>\n              }<br \/>\n            });<br \/>\n          }<br \/>\n        }<br \/>\n      },<br \/>\n    });<\/p>\n<p>    if (result.errors.length &gt; 0) {<br \/>\n      result.valid &#061; false;<br \/>\n    }<br \/>\n  } catch (err: any) {<br \/>\n    result.valid &#061; false;<br \/>\n    result.errors.push(&#096;AST \u89e3\u6790\u62a5\u9519: ${err.message}&#096;);<br \/>\n  }<\/p>\n<p>  return result;<br \/>\n}<\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u628a\u751f\u6210\u5185\u5bb9\u5f53\u4f5c\u5916\u90e8\u8f93\u5165\u5904\u7406\u3002\u89e3\u6790\u5931\u8d25\u3001\u7ed3\u6784\u8d85\u8fc7\u7ea6\u675f\u6216\u51fa\u73b0\u672a\u5141\u8bb8\u7684\u6837\u5f0f\u503c\u65f6&#xff0c;\u963b\u6b62\u5b83\u8fdb\u5165\u4e3b\u5206\u652f&#xff0c;\u5e76\u56de\u9000\u5230\u4eba\u5de5\u786e\u8ba4\u8fc7\u7684\u6a21\u677f\u3002<\/p>\n<hr \/>\n<h4>\u4e0a\u7ebf\u524d\u68c0\u67e5\u4ec0\u4e48<\/h4>\n<p>\u628a\u751f\u6210\u7ed3\u679c\u653e\u5165\u7070\u5ea6\u6216\u9884\u89c8\u73af\u5883&#xff0c;\u6301\u7eed\u89c2\u5bdf\u4ee5\u4e0b\u9879\u76ee&#xff0c;\u5e76\u4e0e\u9879\u76ee\u539f\u6709\u57fa\u7ebf\u6bd4\u8f83&#xff1a;<\/p>\n<table>\n<tr>\u9879\u76ee\u76ee\u7684<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">\u9996\u5e27\u4e0e\u4ea4\u4e92\u6027\u80fd<\/td>\n<td align=\"left\">\u9632\u6b62\u989d\u5916\u8282\u70b9\u548c\u6837\u5f0f\u8ba1\u7b97\u62d6\u6162\u9875\u9762<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">DOM \u6570\u91cf\u4e0e\u5d4c\u5957<\/td>\n<td align=\"left\">\u907f\u514d\u65e0\u610f\u4e49\u7684\u5305\u88f9\u5c42\u8fdb\u5165\u7ec4\u4ef6\u5e93<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">Token \u547d\u4e2d\u60c5\u51b5<\/td>\n<td align=\"left\">\u4fdd\u8bc1\u4e3b\u9898\u5207\u6362\u548c\u8bbe\u8ba1\u66f4\u65b0\u4ecd\u7136\u6709\u6548<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u964d\u7ea7\u8def\u5f84<\/td>\n<td align=\"left\">\u6821\u9a8c\u5931\u8d25\u65f6\u59cb\u7ec8\u6709\u7a33\u5b9a\u7684\u9ed8\u8ba4\u7ec4\u4ef6\u53ef\u7528<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>AI UI \u751f\u6210\u9002\u5408\u4ea7\u51fa\u8349\u7a3f&#xff0c;\u5de5\u7a0b\u89c4\u5219\u8d1f\u8d23\u51b3\u5b9a\u8349\u7a3f\u80fd\u5426\u5408\u5165\u3002\u5148\u9650\u5b9a\u8f93\u5165\u548c\u7ec4\u4ef6\u8303\u56f4&#xff0c;\u518d\u7528 AST \u4e0e Token \u6821\u9a8c\u6536\u53e3&#xff0c;\u7ef4\u62a4\u6210\u672c\u4f1a\u4f4e\u5f88\u591a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AI \u8f85\u52a9 UI \u751f\u6210\u4e0e\u8bbe\u8ba1\u7cfb\u7edf\u81ea\u52a8\u5316\u5b9e\u8df5&#xff1a;\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60<br \/>\n\u6f14\u793a\u91cc&#xff0c;\u7ed9\u5927\u8bed\u8a00\u6a21\u578b\u4e00\u53e5\u63cf\u8ff0&#xff0c;\u5f88\u5feb\u5c31\u80fd\u5f97\u5230\u4e00\u4e2a\u80fd\u770b\u7684 React \u5361\u7247\u3002\u4f46\u80fd\u6e32\u67d3\u4e0d\u7b49\u4e8e\u80fd\u7ef4\u62a4\u3002\u751f\u6210\u4ee3\u7801\u5e38\u89c1\u7684\u95ee\u9898\u662f\u5c42\u7ea7\u8fc7\u6df1\u3001\u5185\u8054\u6837\u5f0f\u8fc7\u591a&#xff0c;\u4ee5\u53ca\u7ed5\u5f00\u73b0\u6709 Token\u3002<br \/>\n\u5148\u628a\u201c\u80fd\u751f\u6210\u201d\u62c6\u6210\u53ef\u68c0\u67e5\u7684\u6761\u4ef6<br \/>\n\u628a\u751f\u6210\u4ee3\u7801\u63a5\u5165\u9879\u76ee\u4e4b\u524d&#xff0c;\u5148\u5728\u72ec\u7acb\u9884\u89c8\u9875\u68c0\u67e5 DOM \u6570\u91cf\u3001\u6700\u5927\u5d4c\u5957\u6df1\u5ea6\u3001\u5185\u8054\u6837\u5f0f\u548c Token \u4f7f\u7528\u60c5\u51b5\u3002\u4e0b\u9762\u7684\u811a\u672c\u53ef\u4f5c\u4e3a\u672c\u5730\u8bca\u65ad\u8d77\u70b9&amp;#xff1b<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[573,2878,594,87],"topic":[],"class_list":["post-92689","post","type-post","status-publish","format-standard","hentry","category-server","tag-css","tag-flutter","tag-web","tag-87"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>AI \u8f85\u52a9 UI \u751f\u6210\u4e0e\u8bbe\u8ba1\u7cfb\u7edf\u81ea\u52a8\u5316\u5b9e\u8df5\uff1a\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/92689.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AI \u8f85\u52a9 UI \u751f\u6210\u4e0e\u8bbe\u8ba1\u7cfb\u7edf\u81ea\u52a8\u5316\u5b9e\u8df5\uff1a\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"AI \u8f85\u52a9 UI \u751f\u6210\u4e0e\u8bbe\u8ba1\u7cfb\u7edf\u81ea\u52a8\u5316\u5b9e\u8df5&#xff1a;\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60 \u6f14\u793a\u91cc&#xff0c;\u7ed9\u5927\u8bed\u8a00\u6a21\u578b\u4e00\u53e5\u63cf\u8ff0&#xff0c;\u5f88\u5feb\u5c31\u80fd\u5f97\u5230\u4e00\u4e2a\u80fd\u770b\u7684 React \u5361\u7247\u3002\u4f46\u80fd\u6e32\u67d3\u4e0d\u7b49\u4e8e\u80fd\u7ef4\u62a4\u3002\u751f\u6210\u4ee3\u7801\u5e38\u89c1\u7684\u95ee\u9898\u662f\u5c42\u7ea7\u8fc7\u6df1\u3001\u5185\u8054\u6837\u5f0f\u8fc7\u591a&#xff0c;\u4ee5\u53ca\u7ed5\u5f00\u73b0\u6709 Token\u3002 \u5148\u628a\u201c\u80fd\u751f\u6210\u201d\u62c6\u6210\u53ef\u68c0\u67e5\u7684\u6761\u4ef6 \u628a\u751f\u6210\u4ee3\u7801\u63a5\u5165\u9879\u76ee\u4e4b\u524d&#xff0c;\u5148\u5728\u72ec\u7acb\u9884\u89c8\u9875\u68c0\u67e5 DOM \u6570\u91cf\u3001\u6700\u5927\u5d4c\u5957\u6df1\u5ea6\u3001\u5185\u8054\u6837\u5f0f\u548c Token \u4f7f\u7528\u60c5\u51b5\u3002\u4e0b\u9762\u7684\u811a\u672c\u53ef\u4f5c\u4e3a\u672c\u5730\u8bca\u65ad\u8d77\u70b9&amp;#xff1b\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/92689.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-10T14:48:46+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\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\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/92689.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/92689.html\",\"name\":\"AI \u8f85\u52a9 UI \u751f\u6210\u4e0e\u8bbe\u8ba1\u7cfb\u7edf\u81ea\u52a8\u5316\u5b9e\u8df5\uff1a\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-10T14:48:46+00:00\",\"dateModified\":\"2026-08-10T14:48:46+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/92689.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/92689.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/92689.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AI \u8f85\u52a9 UI \u751f\u6210\u4e0e\u8bbe\u8ba1\u7cfb\u7edf\u81ea\u52a8\u5316\u5b9e\u8df5\uff1a\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"AI \u8f85\u52a9 UI \u751f\u6210\u4e0e\u8bbe\u8ba1\u7cfb\u7edf\u81ea\u52a8\u5316\u5b9e\u8df5\uff1a\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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":"https:\/\/www.wsisp.com\/helps\/92689.html","og_locale":"zh_CN","og_type":"article","og_title":"AI \u8f85\u52a9 UI \u751f\u6210\u4e0e\u8bbe\u8ba1\u7cfb\u7edf\u81ea\u52a8\u5316\u5b9e\u8df5\uff1a\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"AI \u8f85\u52a9 UI \u751f\u6210\u4e0e\u8bbe\u8ba1\u7cfb\u7edf\u81ea\u52a8\u5316\u5b9e\u8df5&#xff1a;\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60 \u6f14\u793a\u91cc&#xff0c;\u7ed9\u5927\u8bed\u8a00\u6a21\u578b\u4e00\u53e5\u63cf\u8ff0&#xff0c;\u5f88\u5feb\u5c31\u80fd\u5f97\u5230\u4e00\u4e2a\u80fd\u770b\u7684 React \u5361\u7247\u3002\u4f46\u80fd\u6e32\u67d3\u4e0d\u7b49\u4e8e\u80fd\u7ef4\u62a4\u3002\u751f\u6210\u4ee3\u7801\u5e38\u89c1\u7684\u95ee\u9898\u662f\u5c42\u7ea7\u8fc7\u6df1\u3001\u5185\u8054\u6837\u5f0f\u8fc7\u591a&#xff0c;\u4ee5\u53ca\u7ed5\u5f00\u73b0\u6709 Token\u3002 \u5148\u628a\u201c\u80fd\u751f\u6210\u201d\u62c6\u6210\u53ef\u68c0\u67e5\u7684\u6761\u4ef6 \u628a\u751f\u6210\u4ee3\u7801\u63a5\u5165\u9879\u76ee\u4e4b\u524d&#xff0c;\u5148\u5728\u72ec\u7acb\u9884\u89c8\u9875\u68c0\u67e5 DOM \u6570\u91cf\u3001\u6700\u5927\u5d4c\u5957\u6df1\u5ea6\u3001\u5185\u8054\u6837\u5f0f\u548c Token \u4f7f\u7528\u60c5\u51b5\u3002\u4e0b\u9762\u7684\u811a\u672c\u53ef\u4f5c\u4e3a\u672c\u5730\u8bca\u65ad\u8d77\u70b9&amp;#xff1b","og_url":"https:\/\/www.wsisp.com\/helps\/92689.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-10T14:48:46+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/92689.html","url":"https:\/\/www.wsisp.com\/helps\/92689.html","name":"AI \u8f85\u52a9 UI \u751f\u6210\u4e0e\u8bbe\u8ba1\u7cfb\u7edf\u81ea\u52a8\u5316\u5b9e\u8df5\uff1a\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-10T14:48:46+00:00","dateModified":"2026-08-10T14:48:46+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/92689.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/92689.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/92689.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"AI \u8f85\u52a9 UI \u751f\u6210\u4e0e\u8bbe\u8ba1\u7cfb\u7edf\u81ea\u52a8\u5316\u5b9e\u8df5\uff1a\u522b\u8ba9\u6f14\u793a\u6548\u679c\u9a97\u4e86\u4f60"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/92689","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=92689"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/92689\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=92689"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=92689"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=92689"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=92689"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}