/*! For license information please see 8789.8b308e3a.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([["8789"],{61738:function(s,n,a){"use strict";a.r(n);var t=a("80681");let l=["innerHTML"];n.default={setup:()=>({html:""}),render:()=>((0,t.wg)(),(0,t.iD)("div",{class:"van-doc-markdown-body",innerHTML:'
\u5BAB\u683C\u53EF\u4EE5\u5728\u6C34\u5E73\u65B9\u5411\u4E0A\u628A\u9875\u9762\u5206\u9694\u6210\u7B49\u5BBD\u5EA6\u7684\u533A\u5757\uFF0C\u7528\u4E8E\u5C55\u793A\u5185\u5BB9\u6216\u8FDB\u884C\u9875\u9762\u5BFC\u822A\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 { Grid, GridItem } from 'vant';\n\nconst app = createApp();\napp.use(Grid);\napp.use(GridItem);\n
\n\u901A\u8FC7 icon
\u5C5E\u6027\u8BBE\u7F6E\u683C\u5B50\u5185\u7684\u56FE\u6807\uFF0Ctext
\u5C5E\u6027\u8BBE\u7F6E\u6587\u5B57\u5185\u5BB9\u3002
<van-grid>\n <van-grid-item icon="photo-o" text="\u6587\u5B57" />\n <van-grid-item icon="photo-o" text="\u6587\u5B57" />\n <van-grid-item icon="photo-o" text="\u6587\u5B57" />\n <van-grid-item icon="photo-o" text="\u6587\u5B57" />\n</van-grid>\n
\n\u9ED8\u8BA4\u4E00\u884C\u5C55\u793A\u56DB\u4E2A\u683C\u5B50\uFF0C\u53EF\u4EE5\u901A\u8FC7 column-num
\u81EA\u5B9A\u4E49\u5217\u6570\u3002
<van-grid :column-num="3">\n <van-grid-item v-for="value in 6" :key="value" icon="photo-o" text="\u6587\u5B57" />\n</van-grid>\n
\n\u901A\u8FC7\u63D2\u69FD\u53EF\u4EE5\u81EA\u5B9A\u4E49\u683C\u5B50\u5C55\u793A\u7684\u5185\u5BB9\u3002
\n<van-grid :border="false" :column-num="3">\n <van-grid-item>\n <van-image\n src="https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg"\n />\n </van-grid-item>\n <van-grid-item>\n <van-image\n src="https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg"\n />\n </van-grid-item>\n <van-grid-item>\n <van-image\n src="https://fastly.jsdelivr.net/npm/@vant/assets/apple-3.jpeg"\n />\n </van-grid-item>\n</van-grid>\n
\n\u8BBE\u7F6E square
\u5C5E\u6027\u540E\uFF0C\u683C\u5B50\u7684\u9AD8\u5EA6\u4F1A\u548C\u5BBD\u5EA6\u4FDD\u6301\u4E00\u81F4\u3002
<van-grid square>\n <van-grid-item v-for="value in 8" :key="value" icon="photo-o" text="\u6587\u5B57" />\n</van-grid>\n
\n\u901A\u8FC7 gutter
\u5C5E\u6027\u8BBE\u7F6E\u683C\u5B50\u4E4B\u95F4\u7684\u8DDD\u79BB\u3002
<van-grid :gutter="10">\n <van-grid-item v-for="value in 8" :key="value" icon="photo-o" text="\u6587\u5B57" />\n</van-grid>\n
\n\u5C06 direction
\u5C5E\u6027\u8BBE\u7F6E\u4E3A horizontal
\uFF0C\u53EF\u4EE5\u8BA9\u5BAB\u683C\u7684\u5185\u5BB9\u5448\u6A2A\u5411\u6392\u5217\u3002
<van-grid direction="horizontal" :column-num="3">\n <van-grid-item icon="photo-o" text="\u6587\u5B57" />\n <van-grid-item icon="photo-o" text="\u6587\u5B57" />\n <van-grid-item icon="photo-o" text="\u6587\u5B57" />\n</van-grid>\n
\n\u901A\u8FC7 to
\u5C5E\u6027\u8BBE\u7F6E Vue Router \u8DF3\u8F6C\u94FE\u63A5\uFF0C\u901A\u8FC7 url
\u5C5E\u6027\u8BBE\u7F6E URL \u8DF3\u8F6C\u94FE\u63A5\u3002
<van-grid clickable :column-num="2">\n <van-grid-item icon="home-o" text="\u8DEF\u7531\u8DF3\u8F6C" to="/" />\n <van-grid-item icon="search" text="URL \u8DF3\u8F6C" url="https://github.com" />\n</van-grid>\n
\n\u8BBE\u7F6E dot
\u5C5E\u6027\u540E\uFF0C\u4F1A\u5728\u56FE\u6807\u53F3\u4E0A\u89D2\u5C55\u793A\u4E00\u4E2A\u5C0F\u7EA2\u70B9\u3002\u8BBE\u7F6E badge
\u5C5E\u6027\u540E\uFF0C\u4F1A\u5728\u56FE\u6807\u53F3\u4E0A\u89D2\u5C55\u793A\u76F8\u5E94\u7684\u5FBD\u6807\u3002
<van-grid :column-num="2">\n <van-grid-item icon="home-o" text="\u6587\u5B57" dot />\n <van-grid-item icon="search" text="\u6587\u5B57" badge="99+" />\n</van-grid>\n
\n\u53C2\u6570 | \n\u8BF4\u660E | \n\u7C7B\u578B | \n\u9ED8\u8BA4\u503C | \n
---|---|---|---|
column-num | \n\u5217\u6570 | \nnumber | string | \n4 | \n
icon-size | \n\u56FE\u6807\u5927\u5C0F\uFF0C\u9ED8\u8BA4\u5355\u4F4D\u4E3Apx | \nnumber | string | \n28px | \n
gutter | \n\u683C\u5B50\u4E4B\u95F4\u7684\u95F4\u8DDD\uFF0C\u9ED8\u8BA4\u5355\u4F4D\u4E3Apx | \nnumber | string | \n0 | \n
border | \n\u662F\u5426\u663E\u793A\u8FB9\u6846 | \nboolean | \ntrue | \n
center | \n\u662F\u5426\u5C06\u683C\u5B50\u5185\u5BB9\u5C45\u4E2D\u663E\u793A | \nboolean | \ntrue | \n
square | \n\u662F\u5426\u5C06\u683C\u5B50\u56FA\u5B9A\u4E3A\u6B63\u65B9\u5F62 | \nboolean | \nfalse | \n
clickable | \n\u662F\u5426\u5F00\u542F\u683C\u5B50\u70B9\u51FB\u53CD\u9988 | \nboolean | \nfalse | \n
direction | \n\u683C\u5B50\u5185\u5BB9\u6392\u5217\u7684\u65B9\u5411\uFF0C\u53EF\u9009\u503C\u4E3A horizontal | \nstring | \nvertical | \n
reverse | \n\u662F\u5426\u8C03\u6362\u56FE\u6807\u548C\u6587\u672C\u7684\u4F4D\u7F6E | \nboolean | \nfalse | \n
\u53C2\u6570 | \n\u8BF4\u660E | \n\u7C7B\u578B | \n\u9ED8\u8BA4\u503C | \n
---|---|---|---|
text | \n\u6587\u5B57 | \nstring | \n- | \n
icon | \n\u56FE\u6807\u540D\u79F0\u6216\u56FE\u7247\u94FE\u63A5\uFF0C\u7B49\u540C\u4E8E Icon \u7EC4\u4EF6\u7684 name \u5C5E\u6027 | \nstring | \n- | \n
icon-prefix | \n\u56FE\u6807\u7C7B\u540D\u524D\u7F00\uFF0C\u7B49\u540C\u4E8E Icon \u7EC4\u4EF6\u7684 class-prefix \u5C5E\u6027 | \nstring | \nvan-icon | \n
icon-color | \n\u56FE\u6807\u989C\u8272\uFF0C\u7B49\u540C\u4E8E Icon \u7EC4\u4EF6\u7684 color \u5C5E\u6027 | \nstring | \n- | \n
dot | \n\u662F\u5426\u663E\u793A\u56FE\u6807\u53F3\u4E0A\u89D2\u5C0F\u7EA2\u70B9 | \nboolean | \nfalse | \n
badge | \n\u56FE\u6807\u53F3\u4E0A\u89D2\u5FBD\u6807\u7684\u5185\u5BB9 | \nnumber | string | \n- | \n
badge-props | \n\u81EA\u5B9A\u4E49\u5FBD\u6807\u7684\u5C5E\u6027\uFF0C\u4F20\u5165\u7684\u5BF9\u8C61\u4F1A\u88AB\u900F\u4F20\u7ED9 Badge \u7EC4\u4EF6\u7684 props | \nBadgeProps | \n- | \n
url | \n\u70B9\u51FB\u540E\u8DF3\u8F6C\u7684\u94FE\u63A5\u5730\u5740 | \nstring | \n- | \n
to | \n\u70B9\u51FB\u540E\u8DF3\u8F6C\u7684\u76EE\u6807\u8DEF\u7531\u5BF9\u8C61\uFF0C\u7B49\u540C\u4E8E Vue Router \u7684 to \u5C5E\u6027 | \nstring | object | \n- | \n
replace | \n\u662F\u5426\u5728\u8DF3\u8F6C\u65F6\u66FF\u6362\u5F53\u524D\u9875\u9762\u5386\u53F2 | \nboolean | \nfalse | \n
\u4E8B\u4EF6\u540D | \n\u8BF4\u660E | \n\u56DE\u8C03\u53C2\u6570 | \n
---|---|---|
click | \n\u70B9\u51FB\u683C\u5B50\u65F6\u89E6\u53D1 | \nevent: MouseEvent | \n
\u540D\u79F0 | \n\u8BF4\u660E | \n
---|---|
default | \n\u81EA\u5B9A\u4E49\u5BAB\u683C\u7684\u6240\u6709\u5185\u5BB9 | \n
icon | \n\u81EA\u5B9A\u4E49\u56FE\u6807 | \n
text | \n\u81EA\u5B9A\u4E49\u6587\u5B57 | \n
\u7EC4\u4EF6\u5BFC\u51FA\u4EE5\u4E0B\u7C7B\u578B\u5B9A\u4E49\uFF1A
\nimport type { GridProps, GridDirection, GridItemProps } from 'vant';\n
\n\u7EC4\u4EF6\u63D0\u4F9B\u4E86\u4E0B\u5217 CSS \u53D8\u91CF\uFF0C\u53EF\u7528\u4E8E\u81EA\u5B9A\u4E49\u6837\u5F0F\uFF0C\u4F7F\u7528\u65B9\u6CD5\u8BF7\u53C2\u8003 ConfigProvider \u7EC4\u4EF6\u3002
\n\u540D\u79F0 | \n\u9ED8\u8BA4\u503C | \n\u63CF\u8FF0 | \n
---|---|---|
--van-grid-item-content-padding | \nvar(--van-padding-md) var(--van-padding-xs) | \n- | \n
--van-grid-item-content-background | \nvar(--van-background-2) | \n- | \n
--van-grid-item-content-active-color | \nvar(--van-active-color) | \n- | \n
--van-grid-item-icon-size | \n28px | \n- | \n
--van-grid-item-text-color | \nvar(--van-text-color) | \n- | \n
--van-grid-item-text-font-size | \nvar(--van-font-size-sm) | \n- | \n