xxxxxxxxxx
1
<template>
2
<mdb-container>
3
<mdb-row>
4
<mdb-col md="4">
5
<mdb-file-input
6
@getValue="getFileInputValue"
7
circle
8
btnColor="mdb-color"
9
btn-title="ADD PHOTO"
10
rounded
11
img
12
:src="src"/>
13
</mdb-col>
14
</mdb-row>
15
</mdb-container>
16
</template>
xxxxxxxxxx
1
<style>
2
@import url("https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap");
3
.hello {
4
margin-top: 150px;
5
text-align: center;
6
}
7
h3 {
8
font-weight: normal;
9
padding-top: 20px;
10
padding-bottom: 30px;
11
}
12
p {
13
color: #969696;
14
margin-bottom: 0;
15
font-size: 14px;
16
}
17
</style>
xxxxxxxxxx
1
<script>
2
import { mdbCol, mdbFileInput, mdbContainer, mdbRow } from "mdbvue";
3
export default {
4
name: "FileInputPage",
5
components: {
6
mdbCol,
7
mdbFileInput,
8
mdbContainer,
9
mdbRow
10
},
11
data() {
12
return {
13
test: 'Test value',
14
src: 'https://mdbootstrap.com/img/Photos/Others/placeholder.jpg',
15
};
16
},
17
methods: {
18
getFileInputValue (val) {
19
this.src='';
20
setTimeout(()=>{
21
this.src="https://mdbootstrap.com/img/Photos/Others/placeholder.jpg"
22
}, 1000)
23
}
24
}
25
};
26
</script>
27
Console errors: 0