{"id":198,"date":"2026-07-08T09:46:17","date_gmt":"2026-07-08T01:46:17","guid":{"rendered":"https:\/\/yykcj.com\/?p=198"},"modified":"2026-07-08T09:46:17","modified_gmt":"2026-07-08T01:46:17","slug":"web-components-%e4%b8%8e-react-vue-angular-%e6%a1%86%e6%9e%b6%e9%9b%86%e6%88%90%e5%ae%9e%e6%88%98%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/yykcj.com\/?p=198","title":{"rendered":"Web Components \u4e0e React\/Vue\/Angular \u6846\u67b6\u96c6\u6210\u5b9e\u6218\u6307\u5357"},"content":{"rendered":"<h2>\u5f15\u8a00<\/h2>\n<p>Web Components \u662f\u4e00\u7ec4\u539f\u751f\u6d4f\u89c8\u5668 API\uff0c\u5141\u8bb8\u5f00\u53d1\u8005\u521b\u5efa\u53ef\u590d\u7528\u7684\u81ea\u5b9a\u4e49\u5143\u7d20\u3002\u7136\u800c\uff0c\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\uff0c\u6211\u4eec\u5f80\u5f80\u9700\u8981\u5728 React\u3001Vue \u6216 Angular \u7b49\u6846\u67b6\u4e2d\u4f7f\u7528\u8fd9\u4e9b\u7ec4\u4ef6\u3002\u7531\u4e8e\u6846\u67b6\u7684\u865a\u62df DOM \u548c\u4e8b\u4ef6\u7cfb\u7edf\u4e0e\u539f\u751f\u5143\u7d20\u5b58\u5728\u5dee\u5f02\uff0c\u76f4\u63a5\u4f7f\u7528\u53ef\u80fd\u4f1a\u9047\u5230\u6570\u636e\u7ed1\u5b9a\u5931\u6548\u3001\u4e8b\u4ef6\u4e22\u5931\u7b49\u95ee\u9898\u3002\u672c\u6587\u5c06\u624b\u628a\u624b\u6559\u4f60\u5982\u4f55\u6b63\u786e\u96c6\u6210 Web Components \u4e0e\u4e09\u5927\u6846\u67b6\uff0c\u5e76\u5206\u4eab\u6700\u4f73\u5b9e\u8df5\u3002<\/p>\n<h2>1. \u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684 Web Component<\/h2>\n<p>\u9996\u5148\uff0c\u6211\u4eec\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a <code><user-card><\/code> \u7684 Web Component\uff0c\u7528\u4e8e\u5c55\u793a\u7528\u6237\u4fe1\u606f\u3002<\/p>\n<pre><code class=\"language-javascript\">\n\/\/ user-card.js\nclass UserCard extends HTMLElement {\n  constructor() {\n    super();\n    this.attachShadow({ mode: &#x27;open&#x27; });\n    this._name = &#x27;&#x27;;\n    this._age = 0;\n  }\n\n  static get observedAttributes() {\n    return [&#x27;name&#x27;, &#x27;age&#x27;];\n  }\n\n  attributeChangedCallback(name, oldValue, newValue) {\n    if (name === &#x27;name&#x27;) this._name = newValue;\n    if (name === &#x27;age&#x27;) this._age = newValue;\n    this.render();\n  }\n\n  connectedCallback() {\n    this.render();\n  }\n\n  render() {\n    this.shadowRoot.innerHTML = `\n      &lt;style&gt;\n        .card { border: 1px solid #ccc; padding: 10px; border-radius: 8px; }\n        .name { font-weight: bold; }\n        .age { color: #666; }\n      &lt;\/style&gt;\n      &lt;div class=&quot;card&quot;&gt;\n        &lt;div class=&quot;name&quot;&gt;${this._name}&lt;\/div&gt;\n        &lt;div class=&quot;age&quot;&gt;${this._age} years old&lt;\/div&gt;\n        &lt;button id=&quot;greet&quot;&gt;Greet&lt;\/button&gt;\n      &lt;\/div&gt;\n    `;\n    this.shadowRoot.querySelector(&#x27;#greet&#x27;).addEventListener(&#x27;click&#x27;, () =&gt; {\n      this.dispatchEvent(new CustomEvent(&#x27;greet&#x27;, { detail: this._name }));\n    });\n  }\n}\n\ncustomElements.define(&#x27;user-card&#x27;, UserCard);\n<\/code><\/pre>\n<p>\u8be5\u7ec4\u4ef6\u63a5\u6536 <code>name<\/code> \u548c <code>age<\/code> \u5c5e\u6027\uff0c\u5e76\u89e6\u53d1 <code>greet<\/code> \u81ea\u5b9a\u4e49\u4e8b\u4ef6\u3002<\/p>\n<h2>2. \u5728 React \u4e2d\u4f7f\u7528 Web Components<\/h2>\n<p>React \u5bf9 Web Components \u7684\u652f\u6301\u8f83\u4e3a\u53cb\u597d\uff0c\u4f46\u9700\u8981\u6ce8\u610f\u5c5e\u6027\u4f20\u9012\u548c\u4e8b\u4ef6\u5904\u7406\u3002<\/p>\n<h3>2.1 \u5b89\u88c5\u4e0e\u5f15\u5165<\/h3>\n<pre><code class=\"language-bash\">\nnpm install --save user-card\n# \u6216\u76f4\u63a5\u5f15\u5165\u811a\u672c\n<\/code><\/pre>\n<p>\u5728 React \u7ec4\u4ef6\u4e2d\u5f15\u5165\uff1a<\/p>\n<pre><code class=\"language-javascript\">\n\/\/ \u5728\u5165\u53e3\u6587\u4ef6\u6216\u7ec4\u4ef6\u4e2d\u5f15\u5165\nimport &#x27;user-card&#x27;;\n<\/code><\/pre>\n<h3>2.2 \u4f7f\u7528\u7ec4\u4ef6<\/h3>\n<pre><code class=\"language-jsx\">\nimport React, { useRef, useEffect } from &#x27;react&#x27;;\n\nfunction App() {\n  const cardRef = useRef(null);\n\n  useEffect(() =&gt; {\n    const card = cardRef.current;\n    const handleGreet = (e) =&gt; {\n      alert(`Hello, ${e.detail}!`);\n    };\n    card.addEventListener(&#x27;greet&#x27;, handleGreet);\n    return () =&gt; card.removeEventListener(&#x27;greet&#x27;, handleGreet);\n  }, []);\n\n  return (\n    &lt;div&gt;\n      {\/* \u6ce8\u610f\uff1aReact \u4e2d\u5c5e\u6027\u540d\u9700\u4f7f\u7528\u9a7c\u5cf0\uff0c\u4f46 Web Components \u5c5e\u6027\u540d\u662f kebab-case *\/}\n      &lt;user-card ref={cardRef} name=&quot;Alice&quot; age={25} \/&gt;\n    &lt;\/div&gt;\n  );\n}\n\nexport default App;\n<\/code><\/pre>\n<p><strong>\u6ce8\u610f<\/strong>\uff1a<\/p>\n<ul>\n<li>\u5c5e\u6027 <code>name<\/code> \u548c <code>age<\/code> \u76f4\u63a5\u4f5c\u4e3a HTML \u5c5e\u6027\u4f20\u9012\uff0cReact \u4f1a\u81ea\u52a8\u5904\u7406\u5b57\u7b26\u4e32\u548c\u6570\u5b57\u3002<\/li>\n<li>\u4e8b\u4ef6\u76d1\u542c\u5fc5\u987b\u4f7f\u7528\u539f\u751f <code>addEventListener<\/code>\uff0c\u56e0\u4e3a React \u7684\u5408\u6210\u4e8b\u4ef6\u65e0\u6cd5\u76f4\u63a5\u6355\u83b7 Web Component \u7684\u81ea\u5b9a\u4e49\u4e8b\u4ef6\u3002<\/li>\n<li>\u5982\u679c\u5c5e\u6027\u662f\u5bf9\u8c61\u6216\u6570\u7ec4\uff0c\u9700\u8981\u901a\u8fc7 <code>JSON.stringify<\/code> \u8f6c\u4e3a\u5b57\u7b26\u4e32\uff0c\u6216\u5728 <code>attributeChangedCallback<\/code> \u4e2d\u89e3\u6790\u3002<\/li>\n<\/ul>\n<h3>2.3 \u4f20\u9012\u590d\u6742\u6570\u636e<\/h3>\n<pre><code class=\"language-jsx\">\n&lt;user-card user={JSON.stringify({name: &#x27;Bob&#x27;, age: 30})} \/&gt;\n<\/code><\/pre>\n<p>\u5728 Web Component \u4e2d\u89e3\u6790\uff1a<\/p>\n<pre><code class=\"language-javascript\">\nattributeChangedCallback(name, oldValue, newValue) {\n  if (name === &#x27;user&#x27;) {\n    const user = JSON.parse(newValue);\n    this._name = user.name;\n    this._age = user.age;\n  }\n  this.render();\n}\n<\/code><\/pre>\n<h2>3. \u5728 Vue \u4e2d\u4f7f\u7528 Web Components<\/h2>\n<p>Vue 3 \u5bf9 Web Components \u6709\u5f88\u597d\u7684\u652f\u6301\uff0c\u4f46\u9700\u8981\u914d\u7f6e <code>isCustomElement<\/code> \u6216\u4f7f\u7528 <code>vue-web-component-wrapper<\/code>\uff08\u4e0d\u63a8\u8350\uff09\u3002<\/p>\n<h3>3.1 \u914d\u7f6e Vue \u5ffd\u7565\u81ea\u5b9a\u4e49\u5143\u7d20<\/h3>\n<p>\u5728 <code>vite.config.js<\/code> \u4e2d\uff1a<\/p>\n<pre><code class=\"language-javascript\">\nimport { defineConfig } from &#x27;vite&#x27;;\nimport vue from &#x27;@vitejs\/plugin-vue&#x27;;\n\nexport default defineConfig({\n  plugins: [\n    vue({\n      template: {\n        compilerOptions: {\n          isCustomElement: (tag) =&gt; tag.startsWith(&#x27;user-&#x27;),\n        },\n      },\n    }),\n  ],\n});\n<\/code><\/pre>\n<h3>3.2 \u4f7f\u7528\u7ec4\u4ef6<\/h3>\n<pre><code class=\"language-vue\">\n&lt;template&gt;\n  &lt;div&gt;\n    &lt;user-card :name=&quot;userName&quot; :age=&quot;userAge&quot; @greet=&quot;handleGreet&quot; ref=&quot;cardRef&quot; \/&gt;\n  &lt;\/div&gt;\n&lt;\/template&gt;\n\n&lt;script setup&gt;\nimport { ref, onMounted, onUnmounted } from &#x27;vue&#x27;;\nimport &#x27;user-card&#x27;;\n\nconst userName = ref(&#x27;Alice&#x27;);\nconst userAge = ref(25);\nconst cardRef = ref(null);\n\nconst handleGreet = (e) =&gt; {\n  alert(`Hello, ${e.detail}!`);\n};\n\n\/\/ \u6ce8\u610f\uff1aVue 3 \u7684 @greet \u53ef\u4ee5\u76f4\u63a5\u7ed1\u5b9a\u81ea\u5b9a\u4e49\u4e8b\u4ef6\uff0c\u4f46\u9700\u8981\u7ec4\u4ef6\u89e6\u53d1 CustomEvent\n\/\/ \u5982\u679c\u4e8b\u4ef6\u540d\u662f kebab-case\uff0cVue \u4f1a\u81ea\u52a8\u8f6c\u6362\n&lt;\/script&gt;\n<\/code><\/pre>\n<p><strong>\u6ce8\u610f<\/strong>\uff1a<\/p>\n<ul>\n<li>Vue 3 \u652f\u6301\u5728\u6a21\u677f\u4e2d\u76f4\u63a5\u4f7f\u7528 <code>@greet<\/code> \u76d1\u542c\u81ea\u5b9a\u4e49\u4e8b\u4ef6\uff0c\u4f46\u4e8b\u4ef6\u540d\u5fc5\u987b\u5168\u90e8\u5c0f\u5199\uff08\u56e0\u4e3a HTML \u5c5e\u6027\u4e0d\u533a\u5206\u5927\u5c0f\u5199\uff09\u3002<\/li>\n<li>\u5c5e\u6027\u7ed1\u5b9a\u4f7f\u7528 <code>:prop<\/code> \u8bed\u6cd5\uff0cVue \u4f1a\u81ea\u52a8\u5c06 camelCase \u8f6c\u4e3a kebab-case\uff08\u4f8b\u5982 <code>:userName<\/code> \u53d8\u4e3a <code>user-name<\/code> \u5c5e\u6027\uff09\u3002<\/li>\n<\/ul>\n<h3>3.3 \u4f20\u9012\u5bf9\u8c61\u5c5e\u6027<\/h3>\n<pre><code class=\"language-vue\">\n&lt;template&gt;\n  &lt;user-card :user=&quot;userObject&quot; \/&gt;\n&lt;\/template&gt;\n\n&lt;script setup&gt;\nconst userObject = { name: &#x27;Bob&#x27;, age: 30 };\n&lt;\/script&gt;\n<\/code><\/pre>\n<p>Vue \u4f1a\u5c06\u5bf9\u8c61\u8f6c\u4e3a JSON \u5b57\u7b26\u4e32\u4f20\u9012\u7ed9\u5c5e\u6027\uff0cWeb Component \u9700\u89e3\u6790\u3002<\/p>\n<h2>4. \u5728 Angular \u4e2d\u4f7f\u7528 Web Components<\/h2>\n<p>Angular \u4f7f\u7528 Zone.js \u548c\u81ea\u5b9a\u4e49\u4e8b\u4ef6\u5904\u7406\uff0c\u9700\u8981\u914d\u7f6e CUSTOM<em>ELEMENTS<\/em>SCHEMA\u3002<\/p>\n<h3>4.1 \u914d\u7f6e\u6a21\u5757<\/h3>\n<pre><code class=\"language-typescript\">\n\/\/ app.module.ts\nimport { NgModule, CUSTOM_ELEMENTS_SCHEMA } from &#x27;@angular\/core&#x27;;\nimport { BrowserModule } from &#x27;@angular\/platform-browser&#x27;;\nimport { AppComponent } from &#x27;.\/app.component&#x27;;\n\n@NgModule({\n  declarations: [AppComponent],\n  imports: [BrowserModule],\n  schemas: [CUSTOM_ELEMENTS_SCHEMA], \/\/ \u5141\u8bb8\u81ea\u5b9a\u4e49\u5143\u7d20\n  bootstrap: [AppComponent],\n})\nexport class AppModule {}\n<\/code><\/pre>\n<h3>4.2 \u4f7f\u7528\u7ec4\u4ef6<\/h3>\n<pre><code class=\"language-typescript\">\n\/\/ app.component.ts\nimport { Component, ElementRef, ViewChild, AfterViewInit, OnDestroy } from &#x27;@angular\/core&#x27;;\n\n@Component({\n  selector: &#x27;app-root&#x27;,\n  template: `\n    &lt;user-card\n      [attr.name]=&quot;userName&quot;\n      [attr.age]=&quot;userAge&quot;\n      #cardRef\n    &gt;&lt;\/user-card&gt;\n  `,\n})\nexport class AppComponent implements AfterViewInit, OnDestroy {\n  userName = &#x27;Alice&#x27;;\n  userAge = 25;\n  @ViewChild(&#x27;cardRef&#x27;, { static: true }) cardRef!: ElementRef;\n  private listener!: (e: Event) =&gt; void;\n\n  ngAfterViewInit() {\n    this.listener = (e: Event) =&gt; {\n      const customEvent = e as CustomEvent;\n      alert(`Hello, ${customEvent.detail}!`);\n    };\n    this.cardRef.nativeElement.addEventListener(&#x27;greet&#x27;, this.listener);\n  }\n\n  ngOnDestroy() {\n    this.cardRef.nativeElement.removeEventListener(&#x27;greet&#x27;, this.listener);\n  }\n}\n<\/code><\/pre>\n<p><strong>\u6ce8\u610f<\/strong>\uff1a<\/p>\n<ul>\n<li>\u5c5e\u6027\u7ed1\u5b9a\u5fc5\u987b\u4f7f\u7528 <code>[attr.name]<\/code> \u8bed\u6cd5\uff0c\u5426\u5219 Angular \u4f1a\u5c1d\u8bd5\u8fdb\u884c\u53cc\u5411\u7ed1\u5b9a\u3002<\/li>\n<li>\u4e8b\u4ef6\u76d1\u542c\u5fc5\u987b\u901a\u8fc7\u539f\u751f API\uff0c\u56e0\u4e3a Angular \u7684 <code>(greet)<\/code> \u8bed\u6cd5\u65e0\u6cd5\u76f4\u63a5\u8bc6\u522b\u81ea\u5b9a\u4e49\u4e8b\u4ef6\uff08\u9664\u975e\u4f7f\u7528 <code>@Output<\/code> \u88c5\u9970\u5668\u5305\u88c5\uff0c\u4f46 Web Component \u4e0d\u662f Angular \u7ec4\u4ef6\uff09\u3002<\/li>\n<li>\u5982\u679c\u5c5e\u6027\u662f\u5bf9\u8c61\uff0c\u53ef\u4ee5\u4f7f\u7528 <code>[attr.user]=\"userObject | json\"<\/code> \u4f46\u9700\u6ce8\u610f JSON \u5e8f\u5217\u5316\u3002<\/li>\n<\/ul>\n<h2>5. \u6700\u4f73\u5b9e\u8df5\u4e0e\u5e38\u89c1\u5751<\/h2>\n<h3>5.1 \u5c5e\u6027\u547d\u540d<\/h3>\n<p>Web Components \u4f7f\u7528 kebab-case \u5c5e\u6027\u540d\uff0c\u800c React \u548c Vue \u63a8\u8350 camelCase\u3002\u5728\u6846\u67b6\u4e2d\u4f20\u9012\u65f6\uff0c\u6846\u67b6\u4f1a\u81ea\u52a8\u8f6c\u6362\uff0c\u4f46\u9700\u6ce8\u610f\uff1a<\/p>\n<ul>\n<li>React\uff1a\u76f4\u63a5\u5199 kebab-case \u5c5e\u6027\u540d\uff0c\u5982 <code>user-name<\/code>\u3002<\/li>\n<li>Vue\uff1a\u4f7f\u7528 <code>:userName<\/code> \u4f1a\u8f6c\u6362\u4e3a <code>user-name<\/code>\u3002<\/li>\n<li>Angular\uff1a\u4f7f\u7528 <code>[attr.user-name]<\/code>\u3002<\/li>\n<\/ul>\n<h3>5.2 \u4e8b\u4ef6\u5904\u7406<\/h3>\n<ul>\n<li>\u6240\u6709\u6846\u67b6\u4e2d\uff0c\u81ea\u5b9a\u4e49\u4e8b\u4ef6\u90fd\u5efa\u8bae\u4f7f\u7528\u539f\u751f <code>addEventListener<\/code> \u76d1\u542c\uff0c\u56e0\u4e3a\u6846\u67b6\u7684\u5408\u6210\u4e8b\u4ef6\u7cfb\u7edf\u53ef\u80fd\u65e0\u6cd5\u6b63\u786e\u5904\u7406\u3002<\/li>\n<li>Vue 3 \u7684 <code>@<\/code> \u8bed\u6cd5\u53ef\u4ee5\u5de5\u4f5c\uff0c\u4f46\u4e8b\u4ef6\u540d\u5fc5\u987b\u5168\u90e8\u5c0f\u5199\u3002<\/li>\n<li>Angular \u53ef\u4ee5\u901a\u8fc7 <code>@HostListener<\/code> \u6216 <code>addEventListener<\/code>\u3002<\/li>\n<\/ul>\n<h3>5.3 \u751f\u547d\u5468\u671f<\/h3>\n<p>Web Components \u7684 <code>connectedCallback<\/code> \u5bf9\u5e94\u6846\u67b6\u7684\u6302\u8f7d\u9636\u6bb5\uff0c<code>disconnectedCallback<\/code> \u5bf9\u5e94\u5378\u8f7d\u3002\u786e\u4fdd\u5728\u5378\u8f7d\u65f6\u79fb\u9664\u4e8b\u4ef6\u76d1\u542c\uff0c\u907f\u514d\u5185\u5b58\u6cc4\u6f0f\u3002<\/p>\n<h3>5.4 \u6837\u5f0f\u9694\u79bb<\/h3>\n<p>Web Components \u7684 Shadow DOM \u63d0\u4f9b\u6837\u5f0f\u9694\u79bb\uff0c\u4f46\u6846\u67b6\u7684\u5168\u5c40\u6837\u5f0f\u65e0\u6cd5\u7a7f\u900f\u3002\u5982\u679c\u9700\u8981\u8986\u76d6\u6837\u5f0f\uff0c\u53ef\u4ee5\u4f7f\u7528 CSS \u81ea\u5b9a\u4e49\u5c5e\u6027\uff08CSS Variables\uff09\u6216 <code>::part<\/code> \u4f2a\u5143\u7d20\u3002<\/p>\n<pre><code class=\"language-css\">\nuser-card {\n  --card-border-color: blue;\n}\n<\/code><\/pre>\n<p>\u5728 Web Component \u4e2d\u4f7f\u7528\uff1a<\/p>\n<pre><code class=\"language-css\">\n.card {\n  border-color: var(--card-border-color, #ccc);\n}\n<\/code><\/pre>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u672c\u6587\u901a\u8fc7\u4e00\u4e2a\u5b8c\u6574\u7684 <code>user-card<\/code> \u793a\u4f8b\uff0c\u6f14\u793a\u4e86 Web Components \u4e0e React\u3001Vue \u548c Angular \u7684\u96c6\u6210\u65b9\u6cd5\u3002\u6838\u5fc3\u8981\u70b9\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>\u5c5e\u6027\u4f20\u9012\uff1a\u4f7f\u7528\u539f\u751f\u5c5e\u6027\uff0c\u590d\u6742\u6570\u636e\u9700\u5e8f\u5217\u5316\u3002<\/li>\n<li>\u4e8b\u4ef6\u76d1\u542c\uff1a\u4f18\u5148\u4f7f\u7528\u539f\u751f <code>addEventListener<\/code>\u3002<\/li>\n<li>\u751f\u547d\u5468\u671f\u7ba1\u7406\uff1a\u6ce8\u610f\u5728\u5378\u8f7d\u65f6\u6e05\u7406\u3002<\/li>\n<li>\u6837\u5f0f\u9694\u79bb\uff1a\u5229\u7528 CSS \u81ea\u5b9a\u4e49\u5c5e\u6027\u8fdb\u884c\u4e3b\u9898\u5b9a\u5236\u3002<\/li>\n<\/ul>\n<p>Web Components \u4e0e\u6846\u67b6\u7684\u96c6\u6210\u5e76\u4e0d\u590d\u6742\uff0c\u4f46\u9700\u8981\u7406\u89e3\u4e24\u8005\u4e4b\u95f4\u7684\u5dee\u5f02\u3002\u638c\u63e1\u8fd9\u4e9b\u6280\u5de7\u540e\uff0c\u4f60\u53ef\u4ee5\u5728\u9879\u76ee\u4e2d\u65e0\u7f1d\u4f7f\u7528\u4efb\u4f55 Web Component\uff0c\u4eab\u53d7\u8de8\u6846\u67b6\u590d\u7528\u7684\u4fbf\u5229\u3002<\/p>\n<h2>\u5ef6\u4f38\u9605\u8bfb<\/h2>\n<ul>\n<li><a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/Web_Components\">MDN Web Components \u6587\u6863<\/a><\/li>\n<li><a href=\"https:\/\/lit.dev\/\">lit-html \u5e93<\/a> &#8211; \u7b80\u5316 Web Components \u5f00\u53d1<\/li>\n<li><a href=\"https:\/\/stenciljs.com\/\">Stencil \u6846\u67b6<\/a> &#8211; \u751f\u6210\u9ad8\u6027\u80fd Web Components<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5c06 Web Components \u4e0e React\u3001Vue \u548c Angular \u4e3b\u6d41\u6846\u67b6\u96c6\u6210\uff0c\u6db5\u76d6\u6570\u636e\u4f20\u9012\u3001\u4e8b\u4ef6\u5904\u7406\u548c\u5e38\u89c1\u5751\u70b9\uff0c\u5e2e\u52a9\u4f60\u5728\u9879\u76ee\u4e2d\u5e73\u6ed1\u4f7f\u7528\u539f\u751f\u7ec4\u4ef6\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[29,11,28,26,27,110],"class_list":["post-198","post","type-post","status-publish","format-standard","hentry","category-3","tag-angular","tag-react","tag-vue","tag-web-components","tag-27","tag-110"],"_links":{"self":[{"href":"https:\/\/yykcj.com\/index.php?rest_route=\/wp\/v2\/posts\/198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yykcj.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yykcj.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yykcj.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yykcj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=198"}],"version-history":[{"count":0,"href":"https:\/\/yykcj.com\/index.php?rest_route=\/wp\/v2\/posts\/198\/revisions"}],"wp:attachment":[{"href":"https:\/\/yykcj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yykcj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yykcj.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}