Remove default v-input-file icon in Vuetify

2020-04-21 02:09发布

问题:

v-file-input is a new component that appeared in Vuetify v2.

<v-file-input multiple label="File input"></v-file-input>

The default behavior shows a prepended icon:

Is there a way to get rid of it ?

回答1:

Try this:

<v-file-input multiple label="File input" :prepend-icon="undefined"></v-file-input>

or

<v-file-input multiple label="File input" prepend-icon="fancyIconName"></v-file-input>


回答2:

<v-file-input multiple label="File input" prepend-icon=""></v-file-input>

You can disable (or change) it globally in whole app by initializing Vuetify like this:

new Vuetify({
    icons: {
      values: {
        file: ''
      },
    } 
  })

See the docs