@timus-networks/theme 1.0.21 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components-js/ThemeAlert.vue +76 -0
- package/components-js/ThemeAvatar.vue +55 -0
- package/components-js/ThemeBadge.vue +86 -0
- package/components-js/ThemeButtons.vue +2 -2
- package/components-js/ThemeCascader.vue +337 -0
- package/components-js/ThemeCheckbox.d.ts +2 -0
- package/components-js/ThemeCheckbox.vue +143 -0
- package/components-js/ThemeForm.vue +50 -182
- package/components-js/ThemeInputs.vue +0 -51
- package/components-js/ThemeLink.vue +91 -0
- package/components-js/ThemeLogo.vue +57 -0
- package/components-js/ThemeRadio.d.ts +2 -0
- package/components-js/ThemeRadio.vue +124 -0
- package/components-js/ThemeSelect.vue +232 -0
- package/components-js/ThemeTable.vue +245 -0
- package/components-js/ThemeTag.vue +142 -0
- package/components-js/ThemeTimePicker.vue +376 -43
- package/components-js/ThemeToggle.vue +122 -0
- package/components-js/ThemeTooltip.vue +189 -0
- package/components-js/TimusSamples.vue +33 -20
- package/components-js/exporter.js +5 -5
- package/components-ts/ThemeAlert.vue +76 -0
- package/components-ts/ThemeAvatar.vue +55 -0
- package/components-ts/ThemeBadge.vue +86 -0
- package/components-ts/ThemeButtons.vue +2 -2
- package/components-ts/ThemeCascader.vue +337 -0
- package/components-ts/ThemeCheckbox.vue +146 -0
- package/components-ts/ThemeForm.vue +50 -183
- package/components-ts/ThemeInputs.vue +0 -51
- package/components-ts/ThemeLink.vue +91 -0
- package/components-ts/ThemeLogo.vue +57 -0
- package/components-ts/ThemeRadio.vue +127 -0
- package/components-ts/ThemeSelect.vue +232 -0
- package/components-ts/ThemeTable.vue +245 -0
- package/components-ts/ThemeTag.vue +142 -0
- package/components-ts/ThemeTimePicker.vue +376 -43
- package/components-ts/ThemeToggle.vue +122 -0
- package/components-ts/ThemeTooltip.vue +189 -0
- package/components-ts/TimusSamples.vue +33 -20
- package/components-ts/exporter.js +5 -5
- package/index.d.ts +3 -1
- package/logo/timus-icon.svg +17 -0
- package/logo/timus-logo.svg +22 -0
- package/module.js +6 -2
- package/output/main.css +1 -1
- package/package.json +40 -40
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pt-8 pb-16 flex gap-12 flex-col">
|
|
3
|
+
<section>
|
|
4
|
+
<h1>Basic usage</h1>
|
|
5
|
+
<p class="p-lg my-6">v-model is the value of el-option that is currently selected.</p>
|
|
6
|
+
<div class="grid grid-flow-col auto-cols-max gap-4">
|
|
7
|
+
<el-select v-model="value" placeholder="Select">
|
|
8
|
+
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
|
|
9
|
+
</el-select>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
|
|
12
|
+
<p class="text-xs">
|
|
13
|
+
<code><el-button :type="'primary'">Primary</el-button></code>
|
|
14
|
+
</p>
|
|
15
|
+
</div>
|
|
16
|
+
</section>
|
|
17
|
+
|
|
18
|
+
<section>
|
|
19
|
+
<h1>Disabled option</h1>
|
|
20
|
+
<p class="p-lg my-6">Set the value of disabled in el-option to true to disable this option.</p>
|
|
21
|
+
<div class="grid grid-flow-col auto-cols-max gap-4">
|
|
22
|
+
<el-select v-model="value" placeholder="Select">
|
|
23
|
+
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" :disabled="item.disabled"> </el-option>
|
|
24
|
+
</el-select>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="my-4 p-4 border-l-4 border-info-600 bg-info-100">
|
|
27
|
+
<p class="text-xs">
|
|
28
|
+
Outline görünümü için, buton elementinize <code>class="outline"</code> ekleyin. Örnek:
|
|
29
|
+
<code><el-button class="outline">Button</el-button></code>
|
|
30
|
+
</p>
|
|
31
|
+
</div>
|
|
32
|
+
</section>
|
|
33
|
+
|
|
34
|
+
<section>
|
|
35
|
+
<h1>Disabled select</h1>
|
|
36
|
+
<p class="p-lg my-6">Set disabled of el-select to make it disabled.</p>
|
|
37
|
+
<div class="grid grid-flow-col auto-cols-max gap-4">
|
|
38
|
+
<el-select v-model="value" disabled placeholder="Select">
|
|
39
|
+
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
|
|
40
|
+
</el-select>
|
|
41
|
+
</div>
|
|
42
|
+
<div class="my-4 p-4 border-l-4 border-info-600 bg-info-100">
|
|
43
|
+
<p class="text-xs">
|
|
44
|
+
Ghost görünümü için, buton elementinize <code>class="ghost"</code> ekleyin. Örnek:
|
|
45
|
+
<code><el-button class="ghost">Button</el-button></code>
|
|
46
|
+
</p>
|
|
47
|
+
</div>
|
|
48
|
+
</section>
|
|
49
|
+
|
|
50
|
+
<section>
|
|
51
|
+
<h1>Clearable single select</h1>
|
|
52
|
+
<p class="p-lg my-6">Farklı boyutlardaki butonlarımız, çeşitli arayüz ihtiyaçlarına yanıt vermek için tasarlanmıştır.</p>
|
|
53
|
+
<div class="grid grid-flow-col auto-cols-max items-center gap-4">
|
|
54
|
+
<el-select v-model="value" clearable placeholder="Select">
|
|
55
|
+
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
|
|
56
|
+
</el-select>
|
|
57
|
+
</div>
|
|
58
|
+
<div class="my-4 p-4 border-l-4 border-info-600 bg-info-100">
|
|
59
|
+
<p class="text-xs">
|
|
60
|
+
Örnekler:
|
|
61
|
+
<code><el-button :size="'large'">Button</el-button></code>
|
|
62
|
+
</p>
|
|
63
|
+
</div>
|
|
64
|
+
</section>
|
|
65
|
+
|
|
66
|
+
<section>
|
|
67
|
+
<h1>Basic multiple select</h1>
|
|
68
|
+
<p class="p-lg my-6">Etkileşime kapalı 'disabled' butonlarımız, kullanılamaz durumları göstermek için kullanılır.</p>
|
|
69
|
+
<div class="grid grid-flow-col auto-cols-max gap-4 items-center">
|
|
70
|
+
<el-select v-model="value1" multiple placeholder="Select">
|
|
71
|
+
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
|
|
72
|
+
</el-select>
|
|
73
|
+
<el-select v-model="value2" multiple collapse-tags placeholder="Select" type="primary">
|
|
74
|
+
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
|
|
75
|
+
</el-select>
|
|
76
|
+
</div>
|
|
77
|
+
<div class="my-4 p-4 border-l-4 border-red-600 bg-red-100">
|
|
78
|
+
<p class="text-xs">
|
|
79
|
+
Butonu devre dışı bırakmak için, <code>disabled</code> özelliğini ekleyin. Örnek:
|
|
80
|
+
<code><el-button disabled>Button</el-button></code>
|
|
81
|
+
</p>
|
|
82
|
+
</div>
|
|
83
|
+
</section>
|
|
84
|
+
|
|
85
|
+
<section>
|
|
86
|
+
<h1>Custom template</h1>
|
|
87
|
+
<p class="p-lg my-6">
|
|
88
|
+
İkonlarla zenginleştirilmiş butonlarımız, görsel bir ipucu sunar ve kullanıcı deneyimini artırır. Tüm ikonlarımızın listesini görmek için
|
|
89
|
+
<nuxt-link to="/icons" class="text-blue-600 hover:underline">buraya tıklayın</nuxt-link>.
|
|
90
|
+
</p>
|
|
91
|
+
<div class="grid grid-flow-col auto-cols-max gap-4">
|
|
92
|
+
<el-select v-model="value" placeholder="Select">
|
|
93
|
+
<el-option v-for="item in cities" :key="item.value" :label="item.label" :value="item.value">
|
|
94
|
+
<span style="float: left">{{ item.label }}</span>
|
|
95
|
+
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.value }}</span>
|
|
96
|
+
</el-option>
|
|
97
|
+
</el-select>
|
|
98
|
+
</div>
|
|
99
|
+
<div class="my-4 p-4 border-l-4 border-info-600 bg-info-100">
|
|
100
|
+
<p class="text-xs">
|
|
101
|
+
Örnekler:
|
|
102
|
+
<code><el-button type="primary" class="isax-trash"></el-button></code>. Sağda ikon için <code>class="icon-right"</code> ekleyin.
|
|
103
|
+
</p>
|
|
104
|
+
</div>
|
|
105
|
+
</section>
|
|
106
|
+
|
|
107
|
+
<section>
|
|
108
|
+
<h1>Grouping</h1>
|
|
109
|
+
<p class="p-lg my-6">Display options in groups.</p>
|
|
110
|
+
<div class="grid grid-flow-col auto-cols-max gap-4">
|
|
111
|
+
<el-select v-model="value" placeholder="Select">
|
|
112
|
+
<el-option-group v-for="group in groups" :key="group.label" :label="group.label">
|
|
113
|
+
<el-option v-for="item in group.options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
|
|
114
|
+
</el-option-group>
|
|
115
|
+
</el-select>
|
|
116
|
+
</div>
|
|
117
|
+
<div class="my-4 p-4 border-l-4 border-info-600 bg-info-100">
|
|
118
|
+
<p class="text-xs">Buton grupları için <code><el-button-group></code> kullanın.</p>
|
|
119
|
+
</div>
|
|
120
|
+
</section>
|
|
121
|
+
</div>
|
|
122
|
+
</template>
|
|
123
|
+
<script>
|
|
124
|
+
import Vue from 'vue';
|
|
125
|
+
|
|
126
|
+
export default Vue.extend({
|
|
127
|
+
name: 'TimusButtonSample',
|
|
128
|
+
data() {
|
|
129
|
+
return {
|
|
130
|
+
cities: [
|
|
131
|
+
{
|
|
132
|
+
value: 'Beijing',
|
|
133
|
+
label: 'Beijing',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
value: 'Shanghai',
|
|
137
|
+
label: 'Shanghai',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
value: 'Nanjing',
|
|
141
|
+
label: 'Nanjing',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
value: 'Chengdu',
|
|
145
|
+
label: 'Chengdu',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
value: 'Shenzhen',
|
|
149
|
+
label: 'Shenzhen',
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
value: 'Guangzhou',
|
|
153
|
+
label: 'Guangzhou',
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
groups: [
|
|
157
|
+
{
|
|
158
|
+
label: 'Popular cities',
|
|
159
|
+
options: [
|
|
160
|
+
{
|
|
161
|
+
value: 'Shanghai',
|
|
162
|
+
label: 'Shanghai',
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
value: 'Beijing',
|
|
166
|
+
label: 'Beijing',
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
label: 'City name',
|
|
172
|
+
options: [
|
|
173
|
+
{
|
|
174
|
+
value: 'Chengdu',
|
|
175
|
+
label: 'Chengdu',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
value: 'Shenzhen',
|
|
179
|
+
label: 'Shenzhen',
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
value: 'Guangzhou',
|
|
183
|
+
label: 'Guangzhou',
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
value: 'Dalian',
|
|
187
|
+
label: 'Dalian',
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
options: [
|
|
193
|
+
{
|
|
194
|
+
value: 'Option1',
|
|
195
|
+
label: 'Option1',
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
value: 'Option2',
|
|
199
|
+
label: 'Option2',
|
|
200
|
+
disabled: true,
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
value: 'Option3',
|
|
204
|
+
label: 'Option3',
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
value: 'Option4',
|
|
208
|
+
label: 'Option4',
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
value: 'Option5',
|
|
212
|
+
label: 'Option5',
|
|
213
|
+
},
|
|
214
|
+
],
|
|
215
|
+
value: '',
|
|
216
|
+
value1: [],
|
|
217
|
+
value2: [],
|
|
218
|
+
};
|
|
219
|
+
},
|
|
220
|
+
computed: {
|
|
221
|
+
gridSize() {
|
|
222
|
+
const grids = {
|
|
223
|
+
5: 'grid-cols-5',
|
|
224
|
+
6: 'grid-cols-6',
|
|
225
|
+
7: 'grid-cols-7',
|
|
226
|
+
8: 'grid-cols-8',
|
|
227
|
+
};
|
|
228
|
+
return grids;
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
</script>
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pt-8 pb-16 flex gap-12 flex-col">
|
|
3
|
+
<section>
|
|
4
|
+
<h1>Fixed Height</h1>
|
|
5
|
+
<p class="p-md-c my-6">
|
|
6
|
+
This example demonstrates the basic usage of creating a data table using the `el-table` component provided by Element UI. Please note
|
|
7
|
+
that the outer border is applied with `table-container`.
|
|
8
|
+
</p>
|
|
9
|
+
<div class="grid flex-column">
|
|
10
|
+
<div class="table-container mb-4">
|
|
11
|
+
<el-table
|
|
12
|
+
:data="tableData"
|
|
13
|
+
:default-sort="{ prop: 'date', order: 'descending' }"
|
|
14
|
+
@selection-change="handleSelectionChange"
|
|
15
|
+
ref="multipleTable"
|
|
16
|
+
height="360px"
|
|
17
|
+
style="width: 100%"
|
|
18
|
+
>
|
|
19
|
+
<el-table-column type="selection" width="55"> </el-table-column>
|
|
20
|
+
<el-table-column
|
|
21
|
+
fixed
|
|
22
|
+
prop="date"
|
|
23
|
+
label="Date"
|
|
24
|
+
sortable
|
|
25
|
+
column-key="date"
|
|
26
|
+
:filters="[
|
|
27
|
+
{ text: '2016-05-01', value: '2016-05-01' },
|
|
28
|
+
{ text: '2016-05-02', value: '2016-05-02' },
|
|
29
|
+
{ text: '2016-05-03', value: '2016-05-03' },
|
|
30
|
+
{ text: '2016-05-04', value: '2016-05-04' },
|
|
31
|
+
]"
|
|
32
|
+
:filter-method="filterHandler"
|
|
33
|
+
>
|
|
34
|
+
</el-table-column>
|
|
35
|
+
<el-table-column prop="name" label="Name" width="180"> </el-table-column>
|
|
36
|
+
<el-table-column prop="address" label="Address" :formatter="formatter"> </el-table-column>
|
|
37
|
+
<el-table-column
|
|
38
|
+
prop="tag"
|
|
39
|
+
label="Tag"
|
|
40
|
+
:filters="[
|
|
41
|
+
{ text: 'Home', value: 'Home' },
|
|
42
|
+
{ text: 'Office', value: 'Office' },
|
|
43
|
+
{ text: 'Potato', value: 'Potato' },
|
|
44
|
+
]"
|
|
45
|
+
:filter-method="filterTag"
|
|
46
|
+
filter-placement="top-start"
|
|
47
|
+
>
|
|
48
|
+
</el-table-column>
|
|
49
|
+
<el-table-column prop="name" label="Name" width="120"> </el-table-column>
|
|
50
|
+
<el-table-column prop="state" label="State" width="120"> </el-table-column>
|
|
51
|
+
<el-table-column prop="city" label="City" width="120"> </el-table-column>
|
|
52
|
+
<el-table-column prop="address" label="Address" width="300"> </el-table-column>
|
|
53
|
+
<el-table-column prop="zip" label="Zip" width="120"> </el-table-column>
|
|
54
|
+
<el-table-column fixed="right" label="Operations" width="120">
|
|
55
|
+
<template slot-scope="scope">
|
|
56
|
+
<el-button @click.native.prevent="deleteRow(scope.$index, tableData)" type="text" size="small"> Remove </el-button>
|
|
57
|
+
</template>
|
|
58
|
+
</el-table-column>
|
|
59
|
+
</el-table>
|
|
60
|
+
</div>
|
|
61
|
+
<el-pagination
|
|
62
|
+
@size-change="handleSizeChange"
|
|
63
|
+
@current-change="handleCurrentChange"
|
|
64
|
+
:current-page.sync="currentPage4"
|
|
65
|
+
:page-sizes="[100, 200, 300, 400]"
|
|
66
|
+
:page-size="100"
|
|
67
|
+
layout="total, prev, pager, next, jumper, sizes"
|
|
68
|
+
:total="400"
|
|
69
|
+
>
|
|
70
|
+
</el-pagination>
|
|
71
|
+
</div>
|
|
72
|
+
<div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
|
|
73
|
+
<p class="text-xs">
|
|
74
|
+
<code>
|
|
75
|
+
<div class="table-container"><el-table :data="tableData" :default-sort="{ prop: 'date', order: 'descending'
|
|
76
|
+
}"></el-table></div>
|
|
77
|
+
</code>
|
|
78
|
+
</p>
|
|
79
|
+
</div>
|
|
80
|
+
</section>
|
|
81
|
+
|
|
82
|
+
<section>
|
|
83
|
+
<h1>Expandable Row</h1>
|
|
84
|
+
<p class="p-md-c my-6">
|
|
85
|
+
When the row content is too long and you do not want to display the horizontal scroll bar, you can use the expandable row feature.
|
|
86
|
+
Activate expandable row by adding type="expand" and scoped slot. The template for el-table-column will be rendered as the contents of
|
|
87
|
+
the expanded row, and you can access the same attributes as when you are using Scoped slot in custom column templates.
|
|
88
|
+
</p>
|
|
89
|
+
<div class="grid grid-flow-col auto-cols-max gap-4">
|
|
90
|
+
<div class="table-container mb-4">
|
|
91
|
+
<el-table :data="tableData" style="width: 100%">
|
|
92
|
+
<el-table-column type="expand">
|
|
93
|
+
<template slot-scope="props">
|
|
94
|
+
<p>State: {{ props.row.state }}</p>
|
|
95
|
+
<p>City: {{ props.row.city }}</p>
|
|
96
|
+
<p>Address: {{ props.row.address }}</p>
|
|
97
|
+
<p>Zip: {{ props.row.zip }}</p>
|
|
98
|
+
</template>
|
|
99
|
+
</el-table-column>
|
|
100
|
+
<el-table-column label="Date" prop="date"> </el-table-column>
|
|
101
|
+
<el-table-column label="Name" prop="name"> </el-table-column>
|
|
102
|
+
</el-table>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
<div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
|
|
106
|
+
<p class="text-xs">
|
|
107
|
+
<code>
|
|
108
|
+
<el-table :data="tableData"> <el-table-column type="expand"> <template v-slot="props"> <p>State: {
|
|
109
|
+
props.row.state } </p> </template> </el-table-column> </el-table>
|
|
110
|
+
</code>
|
|
111
|
+
</p>
|
|
112
|
+
</div>
|
|
113
|
+
</section>
|
|
114
|
+
</div>
|
|
115
|
+
</template>
|
|
116
|
+
|
|
117
|
+
<script>
|
|
118
|
+
import Vue from 'vue';
|
|
119
|
+
|
|
120
|
+
export default Vue.extend({
|
|
121
|
+
name: 'ThemeTable',
|
|
122
|
+
computed: {
|
|
123
|
+
gridSize() {
|
|
124
|
+
const grids = {
|
|
125
|
+
5: 'grid-cols-5',
|
|
126
|
+
6: 'grid-cols-6',
|
|
127
|
+
7: 'grid-cols-7',
|
|
128
|
+
8: 'grid-cols-8',
|
|
129
|
+
};
|
|
130
|
+
return grids;
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
data() {
|
|
134
|
+
return {
|
|
135
|
+
multipleSelection: [],
|
|
136
|
+
currentPage1: 5,
|
|
137
|
+
currentPage2: 5,
|
|
138
|
+
currentPage3: 5,
|
|
139
|
+
currentPage4: 4,
|
|
140
|
+
tableData: [
|
|
141
|
+
{
|
|
142
|
+
date: '2016-05-03',
|
|
143
|
+
name: 'Tom',
|
|
144
|
+
state: 'California',
|
|
145
|
+
city: 'Los Angeles',
|
|
146
|
+
address: 'No. 189, Grove St, Los Angeles',
|
|
147
|
+
zip: 'CA 90036',
|
|
148
|
+
tag: 'Home',
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
date: '2016-05-02',
|
|
152
|
+
name: 'Tom',
|
|
153
|
+
state: 'California',
|
|
154
|
+
city: 'Los Angeles',
|
|
155
|
+
address: 'No. 189, Grove St, Los Angeles',
|
|
156
|
+
zip: 'CA 90036',
|
|
157
|
+
tag: 'Office',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
date: '2016-05-04',
|
|
161
|
+
name: 'Tom',
|
|
162
|
+
state: 'California',
|
|
163
|
+
city: 'Los Angeles',
|
|
164
|
+
address: 'No. 189, Grove St, Los Angeles',
|
|
165
|
+
zip: 'CA 90036',
|
|
166
|
+
tag: 'Home',
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
date: '2016-05-01',
|
|
170
|
+
name: 'Tom',
|
|
171
|
+
state: 'California',
|
|
172
|
+
city: 'Los Angeles',
|
|
173
|
+
address: 'No. 189, Grove St, Los Angeles',
|
|
174
|
+
zip: 'CA 90036',
|
|
175
|
+
tag: 'Office',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
date: '2016-05-08',
|
|
179
|
+
name: 'Tom',
|
|
180
|
+
state: 'California',
|
|
181
|
+
city: 'Los Angeles',
|
|
182
|
+
address: 'No. 189, Grove St, Los Angeles',
|
|
183
|
+
zip: 'CA 90036',
|
|
184
|
+
tag: 'Office',
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
date: '2016-05-06',
|
|
188
|
+
name: 'Tom',
|
|
189
|
+
state: 'California',
|
|
190
|
+
city: 'Los Angeles',
|
|
191
|
+
address: 'No. 189, Grove St, Los Angeles',
|
|
192
|
+
zip: 'CA 90036',
|
|
193
|
+
tag: 'Home',
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
date: '2016-05-07',
|
|
197
|
+
name: 'Tom',
|
|
198
|
+
state: 'California',
|
|
199
|
+
city: 'Los Angeles',
|
|
200
|
+
address: 'No. 189, Grove St, Los Angeles',
|
|
201
|
+
zip: 'CA 90036',
|
|
202
|
+
tag: 'Office',
|
|
203
|
+
},
|
|
204
|
+
],
|
|
205
|
+
};
|
|
206
|
+
},
|
|
207
|
+
methods: {
|
|
208
|
+
toggleSelection(rows) {
|
|
209
|
+
if (rows) {
|
|
210
|
+
rows.forEach((row) => {
|
|
211
|
+
this.$refs.multipleTable.toggleRowSelection(row);
|
|
212
|
+
});
|
|
213
|
+
} else {
|
|
214
|
+
this.$refs.multipleTable.clearSelection();
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
handleSelectionChange(val) {
|
|
218
|
+
this.multipleSelection = val;
|
|
219
|
+
},
|
|
220
|
+
resetDateFilter() {
|
|
221
|
+
this.$refs.filterTable.clearFilter('date');
|
|
222
|
+
},
|
|
223
|
+
clearFilter() {
|
|
224
|
+
this.$refs.filterTable.clearFilter();
|
|
225
|
+
},
|
|
226
|
+
formatter(row, column) {
|
|
227
|
+
return row.address;
|
|
228
|
+
},
|
|
229
|
+
filterTag(value, row) {
|
|
230
|
+
return row.tag === value;
|
|
231
|
+
},
|
|
232
|
+
filterHandler(value, row, column) {
|
|
233
|
+
console.log(row, column, value);
|
|
234
|
+
const property = column['property'];
|
|
235
|
+
return row[property] === value;
|
|
236
|
+
},
|
|
237
|
+
handleSizeChange(val) {
|
|
238
|
+
console.log(`${val} items per page`);
|
|
239
|
+
},
|
|
240
|
+
handleCurrentChange(val) {
|
|
241
|
+
console.log(`current page: ${val}`);
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
});
|
|
245
|
+
</script>
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="pt-8 pb-16 flex gap-12 flex-col">
|
|
3
|
+
<section>
|
|
4
|
+
<h1>Basic</h1>
|
|
5
|
+
<p class="p-lg my-6">
|
|
6
|
+
Use the type attribute to define Tag's type. In addition, the color attribute can be used to set the background color of the Tag.
|
|
7
|
+
</p>
|
|
8
|
+
<div class="grid grid-flow-col auto-cols-max gap-4">
|
|
9
|
+
<el-tag :disable-transitions="true">Tag 1</el-tag>
|
|
10
|
+
<el-tag type="success">Tag 2</el-tag>
|
|
11
|
+
<el-tag type="info">Tag 3</el-tag>
|
|
12
|
+
<el-tag type="warning">Tag 4</el-tag>
|
|
13
|
+
<el-tag type="danger">Tag 5</el-tag>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
|
|
16
|
+
<p class="text-xs">
|
|
17
|
+
<code><el-input placeholder="Please input" v-model="input"></el-input></code>
|
|
18
|
+
</p>
|
|
19
|
+
</div>
|
|
20
|
+
</section>
|
|
21
|
+
|
|
22
|
+
<section>
|
|
23
|
+
<h1>Removable</h1>
|
|
24
|
+
<p class="p-lg my-6">
|
|
25
|
+
Use the type attribute to define Tag's type. In addition, the color attribute can be used to set the background color of the Tag.
|
|
26
|
+
</p>
|
|
27
|
+
<div class="grid grid-flow-col auto-cols-max gap-4">
|
|
28
|
+
<el-tag v-for="tag in tags" :key="tag.name" closable :type="tag.type">
|
|
29
|
+
{{ tag.name }}
|
|
30
|
+
</el-tag>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
|
|
33
|
+
<p class="text-xs">
|
|
34
|
+
<code><el-input placeholder="Please input" v-model="input"></el-input></code>
|
|
35
|
+
</p>
|
|
36
|
+
</div>
|
|
37
|
+
</section>
|
|
38
|
+
|
|
39
|
+
<section>
|
|
40
|
+
<h1>Sizes</h1>
|
|
41
|
+
<p class="p-lg my-6">Besides default size, Tag component provides three additional sizes for you to choose among different scenarios.</p>
|
|
42
|
+
<div class="grid grid-flow-col auto-cols-max gap-4">
|
|
43
|
+
<el-tag>Default</el-tag>
|
|
44
|
+
<el-tag size="large">Large</el-tag>
|
|
45
|
+
<el-tag size="medium">Medium</el-tag>
|
|
46
|
+
<el-tag size="small">Small</el-tag>
|
|
47
|
+
<el-tag size="mini">Mini</el-tag>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
|
|
50
|
+
<p class="text-xs">
|
|
51
|
+
<code><el-input placeholder="Please input" v-model="input"></el-input></code>
|
|
52
|
+
</p>
|
|
53
|
+
</div>
|
|
54
|
+
</section>
|
|
55
|
+
|
|
56
|
+
<section>
|
|
57
|
+
<h1>Edit Dynamically</h1>
|
|
58
|
+
<p class="p-lg my-6">You can use the close event to add and remove tag dynamically.</p>
|
|
59
|
+
<div class="grid grid-flow-col auto-cols-max gap-4">
|
|
60
|
+
<el-tag :key="tag" v-for="tag in dynamicTags" closable :disable-transitions="true" @close="handleClose(tag)">
|
|
61
|
+
{{ tag }}
|
|
62
|
+
</el-tag>
|
|
63
|
+
<el-input
|
|
64
|
+
class="input-new-tag"
|
|
65
|
+
v-if="inputVisible"
|
|
66
|
+
v-model="inputValue"
|
|
67
|
+
ref="saveTagInput"
|
|
68
|
+
size="mini"
|
|
69
|
+
@keyup.enter.native="handleInputConfirm"
|
|
70
|
+
@blur="handleInputConfirm"
|
|
71
|
+
>
|
|
72
|
+
</el-input>
|
|
73
|
+
<el-button v-else class="button-new-tag" size="small" @click="showInput">+ New Tag</el-button>
|
|
74
|
+
</div>
|
|
75
|
+
<div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
|
|
76
|
+
<p class="text-xs">
|
|
77
|
+
<code><el-input placeholder="Please input" v-model="input"></el-input></code>
|
|
78
|
+
</p>
|
|
79
|
+
</div>
|
|
80
|
+
</section>
|
|
81
|
+
</div>
|
|
82
|
+
</template>
|
|
83
|
+
<script>
|
|
84
|
+
import Vue from 'vue';
|
|
85
|
+
|
|
86
|
+
export default Vue.extend({
|
|
87
|
+
name: 'TimusButtonSample',
|
|
88
|
+
computed: {
|
|
89
|
+
gridSize() {
|
|
90
|
+
const grids = {
|
|
91
|
+
5: 'grid-cols-5',
|
|
92
|
+
6: 'grid-cols-6',
|
|
93
|
+
7: 'grid-cols-7',
|
|
94
|
+
8: 'grid-cols-8',
|
|
95
|
+
};
|
|
96
|
+
return grids;
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
data() {
|
|
100
|
+
return {
|
|
101
|
+
dynamicTags: ['Tag 1', 'Tag 2', 'Tag 3'],
|
|
102
|
+
inputVisible: false,
|
|
103
|
+
inputValue: '',
|
|
104
|
+
tags: [
|
|
105
|
+
{ name: 'Tag 1', type: '' },
|
|
106
|
+
{ name: 'Tag 2', type: 'success' },
|
|
107
|
+
{ name: 'Tag 3', type: 'info' },
|
|
108
|
+
{ name: 'Tag 4', type: 'warning' },
|
|
109
|
+
{ name: 'Tag 5', type: 'danger' },
|
|
110
|
+
],
|
|
111
|
+
items: [
|
|
112
|
+
{ type: '', label: 'Tag 1' },
|
|
113
|
+
{ type: 'success', label: 'Tag 2' },
|
|
114
|
+
{ type: 'info', label: 'Tag 3' },
|
|
115
|
+
{ type: 'danger', label: 'Tag 4' },
|
|
116
|
+
{ type: 'warning', label: 'Tag 5' },
|
|
117
|
+
],
|
|
118
|
+
};
|
|
119
|
+
},
|
|
120
|
+
methods: {
|
|
121
|
+
handleClose(tag) {
|
|
122
|
+
this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
showInput() {
|
|
126
|
+
this.inputVisible = true;
|
|
127
|
+
this.$nextTick((_) => {
|
|
128
|
+
this.$refs.saveTagInput.$refs.input.focus();
|
|
129
|
+
});
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
handleInputConfirm() {
|
|
133
|
+
let inputValue = this.inputValue;
|
|
134
|
+
if (inputValue) {
|
|
135
|
+
this.dynamicTags.push(inputValue);
|
|
136
|
+
}
|
|
137
|
+
this.inputVisible = false;
|
|
138
|
+
this.inputValue = '';
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
</script>
|