I am attempting to create a straightforward input component using Vue, where if the condition IsPassword is true, the type will be set to "password," and if it is false, the type will be set to "text."
I suspect there may be a syntax error causing a parsing JavaScript error.
This is a simplified version of my code
App.vue
import InputText from "@/components/InputText.vue";
<template>
Username : <InputText/>
Password : <InputText :isPassword="true">
</template>
InputText.vue
<template>
<input :type="{IsPassword ? 'password':'text'}" value="I am encountering an error here">
</template>
<script>
export default {
props: {
IsPassword: Boolean
}
}
</script>