{"id":28077,"date":"2024-11-24T12:14:40","date_gmt":"2024-11-24T04:14:40","guid":{"rendered":"https:\/\/fwq.ai\/blog\/28077\/"},"modified":"2024-11-24T12:14:40","modified_gmt":"2024-11-24T04:14:40","slug":"elementui-%e5%af%b9%e8%af%9d%e6%a1%86%e5%b5%8c%e5%a5%97%e5%88%86%e9%a1%b5%e8%a1%a8%e6%a0%bc%ef%bc%8c%e5%88%86%e9%a1%b5%e5%88%87%e6%8d%a2%e5%90%8e%e5%87%ba%e7%8e%b0%e9%97%aa%e7%83%81%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/28077\/","title":{"rendered":"ElementUI \u5bf9\u8bdd\u6846\u5d4c\u5957\u5206\u9875\u8868\u683c\uff0c\u5206\u9875\u5207\u6362\u540e\u51fa\u73b0\u95ea\u70c1\u95ee\u9898\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173139179260951.jpg\" class=\"aligncenter\" title=\"ElementUI \u5bf9\u8bdd\u6846\u5d4c\u5957\u5206\u9875\u8868\u683c\uff0c\u5206\u9875\u5207\u6362\u540e\u51fa\u73b0\u95ea\u70c1\u95ee\u9898\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" alt=\"ElementUI \u5bf9\u8bdd\u6846\u5d4c\u5957\u5206\u9875\u8868\u683c\uff0c\u5206\u9875\u5207\u6362\u540e\u51fa\u73b0\u95ea\u70c1\u95ee\u9898\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>elementui \u5bf9\u8bdd\u6846\u5d4c\u5957\u5206\u9875\u8868\u683c\u4e2d\u7684\u5206\u9875\u95ea\u70c1\u95ee\u9898<\/strong><\/p>\n<\/p>\n<h3>\u95ee\u9898\u63cf\u8ff0<\/h3>\n<p>\u5728 elementui \u4e2d\uff0c\u5c06\u4e00\u4e2a\u8868\u683c\u5d4c\u5957\u5728\u5bf9\u8bdd\u6846\u4e2d\uff0c\u5e76\u4e14\u8868\u683c\u4f7f\u7528\u5206\u9875\u529f\u80fd\u3002\u5207\u6362\u5230\u4e0b\u4e00\u9875\u540e\uff0c\u4e4b\u524d\u7684\u9875\u9762\u4ecd\u4f5c\u4e3a\u80cc\u666f\u663e\u793a\u3002<\/p>\n<\/p>\n<h3>\u89e3\u51b3\u65b9\u6848<\/h3>\n<p>\u5c06\u5bf9\u8bdd\u6846\u79fb\u5230\u8868\u683c\u5916\u90e8\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<p><strong>\u6a21\u677f<\/strong><\/p>\n<pre>&lt;template&gt;\n  &lt;el-table&gt;\n    &lt;el-table-column label=\"\u6743\u9650\u4fe1\u606f\" prop=\"permission\"&gt;\n      &lt;template slot-scope=\"scope\"&gt;\n        &lt;el-button size=\"mini\" slot=\"reference\" @click=\"openpermissiondialog(scope.row.id)\"&gt;\u67e5\u770b&lt;\/el-button&gt;\n      &lt;\/template&gt;\n    &lt;\/el-table-column&gt;\n  &lt;\/el-table&gt;\n\n  &lt;el-dialog title=\"\u89d2\u8272\u6743\u9650\u4fe1\u606f\" :visible.sync=\"permissiondialogue\" width=\"40%\" @closed=\"closedpermissiondialog\"&gt;\n    &lt;permissiontable :roleid=\"permissionroleid\"&gt;&lt;\/permissiontable&gt;\n  &lt;\/el-dialog&gt;\n&lt;\/template&gt;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p><strong>\u811a\u672c<\/strong><\/p>\n<pre>data() {\n  return {\n      ...,\n      permissionRoleId: null,\n  }\n},\nmethods: {\n  openPermissionDialog(id) {\n    this.permissionRoleId = id;\n    this.permissionDialogue = true;\n  },\n  closedPermissionDialog() {\n    this.permissionRoleId = null;\n  },\n},<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<h3>\u539f\u56e0<\/h3>\n<p>\u5c06\u5bf9\u8bdd\u6846\u5199\u5728\u8868\u683c\u5217\u4e2d\uff0c\u76f8\u5f53\u4e8e\u5728\u6bcf\u884c\u521b\u5efa\u4e00\u4e2a\u72ec\u7acb\u7684\u5bf9\u8bdd\u6846\u3002\u5f53\u5207\u6362\u5206\u9875\u65f6\uff0c\u53ea\u6709\u6700\u4e0a\u5c42\u7684\u5bf9\u8bdd\u6846\u4f1a\u66f4\u65b0\uff0c\u800c\u5176\u4ed6\u5bf9\u8bdd\u6846\u4ecd\u7136\u4fdd\u6301\u4e4b\u524d\u7684\u72b6\u6001\uff0c\u4ece\u800c\u5bfc\u81f4\u4e4b\u524d\u7684\u5206\u9875\u663e\u793a\u4e3a\u80cc\u666f\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fElementUI \u5bf9\u8bdd\u6846\u5d4c\u5957\u5206\u9875\u8868\u683c\uff0c\u5206\u9875\u5207\u6362\u540e\u51fa\u73b0\u95ea\u70c1\u95ee\u9898\u5982\u4f55\u89e3\u51b3\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 \u5bf9\u8bdd\u6846\u5d4c\u5957\u5206\u9875\u8868\u683c\u4e2d\u7684\u5206\u9875\u95ea\u70c1\u95ee\u9898 \u95ee\u9898\u63cf\u8ff0 \u5728 elementui \u4e2d\uff0c\u5c06\u4e00\u4e2a\u8868\u683c\u5d4c\u5957\u5728\u5bf9\u8bdd\u6846\u4e2d\uff0c\u5e76\u4e14\u8868\u683c\u4f7f\u7528\u5206\u9875\u529f\u80fd\u3002\u5207\u6362\u5230\u4e0b\u4e00\u9875\u540e\uff0c\u4e4b\u524d\u7684\u9875\u9762\u4ecd\u4f5c\u4e3a\u80cc\u666f\u663e\u793a\u3002 \u89e3\u51b3\u65b9\u6848 \u5c06\u5bf9\u8bdd\u6846\u79fb\u5230\u8868\u683c\u5916\u90e8\uff0c\u5982\u4e0b\u6240\u793a\uff1a \u6a21\u677f &lt;template&gt; &lt;el-table&gt; &lt;el-table-column label=&#8221;\u6743\u9650\u4fe1\u606f&#8221; prop=&#8221;permission&#8221;&gt; &lt;template slot-scope=&#8221;scope&#8221;&gt; &lt;el-button size=&#8221;mini&#8221; slot=&#8221;reference&#8221; @click=&#8221;openpermissiondialog(scope.row.id)&#8221;&gt;\u67e5\u770b&lt;\/el-button&gt; &lt;\/template&gt; &lt;\/el-table-column&gt; &lt;\/el-table&gt; &lt;el-dialog title=&#8221;\u89d2\u8272\u6743\u9650\u4fe1\u606f&#8221; :visible.sync=&#8221;permissiondialogue&#8221; width=&#8221;40%&#8221; @closed=&#8221;closedpermissiondialog&#8221;&gt; &lt;permissiontable :roleid=&#8221;permissionroleid&#8221;&gt;&lt;\/permissiontable&gt; &lt;\/el-dialog&gt; &lt;\/template&gt; \u767b\u5f55\u540e\u590d\u5236 \u811a\u672c data() { return { &#8230;, permissionRoleId: null, } }, methods: { openPermissionDialog(id) { this.permissionRoleId = id; this.permissionDialogue = true; }, closedPermissionDialog() [&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-28077","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28077","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=28077"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/28077\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=28077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=28077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=28077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}