<input v-model="password" required type="password" :placeholder="$t(('login.password'))" id="password" />
<script setup> const props = defineProps(['format', 'message', 'value']); const { format } = toRefs(props); function checkValid(){ if (!props.format || !props.value || (props.value.length < 4)) { return true; } const regex = new RegExp(format.value); console.log(regex.test(props.value)) return regex.test(props.value); }</script>
<script setup> const props = defineProps(['format', 'message', 'value']); const { test } = toRefs(props.format); function checkValid(){ if (!props.format || !props.value || (props.value.length < 4)) { return true; } const regex = new RegExp(test); console.log(regex.test(props.value)) return regex.test(props.value); }</script>