|
@@ -4,7 +4,7 @@
|
|
v-model="value"
|
|
v-model="value"
|
|
variant="outlined"
|
|
variant="outlined"
|
|
:density="item.dense || 'compact'"
|
|
:density="item.dense || 'compact'"
|
|
- :type="item.type"
|
|
|
|
|
|
+ :type="item.type === 'phoneNumber' ? 'number' : item.type"
|
|
:rules="item.rules"
|
|
:rules="item.rules"
|
|
:disabled="item.disabled"
|
|
:disabled="item.disabled"
|
|
:style="{width: item.width}"
|
|
:style="{width: item.width}"
|
|
@@ -34,6 +34,7 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script setup>
|
|
<script setup>
|
|
|
|
+import { useI18n } from '@/hooks/web/useI18n'; const { t } = useI18n()
|
|
import { debounce } from 'lodash'
|
|
import { debounce } from 'lodash'
|
|
import { ref, watch } from 'vue';
|
|
import { ref, watch } from 'vue';
|
|
defineOptions({ name:'FormUI-v-text-field'})
|
|
defineOptions({ name:'FormUI-v-text-field'})
|
|
@@ -86,6 +87,12 @@ const handleWheel = (event, item) => {
|
|
item.value++
|
|
item.value++
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+if (item.type === 'phoneNumber') {
|
|
|
|
+ const phoneRules = [v => !v || v?.length <= 11 && /^1[3456789]\d{9}$/.test(v) || t('login.correctPhoneNumber')]
|
|
|
|
+ item.rules = item.rules ? [ ...phoneRules, ...item.rules] : phoneRules
|
|
|
|
+ item.counter = item.counter ? item.counter : 11
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
|
|