@@ -69,6 +69,7 @@ const isAllowPaste = ref(false)
69
69
const otpLength = ref (6 )
70
70
const currentOtpType = ref (' text' )
71
71
const currentSeparator = ref (' middle' )
72
+ const isAllowSeparator = ref (false )
72
73
73
74
const changeOnlyNumber = () => {
74
75
otpInput .value .clear ()
@@ -84,6 +85,8 @@ const changeOtpType = () => {
84
85
}
85
86
86
87
const changeSeparator = () => currentSeparator .value = currentSeparator .value === " middle" ? " all" : " middle"
88
+
89
+ const changeAllowSeparator = () => isAllowSeparator .value = ! isAllowSeparator .value
87
90
< / script>
88
91
< label> Current OTP Length is: ` {{ otpLength }}` < / label> < br / >
89
92
< label>< input type= " checkbox" : checked= " isOutlined" @change= " isOutlined = !isOutlined" > Outlined< / label>
@@ -93,6 +96,7 @@ const changeSeparator = () => currentSeparator.value = currentSeparator.value ==
93
96
< label>< input type= " checkbox" : checked= " isReadonly" @change= " isReadonly = !isReadonly" > Readonly< / label>
94
97
< label>< input type= " checkbox" : checked= " isAllowPaste" @change= " isAllowPaste = !isAllowPaste" > AllowPaste< / label> < br / >
95
98
< label>< input type= " checkbox" @change= " changeOtpType" > OTP type: ` {{ currentOtpType }}` < / label> < br / >
99
+ < label>< input type= " checkbox" @change= " changeAllowSeparator" > Allow separator: ` {{ isAllowSeparator }}` < / label> < br / >
96
100
< label>< input type= " checkbox" @change= " changeSeparator" > Separator: ` {{ currentSeparator }}` < / label> < br / >
97
101
98
102
@@ -115,7 +119,7 @@ const changeSeparator = () => currentSeparator.value = currentSeparator.value ==
115
119
: readonly= " isReadonly"
116
120
: allowPaste= " isAllowPaste"
117
121
: separatorType= " currentSeparator"
118
- separator= " - "
122
+ : separator= " isAllowSeparator ? '-' : '' "
119
123
/ >
120
124
<!-- Using
121
125
< button @click= " clearOtp" > Clear OTP < / button> -->
0 commit comments