{"id":28350,"date":"2024-11-24T11:42:00","date_gmt":"2024-11-24T03:42:00","guid":{"rendered":"https:\/\/fwq.ai\/blog\/28350\/"},"modified":"2024-11-24T11:42:00","modified_gmt":"2024-11-24T03:42:00","slug":"%e5%a6%82%e4%bd%95%e4%bc%98%e5%8c%96-elementui-el-collapse-%e5%b1%95%e5%bc%80%e6%97%b6%e5%8a%a0%e8%bd%bd%e6%95%b0%e6%8d%ae%e7%9a%84%e5%8d%a1%e9%a1%bf%e9%97%ae%e9%a2%98%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/28350\/","title":{"rendered":"\u5982\u4f55\u4f18\u5316 ElementUI el-collapse \u5c55\u5f00\u65f6\u52a0\u8f7d\u6570\u636e\u7684\u5361\u987f\u95ee\u9898\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173156274389556.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f18\u5316 ElementUI el-collapse \u5c55\u5f00\u65f6\u52a0\u8f7d\u6570\u636e\u7684\u5361\u987f\u95ee\u9898\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f18\u5316 ElementUI el-collapse \u5c55\u5f00\u65f6\u52a0\u8f7d\u6570\u636e\u7684\u5361\u987f\u95ee\u9898\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>elementui el-collapse \u52a0\u8f7d\u6570\u636e\u65f6\u7684\u5361\u987f\u4f18\u5316<\/strong><\/p>\n<p>\u5728\u4f7f\u7528 ElementUI \u7684 el-collapse \u65f6\uff0c\u5c55\u5f00\u7ec4\u4ef6\u65f6\u9700\u8981\u4ece\u63a5\u53e3\u83b7\u53d6\u6570\u636e\uff0c\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5361\u987f\u3002<\/p>\n<p><strong>\u539f\u56e0<\/strong><\/p>\n<p>\u5361\u987f\u7684\u539f\u56e0\u5728\u4e8e\uff0c\u5c55\u5f00 el-collapse \u65f6\uff0cVue \u4f1a\u52a8\u6001\u6e32\u67d3\u6570\u636e\uff0c\u8fd9\u4f1a\u5360\u7528\u5927\u91cf\u65f6\u95f4\u3002<\/p>\n<p><strong>\u4f18\u5316\u5efa\u8bae<\/strong><\/p>\n<p>\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u6b65\u9aa4\u4f18\u5316\uff1a<\/p>\n<ol>\n<li>\u7ed9 <strong>el-collapse-item<\/strong> \u7ec4\u4ef6\u6dfb\u52a0 v-loading \u5c5e\u6027\uff1a<\/li>\n<\/ol>\n<pre>&lt;el-collapse-item v-loading=\"loading\"&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li>\u4e3a\u7ec4\u4ef6\u6dfb\u52a0 loading \u6837\u5f0f\uff1a<\/li>\n<\/ol>\n<pre>.el-loading-mask {\n  background: rgba(255, 255, 255, 0.8);\n  animation: loading 1.4s infinite linear;\n}\n\n@keyframes loading {\n  0% {\n    transform: rotate(0deg);\n  }\n  100% {\n    transform: rotate(360deg);\n  }\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<ol>\n<li>\u5728\u70b9\u51fb\u5c55\u5f00\u65f6\u6dfb\u52a0 loading\uff0c\u6570\u636e\u52a0\u8f7d\u5b8c\u6210\u540e\u79fb\u9664 loading \u5e76\u5c55\u5f00\u9762\u677f\uff1a<\/li>\n<\/ol>\n<pre>handleExpand(name) {\n  this.loading = true;\n  this.$nextTick(() =&gt; {\n    \/\/ \u6570\u636e\u52a0\u8f7d\u5b8c\u6210\u540e\n    this.loading = false;\n    this.$refs[name].open();\n  });\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f18\u5316 ElementUI el-collapse \u5c55\u5f00\u65f6\u52a0\u8f7d\u6570\u636e\u7684\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>elementui el-collapse \u52a0\u8f7d\u6570\u636e\u65f6\u7684\u5361\u987f\u4f18\u5316 \u5728\u4f7f\u7528 ElementUI \u7684 el-collapse \u65f6\uff0c\u5c55\u5f00\u7ec4\u4ef6\u65f6\u9700\u8981\u4ece\u63a5\u53e3\u83b7\u53d6\u6570\u636e\uff0c\u8fd9\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5361\u987f\u3002 \u539f\u56e0 \u5361\u987f\u7684\u539f\u56e0\u5728\u4e8e\uff0c\u5c55\u5f00 el-collapse \u65f6\uff0cVue \u4f1a\u52a8\u6001\u6e32\u67d3\u6570\u636e\uff0c\u8fd9\u4f1a\u5360\u7528\u5927\u91cf\u65f6\u95f4\u3002 \u4f18\u5316\u5efa\u8bae \u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u6b65\u9aa4\u4f18\u5316\uff1a \u7ed9 el-collapse-item \u7ec4\u4ef6\u6dfb\u52a0 v-loading \u5c5e\u6027\uff1a &lt;el-collapse-item v-loading=&#8221;loading&#8221;&gt; \u767b\u5f55\u540e\u590d\u5236 \u4e3a\u7ec4\u4ef6\u6dfb\u52a0 loading \u6837\u5f0f\uff1a .el-loading-mask { background: rgba(255, 255, 255, 0.8); animation: loading 1.4s infinite linear; } @keyframes loading { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } \u767b\u5f55\u540e\u590d\u5236 \u5728\u70b9\u51fb\u5c55\u5f00\u65f6\u6dfb\u52a0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-28350","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28350","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=28350"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28350\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=28350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=28350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=28350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}