diff --git a/src/components/UI/FormInput.vue b/src/components/UI/FormInput.vue index 5d1ec02a..84f7f538 100644 --- a/src/components/UI/FormInput.vue +++ b/src/components/UI/FormInput.vue @@ -6,23 +6,25 @@ interface Props { modelValue: string placeholder?: string limit?: number - hasAtmark?: boolean + icon?: 'magnify' | 'at' hasAnchor?: boolean } const props = withDefaults(defineProps(), { placeholder: '', limit: undefined, - hasAtmark: false, + icon: undefined, hasAnchor: false }) const emit = defineEmits<{ (e: 'update:modelValue', modelValue: string): void }>() -const isExceeded = computed( - () => props.limit && [...props.modelValue].length > props.limit -) +//Unicode Codepoint数でカウント +const textLength = computed(() => [...props.modelValue].length) + +const isExceeded = computed(() => props.limit && textLength.value > props.limit) + const isValidLink = computed(() => { let url try { @@ -40,7 +42,9 @@ const handleInput = (event: Event) => {