Good day,
I have a v-file-input like so:
<v-file-input
:rules="rules"
accept="text/csv"
label="Select a CSV file..."
></v-file-input>
Here is my rule that is supposed to detect when the file doesn't have a ".csv" extension:
rules: [
file => {
const pattern = /\.csv$/;
return (
!file || pattern.test(file) || 'File type should be csv.'
)
}
],
But it doesn't work. Whether I select a .txt, .csv, or .jar, the file-input thinks they're all invalid.
How can I get it only error on a non-csv file?
Thank you for any assistance.