Open blpraveen opened 5 years ago
I need to upload an image in vform.
<form @submit.prevent="editmode ? updatePost() : createPost()"> <div class="modal-body"> <div class="form-group"> <input v-model="form.title" id="title" type="text" name="title" placeholder="Title" class="form-control" :class="{ 'is-invalid': form.errors.has('title') }"> <has-error :form="form" field="title"></has-error> </div> <div class="form-group"> <input v-model="form.featured" id="featured" type="file" name="featured" placeholder="Featured Image" @change="selectFile" class="form-control" :class="{ 'is-invalid': form.errors.has('featured') }"> <has-error :form="form" field="featured"></has-error> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-danger" data-dismiss="modal">Close</button> <button v-show="editmode" type="submit" class="btn btn-success">Update</button> <button v-show="!editmode" type="submit" class="btn btn-primary">Create</button> </div> </form>
I need to upload an image in vform.