forked from vuematerial/vue-material
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFile.vue
More file actions
181 lines (156 loc) · 6.64 KB
/
File.vue
File metadata and controls
181 lines (156 loc) · 6.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<template>
<page-content page-title="Components - File">
<docs-component>
<div slot="description">
<p>The file picker aims to select files like images, videos and other formats. They can have multiple files and use the device file system to pick the file.</p>
</div>
<div slot="api">
<api-table name="md-file">
<md-table slot="properties">
<md-table-header>
<md-table-row>
<md-table-head>Name</md-table-head>
<md-table-head>Type</md-table-head>
<md-table-head>Description</md-table-head>
</md-table-row>
</md-table-header>
<md-table-body>
<md-table-row>
<md-table-cell>v-model</md-table-cell>
<md-table-cell><code>String</code></md-table-cell>
<md-table-cell>A required model object to bind the value.</md-table-cell>
</md-table-row>
<md-table-row>
<md-table-cell>id</md-table-cell>
<md-table-cell><code>String</code></md-table-cell>
<md-table-cell>Set the input id.</md-table-cell>
</md-table-row>
<md-table-row>
<md-table-cell>name</md-table-cell>
<md-table-cell><code>String</code></md-table-cell>
<md-table-cell>Set the input name.</md-table-cell>
</md-table-row>
<md-table-row>
<md-table-cell>disabled</md-table-cell>
<md-table-cell><code>Boolean</code></md-table-cell>
<md-table-cell>Disable the input and prevent its actions. <br>Default <code>false</code></md-table-cell>
</md-table-row>
<md-table-row>
<md-table-cell>required</md-table-cell>
<md-table-cell><code>Boolean</code></md-table-cell>
<md-table-cell>Apply the required rule to style the label with an "*". <br>Default <code>false</code></md-table-cell>
</md-table-row>
<md-table-row>
<md-table-cell>accept</md-table-cell>
<md-table-cell><code>String</code></md-table-cell>
<md-table-cell>Filter files that can be selected by mimetype pattern.</md-table-cell>
</md-table-row>
<md-table-row>
<md-table-cell>multiple</md-table-cell>
<md-table-cell><code>Boolean</code></md-table-cell>
<md-table-cell>Enable multiple selection.</md-table-cell>
</md-table-row>
</md-table-body>
</md-table>
<md-table slot="events">
<md-table-header>
<md-table-row>
<md-table-head>Name</md-table-head>
<md-table-head>Value</md-table-head>
<md-table-head>Description</md-table-head>
</md-table-row>
</md-table-header>
<md-table-body>
<md-table-row>
<md-table-cell>input</md-table-cell>
<md-table-cell>Emits the file name</md-table-cell>
<md-table-cell>Triggered every time a file is selected.</md-table-cell>
</md-table-row>
<md-table-row>
<md-table-cell>selected</md-table-cell>
<md-table-cell>Emits a <code>FileList</code>.</md-table-cell>
<md-table-cell>Triggered every time a file is selected.</md-table-cell>
</md-table-row>
</md-table-body>
</md-table>
</api-table>
</div>
<div slot="example">
<example-box card-title="Single File">
<div slot="demo">
<md-input-container>
<label>Single</label>
<md-file v-model="single"></md-file>
</md-input-container>
<md-input-container>
<md-file v-model="placeholder" placeholder="A nice input placeholder"></md-file>
</md-input-container>
<md-input-container>
<md-file placeholder="Disabled" disabled></md-file>
</md-input-container>
<md-input-container>
<label>Initial Value</label>
<md-file v-model="initialValue"></md-file>
</md-input-container>
<md-input-container>
<label>Multiple</label>
<md-file v-model="multiple" multiple></md-file>
</md-input-container>
<md-input-container>
<label>Only Images</label>
<md-file v-model="onlyImages" accept="image/*"></md-file>
</md-input-container>
</div>
<div slot="code">
<code-block lang="xml">
<md-input-container>
<label>Single</label>
<md-file v-model="single"></md-file>
</md-input-container>
<md-input-container>
<md-file v-model="placeholder" placeholder="A nice input placeholder"></md-file>
</md-input-container>
<md-input-container>
<md-file placeholder="Disabled" disabled></md-file>
</md-input-container>
<md-input-container>
<label>Initial Value</label>
<md-file v-model="initialValue"></md-file>
</md-input-container>
<md-input-container>
<label>Multiple</label>
<md-file v-model="multiple" multiple></md-file>
</md-input-container>
<md-input-container>
<label>Only Images</label>
<md-file v-model="onlyImages" accept="image/*"></md-file>
</md-input-container>
</code-block>
<code-block lang="javascript">
export default {
data: () => ({
single: null,
placeholder: null,
initialValue: 'my-profile-picture.jpg',
multiple: null,
onlyImages: null
})
};
</code-block>
</div>
</example-box>
</div>
</docs-component>
</page-content>
</template>
<script>
export default {
data: () => ({
single: null,
placeholder: null,
initialValue: 'my-profile-picture.jpg',
multiple: null,
onlyImages: null
})
};
</script>