{"id":52950,"date":"2024-12-03T09:17:22","date_gmt":"2024-12-03T01:17:22","guid":{"rendered":"https:\/\/fwq.ai\/blog\/52950\/"},"modified":"2024-12-03T09:17:22","modified_gmt":"2024-12-03T01:17:22","slug":"vue-%e8%a1%a8%e6%a0%bc%e5%90%88%e5%b9%b6%e5%8d%95%e5%85%83%e6%a0%bc%e5%90%8e%ef%bc%8c%e5%a6%82%e4%bd%95%e5%8e%bb%e9%99%a4%e5%a4%9a%e4%bd%99%e6%95%b0%e6%8d%ae%ef%bc%9f-3","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/52950\/","title":{"rendered":"Vue \u8868\u683c\u5408\u5e76\u5355\u5143\u683c\u540e\uff0c\u5982\u4f55\u53bb\u9664\u591a\u4f59\u6570\u636e\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>Vue \u8868\u683c\u5408\u5e76\u5355\u5143\u683c\u540e\uff0c\u5982\u4f55\u53bb\u9664\u591a\u4f59\u6570\u636e\uff1f <\/h1>\n<p>\u4eca\u5929\u7c73\u4e91\u7ed9\u5927\u5bb6\u5e26\u6765\u4e86<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300aVue \u8868\u683c\u5408\u5e76\u5355\u5143\u683c\u540e\uff0c\u5982\u4f55\u53bb\u9664\u591a\u4f59\u6570\u636e\uff1f \u300b<\/span>\uff0c\u5176\u4e2d\u6d89\u53ca\u5230\u7684\u77e5\u8bc6\u70b9\u5305\u62ec<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\uff0c\u65e0\u8bba\u4f60\u662f\u5c0f\u767d\u8fd8\u662f\u8001\u624b\uff0c\u90fd\u9002\u5408\u770b\u4e00\u770b\u54e6~\u6709\u597d\u7684\u5efa\u8bae\u4e5f\u6b22\u8fce\u5927\u5bb6\u5728\u8bc4\u8bba\u7559\u8a00\uff0c\u82e5\u662f\u770b\u5b8c\u6709\u6240\u6536\u83b7\uff0c\u4e5f\u5e0c\u671b\u5927\u5bb6\u80fd\u591a\u591a\u70b9\u8d5e\u652f\u6301\u5440\uff01\u4e00\u8d77\u52a0\u6cb9\u5b66\u4e60~<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241125\/17324955396743c8b3df30e.jpg\" class=\"aligncenter\" title=\"Vue \u8868\u683c\u5408\u5e76\u5355\u5143\u683c\u540e\uff0c\u5982\u4f55\u53bb\u9664\u591a\u4f59\u6570\u636e\uff1f\u63d2\u56fe\" alt=\"Vue \u8868\u683c\u5408\u5e76\u5355\u5143\u683c\u540e\uff0c\u5982\u4f55\u53bb\u9664\u591a\u4f59\u6570\u636e\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>vue \u539f\u751ftable\u5408\u5e76\u5355\u5143\u683c\uff0c\u5982\u4f55\u53bb\u9664\u591a\u4f59\u6570\u636e\uff1f<\/strong><\/p>\n<p>\u5728\u4f7f\u7528\u539f\u751ftable\u5408\u5e76\u5355\u5143\u683c\u7684\u65f6\u5019\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u8d85\u51fa\u5408\u5e76\u8303\u56f4\u7684\u6570\u636e\u540e\u79fb\u7684\u95ee\u9898\u3002\u4ee5\u5982\u4e0b\u6570\u636e\u4e3a\u4f8b\uff1a<\/p>\n<pre>data_list:  [\n            {\n                question_code: \"63\",\n                module_id: \"20\",\n                module_name: \"\u52a1\u6548\u505a\u4f8b\u79bb\u573a\",\n                sub_tool_code: \"51\",\n                content_code: \"97\",\n                question_type: 90,\n                merge_number:1,\n                item_attr: 42,\n                item_attr_name: '\u666e\u901a\u9898\u76ee',\n                opr_date: \"1982-10-09\"\n            },\n             {\n                question_code: \"63\",\n                module_id: \"20\",\n                module_name: \"\u52a1\u6548\u505a\u4f8b\u79bb\u573a\",\n                sub_tool_code: \"51\",\n                content_code: \"97\",\n                question_type: 90,\n                merge_number:1,\n                item_attr: 42,\n                item_attr_name: '\u666e\u901a\u9898\u76ee2',\n                opr_date: \"1982-10-09\"\n            },\n            {\n                question_code: \"63\",\n                module_id: \"20\",\n                module_name: \"\u52a1\u6548\u505a\u4f8b\u79bb\u573a\",\n                sub_tool_code: \"51\",\n                content_code: \"97\",\n                question_type: 90,\n                merge_number:2,\n                item_attr: 42,\n                item_attr_name: '\u666e\u901a\u9898\u76ee',\n                opr_date: \"1982-10-09\"\n            },\n            {\n                question_code: \"63\",\n                module_id: \"20\",\n                module_name: \"\u52a1\u6548\u505a\u4f8b\u79bb\u573a\",\n                sub_tool_code: \"51\",\n                content_code: \"97\",\n                question_type: 90,\n                merge_number:2,\n                item_attr: 42,\n                item_attr_name: '\u666e\u901a\u9898\u76ee',\n                opr_date: \"1982-10-09\"\n            }\n        ]<\/pre>\n<p>\u60f3\u8981\u5c06merge_number\u5927\u4e8e2\u7684\u5355\u5143\u683c\u5408\u5e76\uff0c\u5e76\u5c06item_attr_name\u6570\u636e\u663e\u793a\u5728\u5408\u5e76\u540e\u7684\u5355\u5143\u683c\u4e2d\u3002\u7136\u800c\uff0c\u76ee\u524d\u8868\u683c\u4e2d\u7684\u6570\u636e\u51fa\u73b0\u4e86\u540e\u79fb\u95ee\u9898\uff0c\u9700\u8981\u53bb\u9664\u591a\u4f59\u7684\u6570\u636e\u3002<\/p>\n<p>\u89e3\u51b3\u65b9\u6848\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\n<p><strong>\u5bf9\u6570\u636e\u8fdb\u884c\u5904\u7406<\/strong><\/p>\n<p>\u4e3a\u4e86\u5904\u7406\u5408\u5e76\u5355\u5143\u683c\uff0c\u6211\u4eec\u9700\u8981\u521b\u5efa\u4e00\u4e2amerge\u53d8\u91cf\u6765\u8ddf\u8e2a\u8981\u5408\u5e76\u7684\u884c\u6570\u3002\u7136\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u904d\u5386\u6570\u636e\uff0c\u4e3a\u6bcf\u4e2a\u884c\u8bbe\u7f6emerge_number\u3002\u5982\u679cmerge_number\u5927\u4e8e1\uff0c\u5219\u9012\u51cfmerge\u3002\u5982\u679cmerge\u5927\u4e8e0\uff0c\u5219\u5ffd\u7565\u8be5\u884c\u3002<\/p>\n<p>\u4f7f\u7528JavaScript\u4ee3\u7801\uff0c\u53ef\u4ee5\u5728Vue\u4e4b\u5916\u8fdb\u884c\u5904\u7406\uff1a<\/p>\n<pre>\/\/ \u5047\u8bbe data \u662f\u9898\u4e2d\u63d0\u4f9b\u7684\u6570\u636e\nimport { data } from \".\/data.js\";\n\nconst data_list = ((data) =&gt; {\n  let merge = 0;\n  data.forEach((row) =&gt; {\n    if (merge &gt; 0) {\n      row.merge_number = 0;\n    } else {\n      merge = row.merge_number;\n    }\n    merge--;\n  });\n  return data;\n})(data);<\/pre>\n<\/li>\n<li>\n<p><strong>\u5728Vue\u4e2d\u6e32\u67d3<\/strong><\/p>\n<p>\u5728Vue\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u5224\u65admerge_number\u662f\u5426\u5927\u4e8e0\uff0c\u5982\u679c\u4e0d\u5927\u4e8e0\uff0c\u5219\u4e0d\u6e32\u67d3\u5bf9\u5e94\u7684\u5355\u5143\u683c\u3002<\/p>\n<pre>&lt;template v-if=\"item.merge_number &gt; 0\"&gt;\n  &lt;td :rowspan=\"item.merge_number\"&gt;{{ item.item_attr }}&lt;\/td&gt;\n  &lt;td :rowspan=\"item.merge_number\"&gt;{{ item.operate_time }}&lt;\/td&gt;\n&lt;\/template&gt;<\/pre>\n<\/li>\n<\/ol>\n<p>\u8fd9\u6837\u5904\u7406\u540e\uff0c\u591a\u4f59\u7684\u6570\u636e\u5c06\u88ab\u9690\u85cf\uff0c\u5408\u5e76\u5355\u5143\u683c\u4e5f\u4f1a\u6309\u9884\u671f\u663e\u793a\u3002<\/p>\n<p>\u4eca\u5929\u5173\u4e8e\u300aVue \u8868\u683c\u5408\u5e76\u5355\u5143\u683c\u540e\uff0c\u5982\u4f55\u53bb\u9664\u591a\u4f59\u6570\u636e\uff1f \u300b\u7684\u5185\u5bb9\u5c31\u4ecb\u7ecd\u5230\u8fd9\u91cc\u4e86\uff0c\u662f\u4e0d\u662f\u5b66\u8d77\u6765\u4e00\u76ee\u4e86\u7136\uff01\u60f3\u8981\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u7684\u5185\u5bb9\u8bf7\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff01<\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   win7\u600e\u4e48\u66f4\u6539\u5168\u5c40\u5b57\u4f53\u5927\u5c0f win7\u5168\u5c40\u5b57\u4f53\u5927\u5c0f\u66f4\u6539\u6559\u7a0b\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>Vue \u8868\u683c\u5408\u5e76\u5355\u5143\u683c\u540e\uff0c\u5982\u4f55\u53bb\u9664\u591a\u4f59\u6570\u636e\uff1f \u4eca\u5929\u7c73\u4e91\u7ed9\u5927\u5bb6\u5e26\u6765\u4e86\u300aVue \u8868\u683c\u5408\u5e76\u5355\u5143\u683c\u540e\uff0c\u5982\u4f55\u53bb\u9664\u591a\u4f59\u6570\u636e\uff1f \u300b\uff0c\u5176\u4e2d\u6d89\u53ca\u5230\u7684\u77e5\u8bc6\u70b9\u5305\u62ec\u7b49\u7b49\uff0c\u65e0\u8bba\u4f60\u662f\u5c0f\u767d\u8fd8\u662f\u8001\u624b\uff0c\u90fd\u9002\u5408\u770b\u4e00\u770b\u54e6~\u6709\u597d\u7684\u5efa\u8bae\u4e5f\u6b22\u8fce\u5927\u5bb6\u5728\u8bc4\u8bba\u7559\u8a00\uff0c\u82e5\u662f\u770b\u5b8c\u6709\u6240\u6536\u83b7\uff0c\u4e5f\u5e0c\u671b\u5927\u5bb6\u80fd\u591a\u591a\u70b9\u8d5e\u652f\u6301\u5440\uff01\u4e00\u8d77\u52a0\u6cb9\u5b66\u4e60~ vue \u539f\u751ftable\u5408\u5e76\u5355\u5143\u683c\uff0c\u5982\u4f55\u53bb\u9664\u591a\u4f59\u6570\u636e\uff1f \u5728\u4f7f\u7528\u539f\u751ftable\u5408\u5e76\u5355\u5143\u683c\u7684\u65f6\u5019\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u8d85\u51fa\u5408\u5e76\u8303\u56f4\u7684\u6570\u636e\u540e\u79fb\u7684\u95ee\u9898\u3002\u4ee5\u5982\u4e0b\u6570\u636e\u4e3a\u4f8b\uff1a data_list: [ { question_code: &#8220;63&#8221;, module_id: &#8220;20&#8221;, module_name: &#8220;\u52a1\u6548\u505a\u4f8b\u79bb\u573a&#8221;, sub_tool_code: &#8220;51&#8221;, content_code: &#8220;97&#8221;, question_type: 90, merge_number:1, item_attr: 42, item_attr_name: &#8216;\u666e\u901a\u9898\u76ee&#8217;, opr_date: &#8220;1982-10-09&#8221; }, { question_code: &#8220;63&#8221;, module_id: &#8220;20&#8221;, module_name: &#8220;\u52a1\u6548\u505a\u4f8b\u79bb\u573a&#8221;, sub_tool_code: &#8220;51&#8221;, content_code: &#8220;97&#8221;, question_type: 90, merge_number:1, item_attr: 42, item_attr_name: &#8216;\u666e\u901a\u9898\u76ee2&#8217;, opr_date: &#8220;1982-10-09&#8221; }, { question_code: &#8220;63&#8221;, [&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-52950","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52950","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=52950"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52950\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=52950"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=52950"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=52950"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}