<form v-on:submit.prevent="guardarTipoProveedor" accept-charset="UTF-8" enctype="multipart/form-data">
    <div class="modal fade" id="modal-tipo-proveedor">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" v-text="editando ? 'Editar tipo de proveedor' : 'Crear tipo de proveedor'"></h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body pb-0">
                    <div class="row">
                        <div class="col">
                            <div class="form-group">
                                <label for="nombre">Nombre *</label>
                                <input v-model="tipoProveedor.nombre" name="nombre" type="text" class="form-control">
                            </div>
                            <div class="form-group">
                                <label for="direccion">Banner</label>
    
                                <div v-if="tipoProveedor.banner != ''" style="border: 1px solid #ced4da; position: relative;" class="rounded mb-4">
                                    <button v-on:click="borrarImagen" type="button" class="close" style="position: absolute; right: 20px; top: 15px;">
                                        <span aria-hidden="true">&times;</span>
                                    </button>
                                    <img :src="tipoProveedor.banner" class="my-2" alt="" width="100%">
                                </div>
        
                                <div class="input-group">
                                    <div class="custom-file">
                                        <input v-on:change="cargarImagen" ref="bannerFile" type="file" class="custom-file-input" id="inputGroupFile02" aria-describedby="inputGroupFileAddon03">
                                        <label class="custom-file-label" for="inputGroupFile02" data-browse="Buscar"></label>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer d-block">
                    <div v-if="errores != null" class="row">
                        <div class="col">
                            <div class="alert alert-danger mt-2" role="alert">
                                <ul class="mb-0">
                                    <li v-for="error in errores" class="text-danger">@{{ error[0] }}</li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col">
                            <input type="submit" class="btn btn-primary float-right" value="Guardar">
                            <button type="button" class="btn btn-secondary float-right mr-2" data-dismiss="modal">Cerrar</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>