File tree 2 files changed +8
-31
lines changed
docs/app/pages/Components/File/examples
src/components/MdField/MdFile
2 files changed +8
-31
lines changed Original file line number Diff line number Diff line change 2
2
<div >
3
3
<md-field >
4
4
<label >Single</label >
5
- <md-file />
5
+ <md-file v-model = " single " />
6
6
</md-field >
7
7
8
8
<md-field >
9
9
<label >Upload files</label >
10
- <md-file placeholder =" A nice input placeholder" />
10
+ <md-file v-model = " placeholder" placeholder =" A nice input placeholder" />
11
11
</md-field >
12
12
13
13
<md-field >
14
14
<label >Disabled</label >
15
- <md-file disabled />
15
+ <md-file v-model = " disabled " disabled />
16
16
</md-field >
17
17
18
18
<md-field >
19
19
<label >Initial value</label >
20
- <md-file v-model =" initial" />
20
+ <md-file v-model =" initial" />
21
21
</md-field >
22
22
23
23
<md-field >
24
24
<label >Multiple</label >
25
- <md-file multiple v-model =" multiple" />
25
+ <md-file v-model =" multiple" multiple />
26
26
</md-field >
27
27
28
28
<md-field >
29
29
<label >Only images</label >
30
- <md-file accept =" image/*" v-model = " single " />
30
+ <md-file v-model = " single " accept =" image/*" />
31
31
</md-field >
32
32
</div >
33
33
</template >
@@ -38,6 +38,8 @@ export default {
38
38
data : () => ({
39
39
initial: ' vue-material-is-awesome.jpg' ,
40
40
single: null ,
41
+ placeholder: null ,
42
+ disabled: null ,
41
43
multiple: null
42
44
})
43
45
}
Original file line number Diff line number Diff line change @@ -14,28 +14,3 @@ test('should render the field', async () => {
14
14
expect ( wrapper . hasClass ( 'md-field' ) ) . toBe ( true )
15
15
expect ( wrapper . text ( ) . trim ( ) ) . toBe ( 'Lorem ipsum' )
16
16
} )
17
-
18
- test ( 'should render the file field' , async ( ) => {
19
- const wrapperWithFile = mount ( MdField , {
20
- slots : {
21
- default : [ MdFile ]
22
- }
23
- } )
24
-
25
- const mdFile = wrapperWithFile . first ( MdFile )
26
-
27
- expect ( mdFile . hasClass ( 'md-file' ) ) . toBe ( true )
28
- } )
29
-
30
- test ( 'should render the input field inside the mdFile' , async ( ) => {
31
- const wrapperWithFile = mount ( MdField , {
32
- slots : {
33
- default : [ MdFile ]
34
- }
35
- } )
36
-
37
- const mdFile = wrapperWithFile . first ( MdFile )
38
- const mdInput = mdFile . vm . $children [ 0 ]
39
-
40
- expect ( mdFile . hasClass ( 'md-file' ) && mdInput instanceof Object ) . toBe ( true )
41
- } )
You can’t perform that action at this time.
0 commit comments