{"id":2719,"date":"2024-11-10T13:47:43","date_gmt":"2024-11-10T05:47:43","guid":{"rendered":"https:\/\/fwq.ai\/blog\/2719\/"},"modified":"2024-11-10T13:47:43","modified_gmt":"2024-11-10T05:47:43","slug":"vue-uniapp-%e4%b8%ad%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e7%b1%bb%e4%bc%bc%e5%9b%be%e7%89%87%e6%89%80%e7%a4%ba%e7%9a%84%e6%97%a5%e5%91%a8%e6%9c%88%e5%b9%b4%e5%88%87%e6%8d%a2%e6%a0%87%e7%ad%be%e6%95%88","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/2719\/","title":{"rendered":"Vue\/Uniapp \u4e2d\u5982\u4f55\u5b9e\u73b0\u7c7b\u4f3c\u56fe\u7247\u6240\u793a\u7684\u65e5\u5468\u6708\u5e74\u5207\u6362\u6807\u7b7e\u6548\u679c\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173086344999453.jpg\" class=\"aligncenter\" title=\"Vue\/Uniapp \u4e2d\u5982\u4f55\u5b9e\u73b0\u7c7b\u4f3c\u56fe\u7247\u6240\u793a\u7684\u65e5\u5468\u6708\u5e74\u5207\u6362\u6807\u7b7e\u6548\u679c\uff1f\u63d2\u56fe\" alt=\"Vue\/Uniapp \u4e2d\u5982\u4f55\u5b9e\u73b0\u7c7b\u4f3c\u56fe\u7247\u6240\u793a\u7684\u65e5\u5468\u6708\u5e74\u5207\u6362\u6807\u7b7e\u6548\u679c\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\/\u4e2d\uff0c\u5982\u4f55\u5b9e\u73b0\u7c7b\u4f3c\u56fe\u7247\u4e2d\u6548\u679c\u7684\u65e5\u5468\u6708\u5e74\u5207\u6362\u6807\u7b7e\uff1f<\/strong><\/p>\n<p>\u56fe\u7247\u4e2d\u5448\u73b0\u4e86\u56db\u4e2a\u6807\u7b7e\uff0c\u9009\u4e2d&#8221;\u65e5&#8221;\u540e\uff0c\u80cc\u666f\u53d8\u6210\u84dd\u8272\uff0c\u5b57\u4f53\u53d8\u6210\u767d\u8272\u3002\u800c\u5176\u4ed6\u672a\u9009\u4e2d\u7684\u6807\u7b7e\uff0c\u80cc\u666f\u4e3a\u7070\u8272\uff0c\u5b57\u4f53\u4e5f\u5448\u7070\u8272\u3002<\/p>\n<p>\u4e00\u4f4d\u7f51\u53cb\u901a\u8fc7\u7eafhtml\u5b9e\u73b0\u4e86\u4e00\u4e2a\u7b80\u6613\u7684\u7248\u672c\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre>&lt;div class=\"tabs\"&gt;\n  &lt;div class=\"tab active\"&gt;\u65e5&lt;\/div&gt;\n  &lt;div class=\"tab\"&gt;\u5468&lt;\/div&gt;\n  &lt;div class=\"tab\"&gt;\u6708&lt;\/div&gt;\n  &lt;div class=\"tab\"&gt;\u5e74&lt;\/div&gt;\n&lt;\/div&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5177\u4f53\u6548\u679c\uff0c\u53ef\u4ee5\u70b9\u5f00\u4e0a\u9762\u7684\u5730\u5740\u770b\u56fe\u7247\u3002<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<p>\u800c\u7c7b\u4f3c\u7684\u6548\u679c\uff0c\u4e5f\u53ef\u4ee5\u5728vue\/uniapp\u4e2d\u7528\u7a0d\u590d\u6742\u7684\u4ee3\u7801\u5b9e\u73b0\u3002\u8be6\u89c1\u4ee3\u7801\u91cc\u6ce8\u91ca\u7684\u90e8\u5206\uff1a<\/p>\n<pre>&lt;style&gt;\n  .tabs {\n    display: flex;\n    justify-content: space-between;\n    flex-direction: row;\n    background-color: #E1E1E1;\n    border-radius: 82px;\n    height: 82px;\n  }\n\n  .tab {\n    font-size: 36px;\n    color: rgba(69, 69, 68, 1);\n    width: 100%;\n    text-align: center;\n    line-height: 82px;\n  }\n\n  .tab.active {  \/\/ \u88ab\u9009\u4e2d\u6807\u7b7e\u7684\u6837\u5f0f\n    color: rgba(255, 255, 255, 1);\n    background-color: #31BDEC;\n    border-radius: 82px;\n  }\n&lt;\/style&gt;\n\n&lt;template&gt;\n  &lt;view class=\"tabs\"&gt;\n    &lt;view v-for=\"item in ['\u65e5', '\u5468', '\u6708', '\u5e74']\" :class=\"item==currentDay?'tab active':'tab'\" @click=\"changeDay(item)\"&gt;\n      {{ item }}\n    &lt;\/view&gt;\n  &lt;\/view&gt;\n&lt;\/template&gt;\n\n&lt;script&gt;\nexport default {\n  data () {\n    return {\n      currentDay: '\u65e5',\n    }\n  },\n  methods: {\n    changeDay (day) {\n      this.currentDay = day\n    }\n  }\n}\n&lt;\/script&gt;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fVue\/Uniapp \u4e2d\u5982\u4f55\u5b9e\u73b0\u7c7b\u4f3c\u56fe\u7247\u6240\u793a\u7684\u65e5\u5468\u6708\u5e74\u5207\u6362\u6807\u7b7e\u6548\u679c\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>\/\u4e2d\uff0c\u5982\u4f55\u5b9e\u73b0\u7c7b\u4f3c\u56fe\u7247\u4e2d\u6548\u679c\u7684\u65e5\u5468\u6708\u5e74\u5207\u6362\u6807\u7b7e\uff1f \u56fe\u7247\u4e2d\u5448\u73b0\u4e86\u56db\u4e2a\u6807\u7b7e\uff0c\u9009\u4e2d&#8221;\u65e5&#8221;\u540e\uff0c\u80cc\u666f\u53d8\u6210\u84dd\u8272\uff0c\u5b57\u4f53\u53d8\u6210\u767d\u8272\u3002\u800c\u5176\u4ed6\u672a\u9009\u4e2d\u7684\u6807\u7b7e\uff0c\u80cc\u666f\u4e3a\u7070\u8272\uff0c\u5b57\u4f53\u4e5f\u5448\u7070\u8272\u3002 \u4e00\u4f4d\u7f51\u53cb\u901a\u8fc7\u7eafhtml\u5b9e\u73b0\u4e86\u4e00\u4e2a\u7b80\u6613\u7684\u7248\u672c\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a &lt;div class=&#8221;tabs&#8221;&gt; &lt;div class=&#8221;tab active&#8221;&gt;\u65e5&lt;\/div&gt; &lt;div class=&#8221;tab&#8221;&gt;\u5468&lt;\/div&gt; &lt;div class=&#8221;tab&#8221;&gt;\u6708&lt;\/div&gt; &lt;div class=&#8221;tab&#8221;&gt;\u5e74&lt;\/div&gt; &lt;\/div&gt; \u767b\u5f55\u540e\u590d\u5236 \u5177\u4f53\u6548\u679c\uff0c\u53ef\u4ee5\u70b9\u5f00\u4e0a\u9762\u7684\u5730\u5740\u770b\u56fe\u7247\u3002 \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u800c\u7c7b\u4f3c\u7684\u6548\u679c\uff0c\u4e5f\u53ef\u4ee5\u5728vue\/uniapp\u4e2d\u7528\u7a0d\u590d\u6742\u7684\u4ee3\u7801\u5b9e\u73b0\u3002\u8be6\u89c1\u4ee3\u7801\u91cc\u6ce8\u91ca\u7684\u90e8\u5206\uff1a &lt;style&gt; .tabs { display: flex; justify-content: space-between; flex-direction: row; background-color: #E1E1E1; border-radius: 82px; height: 82px; } .tab { font-size: 36px; color: rgba(69, 69, 68, 1); width: 100%; text-align: center; line-height: 82px; } .tab.active { \/\/ \u88ab\u9009\u4e2d\u6807\u7b7e\u7684\u6837\u5f0f [&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-2719","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2719","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=2719"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2719\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=2719"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=2719"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=2719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}