Importar de excel
/components/dna/excel-import/Index.vue
Forma de uso
<template>
<div>
<excel-import
:scheme="scheme"
template-doc-text="Descargar plantilla"
template-doc-filename="Plantilla"
finished-button-text="Ejecutar importación"
@finished="handleData"
/>
</div>
</template><script>
import ExcelImport from '~/components/dna/excel-import/Index'
import { Utils } from '~/mixins/utils'
export default {
mixins: [Utils()],
components: {
ExcelImport,
},
data() {
return {
scheme: [
{ key: 'id', label: 'ID', id: true },
{ key: 'name', label: 'Nombre' },
{
key: 'rut',
label: 'RUT',
rules: 'required|run|unique_in_doc',
format: (rut) => (rut ? this.runFormatting(`${rut}`) : rut),
},
{ key: 'position', label: 'Cargo' },
{ key: 'status', label: 'Estado' },
],
}
},
methods: {
handleData(data) {
console.log(data)
},
},
}
</script>Scheme
Última actualización