@kizmann/nano-ui 0.8.36 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- package/bun.lockb +0 -0
- package/demos/overview.html +2 -15
- package/dist/nano-ui.css +1 -1
- package/dist/nano-ui.js +1 -1
- package/dist/nano-ui.js.map +1 -1
- package/dist/themes/light.css +1 -1
- package/docs/README.md +1 -2
- package/docs/_sidebar.md +19 -21
- package/docs/dist/docs.css +2 -0
- package/docs/{data → files/data}/table.md +40 -14
- package/docs/files/form/button.md +122 -0
- package/docs/{form → files/form}/form.md +14 -0
- package/docs/files/form/input.md +90 -0
- package/docs/files/form/switch.md +92 -0
- package/docs/index.html +163 -44
- package/docs/src/scss/docsify/basic/_layout.sass +3 -6
- package/docs/src/scss/docsify/syntax.scss +139 -0
- package/docs/src/scss/docsify/vue.sass +2 -15
- package/docs/src/scss/index.scss +428 -16
- package/package.json +1 -1
- package/src/button/src/button/button.js +1 -9
- package/src/datetimepicker/src/datetimepicker/datetimepicker.js +8 -0
- package/src/mixins/src/ctor.js +0 -6
- package/src/radio/src/radio-group/radio-group.js +1 -1
- package/src/root/vars.scss +10 -10
- package/src/table/src/table/table.scss +0 -1
- package/src/tags/src/tags-item/tags-item.js +17 -1
- package/themes/light/root/vars.scss +10 -10
- package/themes/light/switch/src/switch/switch.scss +1 -1
- package/themes/light/table/src/table/table.scss +1 -1
- package/themes/light/tags/src/tags-item/tags-item.scss +16 -0
- package/webpack.config.js +13 -13
- package/dist/themes/basic.css +0 -2029
- package/dist/themes/flat.css +0 -1806
- package/dist/themes/flat.dark.css +0 -1809
- package/docs/dist/index.css +0 -6977
- package/docs/form/button.md +0 -299
- package/docs/form/input.md +0 -205
- package/docs/form/switch.md +0 -166
- /package/docs/{data → files/data}/draggable.md +0 -0
- /package/docs/{data → files/data}/map.md +0 -0
- /package/docs/{data → files/data}/paginator.md +0 -0
- /package/docs/{data → files/data}/virtualscroller.md +0 -0
- /package/docs/{form → files/form}/cascader.md +0 -0
- /package/docs/{form → files/form}/checkbox.md +0 -0
- /package/docs/{form → files/form}/datepicker.md +0 -0
- /package/docs/{form → files/form}/radio.md +0 -0
- /package/docs/{form → files/form}/select.md +0 -0
- /package/docs/{form → files/form}/textarea.md +0 -0
- /package/docs/{form → files/form}/timepicker.md +0 -0
- /package/docs/{form → files/form}/transfer.md +0 -0
- /package/docs/{others → files/others}/config.md +0 -0
- /package/docs/{others → files/others}/confirm.md +0 -0
- /package/docs/{others → files/others}/loader.md +0 -0
- /package/docs/{others → files/others}/modal.md +0 -0
- /package/docs/{others → files/others}/notification.md +0 -0
- /package/docs/{others → files/others}/popover.md +0 -0
- /package/docs/{others → files/others}/resizer.md +0 -0
- /package/docs/{others → files/others}/scrollbar.md +0 -0
- /package/docs/{others → files/others}/tabs.md +0 -0
package/docs/form/button.md
DELETED
@@ -1,299 +0,0 @@
|
|
1
|
-
# Button
|
2
|
-
Button with diffrent styles.
|
3
|
-
|
4
|
-
```vue
|
5
|
-
<n-button @click="somevar = false">Button text</n-button>
|
6
|
-
```
|
7
|
-
|
8
|
-
### Basic buttons
|
9
|
-
|
10
|
-
```html
|
11
|
-
/*vue*/
|
12
|
-
|
13
|
-
<template>
|
14
|
-
<div class="grid grid--col grid--20-20">
|
15
|
-
<div class="col--1-1">
|
16
|
-
<n-button type="primary">Primary</n-button>
|
17
|
-
<n-button type="secondary">Secondary</n-button>
|
18
|
-
<n-button type="success">Success</n-button>
|
19
|
-
<n-button type="warning">Warning</n-button>
|
20
|
-
<n-button type="danger">Danger</n-button>
|
21
|
-
<n-button type="info">Info</n-button>
|
22
|
-
</div>
|
23
|
-
<div class="col--1-1">
|
24
|
-
<n-button type="primary" :disabled="true">Primary</n-button>
|
25
|
-
<n-button type="secondary" :disabled="true">Secondary</n-button>
|
26
|
-
<n-button type="success" :disabled="true">Success</n-button>
|
27
|
-
<n-button type="warning" :disabled="true">Warning</n-button>
|
28
|
-
<n-button type="danger" :disabled="true">Danger</n-button>
|
29
|
-
<n-button type="info" :disabled="true">Info</n-button>
|
30
|
-
</div>
|
31
|
-
</template>
|
32
|
-
|
33
|
-
<script>
|
34
|
-
export default {}
|
35
|
-
</script>
|
36
|
-
|
37
|
-
```
|
38
|
-
|
39
|
-
### Plain buttons
|
40
|
-
|
41
|
-
```html
|
42
|
-
/*vue*/
|
43
|
-
|
44
|
-
<template>
|
45
|
-
<div class="grid grid--col grid--20-20">
|
46
|
-
<div class="col--1-1">
|
47
|
-
<n-button type="primary" :plain="true">Primary</n-button>
|
48
|
-
<n-button type="secondary" :plain="true">Secondary</n-button>
|
49
|
-
<n-button type="success" :plain="true">Success</n-button>
|
50
|
-
<n-button type="warning" :plain="true">Warning</n-button>
|
51
|
-
<n-button type="danger" :plain="true">Danger</n-button>
|
52
|
-
<n-button type="info" :plain="true">Info</n-button>
|
53
|
-
</div>
|
54
|
-
<div class="col--1-1">
|
55
|
-
<n-button type="primary" :plain="true" :disabled="true">Primary</n-button>
|
56
|
-
<n-button type="secondary" :plain="true" :disabled="true">Secondary</n-button>
|
57
|
-
<n-button type="success" :plain="true" :disabled="true">Success</n-button>
|
58
|
-
<n-button type="warning" :plain="true" :disabled="true">Warning</n-button>
|
59
|
-
<n-button type="danger" :plain="true" :disabled="true">Danger</n-button>
|
60
|
-
<n-button type="info" :plain="true" :disabled="true">Info</n-button>
|
61
|
-
</div>
|
62
|
-
</div>
|
63
|
-
</template>
|
64
|
-
|
65
|
-
<script>
|
66
|
-
export default {}
|
67
|
-
</script>
|
68
|
-
|
69
|
-
```
|
70
|
-
|
71
|
-
### Rounded buttons
|
72
|
-
|
73
|
-
```html
|
74
|
-
/*vue*/
|
75
|
-
|
76
|
-
<template>
|
77
|
-
<div class="grid grid--col grid--20-20">
|
78
|
-
<div class="col--1-1">
|
79
|
-
<n-button type="primary" :round="true">Primary</n-button>
|
80
|
-
<n-button type="secondary" :round="true">Secondary</n-button>
|
81
|
-
<n-button type="success" :round="true">Success</n-button>
|
82
|
-
<n-button type="warning" :round="true">Warning</n-button>
|
83
|
-
<n-button type="danger" :round="true">Danger</n-button>
|
84
|
-
<n-button type="info" :round="true">Info</n-button>
|
85
|
-
</div>
|
86
|
-
<div class="col--1-1">
|
87
|
-
<n-button type="primary" :round="true" :plain="true">Primary</n-button>
|
88
|
-
<n-button type="secondary" :round="true" :plain="true">Secondary</n-button>
|
89
|
-
<n-button type="success" :round="true" :plain="true">Success</n-button>
|
90
|
-
<n-button type="warning" :round="true" :plain="true">Warning</n-button>
|
91
|
-
<n-button type="danger" :round="true" :plain="true">Danger</n-button>
|
92
|
-
<n-button type="info" :round="true" :plain="true">Info</n-button>
|
93
|
-
</div>
|
94
|
-
</template>
|
95
|
-
|
96
|
-
<script>
|
97
|
-
export default {}
|
98
|
-
</script>
|
99
|
-
|
100
|
-
```
|
101
|
-
|
102
|
-
### Link buttons
|
103
|
-
|
104
|
-
```html
|
105
|
-
/*vue*/
|
106
|
-
|
107
|
-
<template>
|
108
|
-
<div class="grid grid--col grid--20-20">
|
109
|
-
<div class="col--1-1">
|
110
|
-
<n-button type="primary" :link="true">Primary</n-button>
|
111
|
-
<n-button type="success" :link="true">Success</n-button>
|
112
|
-
<n-button type="warning" :link="true">Warning</n-button>
|
113
|
-
<n-button type="danger" :link="true">Danger</n-button>
|
114
|
-
<n-button type="info" :link="true">Info</n-button>
|
115
|
-
</div>
|
116
|
-
</div>
|
117
|
-
</template>
|
118
|
-
|
119
|
-
<script>
|
120
|
-
export default {}
|
121
|
-
</script>
|
122
|
-
|
123
|
-
```
|
124
|
-
|
125
|
-
### Buttons with icon
|
126
|
-
|
127
|
-
```html
|
128
|
-
/*vue*/
|
129
|
-
|
130
|
-
<template>
|
131
|
-
<div class="grid grid--col grid--20-20">
|
132
|
-
<div class="col--1-1">
|
133
|
-
<n-button type="primary" :icon="icons.primary" icon-position="before">Primary</n-button>
|
134
|
-
<n-button type="success" :icon="icons.success" icon-position="before">Success</n-button>
|
135
|
-
<n-button type="warning" :icon="icons.warning" icon-position="before">Warning</n-button>
|
136
|
-
<n-button type="danger" :icon="icons.danger" icon-position="before">Danger</n-button>
|
137
|
-
<n-button type="info" :icon="icons.info" icon-position="before">Info</n-button>
|
138
|
-
</div>
|
139
|
-
<div class="col--1-1">
|
140
|
-
<n-button type="primary" :plain="true" :icon="icons.primary" icon-position="after">Primary</n-button>
|
141
|
-
<n-button type="success" :plain="true" :icon="icons.success" icon-position="after">Success</n-button>
|
142
|
-
<n-button type="warning" :plain="true" :icon="icons.warning" icon-position="after">Warning</n-button>
|
143
|
-
<n-button type="danger" :plain="true" :icon="icons.danger" icon-position="after">Danger</n-button>
|
144
|
-
<n-button type="info" :plain="true" :icon="icons.info" icon-position="after">Info</n-button>
|
145
|
-
</div>
|
146
|
-
</div>
|
147
|
-
</template>
|
148
|
-
|
149
|
-
<script>
|
150
|
-
export default {}
|
151
|
-
</script>
|
152
|
-
|
153
|
-
```
|
154
|
-
|
155
|
-
### Buttons with only icon
|
156
|
-
|
157
|
-
```html
|
158
|
-
/*vue*/
|
159
|
-
|
160
|
-
<template>
|
161
|
-
<div class="grid grid--col grid--20-20">
|
162
|
-
<div class="col--1-1">
|
163
|
-
<n-button type="primary" :icon="icons.primary" :square="true"></n-button>
|
164
|
-
<n-button type="success" :icon="icons.success" :square="true" :round="true"></n-button>
|
165
|
-
<n-button type="warning" :icon="icons.warning" :square="true"></n-button>
|
166
|
-
<n-button type="danger" :icon="icons.danger" :square="true" :round="true"></n-button>
|
167
|
-
<n-button type="info" :icon="icons.info" :square="true"></n-button>
|
168
|
-
</div>
|
169
|
-
</div>
|
170
|
-
</template>
|
171
|
-
|
172
|
-
<script>
|
173
|
-
export default {}
|
174
|
-
</script>
|
175
|
-
|
176
|
-
```
|
177
|
-
|
178
|
-
### Button group
|
179
|
-
|
180
|
-
```html
|
181
|
-
/*vue*/
|
182
|
-
|
183
|
-
<template>
|
184
|
-
<div class="grid grid--col grid--20-20">
|
185
|
-
<div class="col--1-1">
|
186
|
-
<n-button-group>
|
187
|
-
<n-button type="primary" :icon="icons.angleLeft" icon-position="before">Previous</n-button>
|
188
|
-
<n-button type="primary" :icon="icons.angleRight" icon-position="after">Previous</n-button>
|
189
|
-
</n-button-group>
|
190
|
-
</div>
|
191
|
-
</div>
|
192
|
-
</template>
|
193
|
-
|
194
|
-
<script>
|
195
|
-
export default {}
|
196
|
-
</script>
|
197
|
-
|
198
|
-
```
|
199
|
-
|
200
|
-
### Button sizes
|
201
|
-
|
202
|
-
```html
|
203
|
-
/*vue*/
|
204
|
-
|
205
|
-
<template>
|
206
|
-
<div class="grid grid--col grid--20-20">
|
207
|
-
<div class="col--1-1">
|
208
|
-
<n-button type="primary" size="mini">Mini</n-button>
|
209
|
-
<n-button type="primary" size="small">Small</n-button>
|
210
|
-
<n-button type="primary">Default</n-button>
|
211
|
-
<n-button type="primary" size="large">Large</n-button>
|
212
|
-
</div>
|
213
|
-
</div>
|
214
|
-
</template>
|
215
|
-
|
216
|
-
<script>
|
217
|
-
export default {}
|
218
|
-
</script>
|
219
|
-
|
220
|
-
```
|
221
|
-
|
222
|
-
|
223
|
-
### Button native type
|
224
|
-
|
225
|
-
```html
|
226
|
-
/*vue*/
|
227
|
-
|
228
|
-
<template>
|
229
|
-
<div class="grid grid--col grid--20-20">
|
230
|
-
<div class="col--1-1">
|
231
|
-
<n-button type="primary" native-type="a" href="http://google.com" target="_blank">www.google.com</n-button>
|
232
|
-
</div>
|
233
|
-
</div>
|
234
|
-
</template>
|
235
|
-
|
236
|
-
<script>
|
237
|
-
export default {}
|
238
|
-
</script>
|
239
|
-
|
240
|
-
```
|
241
|
-
|
242
|
-
### Properties
|
243
|
-
**type**
|
244
|
-
default: 'primary'
|
245
|
-
types: String
|
246
|
-
_Button type (primary, secondary, succes, warning, danger, info)_
|
247
|
-
|
248
|
-
**type**
|
249
|
-
default: 'link'
|
250
|
-
types: Boolean
|
251
|
-
_Applies link styling for button_
|
252
|
-
|
253
|
-
**size**
|
254
|
-
default: null
|
255
|
-
types: String
|
256
|
-
_Button size (mini, small, large)_
|
257
|
-
|
258
|
-
**square**
|
259
|
-
default: false
|
260
|
-
types: Boolean
|
261
|
-
_If button is square, helpful for only icon buttons_
|
262
|
-
|
263
|
-
**round**
|
264
|
-
default: false
|
265
|
-
types: Boolean
|
266
|
-
_If button is rounded_
|
267
|
-
|
268
|
-
**plain**
|
269
|
-
default: false
|
270
|
-
types: Boolean
|
271
|
-
_If button uses plain style_
|
272
|
-
|
273
|
-
**disabled**
|
274
|
-
default: false
|
275
|
-
types: Boolean
|
276
|
-
_If button uses disabled style and mode_
|
277
|
-
|
278
|
-
**icon**
|
279
|
-
default: ''
|
280
|
-
types: String
|
281
|
-
_Icon class (fa fa-times)_
|
282
|
-
|
283
|
-
**iconPosition**
|
284
|
-
default: 'before'
|
285
|
-
types: String
|
286
|
-
_Icon position (before, after)_
|
287
|
-
|
288
|
-
**nativeType**
|
289
|
-
default: 'button'
|
290
|
-
types: String
|
291
|
-
_Native button type (a, button, div etc.)_
|
292
|
-
|
293
|
-
### Events
|
294
|
-
```javascript
|
295
|
-
/* Allows all types which are supported by native type */
|
296
|
-
NButton.$on('click', (event) => {
|
297
|
-
console.log(event);
|
298
|
-
});
|
299
|
-
```
|
package/docs/form/input.md
DELETED
@@ -1,205 +0,0 @@
|
|
1
|
-
# Input
|
2
|
-
Input with diffrent styles.
|
3
|
-
|
4
|
-
```vue
|
5
|
-
<n-input v-model="text"></n-input>
|
6
|
-
```
|
7
|
-
|
8
|
-
### Input
|
9
|
-
|
10
|
-
```html
|
11
|
-
/*vue*/
|
12
|
-
|
13
|
-
<template>
|
14
|
-
<div class="grid grid--col grid--20-20">
|
15
|
-
<div class="col--1-1">
|
16
|
-
<n-input v-model="text" placeholder="Enter text" />
|
17
|
-
</div>
|
18
|
-
<div class="col--1-1">
|
19
|
-
<n-input v-model="text" placeholder="Enter text" :disabled="true" />
|
20
|
-
</div>
|
21
|
-
</div>
|
22
|
-
</template>
|
23
|
-
|
24
|
-
<script>
|
25
|
-
export default {
|
26
|
-
data()
|
27
|
-
{
|
28
|
-
return { text: '' };
|
29
|
-
}
|
30
|
-
}
|
31
|
-
</script>
|
32
|
-
|
33
|
-
```
|
34
|
-
|
35
|
-
### Round input
|
36
|
-
|
37
|
-
```html
|
38
|
-
/*vue*/
|
39
|
-
|
40
|
-
<template>
|
41
|
-
<div class="grid grid--col grid--20-20">
|
42
|
-
<div class="col--1-1">
|
43
|
-
<n-input v-model="text" placeholder="Enter text" :round="true" />
|
44
|
-
</div>
|
45
|
-
<div class="col--1-1">
|
46
|
-
<n-input v-model="text" placeholder="Enter text" :round="true" :disabled="true" />
|
47
|
-
</div>
|
48
|
-
</div>
|
49
|
-
</template>
|
50
|
-
|
51
|
-
<script>
|
52
|
-
export default {
|
53
|
-
data()
|
54
|
-
{
|
55
|
-
return { text: '' };
|
56
|
-
}
|
57
|
-
}
|
58
|
-
</script>
|
59
|
-
|
60
|
-
```
|
61
|
-
|
62
|
-
### Input with icon
|
63
|
-
|
64
|
-
```html
|
65
|
-
/*vue*/
|
66
|
-
|
67
|
-
<template>
|
68
|
-
<div class="grid grid--row grid--wrap grid--20-20">
|
69
|
-
<div class="col--1-1 col--1-2@md">
|
70
|
-
<n-input v-model="text" icon="fa fa-search" :icon-disabled="!canSearch" icon-position="before" @icon-click="search" />
|
71
|
-
</div>
|
72
|
-
<div class="col--1-1 col--1-2@md">
|
73
|
-
<n-input v-model="text" :native-type="type" :icon="eyeIcon" icon-position="after" @icon-click="toggle" />
|
74
|
-
</div>
|
75
|
-
</div>
|
76
|
-
</template>
|
77
|
-
|
78
|
-
<script>
|
79
|
-
export default {
|
80
|
-
data()
|
81
|
-
{
|
82
|
-
return { type: 'password', text: 'Top secret password' };
|
83
|
-
},
|
84
|
-
computed: {
|
85
|
-
canSearch()
|
86
|
-
{
|
87
|
-
return !! this.text;
|
88
|
-
},
|
89
|
-
eyeIcon()
|
90
|
-
{
|
91
|
-
return this.type === 'text' ?
|
92
|
-
'fa fa-eye-slash' : 'fa fa-eye';
|
93
|
-
}
|
94
|
-
},
|
95
|
-
methods: {
|
96
|
-
toggle()
|
97
|
-
{
|
98
|
-
this.type = this.type === 'text' ?
|
99
|
-
'password' : 'text';
|
100
|
-
},
|
101
|
-
search()
|
102
|
-
{
|
103
|
-
window.alert('Search for: ' + this.text);
|
104
|
-
}
|
105
|
-
}
|
106
|
-
}
|
107
|
-
</script>
|
108
|
-
|
109
|
-
```
|
110
|
-
|
111
|
-
### Input with icon
|
112
|
-
|
113
|
-
```html
|
114
|
-
/*vue*/
|
115
|
-
|
116
|
-
<template>
|
117
|
-
<div class="grid grid--col grid--20-20">
|
118
|
-
<div class="col--1-1">
|
119
|
-
<n-input value="Small" size="small" />
|
120
|
-
</div>
|
121
|
-
<div class="col--1-1">
|
122
|
-
<n-input value="Default" />
|
123
|
-
</div>
|
124
|
-
<div class="col--1-1">
|
125
|
-
<n-input value="Large" size="large" />
|
126
|
-
</div>
|
127
|
-
</div>
|
128
|
-
</template>
|
129
|
-
|
130
|
-
<script>
|
131
|
-
export default {}
|
132
|
-
</script>
|
133
|
-
|
134
|
-
```
|
135
|
-
|
136
|
-
### Input group
|
137
|
-
|
138
|
-
```html
|
139
|
-
/*vue*/
|
140
|
-
|
141
|
-
<template>
|
142
|
-
<div class="grid grid--col grid--20-20">
|
143
|
-
<div class="col--1-1">
|
144
|
-
<n-button-group>
|
145
|
-
<n-input v-model="text" placeholder="Enter text"></n-input>
|
146
|
-
<n-button icon="fa fa-search">Search</n-button>
|
147
|
-
</n-button-group>
|
148
|
-
</div>
|
149
|
-
</div>
|
150
|
-
</template>
|
151
|
-
|
152
|
-
<script>
|
153
|
-
export default {
|
154
|
-
data()
|
155
|
-
{
|
156
|
-
return { text: '' };
|
157
|
-
}
|
158
|
-
}
|
159
|
-
</script>
|
160
|
-
|
161
|
-
```
|
162
|
-
|
163
|
-
### Properties
|
164
|
-
**value**
|
165
|
-
default: null
|
166
|
-
types: String
|
167
|
-
_Input value_
|
168
|
-
|
169
|
-
**size**
|
170
|
-
default: 'default'
|
171
|
-
types: String
|
172
|
-
_Button size (small, default, large)_
|
173
|
-
|
174
|
-
**round**
|
175
|
-
default: false
|
176
|
-
types: Boolean
|
177
|
-
_If button is rounded_
|
178
|
-
|
179
|
-
**disabled**
|
180
|
-
default: false
|
181
|
-
types: Boolean
|
182
|
-
_If button uses disabled style and mode_
|
183
|
-
|
184
|
-
**icon**
|
185
|
-
default: ''
|
186
|
-
types: String
|
187
|
-
_Icon class (fa fa-times)_
|
188
|
-
|
189
|
-
**iconDisabled**
|
190
|
-
default: false
|
191
|
-
types: Boolen
|
192
|
-
_If icon button will be disabled_
|
193
|
-
|
194
|
-
**nativeType**
|
195
|
-
default: 'button'
|
196
|
-
types: String
|
197
|
-
_Native button type (a, button, div etc.)_
|
198
|
-
|
199
|
-
### Events
|
200
|
-
```javascript
|
201
|
-
/* Allows all types which are supported by native type, but overrides default input event */
|
202
|
-
NDraggable.$on('input', (value) => {
|
203
|
-
console.log(value);
|
204
|
-
});
|
205
|
-
```
|
package/docs/form/switch.md
DELETED
@@ -1,166 +0,0 @@
|
|
1
|
-
# Switch
|
2
|
-
Checkbox with diffrent styles.
|
3
|
-
|
4
|
-
```vue
|
5
|
-
<n-switch v-model="value">Your label</n-switch>
|
6
|
-
```
|
7
|
-
|
8
|
-
### Switch
|
9
|
-
|
10
|
-
```html
|
11
|
-
/*vue*/
|
12
|
-
|
13
|
-
<template>
|
14
|
-
<div class="grid grid--col grid--20-20">
|
15
|
-
<div class="col--1-1">
|
16
|
-
<n-switch v-model="value">Accept something</n-switch>
|
17
|
-
</div>
|
18
|
-
<div class="col--1-1">
|
19
|
-
<n-switch v-model="value" :disabled="true">Can't accept me</n-switch>
|
20
|
-
</div>
|
21
|
-
</div>
|
22
|
-
</template>
|
23
|
-
|
24
|
-
<script>
|
25
|
-
export default {
|
26
|
-
data()
|
27
|
-
{
|
28
|
-
return {
|
29
|
-
value: true
|
30
|
-
};
|
31
|
-
}
|
32
|
-
}
|
33
|
-
</script>
|
34
|
-
|
35
|
-
```
|
36
|
-
|
37
|
-
### Switch with custom values
|
38
|
-
|
39
|
-
```html
|
40
|
-
/*vue*/
|
41
|
-
|
42
|
-
<template>
|
43
|
-
<div class="grid grid--col grid--20-20">
|
44
|
-
<div class="col--1-1">
|
45
|
-
<n-switch v-model="value" on-value="foo" off-value="bar">Accept foobar</n-switch>
|
46
|
-
</div>
|
47
|
-
<div class="col--1-1">
|
48
|
-
<pre class="pretty">{{ value }}</pre>
|
49
|
-
</div>
|
50
|
-
</div>
|
51
|
-
</template>
|
52
|
-
|
53
|
-
<script>
|
54
|
-
export default {
|
55
|
-
data()
|
56
|
-
{
|
57
|
-
return {
|
58
|
-
value: 'foo'
|
59
|
-
};
|
60
|
-
}
|
61
|
-
}
|
62
|
-
</script>
|
63
|
-
|
64
|
-
```
|
65
|
-
|
66
|
-
### Switch colors
|
67
|
-
|
68
|
-
```html
|
69
|
-
/*vue*/
|
70
|
-
|
71
|
-
<template>
|
72
|
-
<div class="grid grid--col grid--20-20">
|
73
|
-
<div class="col--1-1">
|
74
|
-
<n-switch v-model="value" on-type="success" off-type="danger">Accept me</n-switch>
|
75
|
-
</div>
|
76
|
-
</div>
|
77
|
-
</template>
|
78
|
-
|
79
|
-
<script>
|
80
|
-
export default {
|
81
|
-
data()
|
82
|
-
{
|
83
|
-
return {
|
84
|
-
value: true
|
85
|
-
};
|
86
|
-
}
|
87
|
-
}
|
88
|
-
</script>
|
89
|
-
|
90
|
-
```
|
91
|
-
|
92
|
-
### Switch sizes
|
93
|
-
|
94
|
-
```html
|
95
|
-
/*vue*/
|
96
|
-
|
97
|
-
<template>
|
98
|
-
<div class="grid grid--col grid--20-20">
|
99
|
-
<div class="col--1-1">
|
100
|
-
<n-switch v-model="value" size="small">Accept me</n-switch>
|
101
|
-
</div>
|
102
|
-
<div class="col--1-1">
|
103
|
-
<n-switch v-model="value">Accept me</n-switch>
|
104
|
-
</div>
|
105
|
-
<div class="col--1-1">
|
106
|
-
<n-switch v-model="value" size="large">Accept me</n-switch>
|
107
|
-
</div>
|
108
|
-
</div>
|
109
|
-
</template>
|
110
|
-
|
111
|
-
<script>
|
112
|
-
export default {
|
113
|
-
data()
|
114
|
-
{
|
115
|
-
return {
|
116
|
-
value: true
|
117
|
-
};
|
118
|
-
}
|
119
|
-
}
|
120
|
-
</script>
|
121
|
-
|
122
|
-
```
|
123
|
-
|
124
|
-
### Properties
|
125
|
-
**value**
|
126
|
-
default: null
|
127
|
-
types: String
|
128
|
-
_Input value_
|
129
|
-
|
130
|
-
**size**
|
131
|
-
default: 'default'
|
132
|
-
types: String
|
133
|
-
_Button size (small, default, large)_
|
134
|
-
|
135
|
-
**round**
|
136
|
-
default: false
|
137
|
-
types: Boolean
|
138
|
-
_If button is rounded_
|
139
|
-
|
140
|
-
**disabled**
|
141
|
-
default: false
|
142
|
-
types: Boolean
|
143
|
-
_If button uses disabled style and mode_
|
144
|
-
|
145
|
-
**icon**
|
146
|
-
default: ''
|
147
|
-
types: String
|
148
|
-
_Icon class (fa fa-times)_
|
149
|
-
|
150
|
-
**iconDisabled**
|
151
|
-
default: false
|
152
|
-
types: Boolen
|
153
|
-
_If icon button will be disabled_
|
154
|
-
|
155
|
-
**nativeType**
|
156
|
-
default: 'button'
|
157
|
-
types: String
|
158
|
-
_Native button type (a, button, div etc.)_
|
159
|
-
|
160
|
-
### Events
|
161
|
-
```javascript
|
162
|
-
/* Allows all types which are supported by native type, but overrides default input event */
|
163
|
-
NDraggable.$on('input', (value) => {
|
164
|
-
console.log(value);
|
165
|
-
});
|
166
|
-
```
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|