Closed
Description
Hi)
I have simple component:
<template>
<div :class="[value && value.length > 2 ? 'has-success' : 'has-danger']">
<input type="text"
:class="['form-control', 'form-control-' + (value && value.length > 2 ? 'success' : 'danger')]"
:placeholder="placeholder"
:value="value"
@change="change"
@input="$emit('input', $event.target.value)">
</div>
</template>
<script type="text/javascript">
export default {
props: ['placeholder', 'value'],
methods: {
change(e) {
this.$emit('change', e.target.value);
}
}
}
</script>
And call:
<input-text v-model.trim="who_took" @change="orderUpdate($event, 'who_took')"></input-text>
But .trim
modifier dont working properly: class has-success
sets even if value
contains only spaces...
Metadata
Metadata
Assignees
Labels
No labels