{"id":9917,"date":"2022-09-22T11:14:20","date_gmt":"2022-09-22T03:14:20","guid":{"rendered":"https:\/\/blog.ywdevops.cn\/?p=9917"},"modified":"2022-11-14T12:05:47","modified_gmt":"2022-11-14T04:05:47","slug":"page-2","status":"publish","type":"post","link":"https:\/\/blog.ywdevops.cn\/index.php\/2022\/09\/22\/page-2\/","title":{"rendered":"vue\u9875\u9762\u5b9e\u73b0\u5206\u9875\u529f\u80fd"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u5206\u9875\u529f\u80fd\u5206\u4e3a\u524d\u7aef\u5206\u9875\u548c\u540e\u7aef\u5206\u9875\uff0c\u524d\u7aef\u5206\u9875\u5c31\u662f\u7528\u8bf7\u6c42\u4ece\u540e\u53f0\u628a\u6240\u6709\u7684\u6570\u636e\u62ff\u4e0b\u6765\uff0c\u7136\u540e\u8fdb\u884c\u5206\u9875\uff0c\u5982\u679c\u5f53\u6570\u636e\u8db3\u591f\u5927\u65f6\uff0c\u7f51\u9875\u5c31\u4f1a\u52a0\u8f7d\u7684\u5f88\u6162\uff0c\u552f\u4e00\u7684\u597d\u5904\u5c31\u662f\u53ea\u9700\u8981\u5411\u540e\u53f0\u8bf7\u6c42\u4e00\u6b21\u5c31\u53ef\u4ee5\u4e86<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u540e\u7aef\u5206\u9875\u5c31\u662f\u6570\u636e\u5728\u540e\u53f0\u5df2\u7ecf\u5206\u597d\u9875\u4e86\uff0c\u524d\u7aef\u53ea\u9700\u8981\u7528\u8bf7\u6c42\u53bb\u83b7\u53d6\u6570\u636e\u5373\u53ef\uff0c\u540e\u7aef\u5206\u9875\u7684\u597d\u5904\u662f\u53ea\u4f1a\u628a\u5f53\u524d\u9875\u7684\u6570\u636e\u7ed9\u62ff\u4e0b\u6765\uff0c\u7f51\u9875\u52a0\u8f7d\u7684\u901f\u5ea6\u4f1a\u5f88\u5feb\uff0c\u4f46\u662f\u4e0d\u8db3\u5c31\u662f\u6bcf\u8df3\u8f6c\u4e00\u6b21\uff0c\u524d\u7aef\u90fd\u8981\u5411\u540e\u53f0\u53d1\u9001\u4e00\u6b21\u8bf7\u6c42<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u4f8b\u5b50\u4e2d\u6f14\u793a\u7684\u5c31\u662f\u540e\u7aef\u5206\u9875\u529f\u80fd\uff0c\u56e0\u4e3a\u5728\u540e\u53f0\u5199\u4e86pagesize\u7684\u503c\u4e3a10\uff0c\u4e5f\u5c31\u662f\u4e00\u9875\u4e2d\u663e\u793a\u7684\u8bb0\u5f55\u6570\u4e3a10\uff0c\u56e0\u6b64\u6b64\u4f8b\u5b50\u4e2d\u6211\u4eec\u53ea\u4f20\u9012\u9875\u6570\u5373\u53ef\uff0c\u4e0d\u4f20pagesize\uff0c\u4ee5\u5bc6\u7801\u672c\u5e73\u53f0\u4e3a\u4f8b\u5b50\uff0c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1\u3001\u9996\u5148\u5b9a\u4e49\u5206\u9875\u6a21\u5757\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"710\" height=\"247\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/17-1.png\" alt=\"\" class=\"wp-image-9922\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/17-1.png 710w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/17-1-300x104.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/17-1-600x209.png 600w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;div class=\"block\" width=\"50%\">\r\n    &lt;el-pagination\r\n      @size-change=\"handleSizeChange\"\r\n      @current-change=\"handleCurrentChange\"\r\n      :current-page=\"currentPage\"\r\n      :page-sizes=\"&#91;5, 10, 15, 20]\"\r\n      :page-size=\"pageSize\"\r\n      layout=\"total, sizes, prev, pager, next, jumper\"\r\n      :total=\"total\">\r\n    &lt;\/el-pagination>\r\n&lt;\/div>\r<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>:current-page \u8868\u793a\u5f53\u524d\u662f\u7b2c\u51e0\u9875<\/li><li>:page-sizes \u8868\u793a\u53ef\u4ee5\u9009\u62e9\u4e00\u9875\u591a\u5c11\u6761\u6570\u636e\uff0c\u4e3a\u4e00\u4e2a\u6570\u7ec4<\/li><li>:page-size   \u8868\u793a\u5f53\u524d\u4e00\u9875\u663e\u793a\u51e0\u6761\u6570\u636e<\/li><li>layout \u8868\u793a\u5206\u9875\u9700\u8981\u663e\u793a\u7684\u5185\u5bb9, total\u8868\u793a\u603b\u6570,prev\u8868\u793a\u4e0a\u4e00\u9875,next\u8868\u793a\u4e0b\u4e00\u9875<\/li><li>total \u8868\u793a\u603b\u5171\u591a\u5c11\u6761\u6570\u636e(\u4ece\u6570\u636e\u5e93\u4e2d\u83b7\u53d6)<\/li><li>@size-change\u8868\u793a\u9875\u5927\u5c0f\u66f4\u6539\u7684\u65f6\u5019\u89e6\u53d1\u7684\u4e8b\u4ef6<\/li><li>@current-change\u8868\u793a\u5f53\u524d\u9875\u66f4\u6539\u7684\u65f6\u5019\u89e6\u53d1\u7684\u4e8b\u4ef6<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">2\u3001\u5728script\u6807\u7b7e\u4e2d\u7684data()\u4e2d\u4e3acurrentPage,pageSize\u548ctotal\u8d4b\u521d\u59cb\u503c\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"709\" height=\"136\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/18.png\" alt=\"\" class=\"wp-image-9924\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/18.png 709w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/18-300x58.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/18-600x115.png 600w\" sizes=\"auto, (max-width: 709px) 100vw, 709px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">3\u3001\u5728methods\u4e2d\u6dfb\u52a0\u4e8b\u4ef6\u65b9\u6cd5\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"710\" height=\"173\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/20.png\" alt=\"\" class=\"wp-image-9927\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/20.png 710w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/20-300x73.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/20-600x146.png 600w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>handleSizeChange\uff1a\u66f4\u6539\u9875\u5927\u5c0f\u65f6\u5019\u89e6\u53d1\u4e8b\u4ef6<\/li><li>handleCurrentChange\uff1a\u66f4\u6539\u5f53\u524d\u9875\u65f6\u5019\u89e6\u53d1\u4e8b\u4ef6,this.getList\u8868\u793a\u5728\u9009\u62e9\u9875\u6570\u540e\uff0c\u5c06\u5f53\u524d\u9875\u4f20\u9012\u7ed9\u51fd\u6570\uff0cthis.currentPage\u4e3a\u70b9\u51fb\u540e\u8bbe\u7f6e\u5f53\u524d\u9875<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">4\u3001\u8bbe\u7f6e\u94a9\u5b50\u51fd\u6570\uff0c\u5728\u767b\u5f55\u9875\u9762\u540e\u6267\u884c\u6b64\u94a9\u5b50\u51fd\u6570\uff0c\u83b7\u53d6\u7b2c\u4e00\u9875\u6570\u636e\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"710\" height=\"133\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/1-2.png\" alt=\"\" class=\"wp-image-9930\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/1-2.png 710w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/1-2-300x56.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/1-2-600x112.png 600w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/><\/figure>\n\n\n\n<p class=\"has-luminous-vivid-amber-background-color has-background wp-block-paragraph\">\u6ce8\uff1a\u6b64\u94a9\u5b50\u51fd\u6570\u72ec\u7acb\u4e8emethods\u4e4b\u5916\uff0c\u5355\u72ec\u5b9a\u4e49\u5373\u53ef\uff0c\u4e0d\u5c5e\u4e8e\u4efb\u4f55\u6807\u7b7e\u6216\u8005\u51fd\u6570\u5185<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">5\u3001\u5b9a\u4e49\u83b7\u53d6\u6570\u636e\u7684\u51fd\u6570\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"710\" height=\"310\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/2-2.png\" alt=\"\" class=\"wp-image-9932\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/2-2.png 710w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/2-2-300x131.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/2-2-600x262.png 600w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>PageNum\uff1a\u8868\u793a\u8c03\u7528getList\u7684\u65f6\u5019\u4f20\u9012\u8fc7\u6765\u7684\u7b2c\u51e0\u9875<\/li><li>this.tableData\uff1a\u83b7\u53d6\u540e\u53f0\u8fd4\u56de\u6765\u7684\u6570\u636e<\/li><li>this.currentPage\uff1a\u5f53\u524d\u9875<\/li><li>this.pageSize\uff1a\u6bcf\u9875\u663e\u793a\u7684\u8bb0\u5f55\u6570\uff0c\u4ece\u540e\u53f0\u83b7\u53d6\u7684<\/li><li>this.total\uff1a\u603b\u7684\u8bb0\u5f55\u6570\uff0c\u4e5f\u662f\u4ece\u540e\u53f0\u83b7\u53d6 <\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">6\u3001\u540e\u53f0\u63a5\u53e3\u914d\u7f6eGET\u8bf7\u6c42\u53c2\u6570\uff0c\u53c2\u6570\u540d\u4e3aPageNum(\u540e\u53f0\u5b9a\u4e49\u7684)\uff0c\u503c\u4e3a\u524d\u53f0\u4f20\u9012\u8fc7\u53bb\u7684PageNum\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"709\" height=\"181\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/3-2.png\" alt=\"\" class=\"wp-image-9935\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/3-2.png 709w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/3-2-300x77.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/3-2-600x153.png 600w\" sizes=\"auto, (max-width: 709px) 100vw, 709px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u540e\u53f0\u6839\u636e\u8fdb\u884c\u5206\u9875\u67e5\u8be2\uff0c\u6bd4\u5982\u67e5\u8be2\u7b2c\u4e8c\u9875\uff0c\u67e5\u770b\u63a5\u53e3\u8fd4\u56de\u503c\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"709\" height=\"855\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/4-2.png\" alt=\"\" class=\"wp-image-9937\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/4-2.png 709w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/4-2-249x300.png 249w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/4-2-498x600.png 498w\" sizes=\"auto, (max-width: 709px) 100vw, 709px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u7ed3\u679c\u5982\u56fe\u6240\u793a\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"709\" height=\"239\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/5-2.png\" alt=\"\" class=\"wp-image-9940\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/5-2.png 709w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/5-2-300x101.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2022\/09\/5-2-600x202.png 600w\" sizes=\"auto, (max-width: 709px) 100vw, 709px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u5206\u9875\u529f\u80fd\u5206\u4e3a\u524d\u7aef\u5206\u9875\u548c\u540e\u7aef\u5206\u9875\uff0c\u524d\u7aef\u5206\u9875\u5c31\u662f\u7528\u8bf7\u6c42\u4ece\u540e\u53f0\u628a\u6240\u6709\u7684\u6570\u636e\u62ff\u4e0b\u6765\uff0c\u7136\u540e\u8fdb\u884c\u5206\u9875\uff0c\u5982\u679c\u5f53\u6570\u636e\u8db3\u591f\u5927\u65f6\uff0c [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":9920,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[155,23],"tags":[],"class_list":["post-9917","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vue","category-rong"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":8}},"_links":{"self":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/9917","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/comments?post=9917"}],"version-history":[{"count":13,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/9917\/revisions"}],"predecessor-version":[{"id":9941,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/9917\/revisions\/9941"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media\/9920"}],"wp:attachment":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media?parent=9917"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/categories?post=9917"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/tags?post=9917"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}