{"id":9816,"date":"2021-02-13T23:09:29","date_gmt":"2021-02-13T15:09:29","guid":{"rendered":"https:\/\/www.zhangxinxu.com\/wordpress\/?p=9816"},"modified":"2021-02-19T21:34:31","modified_gmt":"2021-02-19T13:34:31","slug":"web-components-import-css","status":"publish","type":"post","link":"https:\/\/www.zhangxinxu.com\/wordpress\/2021\/02\/web-components-import-css\/","title":{"rendered":"Web Components\u4e2d\u5f15\u5165\u5916\u90e8CSS\u76843\u79cd\u65b9\u6cd5"},"content":{"rendered":"<p>by <a href=\"https:\/\/www.zhangxinxu.com\/\">zhangxinxu<\/a> from <a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=9816\">https:\/\/www.zhangxinxu.com\/wordpress\/?p=9816<\/a><br \/>\n\u672c\u6587\u6b22\u8fce\u5206\u4eab\u4e0e\u805a\u5408\uff0c\u5168\u6587\u8f6c\u8f7d\u5c31\u4e0d\u5fc5\u4e86\uff0c\u5c0a\u91cd\u7248\u6743\uff0c\u5708\u5b50\u5c31\u8fd9\u4e48\u5927\uff0c\u82e5\u6025\u7528\u53ef\u4ee5\u8054\u7cfb\u6388\u6743\u3002<\/p>\n<p><script>window.wxShareImgUrl = 'https:\/\/www.zhangxinxu.com\/study\/image\/share\/202102-import-css.png';<\/script><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202102\/import-css-cover.png\" width=\"480\" height=\"306\" alt=\"\u7231\u5fc3\u7eb9\u7406\" class=\"alignright clip thumb size-medium\" \/><\/p>\n<p>\u4e3a\u4e86\u91cd\u590d\u5229\u7528\uff0c\u672c\u6587\u7684Web Components\u7ec4\u4ef6\u5c31\u4f7f\u7528\u524d\u4e24\u5929\u5199\u7684\u201c<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/2021\/02\/range-input\/\">\u5de7\u7528\u4e24\u4e2atype=range input\u5b9e\u73b0\u533a\u57df\u8303\u56f4\u9009\u62e9<\/a>\u201d\u8fd9\u7bc7\u6587\u7ae0\u4e2d\u7684Range\u7ec4\u4ef6\u793a\u610f\u3002<\/p>\n<p>\u539fRange\u7ec4\u4ef6\u7684CSS\u90fd\u662f\u76f4\u63a5\u5185\u8054\u5728Shadow DOM\u4e2d\u7684\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202102\/2021-02-13_214112.png\" width=\"376\" height=\"260\" alt=\"style\u6837\u5f0f\u5185\u8054\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u5b9e\u9645\u5f00\u53d1\u65f6\u5019\uff0c\u5f80\u5f80\u4f1a\u78b0\u5230\u9700\u8981\u5f15\u5165\u5916\u90e8CSS\u5230Shadow DOM\u4e2d\u7684\u60c5\u51b5\uff0c\u6b64\u65f6\u8be5\u5982\u4f55\u5904\u7406\u624d\u5408\u9002\u5462\uff1f<\/p>\n<p>\u672c\u6587\u4ecb\u7ecd3\u79cd\u5904\u7406\u65b9\u6cd5\u3002<\/p>\n<p>\u5047\u8bbeRange\u7ec4\u4ef6\u9700\u8981\u7684CSS\u90fd\u653e\u5728\u4e86\u4e00\u4e2a\u540d\u4e3arange.css\u7684\u6587\u4ef6\u4e2d\u3002<\/p>\n<h3>\u4e00\u3001@import\u65b9\u6cd5<\/h3>\n<p>\u4ee3\u7801\u793a\u610f\uff1a<\/p>\n<pre>class uiRange extends HTMLElement {\r\n    constructor () {\r\n        super();\r\n        <span style=\"color:green;\">\/\/ \u9644\u52a0Shadow DOM<\/span>\r\n        this.attachShadow({\r\n            mode: 'open'\r\n        });\r\n        <span style=\"color:green;\">\/\/ \u521b\u5efa\u6837\u5f0f<\/span>\r\n        <span style=\"color:#cd0000;\">let node = document.createElement('style');\r\n        node.innerHTML = `@import '.\/range.css';`;\r\n        this.shadowRoot.append(node);<\/span>\r\n    }\r\n    ...\r\n}\r\nif (!customElements.get('ui-range')) {\r\n    customElements.define('ui-range', uiRange);\r\n}<\/pre>\n<p>\u5f15\u7528\u7684\u6838\u5fc3\u5c31\u662f\u4e0b\u9762\u8fd9\u6837CSS\u8bed\u53e5\uff1a<\/p>\n<pre>@import '.\/range.css'<\/pre>\n<p>\u5b9e\u9645DOM\u6e32\u67d3\u6548\u679c\u5982\u4e0b\u622a\u56fe\uff08\u622a\u81eaFirefox\uff09\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202102\/2021-02-13_215336.png\" width=\"355\" height=\"111\" alt=\"@import\u8bed\u53e5\u4f7f\u7528\u793a\u610f\" class=\"alignnone size-medium\" \/><\/p>\n<h4>\u4f18\u7f3a\u70b9<\/h4>\n<p>\u4f18\u70b9\u662f\u517c\u5bb9\u6027\u4e0d\u9519\uff0c\u652f\u6301Shadow DOM\u7684\u5143\u7d20\u5747\u652f\u6301\u6b64\u8bed\u6cd5\uff1b\u4ee5\u53ca\u4f7f\u7528\u6bd4\u8f83\u65b9\u4fbf\u3002<\/p>\n<p>\u7f3a\u70b9\u662f\u6027\u80fd\u8457\u540d\u7684\u5dee\u3002\u6839\u636e\u6211\u770b\u5230\u7684<a href=\"https:\/\/www.webpagetest.org\/result\/161023_VK_9ZC\/\" rel=\"noopener nofollow\" target=\"_blank\">\u67d0\u4e9b\u8d44\u6599\u7684\u6d4b\u8bd5\u6570\u636e<\/a>\uff0c\u4f1a\u6709\u534a\u79d2\u5de6\u53f3\u7684\u963b\u585e\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202102\/2021-02-13_215908.png\" width=\"357\" height=\"216\" alt=\"\u603b\u7684\u963b\u585e\u65f6\u95f4\u793a\u610f\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u4e0d\u8fc7\u6709\u4e9b\u7ad9\u70b9\u5bf9\u4e8e\u5c0f\u5c0f\u7684\u963b\u585e\u5ef6\u65f6\u5e76\u4e0d\u5728\u610f\uff0c\u53cd\u800c\u66f4\u5728\u610f\u4f7f\u7528\u7684\u4fbf\u6377\u6027\uff0c\u6b64\u65f6\u4f7f\u7528@import\u4e5f\u662f\u53ef\u4ee5\u7684\uff0c\u6bd4\u65b9\u8bf4\u4e00\u4e9bdemo\u539f\u578b\u9875\u9762\uff0c\u5185\u90e8\u7684\u6587\u6863\u9875\u9762\u7b49\u3002<\/p>\n<p>\u5982\u679c\u5bf9\u6027\u80fd\u6bd4\u8f83\u5728\u610f\uff0c\u53ef\u4ee5\u8bd5\u8bd5\u4e0b\u9762\u7684fetch\u65b9\u6cd5\u3002<\/p>\n<h3>\u4e8c\u3001fetch\u83b7\u53d6<\/h3>\n<p>\u76f4\u63a5\u4ee5\u8bf7\u6c42\u7684\u65b9\u5f0f\u53bbload CSS\u6587\u4ef6\u7684\u8d44\u6e90\u5185\u5bb9\uff0c\u5e76\u5728Shadow DOM\u4e2d\u8f93\u51fa\u3002<\/p>\n<p>\u4ee3\u7801\u793a\u610f\uff1a<\/p>\n<pre>class uiRange extends HTMLElement {\r\n    constructor () {\r\n        super();\r\n        <span style=\"color:green;\">\/\/ \u9644\u52a0Shadow DOM<\/span>\r\n        this.attachShadow({\r\n            mode: 'open'\r\n        });\r\n        <span style=\"color:green;\">\/\/ \u83b7\u53d6\u6837\u5f0f<\/span>\r\n        <span style=\"color:#cd0000;\">fetch('.\/range.css').then(response => response.text()).then(data => {\r\n            let node = document.createElement('style');\r\n            node.innerHTML = data;\r\n            this.shadowRoot.appendChild(node);<\/span>\r\n        });\r\n    }\r\n    ...\r\n}\r\nif (!customElements.get('ui-range')) {\r\n    customElements.define('ui-range', uiRange);\r\n}<\/pre>\n<p>\u7531\u4e8efetch\u6267\u884c\u7684\u65f6\u5019\u662f\u4e2a\u5f02\u6b65\u7684\u8fc7\u7a0b\uff0c\u56e0\u6b64\u5e76\u4e0d\u4f1a\u53d1\u751f\u52a0\u8f7d\u963b\u585e\uff0c\u7406\u8bba\u6027\u80fd\u4f1a\u597d\u4e00\u70b9\u3002<\/p>\n<h4>\u4f18\u7f3a\u70b9<\/h4>\n<p>\u4f18\u70b9\u662f\u517c\u5bb9\u6027\u4e0d\u9519\uff0c\u652f\u6301Shadow DOM\u7684\u5143\u7d20\u5747\u652f\u6301\u6b64\u8bed\u6cd5\uff1b\u4ee5\u53ca\u6027\u80fd\u8fd8OK\u3002<\/p>\n<p>\u7f3a\u70b9\u662f\u4f7f\u7528\u7684\u65f6\u5019\u6bd4\u8f83\u5570\u55e6\uff0c\u4e5f\u5c31\u662f\u8bed\u53e5\u8f83\u591a\uff0c\u4ee5\u53ca\u611f\u89c9\u4e0d\u662f\u5f88\u6b63\u7edf\u3002<\/p>\n<p><span class=\"hidden\">\/\/zxx: \u5982\u679c\u4f60\u770b\u5230\u8fd9\u6bb5\u6587\u5b57\uff0c\u8bf4\u660e\u4f60\u73b0\u5728\u8bbf\u95ee\u662f\u4f53\u9a8c\u7cdf\u7cd5\u7684\u5783\u573e\u76d7\u7248\u7f51\u7ad9\uff0c\u4f60\u53ef\u4ee5\u8bbf\u95ee\u539f\u6587\u83b7\u5f97\u5f88\u597d\u7684\u4f53\u9a8c\uff1ahttps:\/\/www.zhangxinxu.com\/wordpress\/?p=9816\uff08\u4f5c\u8005\u5f20\u946b\u65ed\uff09<\/span><\/p>\n<p>\u5982\u679c\u4ece\u6b63\u7edf\u89d2\u5ea6\u6765\u8bf4\u7684\u8bdd\uff0c\u4e0b\u9762\u7684\u65b9\u6cd5\u662f\u6700\u5408\u9002\uff0c\u4e5f\u662f\u7406\u8bba\u4e0a\u5e94\u8be5\u63a8\u5d07\u7684\u5916\u90e8CSS\u5f15\u5165\u65b9\u6cd5\u3002<\/p>\n<h3>\u4e09\u3001\u4f5c\u4e3aCSS module import<\/h3>\n<p>\u6b64\u65b9\u6cd5\u4f7f\u7528\u6d4f\u89c8\u5668<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=7876\">\u539f\u751f\u7684import\u8bed\u6cd5<\/a>\uff0c\u4f46\u662fimport\u7684\u662fCSS\u6587\u4ef6\u800c\u4e0d\u662fJS\u6587\u4ef6\u3002<\/p>\n<p>\u4e5f\u5c31\u662f\u628aCSS\u6587\u4ef6\u76f4\u63a5\u4f5c\u4e3a\u6a21\u5757\u5f15\u5165\u3002<\/p>\n<p>\u76f8\u5173\u4ee3\u7801\u6f14\u793a\u5982\u4e0b\uff1a<\/p>\n<pre><span style=\"color:#cd0000;\">import styles from '.\/range.css';<\/span>\r\nclass uiRange extends HTMLElement {\r\n    constructor () {\r\n        super();\r\n\r\n        let shadow = this.attachShadow({\r\n            mode: 'open'\r\n        });\r\n        <span style=\"color:#cd0000;\">shadow.adoptedStyleSheets = [styles];<\/span>\r\n    }\r\n    ...\r\n}\r\nif (!customElements.get('ui-range')) {\r\n    customElements.define('ui-range', uiRange);\r\n}<\/pre>\n<p>\u7b80\u5355\u76842\u6b65\uff1a<\/p>\n<ol>\n<li>import\u5f15\u5165\uff1b<\/li>\n<li>adoptedStyleSheets\u91c7\u7528\uff1b<\/li>\n<\/ol>\n<p>\u8fd9\u4e2a\u65b9\u6cd5\u662f\u672c\u6587\u4ecb\u7ecd\u91cd\u70b9\uff0c\u56e0\u6b64\u6709demo\uff0c\u60a8\u53ef\u4ee5\u72e0\u72e0\u5730\u70b9\u51fb\u8fd9\u91cc\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/study\/202102\/import-css-in-web-components-demo.php\" rel=\"noopener\" target=\"_blank\">Web Components\u4e2dCSS\u6837\u5f0fimport\u5f15\u7528demo<\/a><\/p>\n<p>\u8bf4\u660e\uff1a\u7531\u4e8eCSS\u6587\u4ef6\u76f4\u63a5import\u8fd9\u4e2a\u8bed\u6cd5\u76ee\u524d\u4ec5Chrome\u53ca\u5176\u540c\u6837\u5185\u6838\u6d4f\u89c8\u5668\u652f\u6301\uff0c\u56e0\u6b64Firefox\u548cSafari\u4e0b\u4f7f\u7528\u7684\u662ffetch\u65b9\u6cd5\u3002<\/p>\n<h4>\u5173\u4e8eadoptedStyleSheets<\/h4>\n<p><code>adoptedStyleSheets<\/code>\u8fd9\u4e2aAPI\u65b9\u6cd5\u662f\u968f\u7740\u6837\u5f0f\u8868\u6784\u9020\uff08Constructed StyleSheets\uff09\u4e00\u8d77\u51fa\u73b0\u7684\u3002<\/p>\n<p>\u5b58\u5728\u4e0eshadowRoot\u548cdocument\u4e24\u4e2a\u5bf9\u8c61\u4e0a\uff0c\u7528\u6765\u8bbe\u7f6e\u6837\u5f0f\u3002<\/p>\n<p>\u4f8b\u5982\uff1a<\/p>\n<pre>document.adoptedStyleSheets;   <span style=\"color:green;\">\/\/ \u9ed8\u8ba4\u8fd4\u56de []<\/span><\/pre>\n<p><code>adoptedStyleSheets<\/code>\u7275\u626f\u5230\u7684\u65b0\u7684\u77e5\u8bc6\u70b9\u5f88\u591a\uff0c\u8fd9\u91cc\u4e0d\u5177\u4f53\u5c55\u5f00\uff0c\u4ee5\u540e\u6709\u673a\u4f1a\u66f4\u8be6\u7ec6\u4ecb\u7ecd\u3002<\/p>\n<h4>\u4f18\u7f3a\u70b9<\/h4>\n<p>\u4f18\u70b9\u662f\u4f7f\u7528\u65b9\u4fbf\u5feb\u6377\u4e14\u662f\u5b98\u65b9\u63a8\u8350\u65b9\u6cd5\uff0c\u6216\u8005\u662fimport CSS\u6a21\u5757\u5c31\u662f\u4e3a\u4e86\u8fd9\u4e2a\u573a\u666f\u624d\u652f\u6301\u7684\uff1b\u4ee5\u53ca\u6027\u80fdOK\uff0cimport\u672c\u8eab\u5c31\u662f\u5f02\u6b65\u8fc7\u7a0b\u3002<\/p>\n<p>\u7f3a\u70b9\u5c31\u662f\u517c\u5bb9\u6027\u4e0d\u884c\uff0c\u5982\u4e0b\u56fe\uff08\u6570\u636e\u6e90\u81eaMDN\u6587\u6863\uff09\uff0cFirefox\u548cSafari\u8fd8\u6ca1\u6709\u652f\u6301\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202102\/2021-02-13_223245.png\" width=\"615\" height=\"376\" alt=\"adoptedStyleSheets\u517c\u5bb9\u6027\" class=\"alignnone size-medium\" \/><\/p>\n<p>\u76ee\u524d\u4f7f\u7528\u8fd8\u4e0d\u592a\u6210\u719f\uff0c\u4e0d\u8fc7\u73b0\u5728\u6d4f\u89c8\u5668\u652f\u6301\u65b0\u7279\u6027\u90fd\u662f\u5f88\u5feb\u7684\u3002<\/p>\n<p>\u8bf4\u4e0d\u5b9a2\u5e74\u540e\u5c31\u53ef\u4ee5\u7528\u8d77\u6765\u4e86\u3002<\/p>\n<p>\u5176\u5b9e\uff0c\u914d\u5408\u4e00\u4e9b\u6253\u5305\u5de5\u5177\uff0c\u5b9e\u9645\u9879\u76ee\u4e2d\u4e5f\u662f\u53ef\u4ee5\u4f7f\u7528\u7684\u3002<\/p>\n<h3>\u56db\u30013\u4e2a\u65b9\u6cd5\u5bf9\u6bd4\u603b\u7ed3<\/h3>\n<p>\u6700\u540e\uff0c\u628a\u672c\u6587\u4ecb\u7ecd\u76843\u4e2a\u65b9\u6cd5\u518d\u4e00\u8d77\u5bf9\u6bd4\u603b\u7ed3\u4e0b\uff0c\u53c2\u89c1\u4e0b\u8868\uff1a<\/p>\n<style>td.error{color:red;}td.ok{color:green;}.params_table{margin:auto;}<\/style>\n<table border=\"0\" width=\"300\" class=\"params_table\" cellspacing=\"1\" >\n<thead>\n<tr>\n<th><\/th>\n<th>\u6027\u80fd\u597d<\/th>\n<th>\u4f7f\u7528\u4fbf\u6377<\/th>\n<th>\u517c\u5bb9\u6027\u597d<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th>@import<\/th>\n<td align=\"center\" class=\"error\">\u2718<\/td>\n<td align=\"center\" class=\"ok\">\u2714<\/td>\n<td align=\"center\" class=\"ok\">\u2714<\/td>\n<\/tr>\n<tr>\n<th>fetch<\/th>\n<td align=\"center\" class=\"ok\">\u2714<\/td>\n<td align=\"center\" class=\"error\">\u2718<\/td>\n<td align=\"center\" class=\"ok\">\u2714<\/td>\n<\/tr>\n<tr>\n<th>import<\/th>\n<td align=\"center\" class=\"ok\">\u2714<\/td>\n<td align=\"center\" class=\"ok\">\u2714<\/td>\n<td align=\"center\" class=\"error\">\u2718<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u53ef\u4ee5\u53d1\u73b0\uff0c\u7f3a\u70b9\u6bcf\u4e2a\u65b9\u6cd5\u5404\u5360\u4e00\u9879\u3002<\/p>\n<p>\u5176\u4e2d\uff0cimport\u65b9\u6cd5\u672a\u6765\u6700\u6709\u6f5c\u529b\uff0c\u56e0\u4e3a\uff0c\u517c\u5bb9\u6027\u53ef\u4ee5\u6162\u6162\u53d8\u597d\uff0c\u800c\u5176\u4ed6\u4e24\u4e2a\u65b9\u6cd5\u7684\u7f3a\u70b9\u5df2\u7ecf\u5b9a\u578b\u6ca1\u6551\u4e86\u3002<\/p>\n<p>\u5927\u5bb6\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u4f7f\u7528\u573a\u666f\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u6b63\u6587\u5185\u5bb9\uff0c\u611f\u8c22\u4f60\u7684\u9605\u8bfb\uff0c\u884c\u4e3a\u4ed3\u4fc3\uff0c\u5982\u6709\u9519\u8bef\uff0c\u6b22\u8fce\u6307\u6b63\u3002<\/p>\n<p>\u5982\u679c\u89c9\u5f97\u6587\u7ae0\u4e0d\u9519\uff0c\u4e5f\u6b22\u8fce\u5206\u4eab\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/image.zhangxinxu.com\/image\/emtion\/emoji\/2764.svg\" width=\"20\" height=\"20\" align=\"absmiddle\"><\/p>\n<p>\u770b\u5230\u4e0a\u9762\u7231\u5fc3\u56fe\u6807\u7a81\u7136\u60f3\u5230\u660e\u5929\u662f\u60c5\u4eba\u8282\uff0c\u54ce\u5440\uff0c\u7a81\u7136\u8111\u58f3\u75bc~~<\/p>\n<p>\u672c\u6587\u4e3a\u539f\u521b\u6587\u7ae0\uff0c\u6b22\u8fce\u5206\u4eab\uff0c\u52ff\u5168\u6587\u8f6c\u8f7d\uff0c\u5982\u679c\u5b9e\u5728\u559c\u6b22\uff0c\u53ef\u6536\u85cf\uff0c\u6c38\u4e0d\u8fc7\u671f\uff0c\u4e14\u4f1a\u53ca\u65f6\u66f4\u65b0\u77e5\u8bc6\u70b9\u53ca\u4fee\u6b63\u9519\u8bef\uff0c\u9605\u8bfb\u4f53\u9a8c\u4e5f\u66f4\u597d\u3002<br \/>\n\u672c\u6587\u5730\u5740\uff1a<a href=\"https:\/\/www.zhangxinxu.com\/wordpress\/?p=9816\">https:\/\/www.zhangxinxu.com\/wordpress\/?p=9816<\/a><\/p>\n<p>\uff08\u672c\u7bc7\u5b8c\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/image.zhangxinxu.com\/image\/blog\/202102\/import-css-cover.png\" width=\"160\" height=\"102\" alt=\"\u7231\u5fc3-\u60c5\u4eba\u8282\" class=\"alignright size-medium\" loading=\"lazy\" \/><\/p>\n<p>Web\u7ec4\u4ef6\u5f00\u53d1\u53ef\u80fd\u9700\u8981\u5f15\u5165\u5916\u90e8CSS\u5230Shadow DOM\u4e2d\uff0c\u672c\u6587\u5c31\u4ecb\u7ecd3\u79cd\u5404\u6709\u4f18\u7f3a\u70b9CSS import\u7684\u65b9\u6cd5\uff0c\u5e2e\u52a9\u5927\u5bb6\u66f4\u597d\u5730\u8fdb\u884cweb components\u7ec4\u4ef6\u5f00\u53d1\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,180],"tags":[1014,1714,1715,1291,1148,828,1222],"_links":{"self":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/9816"}],"collection":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/comments?post=9816"}],"version-history":[{"count":0,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/posts\/9816\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=9816"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=9816"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangxinxu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=9816"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}