{"id":52772,"date":"2024-12-03T14:34:53","date_gmt":"2024-12-03T06:34:53","guid":{"rendered":"https:\/\/fwq.ai\/blog\/52772\/"},"modified":"2024-12-03T14:34:53","modified_gmt":"2024-12-03T06:34:53","slug":"%e7%a7%bb%e5%8a%a8%e7%ab%af-h5-%e5%bc%80%e5%8f%91%e4%b8%ad%e5%a6%82%e4%bd%95%e9%81%bf%e5%85%8d%e5%ba%95%e9%83%a8-tab-%e6%a0%8f%e5%88%87%e6%8d%a2%e5%af%bc%e8%87%b4%e9%a1%b5%e9%9d%a2%e5%8d%b8%e8%bd%bd-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/52772\/","title":{"rendered":"\u79fb\u52a8\u7aef H5 \u5f00\u53d1\u4e2d\u5982\u4f55\u907f\u514d\u5e95\u90e8 Tab \u680f\u5207\u6362\u5bfc\u81f4\u9875\u9762\u5378\u8f7d\u548c\u6570\u636e\u91cd\u65b0\u52a0\u8f7d\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u79fb\u52a8\u7aef H5 \u5f00\u53d1\u4e2d\u5982\u4f55\u907f\u514d\u5e95\u90e8 Tab \u680f\u5207\u6362\u5bfc\u81f4\u9875\u9762\u5378\u8f7d\u548c\u6570\u636e\u91cd\u65b0\u52a0\u8f7d\uff1f<\/h1>\n<p>\u77e5\u8bc6\u70b9\u638c\u63e1\u4e86\uff0c\u8fd8\u9700\u8981\u4e0d\u65ad\u7ec3\u4e60\u624d\u80fd\u719f\u7ec3\u8fd0\u7528\u3002\u4e0b\u9762\u7c73\u4e91\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u4e2a\u6587\u7ae0\u5f00\u53d1\u5b9e\u6218\uff0c\u624b\u628a\u624b\u6559\u5927\u5bb6\u5b66\u4e60\u300a\u79fb\u52a8\u7aef H5 \u5f00\u53d1\u4e2d\u5982\u4f55\u907f\u514d\u5e95\u90e8 Tab \u680f\u5207\u6362\u5bfc\u81f4\u9875\u9762\u5378\u8f7d\u548c\u6570\u636e\u91cd\u65b0\u52a0\u8f7d\uff1f\u300b\uff0c\u5728\u5b9e\u73b0\u529f\u80fd\u7684\u8fc7\u7a0b\u4e2d\u4e5f\u5e26\u5927\u5bb6\u91cd\u65b0\u6e29\u4e60\u76f8\u5173\u77e5\u8bc6\u70b9\uff0c\u6e29\u6545\u800c\u77e5\u65b0\uff0c\u56de\u5934\u770b\u770b\u8bf4\u4e0d\u5b9a\u53c8\u6709\u4e0d\u4e00\u6837\u7684\u611f\u609f\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241123\/173233677867415c8aa7589.jpg\" class=\"aligncenter\" title=\"\u79fb\u52a8\u7aef H5 \u5f00\u53d1\u4e2d\u5982\u4f55\u907f\u514d\u5e95\u90e8 Tab \u680f\u5207\u6362\u5bfc\u81f4\u9875\u9762\u5378\u8f7d\u548c\u6570\u636e\u91cd\u65b0\u52a0\u8f7d\uff1f\u63d2\u56fe\" alt=\"\u79fb\u52a8\u7aef H5 \u5f00\u53d1\u4e2d\u5982\u4f55\u907f\u514d\u5e95\u90e8 Tab \u680f\u5207\u6362\u5bfc\u81f4\u9875\u9762\u5378\u8f7d\u548c\u6570\u636e\u91cd\u65b0\u52a0\u8f7d\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u79fb\u52a8\u7aef h5 \u5f00\u53d1\u4e2d\u5e95\u90e8 tab \u680f\u5207\u6362\u529f\u80fd\u7684\u8bbe\u8ba1<\/strong><\/p>\n<p>\u5728\u79fb\u52a8\u7aef h5 \u5f00\u53d1\u4e2d\uff0c\u5e95\u90e8 tab \u680f\u5207\u6362\u662f\u4e00\u4e2a\u5e38\u89c1\u7684\u9700\u6c42\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u4e00\u79cd\u6709\u6548\u7684\u8bbe\u8ba1\u6a21\u5f0f\uff0c\u89e3\u51b3\u5207\u6362 tab \u65f6\u9875\u9762\u5378\u8f7d\u548c\u6570\u636e\u91cd\u65b0\u52a0\u8f7d\u7684\u95ee\u9898\u3002<\/p>\n<p><strong>\u95ee\u9898\u5206\u6790<\/strong><\/p>\n<p>\u6700\u521d\uff0c\u91c7\u7528\u8def\u7531\u5d4c\u5957\u7684\u8bbe\u8ba1\u65b9\u6cd5\uff0c\u4f7f\u5f97\u6bcf\u4e2a tab \u90fd\u662f\u4e00\u4e2a\u72ec\u7acb\u7684\u8def\u7531\u3002\u4f46\u8fd9\u79cd\u8bbe\u8ba1\u5b58\u5728\u4ee5\u4e0b\u95ee\u9898\uff1a<\/p>\n<ul>\n<li>\u5207\u6362 tab \u65f6\u9875\u9762\u4f1a\u5378\u8f7d\uff0c\u5bfc\u81f4\u6570\u636e\u91cd\u65b0\u52a0\u8f7d\u3002<\/li>\n<li>\u65e0\u6cd5\u4fdd\u7559\u9875\u9762\u6eda\u52a8\u9ad8\u5ea6\u3002<\/li>\n<\/ul>\n<p><strong>\u89e3\u51b3\u65b9\u6848<\/strong><\/p>\n<p>\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\uff0c\u6211\u4eec\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u8bbe\u8ba1\u6a21\u5f0f\uff1a<\/p>\n<ul>\n<li>\u4f7f\u7528\u7ec4\u4ef6\u5316\u8bbe\u8ba1\uff0c\u5c06 tab \u7ec4\u4ef6\u5316\u3002<\/li>\n<li>\u901a\u8fc7\u63a7\u5236\u7ec4\u4ef6\u7684\u663e\u9690\u5207\u6362 tab\u3002<\/li>\n<\/ul>\n<p>\u5177\u4f53\u5b9e\u73b0\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\u5728\u4e00\u4e2a\u9875\u9762\u4e2d\u5f15\u5165 tab \u7ec4\u4ef6\uff0c\u5206\u522b\u8d1f\u8d23 tab \u5bfc\u822a\u548c\u5185\u5bb9\u663e\u793a\u3002<\/li>\n<li>\u6839\u636e\u5f53\u524d\u8def\u7531\u72b6\u6001\uff0c\u63a7\u5236 tab \u7ec4\u4ef6\u7684\u663e\u9690\u3002<\/li>\n<li>\u4f7f\u7528 vue-router \u7684 keep-alive \u7ec4\u4ef6\u4fdd\u5b58\u5728 tab \u4e2d\u6e32\u67d3\u7684\u5185\u5bb9\u3002<\/li>\n<\/ol>\n<p>\u8fd9\u6837\uff0c\u5207\u6362 tab \u65f6\u53ea\u9700\u8981\u63a7\u5236 tab \u7ec4\u4ef6\u7684\u663e\u9690\u5373\u53ef\uff0c\u65e0\u9700\u91cd\u65b0\u52a0\u8f7d\u9875\u9762\u6216\u91cd\u65b0\u83b7\u53d6\u6570\u636e\uff0c\u9875\u9762\u6eda\u52a8\u9ad8\u5ea6\u4e5f\u80fd\u5f97\u5230\u4fdd\u7559\u3002<\/p>\n<p><strong>\u793a\u4f8b\u4ee3\u7801<\/strong><\/p>\n<pre>&lt;template&gt;\n  &lt;div&gt;\n    &lt;tab-nav :active-tab=\"activeTab\" @tab-change=\"onTabChange\" \/&gt;\n    &lt;keep-alive&gt;\n      &lt;router-view \/&gt;\n    &lt;\/keep-alive&gt;\n  &lt;\/div&gt;\n&lt;\/template&gt;\n\n&lt;script&gt;\nimport TabNav from 'path\/to\/TabNav.vue'\n\nexport default {\n  components: { TabNav },\n  data() {\n    return {\n      activeTab: 'tab1'\n    }\n  },\n  methods: {\n    onTabChange(activeTab) {\n      this.activeTab = activeTab\n    }\n  }\n}\n&lt;\/script&gt;<\/pre>\n<p>\u4ee5\u4e0a\u5c31\u662f\u300a\u79fb\u52a8\u7aef H5 \u5f00\u53d1\u4e2d\u5982\u4f55\u907f\u514d\u5e95\u90e8 Tab \u680f\u5207\u6362\u5bfc\u81f4\u9875\u9762\u5378\u8f7d\u548c\u6570\u636e\u91cd\u65b0\u52a0\u8f7d\uff1f\u300b\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u5173\u4e8e\u7684\u8d44\u6599\u8bf7\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff01<\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   Win11\u5c0f\u5a1c\u53ef\u4ee5\u8bed\u97f3\u5524\u9192\u5417 Win11\u5c0f\u5a1c\u662f\u5426\u53ef\u4ee5\u8bed\u97f3\u5524\u9192\u8be6\u60c5\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u79fb\u52a8\u7aef H5 \u5f00\u53d1\u4e2d\u5982\u4f55\u907f\u514d\u5e95\u90e8 Tab \u680f\u5207\u6362\u5bfc\u81f4\u9875\u9762\u5378\u8f7d\u548c\u6570\u636e\u91cd\u65b0\u52a0\u8f7d\uff1f \u77e5\u8bc6\u70b9\u638c\u63e1\u4e86\uff0c\u8fd8\u9700\u8981\u4e0d\u65ad\u7ec3\u4e60\u624d\u80fd\u719f\u7ec3\u8fd0\u7528\u3002\u4e0b\u9762\u7c73\u4e91\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u4e2a\u6587\u7ae0\u5f00\u53d1\u5b9e\u6218\uff0c\u624b\u628a\u624b\u6559\u5927\u5bb6\u5b66\u4e60\u300a\u79fb\u52a8\u7aef H5 \u5f00\u53d1\u4e2d\u5982\u4f55\u907f\u514d\u5e95\u90e8 Tab \u680f\u5207\u6362\u5bfc\u81f4\u9875\u9762\u5378\u8f7d\u548c\u6570\u636e\u91cd\u65b0\u52a0\u8f7d\uff1f\u300b\uff0c\u5728\u5b9e\u73b0\u529f\u80fd\u7684\u8fc7\u7a0b\u4e2d\u4e5f\u5e26\u5927\u5bb6\u91cd\u65b0\u6e29\u4e60\u76f8\u5173\u77e5\u8bc6\u70b9\uff0c\u6e29\u6545\u800c\u77e5\u65b0\uff0c\u56de\u5934\u770b\u770b\u8bf4\u4e0d\u5b9a\u53c8\u6709\u4e0d\u4e00\u6837\u7684\u611f\u609f\uff01 \u79fb\u52a8\u7aef h5 \u5f00\u53d1\u4e2d\u5e95\u90e8 tab \u680f\u5207\u6362\u529f\u80fd\u7684\u8bbe\u8ba1 \u5728\u79fb\u52a8\u7aef h5 \u5f00\u53d1\u4e2d\uff0c\u5e95\u90e8 tab \u680f\u5207\u6362\u662f\u4e00\u4e2a\u5e38\u89c1\u7684\u9700\u6c42\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u4e00\u79cd\u6709\u6548\u7684\u8bbe\u8ba1\u6a21\u5f0f\uff0c\u89e3\u51b3\u5207\u6362 tab \u65f6\u9875\u9762\u5378\u8f7d\u548c\u6570\u636e\u91cd\u65b0\u52a0\u8f7d\u7684\u95ee\u9898\u3002 \u95ee\u9898\u5206\u6790 \u6700\u521d\uff0c\u91c7\u7528\u8def\u7531\u5d4c\u5957\u7684\u8bbe\u8ba1\u65b9\u6cd5\uff0c\u4f7f\u5f97\u6bcf\u4e2a tab \u90fd\u662f\u4e00\u4e2a\u72ec\u7acb\u7684\u8def\u7531\u3002\u4f46\u8fd9\u79cd\u8bbe\u8ba1\u5b58\u5728\u4ee5\u4e0b\u95ee\u9898\uff1a \u5207\u6362 tab \u65f6\u9875\u9762\u4f1a\u5378\u8f7d\uff0c\u5bfc\u81f4\u6570\u636e\u91cd\u65b0\u52a0\u8f7d\u3002 \u65e0\u6cd5\u4fdd\u7559\u9875\u9762\u6eda\u52a8\u9ad8\u5ea6\u3002 \u89e3\u51b3\u65b9\u6848 \u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\uff0c\u6211\u4eec\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u8bbe\u8ba1\u6a21\u5f0f\uff1a \u4f7f\u7528\u7ec4\u4ef6\u5316\u8bbe\u8ba1\uff0c\u5c06 tab \u7ec4\u4ef6\u5316\u3002 \u901a\u8fc7\u63a7\u5236\u7ec4\u4ef6\u7684\u663e\u9690\u5207\u6362 tab\u3002 \u5177\u4f53\u5b9e\u73b0\u5982\u4e0b\uff1a \u5728\u4e00\u4e2a\u9875\u9762\u4e2d\u5f15\u5165 tab \u7ec4\u4ef6\uff0c\u5206\u522b\u8d1f\u8d23 tab \u5bfc\u822a\u548c\u5185\u5bb9\u663e\u793a\u3002 \u6839\u636e\u5f53\u524d\u8def\u7531\u72b6\u6001\uff0c\u63a7\u5236 tab \u7ec4\u4ef6\u7684\u663e\u9690\u3002 \u4f7f\u7528 vue-router \u7684 keep-alive \u7ec4\u4ef6\u4fdd\u5b58\u5728 tab \u4e2d\u6e32\u67d3\u7684\u5185\u5bb9\u3002 \u8fd9\u6837\uff0c\u5207\u6362 tab [&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-52772","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52772","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=52772"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52772\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=52772"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=52772"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=52772"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}