/*! For license information please see 43.98605bac.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([["43"],{78569: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:'
\u5E26\u7F51\u683C\u7684\u8F93\u5165\u6846\u7EC4\u4EF6\uFF0C\u53EF\u4EE5\u7528\u4E8E\u8F93\u5165\u5BC6\u7801\u3001\u77ED\u4FE1\u9A8C\u8BC1\u7801\u7B49\u573A\u666F\uFF0C\u901A\u5E38\u4E0E\u6570\u5B57\u952E\u76D8\u7EC4\u4EF6\u914D\u5408\u4F7F\u7528\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 { PasswordInput, NumberKeyboard } from 'vant';\n\nconst app = createApp();\napp.use(PasswordInput);\napp.use(NumberKeyboard);\n
\n\u642D\u914D\u6570\u5B57\u952E\u76D8\u7EC4\u4EF6\u6765\u5B9E\u73B0\u5BC6\u7801\u8F93\u5165\u529F\u80FD\u3002
\n<!-- \u5BC6\u7801\u8F93\u5165\u6846 -->\n<van-password-input\n :value="value"\n :focused="showKeyboard"\n @focus="showKeyboard = true"\n/>\n<!-- \u6570\u5B57\u952E\u76D8 -->\n<van-number-keyboard\n v-model="value"\n :show="showKeyboard"\n @blur="showKeyboard = false"\n/>\n
\nimport { ref } from 'vue';\n\nexport default {\n setup() {\n const value = ref('123');\n const showKeyboard = ref(true);\n\n return {\n value,\n showKeyboard,\n };\n },\n};\n
\n\u901A\u8FC7 length
\u5C5E\u6027\u6765\u8BBE\u7F6E\u5BC6\u7801\u957F\u5EA6\u3002
<van-password-input\n :value="value"\n :length="4"\n :focused="showKeyboard"\n @focus="showKeyboard = true"\n/>\n
\n\u901A\u8FC7 gutter
\u5C5E\u6027\u6765\u8BBE\u7F6E\u683C\u5B50\u4E4B\u95F4\u7684\u95F4\u8DDD\u3002
<van-password-input\n :value="value"\n :gutter="10"\n :focused="showKeyboard"\n @focus="showKeyboard = true"\n/>\n
\n\u5C06 mask
\u8BBE\u7F6E\u4E3A false
\u53EF\u4EE5\u660E\u6587\u5C55\u793A\u8F93\u5165\u7684\u5185\u5BB9\uFF0C\u9002\u7528\u4E8E\u77ED\u4FE1\u9A8C\u8BC1\u7801\u7B49\u573A\u666F\u3002
<van-password-input\n :value="value"\n :mask="false"\n :focused="showKeyboard"\n @focus="showKeyboard = true"\n/>\n
\n\u901A\u8FC7 info
\u5C5E\u6027\u8BBE\u7F6E\u63D0\u793A\u4FE1\u606F\uFF0C\u901A\u8FC7 error-info
\u5C5E\u6027\u8BBE\u7F6E\u9519\u8BEF\u63D0\u793A\uFF0C\u4F8B\u5982\u5F53\u8F93\u5165\u516D\u4F4D\u65F6\u63D0\u793A\u5BC6\u7801\u9519\u8BEF\u3002
<van-password-input\n :value="value"\n info="\u5BC6\u7801\u4E3A 6 \u4F4D\u6570\u5B57"\n :error-info="errorInfo"\n :focused="showKeyboard"\n @focus="showKeyboard = true"\n/>\n<van-number-keyboard\n v-model="value"\n :show="showKeyboard"\n @blur="showKeyboard = false"\n/>\n
\nimport { ref, watch } from 'vue';\n\nexport default {\n setup() {\n const value = ref('123');\n const errorInfo = ref('');\n const showKeyboard = ref(true);\n\n watch(value, (newVal) => {\n if (newVal.length === 6 && newVal !== '123456') {\n errorInfo.value = '\u5BC6\u7801\u9519\u8BEF';\n } else {\n errorInfo.value = '';\n }\n });\n\n return {\n value,\n errorInfo,\n showKeyboard,\n };\n },\n};\n
\n\u53C2\u6570 | \n\u8BF4\u660E | \n\u7C7B\u578B | \n\u9ED8\u8BA4\u503C | \n
---|---|---|---|
value | \n\u5BC6\u7801\u503C | \nstring | \n\'\' | \n
info | \n\u8F93\u5165\u6846\u4E0B\u65B9\u6587\u5B57\u63D0\u793A | \nstring | \n- | \n
error-info | \n\u8F93\u5165\u6846\u4E0B\u65B9\u9519\u8BEF\u63D0\u793A | \nstring | \n- | \n
length | \n\u5BC6\u7801\u6700\u5927\u957F\u5EA6 | \nnumber | string | \n6 | \n
gutter | \n\u8F93\u5165\u6846\u683C\u5B50\u4E4B\u95F4\u7684\u95F4\u8DDD\uFF0C\u5982 20px 2em \uFF0C\u9ED8\u8BA4\u5355\u4F4D\u4E3Apx | \nnumber | string | \n0 | \n
mask | \n\u662F\u5426\u9690\u85CF\u5BC6\u7801\u5185\u5BB9 | \nboolean | \ntrue | \n
focused | \n\u662F\u5426\u5DF2\u805A\u7126\uFF0C\u805A\u7126\u65F6\u4F1A\u663E\u793A\u5149\u6807 | \nboolean | \nfalse | \n
\u4E8B\u4EF6\u540D | \n\u8BF4\u660E | \n\u56DE\u8C03\u53C2\u6570 | \n
---|---|---|
focus | \n\u8F93\u5165\u6846\u805A\u7126\u65F6\u89E6\u53D1 | \n- | \n
\u7EC4\u4EF6\u5BFC\u51FA\u4EE5\u4E0B\u7C7B\u578B\u5B9A\u4E49\uFF1A
\nimport type { PasswordInputProps } 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-password-input-height | \n50px | \n- | \n
--van-password-input-margin | \n0 var(--van-padding-md) | \n- | \n
--van-password-input-font-size | \n20px | \n- | \n
--van-password-input-radius | \n6px | \n- | \n
--van-password-input-background | \nvar(--van-background-2) | \n- | \n
--van-password-input-info-color | \nvar(--van-text-color-2) | \n- | \n
--van-password-input-info-font-size | \nvar(--van-font-size-md) | \n- | \n
--van-password-input-error-info-color | \nvar(--van-danger-color) | \n- | \n
--van-password-input-dot-size | \n10px | \n- | \n
--van-password-input-dot-color | \nvar(--van-text-color) | \n- | \n
--van-password-input-text-color | \nvar(--van-text-color) | \n- | \n
--van-password-input-cursor-color | \nvar(--van-text-color) | \n- | \n
--van-password-input-cursor-width | \n1px | \n- | \n
--van-password-input-cursor-height | \n40% | \n- | \n
--van-password-input-cursor-duration | \n1s | \n- | \n