/*! For license information please see 8284.1f12d2c6.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([["8284"],{89306:function(s,a,n){"use strict";n.r(a);var t=n("80681");let l=["innerHTML"];a.default={setup:()=>({html:""}),render:()=>((0,t.wg)(),(0,t.iD)("div",{class:"van-doc-markdown-body",innerHTML:'
\u8BBE\u7F6E\u5143\u7D20\u4E4B\u95F4\u7684\u95F4\u8DDD\u3002
\n\u901A\u8FC7\u4EE5\u4E0B\u65B9\u5F0F\u6765\u5168\u5C40\u6CE8\u518C\u7EC4\u4EF6\uFF0C\u66F4\u591A\u6CE8\u518C\u65B9\u5F0F\u8BF7\u53C2\u8003\u7EC4\u4EF6\u6CE8\u518C\u3002
\nimport { createApp } from 'vue';\nimport { Space } from 'vant';\n\nconst app = createApp();\napp.use(Space);\n
\nSpace \u7EC4\u4EF6\u4F1A\u5728\u5404\u4E2A\u5B50\u7EC4\u4EF6\u4E4B\u95F4\u8BBE\u7F6E\u4E00\u5B9A\u7684\u95F4\u8DDD\uFF0C\u9ED8\u8BA4\u95F4\u8DDD\u4E3A 8px
\u3002
<van-space>\n <van-button type="primary">\u6309\u94AE</van-button>\n <van-button type="primary">\u6309\u94AE</van-button>\n <van-button type="primary">\u6309\u94AE</van-button>\n <van-button type="primary">\u6309\u94AE</van-button>\n</van-space>\n
\n\u5C06 direction
\u5C5E\u6027\u8BBE\u7F6E\u4E3A vertical
\uFF0C\u53EF\u4EE5\u8BBE\u7F6E\u5782\u76F4\u65B9\u5411\u6392\u5217\u7684\u95F4\u8DDD\u3002
<van-space direction="vertical" fill>\n <van-button type="primary" block>\u6309\u94AE</van-button>\n <van-button type="primary" block>\u6309\u94AE</van-button>\n <van-button type="primary" block>\u6309\u94AE</van-button>\n</van-space>\n
\n\u901A\u8FC7\u8C03\u6574 size
\u7684\u503C\u6765\u63A7\u5236\u95F4\u8DDD\u7684\u5927\u5C0F\u3002\u4F20\u5165 number
\u7C7B\u578B\u65F6\uFF0C\u4F1A\u9ED8\u8BA4\u4F7F\u7528 px
\u5355\u4F4D\uFF1B\u4E5F\u53EF\u4EE5\u4F20\u5165 string
\u7C7B\u578B\uFF0C\u6BD4\u5982 2rem
\u6216 5vw
\u7B49\u5E26\u6709\u5355\u4F4D\u7684\u503C\u3002
<!-- 20px -->\n<van-space :size="20">\n <van-button type="primary">\u6309\u94AE</van-button>\n <van-button type="primary">\u6309\u94AE</van-button>\n <van-button type="primary">\u6309\u94AE</van-button>\n</van-space>\n\n<!-- 2rem -->\n<van-space size="2rem">\n <van-button type="primary">\u6309\u94AE</van-button>\n <van-button type="primary">\u6309\u94AE</van-button>\n <van-button type="primary">\u6309\u94AE</van-button>\n</van-space>\n
\n\u901A\u8FC7\u8C03\u6574 align
\u7684\u503C\u6765\u8BBE\u7F6E\u5B50\u5143\u7D20\u7684\u5BF9\u9F50\u65B9\u5F0F, \u53EF\u9009\u503C\u4E3A start
, center
,end
,baseline
\uFF0C\u5728\u6C34\u5E73\u6A21\u5F0F\u4E0B\u7684\u9ED8\u8BA4\u503C\u4E3A center
\u3002
<van-radio-group\n v-model="align"\n direction="horizontal"\n style="margin-bottom: 16px"\n>\n <van-radio name="start">start</van-radio>\n <van-radio name="center">center</van-radio>\n <van-radio name="end">end</van-radio>\n <van-radio name="baseline">baseline</van-radio>\n</van-radio-group>\n\n<van-space :align="align" style="padding: 16px; background: #f3f2f5">\n <van-button type="primary">{{ align }}</van-button>\n <div style="padding: 40px 20px; background: #fff">Block</div>\n</van-space>\n
\nimport { ref } from 'vue';\n\nexport default {\n setup() {\n const align = ref('center');\n return { align };\n },\n};\n
\n\u5728\u6C34\u5E73\u6A21\u5F0F\u4E0B, \u901A\u8FC7 wrap
\u5C5E\u6027\u6765\u63A7\u5236\u5B50\u5143\u7D20\u662F\u5426\u81EA\u52A8\u6362\u884C\u3002
<van-space wrap>\n <van-button type="primary" block>\u6309\u94AE</van-button>\n <van-button type="primary" block>\u6309\u94AE</van-button>\n <van-button type="primary" block>\u6309\u94AE</van-button>\n <van-button type="primary" block>\u6309\u94AE</van-button>\n <van-button type="primary" block>\u6309\u94AE</van-button>\n <van-button type="primary" block>\u6309\u94AE</van-button>\n <van-button type="primary" block>\u6309\u94AE</van-button>\n <van-button type="primary" block>\u6309\u94AE</van-button>\n</van-space>\n
\n\u53C2\u6570 | \n\u8BF4\u660E | \n\u7C7B\u578B | \n\u9ED8\u8BA4\u503C | \n
---|---|---|---|
direction | \n\u95F4\u8DDD\u65B9\u5411 | \nvertical | horizontal | \nhorizontal | \n
size | \n\u95F4\u8DDD\u5927\u5C0F\uFF0C\u5982 20px 2em \uFF0C\u9ED8\u8BA4\u5355\u4F4D\u4E3A px \uFF0C\u652F\u6301\u6570\u7EC4\u5F62\u5F0F\u6765\u5206\u522B\u8BBE\u7F6E\u6A2A\u5411\u548C\u7EB5\u5411\u95F4\u8DDD | \nnumber | string | number[] | string[] | \n8px | \n
align | \n\u8BBE\u7F6E\u5B50\u5143\u7D20\u7684\u5BF9\u9F50\u65B9\u5F0F | \nstart | end | center | baseline | \n- | \n
wrap | \n\u662F\u5426\u81EA\u52A8\u6362\u884C\uFF0C\u4EC5\u9002\u7528\u4E8E\u6C34\u5E73\u65B9\u5411\u6392\u5217 | \nboolean | \nfalse | \n
fill | \n\u662F\u5426\u8BA9 Space \u53D8\u4E3A\u4E00\u4E2A\u5757\u7EA7\u5143\u7D20\uFF0C\u586B\u5145\u6574\u4E2A\u7236\u5143\u7D20 | \nboolean | \nfalse | \n
\u540D\u79F0 | \n\u8BF4\u660E | \n
---|---|
default | \n\u95F4\u8DDD\u7EC4\u4EF6\u5185\u5BB9 | \n
\u7EC4\u4EF6\u5BFC\u51FA\u4EE5\u4E0B\u7C7B\u578B\u5B9A\u4E49\uFF1A
\nimport type { SpaceProps, SpaceSize, SpaceAlign } from 'vant';\n
\n