Vue Formulate 上 excel 文件的 MIME 验证是什么?

What is the MIME validation for excel files on Vue Formulate.?

Vue Formulate 上 excel 个文件的 MIME 类型是什么

我试过了

<FormulateInput
      type="image"
      name="headshot"
      label="Select an image to upload"
      :uploader="uploadFile"
      help="Select a png, jpg or gif to upload."
      validation="mime:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
    />

但这似乎不起作用。如何验证所选文件是否确实是 .xls.xlsx 文件 .?

vue formulate 附带的默认 mime 列表是 very small。然而,扩展列表非常容易:

import Vue from 'vue'
import VueFormulate from '@braid/vue-formulate'

Vue.use(VueFormulate, {
  mimes: {
    xls: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
    // ... any other mimes
  }
})

这里有相关文档:https://vueformulate.com/guide/inputs/types/file/#mime-types

完全披露:我是 Vue Formulate 的作者。