{"id":26946,"date":"2024-11-24T15:34:59","date_gmt":"2024-11-24T07:34:59","guid":{"rendered":"https:\/\/fwq.ai\/blog\/26946\/"},"modified":"2024-11-24T15:34:59","modified_gmt":"2024-11-24T07:34:59","slug":"element-ui-%e5%bc%b9%e7%aa%97%e7%bb%84%e4%bb%b6%e7%9a%84-visible-%e5%b1%9e%e6%80%a7%e6%98%af%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e7%9a%84%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/26946\/","title":{"rendered":"Element UI \u5f39\u7a97\u7ec4\u4ef6\u7684 visible \u5c5e\u6027\u662f\u5982\u4f55\u5b9e\u73b0\u7684\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173113416434518.jpg\" class=\"aligncenter\" title=\"Element UI \u5f39\u7a97\u7ec4\u4ef6\u7684 visible \u5c5e\u6027\u662f\u5982\u4f55\u5b9e\u73b0\u7684\uff1f\u63d2\u56fe\" alt=\"Element UI \u5f39\u7a97\u7ec4\u4ef6\u7684 visible \u5c5e\u6027\u662f\u5982\u4f55\u5b9e\u73b0\u7684\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>element ui \u5f39\u7a97\u7ec4\u4ef6\u7684 visible \u5c5e\u6027\u89e3\u6790<\/strong><\/p>\n<p>\u5728 Element UI \u7684\u6e90\u7801\u4e2d\uff0c\u6211\u4eec\u53d1\u73b0 Dialog \u7ec4\u4ef6\u7684 props \u4e2d\u6ca1\u6709\u53ef\u89c1\u6027\uff08visible\uff09\u5c5e\u6027\uff0c\u4f46\u5b83\u7684\u4f7f\u7528\u5374\u80fd\u63a5\u6536\u53ef\u89c1\u6027\u53c2\u6570\u3002\u90a3\u4e48\uff0c\u8fd9\u80cc\u540e\u7684\u539f\u7406\u662f\u4ec0\u4e48\uff1f<\/p>\n<p>\u89e3\u7b54\uff1a<\/p>\n<p>visible \u5c5e\u6027\u5b9e\u9645\u4e0a\u662f\u901a\u8fc7mixins\u4e2d\u7684Popup\u6df7\u5408\u8fdb\u5165\u7684\u3002Popup Mixin\u63d0\u4f9b\u4e86\u5bf9\u5f39\u51fa\u5f0f\u7ec4\u4ef6\u7684\u901a\u7528\u529f\u80fd\uff0c\u5305\u62ec\u53ef\u89c1\u6027\u7ba1\u7406\u3002\u8be5 mixin \u5728Dialog\u7ec4\u4ef6\u4e2d\u4f7f\u7528\uff0c\u5141\u8bb8\u5176\u4f7f\u7528 visible \u5c5e\u6027\u3002<\/p>\n<p>\u4ee5\u4e0b\u662f\u76f8\u5173\u6e90\u7801\u8bf4\u660e\uff1a<\/p>\n<p><strong>component.<\/strong><\/p>\n<pre>import Popup from 'element-ui\/src\/utils\/popup';\nexport default {\n  mixins: [Popup, emitter, Migrating],\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>index.js<\/strong><\/p>\n<pre>export default {\n  props: {\n    visible: {\n      type: Boolean,\n      default: false\n    },\n  },\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fElement UI \u5f39\u7a97\u7ec4\u4ef6\u7684 visible \u5c5e\u6027\u662f\u5982\u4f55\u5b9e\u73b0\u7684\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>element ui \u5f39\u7a97\u7ec4\u4ef6\u7684 visible \u5c5e\u6027\u89e3\u6790 \u5728 Element UI \u7684\u6e90\u7801\u4e2d\uff0c\u6211\u4eec\u53d1\u73b0 Dialog \u7ec4\u4ef6\u7684 props \u4e2d\u6ca1\u6709\u53ef\u89c1\u6027\uff08visible\uff09\u5c5e\u6027\uff0c\u4f46\u5b83\u7684\u4f7f\u7528\u5374\u80fd\u63a5\u6536\u53ef\u89c1\u6027\u53c2\u6570\u3002\u90a3\u4e48\uff0c\u8fd9\u80cc\u540e\u7684\u539f\u7406\u662f\u4ec0\u4e48\uff1f \u89e3\u7b54\uff1a visible \u5c5e\u6027\u5b9e\u9645\u4e0a\u662f\u901a\u8fc7mixins\u4e2d\u7684Popup\u6df7\u5408\u8fdb\u5165\u7684\u3002Popup Mixin\u63d0\u4f9b\u4e86\u5bf9\u5f39\u51fa\u5f0f\u7ec4\u4ef6\u7684\u901a\u7528\u529f\u80fd\uff0c\u5305\u62ec\u53ef\u89c1\u6027\u7ba1\u7406\u3002\u8be5 mixin \u5728Dialog\u7ec4\u4ef6\u4e2d\u4f7f\u7528\uff0c\u5141\u8bb8\u5176\u4f7f\u7528 visible \u5c5e\u6027\u3002 \u4ee5\u4e0b\u662f\u76f8\u5173\u6e90\u7801\u8bf4\u660e\uff1a component. import Popup from &#8216;element-ui\/src\/utils\/popup&#8217;; export default { mixins: [Popup, emitter, Migrating], } \u767b\u5f55\u540e\u590d\u5236 index.js export default { props: { visible: { type: Boolean, default: false }, }, } \u767b\u5f55\u540e\u590d\u5236 \u4ee5\u4e0a\u5c31\u662fElement UI \u5f39\u7a97\u7ec4\u4ef6\u7684 [&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-26946","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/26946","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=26946"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/26946\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=26946"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=26946"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=26946"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}