vant/static/js/async/139.1147a1a5.js
2024-04-20 08:49:23 +00:00

2 lines
24 KiB
JavaScript

/*! For license information please see 139.1147a1a5.js.LICENSE.txt */
(self.webpackChunk=self.webpackChunk||[]).push([["139"],{27870:function(s,n,a){"use strict";a.r(n);var t=a("80681");let e=["innerHTML"];n.default={setup:()=>({html:""}),render:()=>((0,t.wg)(),(0,t.iD)("div",{class:"van-doc-markdown-body",innerHTML:'<h1>TimePicker \u65F6\u95F4\u9009\u62E9</h1>\n<div class="van-doc-card"><h3 id="jie-shao" tabindex="-1">\u4ECB\u7ECD</h3>\n<p>\u65F6\u95F4\u9009\u62E9\u5668\uFF0C\u901A\u5E38\u4E0E<a href="#/zh-CN/popup" target="_blank">\u5F39\u51FA\u5C42</a>\u7EC4\u4EF6\u914D\u5408\u4F7F\u7528\u3002</p>\n</div><div class="van-doc-card"><h3 id="yin-ru" tabindex="-1">\u5F15\u5165</h3>\n<p>\u901A\u8FC7\u4EE5\u4E0B\u65B9\u5F0F\u6765\u5168\u5C40\u6CE8\u518C\u7EC4\u4EF6\uFF0C\u66F4\u591A\u6CE8\u518C\u65B9\u5F0F\u8BF7\u53C2\u8003<a href="#/zh-CN/advanced-usage#zu-jian-zhu-ce" target="_blank">\u7EC4\u4EF6\u6CE8\u518C</a>\u3002</p>\n<pre><code class="language-js"><span class="hljs-keyword">import</span> { createApp } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;vue&#x27;</span>;\n<span class="hljs-keyword">import</span> { <span class="hljs-title class_">TimePicker</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;vant&#x27;</span>;\n\n<span class="hljs-keyword">const</span> app = <span class="hljs-title function_">createApp</span>();\napp.<span class="hljs-title function_">use</span>(<span class="hljs-title class_">TimePicker</span>);\n</code></pre>\n</div><h2 id="dai-ma-yan-shi" tabindex="-1">\u4EE3\u7801\u6F14\u793A</h2>\n<div class="van-doc-card"><h3 id="ji-chu-yong-fa" tabindex="-1">\u57FA\u7840\u7528\u6CD5</h3>\n<p>\u901A\u8FC7 <code>v-model</code> \u7ED1\u5B9A\u5F53\u524D\u9009\u4E2D\u7684\u65F6\u95F4\u3002</p>\n<pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-time-picker</span> <span class="hljs-attr">v-model</span>=<span class="hljs-string">&quot;currentTime&quot;</span> <span class="hljs-attr">title</span>=<span class="hljs-string">&quot;\u9009\u62E9\u65F6\u95F4&quot;</span> /&gt;</span>\n</code></pre>\n<pre><code class="language-js"><span class="hljs-keyword">import</span> { ref } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;vue&#x27;</span>;\n\n<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> {\n <span class="hljs-title function_">setup</span>(<span class="hljs-params"></span>) {\n <span class="hljs-keyword">const</span> currentTime = <span class="hljs-title function_">ref</span>([<span class="hljs-string">&#x27;12&#x27;</span>, <span class="hljs-string">&#x27;00&#x27;</span>]);\n <span class="hljs-keyword">return</span> { currentTime };\n },\n};\n</code></pre>\n</div><div class="van-doc-card"><h3 id="xuan-xiang-lei-xing" tabindex="-1">\u9009\u9879\u7C7B\u578B</h3>\n<p>\u901A\u8FC7 <code>columns-type</code> \u5C5E\u6027\u53EF\u4EE5\u63A7\u5236\u9009\u9879\u7684\u7C7B\u578B\uFF0C\u652F\u6301\u4EE5\u4EFB\u610F\u987A\u5E8F\u5BF9 <code>hour</code>\u3001<code>minute</code> \u548C <code>second</code> \u8FDB\u884C\u6392\u5217\u7EC4\u5408\u3002</p>\n<p>\u6BD4\u5982\uFF1A</p>\n<ul>\n<li>\u4F20\u5165 <code>[\'hour\']</code> \u6765\u5355\u72EC\u9009\u62E9\u5C0F\u65F6\u3002</li>\n<li>\u4F20\u5165 <code>[\'minute\']</code> \u6765\u5355\u72EC\u9009\u62E9\u5206\u949F\u3002</li>\n<li>\u4F20\u5165 <code>[\'minute\', \'second\']</code> \u6765\u9009\u62E9\u5206\u949F\u548C\u79D2\u3002</li>\n<li>\u4F20\u5165 <code>[\'hour\', \'minute\', \'second\']</code> \u6765\u9009\u62E9\u5C0F\u65F6\u3001\u5206\u949F\u548C\u79D2\u3002</li>\n</ul>\n<pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-time-picker</span>\n <span class="hljs-attr">v-model</span>=<span class="hljs-string">&quot;currentTime&quot;</span>\n <span class="hljs-attr">title</span>=<span class="hljs-string">&quot;\u9009\u62E9\u65F6\u95F4&quot;</span>\n <span class="hljs-attr">:columns-type</span>=<span class="hljs-string">&quot;columnsType&quot;</span>\n/&gt;</span>\n</code></pre>\n<pre><code class="language-js"><span class="hljs-keyword">import</span> { ref } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;vue&#x27;</span>;\n\n<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> {\n <span class="hljs-title function_">setup</span>(<span class="hljs-params"></span>) {\n <span class="hljs-keyword">const</span> currentTime = <span class="hljs-title function_">ref</span>([<span class="hljs-string">&#x27;12&#x27;</span>, <span class="hljs-string">&#x27;00&#x27;</span>, <span class="hljs-string">&#x27;00&#x27;</span>]);\n <span class="hljs-keyword">const</span> columnsType = [<span class="hljs-string">&#x27;hour&#x27;</span>, <span class="hljs-string">&#x27;minute&#x27;</span>, <span class="hljs-string">&#x27;second&#x27;</span>];\n <span class="hljs-keyword">return</span> {\n currentTime,\n columnsType,\n };\n },\n};\n</code></pre>\n</div><div class="van-doc-card"><h3 id="shi-jian-fan-wei" tabindex="-1">\u65F6\u95F4\u8303\u56F4</h3>\n<p>\u4F60\u53EF\u4EE5\u4F7F\u7528 <code>min-hour</code> \u548C <code>max-hour</code> \u7B49\u5C5E\u6027\u6765\u9650\u5236\u5C0F\u65F6\uFF08hour\uFF09\u8303\u56F4\u3001\u5206\u949F\uFF08minute\uFF09\u8303\u56F4\u548C\u79D2\uFF08second\uFF09\u8303\u56F4\u3002</p>\n<p>\u6BD4\u5982\u4EE5\u4E0B\u793A\u4F8B\uFF0C\u7528\u6237\u53EF\u4EE5\u9009\u62E9\u7684\u5C0F\u65F6\u662F <code>10 ~ 20</code> \uFF0C\u5206\u949F\u662F <code>30 ~ 40</code>\u3002</p>\n<pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-time-picker</span>\n <span class="hljs-attr">v-model</span>=<span class="hljs-string">&quot;currentTime&quot;</span>\n <span class="hljs-attr">title</span>=<span class="hljs-string">&quot;\u9009\u62E9\u65F6\u95F4&quot;</span>\n <span class="hljs-attr">:min-hour</span>=<span class="hljs-string">&quot;10&quot;</span>\n <span class="hljs-attr">:max-hour</span>=<span class="hljs-string">&quot;20&quot;</span>\n <span class="hljs-attr">:min-minute</span>=<span class="hljs-string">&quot;30&quot;</span>\n <span class="hljs-attr">:max-minute</span>=<span class="hljs-string">&quot;40&quot;</span>\n/&gt;</span>\n</code></pre>\n<pre><code class="language-js"><span class="hljs-keyword">import</span> { ref } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;vue&#x27;</span>;\n\n<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> {\n <span class="hljs-title function_">setup</span>(<span class="hljs-params"></span>) {\n <span class="hljs-keyword">const</span> currentTime = <span class="hljs-title function_">ref</span>([<span class="hljs-string">&#x27;12&#x27;</span>, <span class="hljs-string">&#x27;35&#x27;</span>]);\n <span class="hljs-keyword">return</span> { currentTime };\n },\n};\n</code></pre>\n</div><div class="van-doc-card"><h3 id="zheng-ti-shi-jian-fan-wei" tabindex="-1">\u6574\u4F53\u65F6\u95F4\u8303\u56F4</h3>\n<p>\u4F60\u53EF\u4EE5\u4F7F\u7528 <code>min-time</code> \u548C <code>max-time</code> \u5C5E\u6027\u6765\u9650\u5236\u6574\u4F53\u65F6\u95F4\u8303\u56F4\uFF0C\u7EA6\u5B9A\u683C\u5F0F <code>10:00:00</code>\u3002</p>\n<ul>\n<li>\u8BBE\u7F6E <code>min-time</code> \u540E\uFF0C<code>min-hour</code>\u3001<code>min-minute</code>\u3001<code>min-second</code> \u5C5E\u6027\u5C06\u4E0D\u4F1A\u751F\u6548\u3002</li>\n<li>\u8BBE\u7F6E <code>max-time</code> \u540E\uFF0C<code>max-hour</code>\u3001<code>max-minute</code>\u3001<code>max-second</code> \u5C5E\u6027\u5C06\u4E0D\u4F1A\u751F\u6548\u3002</li>\n</ul>\n<p>\u6BD4\u5982\u4EE5\u4E0B\u793A\u4F8B\uFF0C\u7528\u6237\u53EF\u4EE5\u9009\u62E9\u4ECE <code>09:40:10</code> \u5230 <code>20:20:50</code> \u7684\u4EFB\u610F\u65F6\u95F4\u3002</p>\n<pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-time-picker</span>\n <span class="hljs-attr">v-model</span>=<span class="hljs-string">&quot;currentTime&quot;</span>\n <span class="hljs-attr">title</span>=<span class="hljs-string">&quot;\u9009\u62E9\u65F6\u95F4&quot;</span>\n <span class="hljs-attr">:columns-type</span>=<span class="hljs-string">&quot;[&#x27;hour&#x27;, &#x27;minute&#x27;, &#x27;second&#x27;]&quot;</span>\n <span class="hljs-attr">min-time</span>=<span class="hljs-string">&quot;09:40:10&quot;</span>\n <span class="hljs-attr">max-time</span>=<span class="hljs-string">&quot;20:20:50&quot;</span>\n/&gt;</span>\n</code></pre>\n<pre><code class="language-js"><span class="hljs-keyword">import</span> { ref } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;vue&#x27;</span>;\n\n<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> {\n <span class="hljs-title function_">setup</span>(<span class="hljs-params"></span>) {\n <span class="hljs-keyword">const</span> currentTime = <span class="hljs-title function_">ref</span>([<span class="hljs-string">&#x27;12&#x27;</span>, <span class="hljs-string">&#x27;00&#x27;</span>, <span class="hljs-string">&#x27;00&#x27;</span>]);\n <span class="hljs-keyword">return</span> { currentTime };\n },\n};\n</code></pre>\n</div><div class="van-doc-card"><h3 id="ge-shi-hua-xuan-xiang" tabindex="-1">\u683C\u5F0F\u5316\u9009\u9879</h3>\n<p>\u901A\u8FC7\u4F20\u5165 <code>formatter</code> \u51FD\u6570\uFF0C\u53EF\u4EE5\u5BF9\u9009\u9879\u7684\u6587\u5B57\u8FDB\u884C\u683C\u5F0F\u5316\u3002</p>\n<pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-time-picker</span>\n <span class="hljs-attr">v-model</span>=<span class="hljs-string">&quot;currentTime&quot;</span>\n <span class="hljs-attr">title</span>=<span class="hljs-string">&quot;\u9009\u62E9\u65F6\u95F4&quot;</span>\n <span class="hljs-attr">:formatter</span>=<span class="hljs-string">&quot;formatter&quot;</span>\n/&gt;</span>\n</code></pre>\n<pre><code class="language-js"><span class="hljs-keyword">import</span> { ref } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;vue&#x27;</span>;\n\n<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> {\n <span class="hljs-title function_">setup</span>(<span class="hljs-params"></span>) {\n <span class="hljs-keyword">const</span> currentTime = <span class="hljs-title function_">ref</span>([<span class="hljs-string">&#x27;12&#x27;</span>, <span class="hljs-string">&#x27;00&#x27;</span>]);\n <span class="hljs-keyword">const</span> <span class="hljs-title function_">formatter</span> = (<span class="hljs-params">type, option</span>) =&gt; {\n <span class="hljs-keyword">if</span> (type === <span class="hljs-string">&#x27;hour&#x27;</span>) {\n option.<span class="hljs-property">text</span> += <span class="hljs-string">&#x27;\u65F6&#x27;</span>;\n }\n <span class="hljs-keyword">if</span> (type === <span class="hljs-string">&#x27;minute&#x27;</span>) {\n option.<span class="hljs-property">text</span> += <span class="hljs-string">&#x27;\u5206&#x27;</span>;\n }\n <span class="hljs-keyword">return</span> option;\n };\n\n <span class="hljs-keyword">return</span> {\n formatter,\n currentTime,\n };\n },\n};\n</code></pre>\n</div><div class="van-doc-card"><h3 id="guo-lu-xuan-xiang" tabindex="-1">\u8FC7\u6EE4\u9009\u9879</h3>\n<p>\u901A\u8FC7\u4F20\u5165 <code>filter</code> \u51FD\u6570\uFF0C\u53EF\u4EE5\u5BF9\u9009\u9879\u6570\u7EC4\u8FDB\u884C\u8FC7\u6EE4\uFF0C\u5254\u9664\u4E0D\u9700\u8981\u7684\u65F6\u95F4\uFF0C\u5B9E\u73B0\u81EA\u5B9A\u4E49\u65F6\u95F4\u95F4\u9694\u3002</p>\n<pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-time-picker</span> <span class="hljs-attr">v-model</span>=<span class="hljs-string">&quot;currentTime&quot;</span> <span class="hljs-attr">title</span>=<span class="hljs-string">&quot;\u9009\u62E9\u65F6\u95F4&quot;</span> <span class="hljs-attr">:filter</span>=<span class="hljs-string">&quot;filter&quot;</span> /&gt;</span>\n</code></pre>\n<pre><code class="language-js"><span class="hljs-keyword">import</span> { ref } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;vue&#x27;</span>;\n\n<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> {\n <span class="hljs-title function_">setup</span>(<span class="hljs-params"></span>) {\n <span class="hljs-keyword">const</span> currentTime = <span class="hljs-title function_">ref</span>([<span class="hljs-string">&#x27;12&#x27;</span>, <span class="hljs-string">&#x27;00&#x27;</span>]);\n <span class="hljs-keyword">const</span> <span class="hljs-title function_">filter</span> = (<span class="hljs-params">type, options</span>) =&gt; {\n <span class="hljs-keyword">if</span> (type === <span class="hljs-string">&#x27;minute&#x27;</span>) {\n <span class="hljs-keyword">return</span> options.<span class="hljs-title function_">filter</span>(<span class="hljs-function">(<span class="hljs-params">option</span>) =&gt;</span> <span class="hljs-title class_">Number</span>(option.<span class="hljs-property">value</span>) % <span class="hljs-number">10</span> === <span class="hljs-number">0</span>);\n }\n <span class="hljs-keyword">return</span> options;\n };\n\n <span class="hljs-keyword">return</span> {\n filter,\n currentTime,\n };\n },\n};\n</code></pre>\n</div><div class="van-doc-card"><h3 id="gao-ji-yong-fa" tabindex="-1">\u9AD8\u7EA7\u7528\u6CD5</h3>\n<p><code>filter</code> \u51FD\u6570\u7684\u7B2C\u4E09\u4E2A\u53C2\u6570\u80FD\u83B7\u53D6\u5230\u5F53\u524D\u9009\u62E9\u7684\u65F6\u95F4\uFF0C\u8FD9\u5728\u4F7F\u7528\u975E\u53D7\u63A7\u6A21\u5F0F\u65F6\uFF0C\u53EF\u4EE5\u66F4\u7075\u6D3B\u5730\u8FC7\u6EE4\u6389\u4E0D\u9700\u8981\u7684\u65F6\u95F4\u3002</p>\n<pre><code class="language-html"><span class="hljs-tag">&lt;<span class="hljs-name">van-time-picker</span> <span class="hljs-attr">title</span>=<span class="hljs-string">&quot;\u9009\u62E9\u65F6\u95F4&quot;</span> <span class="hljs-attr">:filter</span>=<span class="hljs-string">&quot;filter&quot;</span> /&gt;</span>\n</code></pre>\n<pre><code class="language-js"><span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> {\n <span class="hljs-title function_">setup</span>(<span class="hljs-params"></span>) {\n <span class="hljs-keyword">const</span> <span class="hljs-title function_">filter</span> = (<span class="hljs-params">type, options, values</span>) =&gt; {\n <span class="hljs-keyword">const</span> hour = +values[<span class="hljs-number">0</span>];\n\n <span class="hljs-keyword">if</span> (type === <span class="hljs-string">&#x27;hour&#x27;</span>) {\n <span class="hljs-keyword">return</span> options.<span class="hljs-title function_">filter</span>(\n <span class="hljs-function">(<span class="hljs-params">option</span>) =&gt;</span> <span class="hljs-title class_">Number</span>(option.<span class="hljs-property">value</span>) &gt;= <span class="hljs-number">8</span> &amp;&amp; <span class="hljs-title class_">Number</span>(option.<span class="hljs-property">value</span>) &lt;= <span class="hljs-number">18</span>,\n );\n }\n\n <span class="hljs-keyword">if</span> (type === <span class="hljs-string">&#x27;minute&#x27;</span>) {\n options = options.<span class="hljs-title function_">filter</span>(<span class="hljs-function">(<span class="hljs-params">option</span>) =&gt;</span> <span class="hljs-title class_">Number</span>(option.<span class="hljs-property">value</span>) % <span class="hljs-number">10</span> === <span class="hljs-number">0</span>);\n\n <span class="hljs-keyword">if</span> (hour === <span class="hljs-number">8</span>) {\n <span class="hljs-keyword">return</span> options.<span class="hljs-title function_">filter</span>(<span class="hljs-function">(<span class="hljs-params">option</span>) =&gt;</span> <span class="hljs-title class_">Number</span>(option.<span class="hljs-property">value</span>) &gt;= <span class="hljs-number">40</span>);\n }\n\n <span class="hljs-keyword">if</span> (hour === <span class="hljs-number">18</span>) {\n <span class="hljs-keyword">return</span> options.<span class="hljs-title function_">filter</span>(<span class="hljs-function">(<span class="hljs-params">option</span>) =&gt;</span> <span class="hljs-title class_">Number</span>(option.<span class="hljs-property">value</span>) &lt;= <span class="hljs-number">20</span>);\n }\n }\n\n <span class="hljs-keyword">return</span> options;\n };\n\n <span class="hljs-keyword">return</span> {\n filter,\n };\n },\n};\n</code></pre>\n</div><h2 id="api" tabindex="-1">API</h2>\n<div class="van-doc-card"><h3 id="props" tabindex="-1">Props</h3>\n<table>\n<thead>\n<tr>\n<th>\u53C2\u6570</th>\n<th>\u8BF4\u660E</th>\n<th>\u7C7B\u578B</th>\n<th>\u9ED8\u8BA4\u503C</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>v-model</td>\n<td>\u5F53\u524D\u9009\u4E2D\u7684\u65F6\u95F4</td>\n<td><em>string[]</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>columns-type</td>\n<td>\u9009\u9879\u7C7B\u578B\uFF0C\u7531 <code>hour</code>\u3001<code>minute</code> \u548C <code>second</code> \u7EC4\u6210\u7684\u6570\u7EC4</td>\n<td><em>string[]</em></td>\n<td><code>[\'hour\', \'minute\']</code></td>\n</tr>\n<tr>\n<td>min-hour</td>\n<td>\u53EF\u9009\u7684\u6700\u5C0F\u5C0F\u65F6</td>\n<td><em>number | string</em></td>\n<td><code>0</code></td>\n</tr>\n<tr>\n<td>max-hour</td>\n<td>\u53EF\u9009\u7684\u6700\u5927\u5C0F\u65F6</td>\n<td><em>number | string</em></td>\n<td><code>23</code></td>\n</tr>\n<tr>\n<td>min-minute</td>\n<td>\u53EF\u9009\u7684\u6700\u5C0F\u5206\u949F</td>\n<td><em>number | string</em></td>\n<td><code>0</code></td>\n</tr>\n<tr>\n<td>max-minute</td>\n<td>\u53EF\u9009\u7684\u6700\u5927\u5206\u949F</td>\n<td><em>number | string</em></td>\n<td><code>59</code></td>\n</tr>\n<tr>\n<td>min-second</td>\n<td>\u53EF\u9009\u7684\u6700\u5C0F\u79D2\u6570</td>\n<td><em>number | string</em></td>\n<td><code>0</code></td>\n</tr>\n<tr>\n<td>max-second</td>\n<td>\u53EF\u9009\u7684\u6700\u5927\u79D2\u6570</td>\n<td><em>number | string</em></td>\n<td><code>59</code></td>\n</tr>\n<tr>\n<td>min-time <code>v4.5.0</code></td>\n<td>\u53EF\u9009\u7684\u6700\u5C0F\u65F6\u95F4\uFF0C\u683C\u5F0F\u53C2\u8003 <code>07:40:00</code>\uFF0C\u4F7F\u7528\u65F6 <code>min-hour</code> <code>min-minute</code> <code>min-second</code> \u4E0D\u4F1A\u751F\u6548</td>\n<td><em>string</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>max-time <code>v4.5.0</code></td>\n<td>\u53EF\u9009\u7684\u6700\u5927\u65F6\u95F4\uFF0C\u683C\u5F0F\u53C2\u8003 <code>10:20:00</code>\uFF0C\u4F7F\u7528\u65F6 <code>max-hour</code> <code>max-minute</code> <code>max-second</code> \u4E0D\u4F1A\u751F\u6548</td>\n<td><em>string</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>title</td>\n<td>\u9876\u90E8\u680F\u6807\u9898</td>\n<td><em>string</em></td>\n<td><code>\'\'</code></td>\n</tr>\n<tr>\n<td>confirm-button-text</td>\n<td>\u786E\u8BA4\u6309\u94AE\u6587\u5B57</td>\n<td><em>string</em></td>\n<td><code>\u786E\u8BA4</code></td>\n</tr>\n<tr>\n<td>cancel-button-text</td>\n<td>\u53D6\u6D88\u6309\u94AE\u6587\u5B57</td>\n<td><em>string</em></td>\n<td><code>\u53D6\u6D88</code></td>\n</tr>\n<tr>\n<td>show-toolbar</td>\n<td>\u662F\u5426\u663E\u793A\u9876\u90E8\u680F</td>\n<td><em>boolean</em></td>\n<td><code>true</code></td>\n</tr>\n<tr>\n<td>loading</td>\n<td>\u662F\u5426\u663E\u793A\u52A0\u8F7D\u72B6\u6001</td>\n<td><em>boolean</em></td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td>readonly</td>\n<td>\u662F\u5426\u4E3A\u53EA\u8BFB\u72B6\u6001\uFF0C\u53EA\u8BFB\u72B6\u6001\u4E0B\u65E0\u6CD5\u5207\u6362\u9009\u9879</td>\n<td><em>boolean</em></td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td>filter</td>\n<td>\u9009\u9879\u8FC7\u6EE4\u51FD\u6570</td>\n<td><em>(type: string, options: PickerOption[], values: string[]) =&gt; PickerOption[]</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>formatter</td>\n<td>\u9009\u9879\u683C\u5F0F\u5316\u51FD\u6570</td>\n<td><em>(type: string, option: PickerOption) =&gt; PickerOption</em></td>\n<td>-</td>\n</tr>\n<tr>\n<td>option-height</td>\n<td>\u9009\u9879\u9AD8\u5EA6\uFF0C\u652F\u6301 <code>px</code> <code>vw</code> <code>vh</code> <code>rem</code> \u5355\u4F4D\uFF0C\u9ED8\u8BA4 <code>px</code></td>\n<td><em>number | string</em></td>\n<td><code>44</code></td>\n</tr>\n<tr>\n<td>visible-option-num</td>\n<td>\u53EF\u89C1\u7684\u9009\u9879\u4E2A\u6570</td>\n<td><em>number | string</em></td>\n<td><code>6</code></td>\n</tr>\n<tr>\n<td>swipe-duration</td>\n<td>\u5FEB\u901F\u6ED1\u52A8\u65F6\u60EF\u6027\u6EDA\u52A8\u7684\u65F6\u957F\uFF0C\u5355\u4F4D <code>ms</code></td>\n<td><em>number | string</em></td>\n<td><code>1000</code></td>\n</tr>\n</tbody>\n</table>\n</div><div class="van-doc-card"><h3 id="events" tabindex="-1">Events</h3>\n<table>\n<thead>\n<tr>\n<th>\u4E8B\u4EF6\u540D</th>\n<th>\u8BF4\u660E</th>\n<th>\u56DE\u8C03\u53C2\u6570</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>confirm</td>\n<td>\u70B9\u51FB\u5B8C\u6210\u6309\u94AE\u65F6\u89E6\u53D1</td>\n<td><em>{ selectedValues, selectedOptions, selectedIndexes }</em></td>\n</tr>\n<tr>\n<td>cancel</td>\n<td>\u70B9\u51FB\u53D6\u6D88\u6309\u94AE\u65F6\u89E6\u53D1</td>\n<td><em>{ selectedValues, selectedOptions, selectedIndexes }</em></td>\n</tr>\n<tr>\n<td>change</td>\n<td>\u9009\u9879\u6539\u53D8\u65F6\u89E6\u53D1</td>\n<td><em>{ selectedValues, selectedOptions, selectedIndexes, columnIndex }</em></td>\n</tr>\n</tbody>\n</table>\n</div><div class="van-doc-card"><h3 id="slots" tabindex="-1">Slots</h3>\n<table>\n<thead>\n<tr>\n<th>\u540D\u79F0</th>\n<th>\u8BF4\u660E</th>\n<th>\u53C2\u6570</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>toolbar</td>\n<td>\u81EA\u5B9A\u4E49\u6574\u4E2A\u9876\u90E8\u680F\u7684\u5185\u5BB9</td>\n<td>-</td>\n</tr>\n<tr>\n<td>title</td>\n<td>\u81EA\u5B9A\u4E49\u6807\u9898\u5185\u5BB9</td>\n<td>-</td>\n</tr>\n<tr>\n<td>confirm</td>\n<td>\u81EA\u5B9A\u4E49\u786E\u8BA4\u6309\u94AE\u5185\u5BB9</td>\n<td>-</td>\n</tr>\n<tr>\n<td>cancel</td>\n<td>\u81EA\u5B9A\u4E49\u53D6\u6D88\u6309\u94AE\u5185\u5BB9</td>\n<td>-</td>\n</tr>\n<tr>\n<td>option</td>\n<td>\u81EA\u5B9A\u4E49\u9009\u9879\u5185\u5BB9</td>\n<td><em>option: PickerOption, index: number</em></td>\n</tr>\n<tr>\n<td>columns-top</td>\n<td>\u81EA\u5B9A\u4E49\u9009\u9879\u4E0A\u65B9\u5185\u5BB9</td>\n<td>-</td>\n</tr>\n<tr>\n<td>columns-bottom</td>\n<td>\u81EA\u5B9A\u4E49\u9009\u9879\u4E0B\u65B9\u5185\u5BB9</td>\n<td>-</td>\n</tr>\n</tbody>\n</table>\n</div><div class="van-doc-card"><h3 id="fang-fa" tabindex="-1">\u65B9\u6CD5</h3>\n<p>\u901A\u8FC7 ref \u53EF\u4EE5\u83B7\u53D6\u5230 Picker \u5B9E\u4F8B\u5E76\u8C03\u7528\u5B9E\u4F8B\u65B9\u6CD5\uFF0C\u8BE6\u89C1<a href="#/zh-CN/advanced-usage#zu-jian-shi-li-fang-fa" target="_blank">\u7EC4\u4EF6\u5B9E\u4F8B\u65B9\u6CD5</a>\u3002</p>\n<table>\n<thead>\n<tr>\n<th>\u65B9\u6CD5\u540D</th>\n<th>\u8BF4\u660E</th>\n<th>\u53C2\u6570</th>\n<th>\u8FD4\u56DE\u503C</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>confirm</td>\n<td>\u505C\u6B62\u60EF\u6027\u6EDA\u52A8\u5E76\u89E6\u53D1 <code>confirm</code> \u4E8B\u4EF6</td>\n<td>-</td>\n<td>-</td>\n</tr>\n<tr>\n<td>getSelectedTime</td>\n<td>\u83B7\u53D6\u5F53\u524D\u9009\u4E2D\u7684\u65F6\u95F4</td>\n<td>-</td>\n<td><em>string[]</em></td>\n</tr>\n</tbody>\n</table>\n</div><div class="van-doc-card"><h3 id="lei-xing-ding-yi" tabindex="-1">\u7C7B\u578B\u5B9A\u4E49</h3>\n<p>\u7EC4\u4EF6\u5BFC\u51FA\u4EE5\u4E0B\u7C7B\u578B\u5B9A\u4E49\uFF1A</p>\n<pre><code class="language-ts"><span class="hljs-keyword">import</span> <span class="hljs-keyword">type</span> { <span class="hljs-title class_">TimePickerProps</span>, <span class="hljs-title class_">TimePickerColumnType</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;vant&#x27;</span>;\n</code></pre>\n<p><code>TimePickerInstance</code> \u662F\u7EC4\u4EF6\u5B9E\u4F8B\u7684\u7C7B\u578B\uFF0C\u7528\u6CD5\u5982\u4E0B\uFF1A</p>\n<pre><code class="language-ts"><span class="hljs-keyword">import</span> { ref } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;vue&#x27;</span>;\n<span class="hljs-keyword">import</span> <span class="hljs-keyword">type</span> { <span class="hljs-title class_">TimePickerInstance</span> } <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;vant&#x27;</span>;\n\n<span class="hljs-keyword">const</span> timePickerRef = ref&lt;<span class="hljs-title class_">TimePickerInstance</span>&gt;();\n\ntimePickerRef.<span class="hljs-property">value</span>?.<span class="hljs-title function_">confirm</span>();\n</code></pre>\n</div><h2 id="chang-jian-wen-ti" tabindex="-1">\u5E38\u89C1\u95EE\u9898</h2>\n<div class="van-doc-card"><h3 id="zai-zhuo-mian-duan-wu-fa-cao-zuo-zu-jian" tabindex="-1">\u5728\u684C\u9762\u7AEF\u65E0\u6CD5\u64CD\u4F5C\u7EC4\u4EF6\uFF1F</h3>\n<p>\u53C2\u89C1<a href="#/zh-CN/advanced-usage#zhuo-mian-duan-gua-pei" target="_blank">\u684C\u9762\u7AEF\u9002\u914D</a>\u3002</p>\n</div>'},null,8,e))}}}]);