@@ -69,6 +69,7 @@ const isAllowPaste = ref(false)
6969const otpLength = ref (6 )
7070const currentOtpType = ref (' text' )
7171const currentSeparator = ref (' middle' )
72+ const isAllowSeparator = ref (false )
7273
7374const changeOnlyNumber = () => {
7475 otpInput .value .clear ()
@@ -84,6 +85,8 @@ const changeOtpType = () => {
8485}
8586
8687const changeSeparator = () => currentSeparator .value = currentSeparator .value === " middle" ? " all" : " middle"
88+
89+ const changeAllowSeparator = () => isAllowSeparator .value = ! isAllowSeparator .value
8790< / script>
8891< label> Current OTP Length is: ` {{ otpLength }}` < / label> < br / >
8992< label>< input type= " checkbox" : checked= " isOutlined" @change= " isOutlined = !isOutlined" > Outlined< / label>
@@ -93,6 +96,7 @@ const changeSeparator = () => currentSeparator.value = currentSeparator.value ==
9396< label>< input type= " checkbox" : checked= " isReadonly" @change= " isReadonly = !isReadonly" > Readonly< / label>
9497< label>< input type= " checkbox" : checked= " isAllowPaste" @change= " isAllowPaste = !isAllowPaste" > AllowPaste< / label> < br / >
9598< label>< input type= " checkbox" @change= " changeOtpType" > OTP type: ` {{ currentOtpType }}` < / label> < br / >
99+ < label>< input type= " checkbox" @change= " changeAllowSeparator" > Allow separator: ` {{ isAllowSeparator }}` < / label> < br / >
96100< label>< input type= " checkbox" @change= " changeSeparator" > Separator: ` {{ currentSeparator }}` < / label> < br / >
97101
98102
@@ -115,7 +119,7 @@ const changeSeparator = () => currentSeparator.value = currentSeparator.value ==
115119 : readonly= " isReadonly"
116120 : allowPaste= " isAllowPaste"
117121 : separatorType= " currentSeparator"
118- separator= " - "
122+ : separator= " isAllowSeparator ? '-' : '' "
119123/ >
120124<!-- Using
121125< button @click= " clearOtp" > Clear OTP < / button> -->
0 commit comments