In my TextInput.vue
component, I have created a div.
<div ts-text-input :ts-text-input-filled="setFilledAttribute && !!value"
:ts-text-input-not-valid="!valueValid">
<input :value="value" @input="setValue" @keyup.enter="enterClicked" :placeholder="placeholder" :title="title">
I want to prevent users from entering spaces inside the input box, similar to a username input field behavior.
I tried using the trim()
function, but it doesn't seem to be working. Here's what I did:
In the computed function
computed: {
value: function() {
const {valueGetter, valueGetterOptions} = this,
getter = this.$store.getters[valueGetter];
value.trim();
return valueGetterOptions ? getter(valueGetterOptions) : getter;
},
Any suggestions on how to achieve this would be appreciated. Thank you. (Apologies for any language mistakes)