Chamilo is a learning management system focused on ease of use and accessibility
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chamilo-lms/assets/vue/components/documents/FormUpload.vue

86 lines
1.6 KiB

<template>
<v-form>
<b-row>
<b-col
cols="12"
sm="6"
md="6"
>
<b-form-file
v-model="item.uploadFile"
show-size
placeholder="File upload"
drop-placeholder="Drop file here..."
/>
</b-col>
</b-row>
</v-form>
</template>
<script>
import has from 'lodash/has';
import { validationMixin } from 'vuelidate';
import { required } from 'vuelidate/lib/validators';
import { mapActions } from 'vuex';
import { mapFields } from 'vuex-map-fields';
export default {
name: 'DocumentsFormUpload',
mixins: [validationMixin],
props: {
values: {
type: Object,
required: true
},
errors: {
type: Object,
default: () => {}
},
initialValues: {
type: Object,
default: () => {}
}
},
data() {
return {
5 years ago
parentResourceNodeId: null,
uploadFile: null,
resourceLinkList: null,
5 years ago
filetype: null
};
},
computed: {
// eslint-disable-next-line
item() {
return this.initialValues || this.values;
},
titleErrors() {
const errors = [];
if (!this.$v.item.title.$dirty) return errors;
has(this.violations, 'title') && errors.push(this.violations.title);
!this.$v.item.title.required && errors.push(this.$t('Field is required'));
return errors;
},
violations() {
return this.errors || {};
}
},
methods: {
},
validations: {
item: {
5 years ago
parentResourceNodeId: {
},
uploadFile: {
},
resourceLinkList:{
},
5 years ago
filetype:{
}
}
}
};
</script>