OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Remove white space from v-text-field Vue

  • Thread starter Thread starter teestunna
  • Start date Start date
T

teestunna

Guest
I have a v-text-field in vue, and I will like to remove all white spaces or prevent any white space from it. For instance 'Project Number' input should be 'ProjectNumber'.

I have a function but this doesn't work, I tried keyup too.

Code:
<v-text-field
  @input='removeWhiteSpace(row.newCol)'
  outlined
  dense
  color="primary"
  style="width: 200px;"
  v-model="row.newCol">
</v-text-field>

removeWhiteSpace(text) {
  return text.replace(/[\s\/]/g, '');
}

<p>I have a <code>v-text-field</code> in vue, and I will like to remove all white spaces or prevent any white space from it. For instance <code>'Project Number'</code> input should be <code>'ProjectNumber'</code>.</p>
<p>I have a function but this doesn't work, I tried keyup too.</p>
<pre><code><v-text-field
@input='removeWhiteSpace(row.newCol)'
outlined
dense
color="primary"
style="width: 200px;"
v-model="row.newCol">
</v-text-field>

removeWhiteSpace(text) {
return text.replace(/[\s\/]/g, '');
}
</code></pre>
 

Latest posts

Online statistics

Members online
0
Guests online
4
Total visitors
4
Top