@timus-networks/theme 2.0.16 → 2.2.0
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/README.md +113 -0
- package/dist/module.cjs +5 -0
- package/dist/module.d.mts +11 -0
- package/dist/module.d.ts +11 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +187 -0
- package/dist/runtime/components/development/example.alert.vue +29 -0
- package/dist/runtime/components/development/example.avatar.vue +85 -0
- package/dist/runtime/components/development/example.badge.vue +93 -0
- package/dist/runtime/components/development/example.breadcrumb.vue +54 -0
- package/dist/runtime/components/development/example.button.vue +235 -0
- package/dist/runtime/components/development/example.button.vue.d.ts +11 -0
- package/dist/runtime/components/development/example.card.vue +68 -0
- package/dist/runtime/components/development/example.checkbox.vue +176 -0
- package/dist/runtime/components/development/example.checkbox.vue.d.ts +24 -0
- package/dist/runtime/components/development/example.collapse.vue +38 -0
- package/dist/runtime/components/development/example.datepicker.vue +193 -0
- package/dist/runtime/components/development/example.description.vue +94 -0
- package/dist/runtime/components/development/example.dialog.vue +79 -0
- package/dist/runtime/components/development/example.dropdown.vue +166 -0
- package/dist/runtime/components/development/example.form.vue +488 -0
- package/dist/runtime/components/development/example.input.vue +270 -0
- package/dist/runtime/components/development/example.input.vue.d.ts +23 -0
- package/dist/runtime/components/development/example.link.vue +68 -0
- package/dist/runtime/components/development/example.message.vue +64 -0
- package/dist/runtime/components/development/example.notification.vue +75 -0
- package/dist/runtime/components/development/example.number.vue +70 -0
- package/dist/runtime/components/development/example.pagination.vue +89 -0
- package/dist/runtime/components/development/example.popover.vue +151 -0
- package/dist/runtime/components/development/example.radio.vue +163 -0
- package/dist/runtime/components/development/example.radio.vue.d.ts +25 -0
- package/dist/runtime/components/development/example.select.vue +588 -0
- package/dist/runtime/components/development/example.select.vue.d.ts +70 -0
- package/dist/runtime/components/development/example.sidebar.vue +101 -0
- package/dist/runtime/components/development/example.static.vue +50 -0
- package/dist/runtime/components/development/example.switch.vue +101 -0
- package/dist/runtime/components/development/example.table.vue +112 -0
- package/dist/runtime/components/development/example.tag.vue +255 -0
- package/dist/runtime/components/development/example.timepicker.vue +89 -0
- package/dist/runtime/components/development/example.tooltip.vue +104 -0
- package/dist/runtime/components/development/example.upload.vue +84 -0
- package/dist/runtime/components/production/html-encode.vue +96 -0
- package/dist/runtime/components/production/timus-breadcrumb.d.ts +36 -0
- package/dist/runtime/components/production/timus-breadcrumb.js +224 -0
- package/dist/runtime/components/production/timus-breadcrumb.mjs +224 -0
- package/dist/runtime/components/production/timus-breadcrumb.vue +83 -0
- package/dist/runtime/components/production/timus-breadcrumb.vue.d.ts +340 -0
- package/dist/runtime/composables/useBreadcrumb.d.ts +8 -0
- package/dist/runtime/composables/useBreadcrumb.js +53 -0
- package/dist/runtime/composables/useBreadcrumb.mjs +53 -0
- package/dist/runtime/pages/theme.vue +61 -0
- package/dist/runtime/plugins/disable-warnings-plugin.d.ts +2 -0
- package/dist/runtime/plugins/disable-warnings-plugin.js +18 -0
- package/dist/runtime/plugins/disable-warnings-plugin.mjs +18 -0
- package/dist/runtime/plugins/sample-plugin.d.ts +20 -0
- package/dist/runtime/plugins/sample-plugin.js +5 -0
- package/dist/runtime/plugins/sample-plugin.mjs +5 -0
- package/dist/runtime/plugins/theme-provider-plugin.d.ts +30 -0
- package/dist/runtime/plugins/theme-provider-plugin.js +46 -0
- package/dist/runtime/plugins/theme-provider-plugin.mjs +46 -0
- package/dist/runtime/public/scss/element-plus/affix.css +305 -0
- package/dist/runtime/public/scss/element-plus/alert.css +516 -0
- package/dist/runtime/public/scss/element-plus/anchor-link.css +332 -0
- package/dist/runtime/public/scss/element-plus/anchor.css +376 -0
- package/dist/runtime/public/scss/element-plus/aside.css +308 -0
- package/dist/runtime/public/scss/element-plus/autocomplete.css +411 -0
- package/dist/runtime/public/scss/element-plus/avatar.css +370 -0
- package/dist/runtime/public/scss/element-plus/backtop.css +326 -0
- package/dist/runtime/public/scss/element-plus/badge.css +376 -0
- package/dist/runtime/public/scss/element-plus/base.css +550 -0
- package/dist/runtime/public/scss/element-plus/breadcrumb-item.css +0 -0
- package/dist/runtime/public/scss/element-plus/breadcrumb.css +370 -0
- package/dist/runtime/public/scss/element-plus/button-group.css +535 -0
- package/dist/runtime/public/scss/element-plus/button.css +1089 -0
- package/dist/runtime/public/scss/element-plus/calendar.css +370 -0
- package/dist/runtime/public/scss/element-plus/card.css +347 -0
- package/dist/runtime/public/scss/element-plus/carousel-item.css +350 -0
- package/dist/runtime/public/scss/element-plus/carousel.css +475 -0
- package/dist/runtime/public/scss/element-plus/cascader-panel.css +428 -0
- package/dist/runtime/public/scss/element-plus/cascader.css +560 -0
- package/dist/runtime/public/scss/element-plus/check-tag.css +386 -0
- package/dist/runtime/public/scss/element-plus/checkbox-button.css +451 -0
- package/dist/runtime/public/scss/element-plus/checkbox-group.css +307 -0
- package/dist/runtime/public/scss/element-plus/checkbox.css +588 -0
- package/dist/runtime/public/scss/element-plus/col.css +3270 -0
- package/dist/runtime/public/scss/element-plus/collapse-item.css +0 -0
- package/dist/runtime/public/scss/element-plus/collapse-transition.css +0 -0
- package/dist/runtime/public/scss/element-plus/collapse.css +490 -0
- package/dist/runtime/public/scss/element-plus/color/index.css +0 -0
- package/dist/runtime/public/scss/element-plus/color-picker.css +650 -0
- package/dist/runtime/public/scss/element-plus/common/popup.css +338 -0
- package/dist/runtime/public/scss/element-plus/common/transition.css +420 -0
- package/dist/runtime/public/scss/element-plus/common/var.css +302 -0
- package/dist/runtime/public/scss/element-plus/config-provider.css +0 -0
- package/dist/runtime/public/scss/element-plus/container.css +313 -0
- package/dist/runtime/public/scss/element-plus/dark/css-vars.css +353 -0
- package/dist/runtime/public/scss/element-plus/dark/var.css +302 -0
- package/dist/runtime/public/scss/element-plus/date-picker/date-picker.css +558 -0
- package/dist/runtime/public/scss/element-plus/date-picker/date-range-picker.css +410 -0
- package/dist/runtime/public/scss/element-plus/date-picker/date-table.css +426 -0
- package/dist/runtime/public/scss/element-plus/date-picker/month-table.css +388 -0
- package/dist/runtime/public/scss/element-plus/date-picker/picker-panel.css +454 -0
- package/dist/runtime/public/scss/element-plus/date-picker/picker.css +662 -0
- package/dist/runtime/public/scss/element-plus/date-picker/time-picker.css +384 -0
- package/dist/runtime/public/scss/element-plus/date-picker/time-range-picker.css +338 -0
- package/dist/runtime/public/scss/element-plus/date-picker/time-spinner.css +389 -0
- package/dist/runtime/public/scss/element-plus/date-picker/year-table.css +384 -0
- package/dist/runtime/public/scss/element-plus/date-picker.css +1531 -0
- package/dist/runtime/public/scss/element-plus/descriptions-item.css +347 -0
- package/dist/runtime/public/scss/element-plus/descriptions.css +435 -0
- package/dist/runtime/public/scss/element-plus/dialog.css +512 -0
- package/dist/runtime/public/scss/element-plus/display.css +357 -0
- package/dist/runtime/public/scss/element-plus/divider.css +345 -0
- package/dist/runtime/public/scss/element-plus/drawer.css +419 -0
- package/dist/runtime/public/scss/element-plus/dropdown-item.css +0 -0
- package/dist/runtime/public/scss/element-plus/dropdown-menu.css +0 -0
- package/dist/runtime/public/scss/element-plus/dropdown.css +495 -0
- package/dist/runtime/public/scss/element-plus/empty.css +355 -0
- package/dist/runtime/public/scss/element-plus/footer.css +310 -0
- package/dist/runtime/public/scss/element-plus/form-item.css +0 -0
- package/dist/runtime/public/scss/element-plus/form.css +527 -0
- package/dist/runtime/public/scss/element-plus/header.css +310 -0
- package/dist/runtime/public/scss/element-plus/icon.css +343 -0
- package/dist/runtime/public/scss/element-plus/image-viewer.css +439 -0
- package/dist/runtime/public/scss/element-plus/image.css +343 -0
- package/dist/runtime/public/scss/element-plus/index.css +17293 -0
- package/dist/runtime/public/scss/element-plus/infinite-scroll.css +0 -0
- package/dist/runtime/public/scss/element-plus/input-number.css +494 -0
- package/dist/runtime/public/scss/element-plus/input.css +770 -0
- package/dist/runtime/public/scss/element-plus/link.css +453 -0
- package/dist/runtime/public/scss/element-plus/loading.css +391 -0
- package/dist/runtime/public/scss/element-plus/main.css +311 -0
- package/dist/runtime/public/scss/element-plus/mention.css +413 -0
- package/dist/runtime/public/scss/element-plus/menu-item-group.css +0 -0
- package/dist/runtime/public/scss/element-plus/menu-item.css +0 -0
- package/dist/runtime/public/scss/element-plus/menu.css +737 -0
- package/dist/runtime/public/scss/element-plus/message-box.css +533 -0
- package/dist/runtime/public/scss/element-plus/message.css +528 -0
- package/dist/runtime/public/scss/element-plus/mixins/config.css +0 -0
- package/dist/runtime/public/scss/element-plus/mixins/function.css +0 -0
- package/dist/runtime/public/scss/element-plus/mixins/mixins.css +302 -0
- package/dist/runtime/public/scss/element-plus/mixins/utils.css +0 -0
- package/dist/runtime/public/scss/element-plus/notification.css +413 -0
- package/dist/runtime/public/scss/element-plus/option-group.css +331 -0
- package/dist/runtime/public/scss/element-plus/option.css +354 -0
- package/dist/runtime/public/scss/element-plus/overlay.css +317 -0
- package/dist/runtime/public/scss/element-plus/page-header.css +351 -0
- package/dist/runtime/public/scss/element-plus/pagination.css +586 -0
- package/dist/runtime/public/scss/element-plus/popconfirm.css +315 -0
- package/dist/runtime/public/scss/element-plus/popover.css +352 -0
- package/dist/runtime/public/scss/element-plus/popper.css +400 -0
- package/dist/runtime/public/scss/element-plus/progress.css +449 -0
- package/dist/runtime/public/scss/element-plus/radio-button.css +436 -0
- package/dist/runtime/public/scss/element-plus/radio-group.css +308 -0
- package/dist/runtime/public/scss/element-plus/radio.css +561 -0
- package/dist/runtime/public/scss/element-plus/rate.css +384 -0
- package/dist/runtime/public/scss/element-plus/reset.css +399 -0
- package/dist/runtime/public/scss/element-plus/result.css +381 -0
- package/dist/runtime/public/scss/element-plus/row.css +339 -0
- package/dist/runtime/public/scss/element-plus/scrollbar.css +373 -0
- package/dist/runtime/public/scss/element-plus/segmented.css +460 -0
- package/dist/runtime/public/scss/element-plus/select-dropdown-v2.css +351 -0
- package/dist/runtime/public/scss/element-plus/select-dropdown.css +351 -0
- package/dist/runtime/public/scss/element-plus/select-v2.css +765 -0
- package/dist/runtime/public/scss/element-plus/select.css +765 -0
- package/dist/runtime/public/scss/element-plus/skeleton-item.css +372 -0
- package/dist/runtime/public/scss/element-plus/skeleton.css +335 -0
- package/dist/runtime/public/scss/element-plus/slider.css +480 -0
- package/dist/runtime/public/scss/element-plus/space.css +317 -0
- package/dist/runtime/public/scss/element-plus/spinner.css +342 -0
- package/dist/runtime/public/scss/element-plus/statistic.css +336 -0
- package/dist/runtime/public/scss/element-plus/step.css +586 -0
- package/dist/runtime/public/scss/element-plus/steps.css +319 -0
- package/dist/runtime/public/scss/element-plus/sub-menu.css +0 -0
- package/dist/runtime/public/scss/element-plus/switch.css +594 -0
- package/dist/runtime/public/scss/element-plus/tab-pane.css +0 -0
- package/dist/runtime/public/scss/element-plus/table-column.css +382 -0
- package/dist/runtime/public/scss/element-plus/table-v2.css +520 -0
- package/dist/runtime/public/scss/element-plus/table.css +893 -0
- package/dist/runtime/public/scss/element-plus/tabs.css +892 -0
- package/dist/runtime/public/scss/element-plus/tag.css +624 -0
- package/dist/runtime/public/scss/element-plus/text.css +378 -0
- package/dist/runtime/public/scss/element-plus/time-picker.css +1023 -0
- package/dist/runtime/public/scss/element-plus/time-select.css +946 -0
- package/dist/runtime/public/scss/element-plus/timeline-item.css +415 -0
- package/dist/runtime/public/scss/element-plus/timeline.css +334 -0
- package/dist/runtime/public/scss/element-plus/tooltip-v2.css +410 -0
- package/dist/runtime/public/scss/element-plus/tooltip.css +0 -0
- package/dist/runtime/public/scss/element-plus/tour.css +461 -0
- package/dist/runtime/public/scss/element-plus/transfer.css +497 -0
- package/dist/runtime/public/scss/element-plus/tree-select.css +325 -0
- package/dist/runtime/public/scss/element-plus/tree.css +538 -0
- package/dist/runtime/public/scss/element-plus/upload.css +862 -0
- package/dist/runtime/public/scss/element-plus/var.css +389 -0
- package/dist/runtime/public/scss/element-plus/virtual-list.css +330 -0
- package/dist/runtime/public/scss/theme.css +1268 -0
- package/dist/runtime/server/tsconfig.json +6 -0
- package/dist/runtime/types.d.ts +31 -0
- package/dist/types.d.mts +7 -0
- package/dist/types.d.ts +7 -0
- package/package.json +35 -12
- package/components/TimusIcons.vue +0 -54
- package/generate-icon.js +0 -22
- package/module.ts +0 -84
- package/pages/icons.vue +0 -37
- package/plugins/sample-plugin.ts +0 -5
- package/public/isax/fonts/iconsax.svg +0 -927
- package/public/isax/fonts/iconsax.ttf +0 -0
- package/public/isax/fonts/iconsax.woff +0 -0
- package/public/isax/icons.json +0 -899
- package/public/isax/selection.json +0 -1
- package/public/isax/style.css +0 -1
- package/public/isax/style.scss +0 -5435
- package/public/isax/variables.scss +0 -900
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col gap-8 mb-16">
|
|
3
|
+
<h1 class="">Menu</h1>
|
|
4
|
+
<p>Menu that provides navigation for your website.</p>
|
|
5
|
+
|
|
6
|
+
<el-card>
|
|
7
|
+
<template #header> Sidebar </template>
|
|
8
|
+
<div class="flex flex-col gap-3 items-start">
|
|
9
|
+
<p>
|
|
10
|
+
Vertical <el-text tag="mark">Menu</el-text> with sub-menus. You can use the <el-text tag="mark">el-menu-item-group</el-text> component to create a
|
|
11
|
+
<span class="font-medium">menu group</span>, and the name of the group is determined by the title prop or a named slot.
|
|
12
|
+
</p>
|
|
13
|
+
<div class="flex flex-col gap-4 items-start">
|
|
14
|
+
{{ currentRoute }}
|
|
15
|
+
<el-menu :default-active="currentRoute.path" class="w-[270px]" :router="true" @open="handleOpen" @close="handleClose">
|
|
16
|
+
<el-menu-item index="/" class="isax-grid-3">Dashboard</el-menu-item>
|
|
17
|
+
<el-menu-item index="/theme" class="isax-designtools">Theme</el-menu-item>
|
|
18
|
+
<el-menu-item index="/users" class="isax-profile-circle">User & Teams</el-menu-item>
|
|
19
|
+
<el-menu-item index="/devices" class="isax-monitor-mobbile">Devices</el-menu-item>
|
|
20
|
+
<el-menu-item index="/sites" class="isax-driver-2">Sites</el-menu-item>
|
|
21
|
+
<el-sub-menu index="1">
|
|
22
|
+
<template #title><i class="isax-key-square" /><span>Rules</span></template>
|
|
23
|
+
<el-menu-item index="/rules/firewall">Firewall</el-menu-item>
|
|
24
|
+
<el-menu-item index="/rules/routes">Routes</el-menu-item>
|
|
25
|
+
<el-menu-item index="/rules/forwarding">Forwarding</el-menu-item>
|
|
26
|
+
<el-menu-item index="/rules/acls">Access Control List</el-menu-item>
|
|
27
|
+
</el-sub-menu>
|
|
28
|
+
<el-sub-menu index="2">
|
|
29
|
+
<template #title><i class="isax-shield" /><span>Zero Trust Security</span></template>
|
|
30
|
+
<el-menu-item index="/ztna/dashboard">Dashboard</el-menu-item>
|
|
31
|
+
<el-menu-item index="/ztna/behavior-detection">Behaviors</el-menu-item>
|
|
32
|
+
<el-menu-item index="/ztna/device-posture-check">Device Posture Checks</el-menu-item>
|
|
33
|
+
<el-menu-item index="/ztna/behavior-detection">User Sign-In Policies</el-menu-item>
|
|
34
|
+
<el-menu-item index="/ztna/behavior-detection">Admin Sign-In Policies</el-menu-item>
|
|
35
|
+
</el-sub-menu>
|
|
36
|
+
<el-sub-menu index="3">
|
|
37
|
+
<template #title><i class="isax-folder-open" /><span>Insights</span></template>
|
|
38
|
+
<el-menu-item index="/insights/alerts">Alerts</el-menu-item>
|
|
39
|
+
<el-menu-item index="/ztna/dashboard">Traffic Logs</el-menu-item>
|
|
40
|
+
<el-menu-item index="/ztna/dashboard">Events</el-menu-item>
|
|
41
|
+
<el-menu-item index="/insights/blocked-ips">Blocked IP Addresses</el-menu-item>
|
|
42
|
+
<el-menu-item index="/insights/signed-logs">"Signed Logs"</el-menu-item>
|
|
43
|
+
<el-menu-item index="/insights/reports">Automated Reports</el-menu-item>
|
|
44
|
+
<el-menu-item index="/insights/tracker">Productivity Reports</el-menu-item>
|
|
45
|
+
<el-menu-item index="/insights/dpc-reports">Device Posture Reports</el-menu-item>
|
|
46
|
+
</el-sub-menu>
|
|
47
|
+
<el-sub-menu index="4">
|
|
48
|
+
<template #title><i class="isax-setting-2" /><span>Settings</span></template>
|
|
49
|
+
<el-menu-item index="/settings/captive-portals">Captive Portal</el-menu-item>
|
|
50
|
+
<el-menu-item index="/settings/integrations">Integrations</el-menu-item>
|
|
51
|
+
<el-menu-item index="/settings/configuration">Configurations</el-menu-item>
|
|
52
|
+
<el-menu-item index="/settings/tags">Tags</el-menu-item>
|
|
53
|
+
<el-menu-item index="/settings/administrators">Administrators</el-menu-item>
|
|
54
|
+
<el-menu-item index="/settings/organization">Organization</el-menu-item>
|
|
55
|
+
<el-menu-item index="/settings/downloads">Downloads</el-menu-item>
|
|
56
|
+
</el-sub-menu>
|
|
57
|
+
</el-menu>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
<template #footer>
|
|
61
|
+
<html-encode :tag="snippets.sizes" />
|
|
62
|
+
</template>
|
|
63
|
+
</el-card>
|
|
64
|
+
</div>
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<script lang="ts" setup>
|
|
68
|
+
import { useRoute } from 'nuxt/app';
|
|
69
|
+
import { computed } from 'vue';
|
|
70
|
+
|
|
71
|
+
const route = useRoute();
|
|
72
|
+
const currentRoute = computed(() => ({
|
|
73
|
+
path: route.path,
|
|
74
|
+
fullPath: route.fullPath,
|
|
75
|
+
name: route.name,
|
|
76
|
+
params: route.params,
|
|
77
|
+
query: route.query,
|
|
78
|
+
}));
|
|
79
|
+
const handleOpen = (key: string, keyPath: string[]) => {
|
|
80
|
+
console.log(key, keyPath);
|
|
81
|
+
};
|
|
82
|
+
const handleClose = (key: string, keyPath: string[]) => {
|
|
83
|
+
console.log(key, keyPath);
|
|
84
|
+
};
|
|
85
|
+
const snippets = ref({
|
|
86
|
+
sizes: `
|
|
87
|
+
<el-menu :default-active="currentRoute.path" class="w-[270px]" :router="true" @open="handleOpen" @close="handleClose">
|
|
88
|
+
<el-sub-menu index="4">
|
|
89
|
+
<template #title><i class="isax-setting-2" /><span>Settings</span></template>
|
|
90
|
+
<el-menu-item index="/settings/captive-portals">Captive Portal</el-menu-item>
|
|
91
|
+
<el-menu-item index="/settings/integrations">Integrations</el-menu-item>
|
|
92
|
+
<el-menu-item index="/settings/configuration">Configurations</el-menu-item>
|
|
93
|
+
<el-menu-item index="/settings/tags">Tags</el-menu-item>
|
|
94
|
+
<el-menu-item index="/settings/administrators">Administrators</el-menu-item>
|
|
95
|
+
<el-menu-item index="/settings/organization">Organization</el-menu-item>
|
|
96
|
+
<el-menu-item index="/settings/downloads">Downloads</el-menu-item>
|
|
97
|
+
</el-sub-menu>
|
|
98
|
+
</el-menu>
|
|
99
|
+
`,
|
|
100
|
+
});
|
|
101
|
+
</script>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col gap-8 mb-16">
|
|
3
|
+
<h1 class="">Static - (Coding Not Started)</h1>
|
|
4
|
+
<p>Display statistics.</p>
|
|
5
|
+
|
|
6
|
+
<el-card>
|
|
7
|
+
<template #header>Basic usage</template>
|
|
8
|
+
<div class="flex flex-col gap-3">
|
|
9
|
+
<p>
|
|
10
|
+
To highlight a number or a group of numbers, such as statistical value, amount, and ranking, you can add elements such as icon and unit before and after the number and
|
|
11
|
+
title. And use vueuse to add animated transitions to value.
|
|
12
|
+
</p>
|
|
13
|
+
<section class="flex gap-7.5">
|
|
14
|
+
<el-statistic :value="138">
|
|
15
|
+
<template #title>
|
|
16
|
+
<div style="align-items: center; display: inline-flex">
|
|
17
|
+
Ratio of men to women
|
|
18
|
+
<el-icon style="margin-left: 4px" :size="12">
|
|
19
|
+
<ElIconMale />
|
|
20
|
+
</el-icon>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
<template #suffix>/100</template>
|
|
24
|
+
</el-statistic>
|
|
25
|
+
</section>
|
|
26
|
+
</div>
|
|
27
|
+
<template #footer> <html-encode :tag="snippets.basic" /> </template>
|
|
28
|
+
</el-card>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script lang="ts" setup>
|
|
33
|
+
import { ref } from 'vue';
|
|
34
|
+
|
|
35
|
+
const snippets = ref({
|
|
36
|
+
basic: `
|
|
37
|
+
<el-statistic :value="138">
|
|
38
|
+
<template #title>
|
|
39
|
+
<div style="align-items: center; display: inline-flex">
|
|
40
|
+
Ratio of men to women
|
|
41
|
+
<el-icon style="margin-left: 4px" :size="12">
|
|
42
|
+
<ElIconMale />
|
|
43
|
+
</el-icon>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
<template #suffix>/100</template>
|
|
47
|
+
</el-statistic>
|
|
48
|
+
`,
|
|
49
|
+
});
|
|
50
|
+
</script>
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col gap-8 mb-16">
|
|
3
|
+
<h1 class="">Switch</h1>
|
|
4
|
+
<p>Switch is used for switching between two opposing states.</p>
|
|
5
|
+
|
|
6
|
+
<el-card>
|
|
7
|
+
<template #header> Basic usage </template>
|
|
8
|
+
<div class="flex flex-col gap-3">
|
|
9
|
+
<p>
|
|
10
|
+
Bind <el-text tag="mark">v-model</el-text> to a Boolean typed variable. The <el-text tag="mark">--el-switch-on-color</el-text> and
|
|
11
|
+
<el-text tag="mark">--el-switch-off-color</el-text> CSS variables decides the background color in two states.
|
|
12
|
+
</p>
|
|
13
|
+
<div class="flex gap-4">
|
|
14
|
+
<el-switch v-model="value" />
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
<template #footer> <html-encode :tag="snippets.basic" /> </template>
|
|
18
|
+
</el-card>
|
|
19
|
+
|
|
20
|
+
<el-card>
|
|
21
|
+
<template #header> Sizes </template>
|
|
22
|
+
<div class="flex flex-col gap-3">
|
|
23
|
+
<p>You can set <el-text tag="mark">size</el-text>.</p>
|
|
24
|
+
<div class="flex flex-row gap-7.5">
|
|
25
|
+
<div v-for="size of sizes" :key="size" class="flex flex-col items-start border p-4 rounded">
|
|
26
|
+
<h5 class="font-normal text-neutral-7 grow">{{ size }}</h5>
|
|
27
|
+
<el-switch v-model="value" :size="size" active-text="Open" inactive-text="Close" />
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<template #footer> <html-encode :tag="snippets.sizes" /> </template>
|
|
32
|
+
</el-card>
|
|
33
|
+
|
|
34
|
+
<el-card>
|
|
35
|
+
<template #header> Text description </template>
|
|
36
|
+
<div class="flex flex-col gap-3">
|
|
37
|
+
<p>
|
|
38
|
+
You can add <el-text tag="mark">active-text</el-text> and <el-text tag="mark">inactive-text</el-text> attribute to show texts. use
|
|
39
|
+
<el-text tag="mark">inline-prompt</el-text> attribute to control text is displayed inside dot. You can add active-text and inactive-text attribute to show texts.
|
|
40
|
+
</p>
|
|
41
|
+
<div class="flex flex-col items-start">
|
|
42
|
+
<el-switch v-model="value" active-text="Pay by month" inactive-text="Pay by year" />
|
|
43
|
+
<el-switch v-model="value" inline-prompt width="40" active-text="超出省略" inactive-text="超出省略" />
|
|
44
|
+
<el-switch v-model="value" width="80" inline-prompt active-text="超出省略" inactive-text="超出省略" />
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
<template #footer> <html-encode :tag="snippets.text" /> </template>
|
|
48
|
+
</el-card>
|
|
49
|
+
|
|
50
|
+
<el-card>
|
|
51
|
+
<template #header> Extended value types </template>
|
|
52
|
+
<div class="flex flex-col gap-3">
|
|
53
|
+
<p>
|
|
54
|
+
You can set <el-text tag="mark">active-value</el-text> and <el-text tag="mark">inactive-value</el-text> attributes. They both receive a Boolean, String or Number typed
|
|
55
|
+
value.
|
|
56
|
+
</p>
|
|
57
|
+
<div class="flex items-center gap-4">
|
|
58
|
+
<el-tooltip :content="'Switch value: ' + custom" placement="top">
|
|
59
|
+
<el-switch v-model="custom" active-value="100" inactive-value="0" size="default" :active-text="`Value is ${custom}`" />
|
|
60
|
+
</el-tooltip>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
<template #footer> <html-encode :tag="snippets.value" /> </template>
|
|
64
|
+
</el-card>
|
|
65
|
+
|
|
66
|
+
<el-card>
|
|
67
|
+
<template #header> Disabled </template>
|
|
68
|
+
<div class="flex flex-col gap-3">
|
|
69
|
+
<p>Adding the disabled attribute <el-text tag="mark">disables</el-text> Switch.</p>
|
|
70
|
+
<div class="flex items-center gap-4">
|
|
71
|
+
<el-switch v-model="value" disabled />
|
|
72
|
+
<el-switch v-model="value" class="ml-2" />
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
<template #footer> <html-encode :tag="snippets.disable" /> </template>
|
|
76
|
+
</el-card>
|
|
77
|
+
</div>
|
|
78
|
+
</template>
|
|
79
|
+
|
|
80
|
+
<script lang="ts" setup>
|
|
81
|
+
import { ref } from 'vue';
|
|
82
|
+
|
|
83
|
+
const value = ref(true);
|
|
84
|
+
const custom = ref(100);
|
|
85
|
+
const sizes = ref(['default', 'large', 'medium', 'small', 'mini']);
|
|
86
|
+
const snippets = ref({
|
|
87
|
+
basic: `<el-switch v-model="value2" class="ml-2" style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949" />`,
|
|
88
|
+
sizes: `<el-switch v-model="value" size="large" />`,
|
|
89
|
+
text: `
|
|
90
|
+
<el-switch v-model="value" active-text="Pay by month" inactive-text="Pay by year" />
|
|
91
|
+
<el-switch v-model="value" inline-prompt width="40" active-text="超出省略" inactive-text="超出省略" />
|
|
92
|
+
<el-switch v-model="value" width="80" inline-prompt active-text="超出省略" inactive-text="超出省略" />
|
|
93
|
+
`,
|
|
94
|
+
value: `
|
|
95
|
+
<el-tooltip :content="'Switch value: ' + custom" placement="top">
|
|
96
|
+
<el-switch v-model="custom" active-value="100" inactive-value="0" size="default" :active-text="\`Value is \${custom}\`" />
|
|
97
|
+
</el-tooltip>
|
|
98
|
+
`,
|
|
99
|
+
disable: `<el-switch v-model="value" disabled />`,
|
|
100
|
+
});
|
|
101
|
+
</script>
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col gap-8 mb-16">
|
|
3
|
+
<h1 class="">Table</h1>
|
|
4
|
+
<p>Display multiple data with similar format. You can sort, filter, compare your data in a table.</p>
|
|
5
|
+
|
|
6
|
+
<el-card>
|
|
7
|
+
<template #header> Basic table </template>
|
|
8
|
+
<div class="flex flex-col gap-7.5 items-start">
|
|
9
|
+
<p>
|
|
10
|
+
Basic table is just for data display. After setting attribute <el-text tag="mark">data</el-text> of <el-text tag="mark">el-table</el-text> with an object array, you can
|
|
11
|
+
use prop (corresponding to a key of the object in data array) in <el-text tag="mark">el-table-column</el-text> to insert data to table columns, and set the attribute
|
|
12
|
+
<el-text tag="mark">label</el-text> to define the column name. You can also use the attribute <el-text tag="mark">width</el-text> to define the width of columns.
|
|
13
|
+
</p>
|
|
14
|
+
<el-table :data="tableData" style="width: 100%" flexible height="300">
|
|
15
|
+
<el-table-column type="selection" width="55" />
|
|
16
|
+
<el-table-column label="Date" width="120" show-overflow-tooltip>
|
|
17
|
+
<template #default="scope">{{ scope.row.date }}</template>
|
|
18
|
+
</el-table-column>
|
|
19
|
+
<el-table-column property="name" label="Name" width="120" show-overflow-tooltip />
|
|
20
|
+
<el-table-column property="state" label="State" width="240" show-overflow-tooltip />
|
|
21
|
+
<el-table-column property="city" label="City" show-overflow-tooltip />
|
|
22
|
+
<el-table-column property="zip" label="Zip" show-overflow-tooltip />
|
|
23
|
+
<el-table-column property="address" label="Address" width="140" show-overflow-tooltip />
|
|
24
|
+
</el-table>
|
|
25
|
+
</div>
|
|
26
|
+
<template #footer>
|
|
27
|
+
<code class="flex flex-col gap-3 items-start">
|
|
28
|
+
<html-encode :tag="snippets.basic" />
|
|
29
|
+
</code>
|
|
30
|
+
</template>
|
|
31
|
+
</el-card>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
<script lang="ts" setup>
|
|
35
|
+
import { ElTable } from 'element-plus';
|
|
36
|
+
|
|
37
|
+
interface User {
|
|
38
|
+
date: string;
|
|
39
|
+
name: string;
|
|
40
|
+
state: string;
|
|
41
|
+
city: string;
|
|
42
|
+
zip: string;
|
|
43
|
+
address: string;
|
|
44
|
+
}
|
|
45
|
+
const tableData: User[] = [
|
|
46
|
+
{
|
|
47
|
+
date: '2016-05-03',
|
|
48
|
+
name: 'Tom',
|
|
49
|
+
state: 'California',
|
|
50
|
+
city: 'Los Angeles',
|
|
51
|
+
address: 'No. 189, Grove St, Los Angeles',
|
|
52
|
+
zip: 'CA 90036',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
date: '2016-05-02',
|
|
56
|
+
name: 'Tom',
|
|
57
|
+
state: 'California',
|
|
58
|
+
city: 'Los Angeles',
|
|
59
|
+
address: 'No. 189, Grove St, Los Angeles',
|
|
60
|
+
zip: 'CA 90036',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
date: '2016-05-04',
|
|
64
|
+
name: 'Tom',
|
|
65
|
+
state: 'California',
|
|
66
|
+
city: 'Los Angeles',
|
|
67
|
+
address: 'No. 189, Grove St, Los Angeles',
|
|
68
|
+
zip: 'CA 90036',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
date: '2016-05-01',
|
|
72
|
+
name: 'Tom',
|
|
73
|
+
state: 'California',
|
|
74
|
+
city: 'Los Angeles',
|
|
75
|
+
address: 'No. 189, Grove St, Los Angeles',
|
|
76
|
+
zip: 'CA 90036',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
date: '2016-05-08',
|
|
80
|
+
name: 'Tom',
|
|
81
|
+
state: 'California',
|
|
82
|
+
city: 'Los Angeles',
|
|
83
|
+
address: 'No. 189, Grove St, Los Angeles',
|
|
84
|
+
zip: 'CA 90036',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
date: '2016-05-06',
|
|
88
|
+
name: 'Tom',
|
|
89
|
+
state: 'California',
|
|
90
|
+
city: 'Los Angeles',
|
|
91
|
+
address: 'No. 189, Grove St, Los Angeles',
|
|
92
|
+
zip: 'CA 90036',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
date: '2016-05-07',
|
|
96
|
+
name: 'Tom',
|
|
97
|
+
state: 'California',
|
|
98
|
+
city: 'Los Angeles',
|
|
99
|
+
address: 'No. 189, Grove St, Los Angeles',
|
|
100
|
+
zip: 'CA 90036',
|
|
101
|
+
},
|
|
102
|
+
];
|
|
103
|
+
const snippets = ref({
|
|
104
|
+
basic: `
|
|
105
|
+
<el-table :data="tableData" style="width: 100%">
|
|
106
|
+
<el-table-column prop="date" label="Date" width="180" />
|
|
107
|
+
<el-table-column prop="name" label="Name" width="180" />
|
|
108
|
+
<el-table-column prop="address" label="Address" />
|
|
109
|
+
</el-table>
|
|
110
|
+
`,
|
|
111
|
+
});
|
|
112
|
+
</script>
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col gap-8 mb-16">
|
|
3
|
+
<h1 class="">Tag</h1>
|
|
4
|
+
<p>Used for marking and selection.</p>
|
|
5
|
+
|
|
6
|
+
<el-card>
|
|
7
|
+
<template #header>Types</template>
|
|
8
|
+
<div class="flex flex-col gap-3 items-start">
|
|
9
|
+
<p>
|
|
10
|
+
Use the <el-text tag="mark">type</el-text> attribute to define Tag's type. In addition, the <el-text tag="mark">color</el-text> attribute can be used to set the
|
|
11
|
+
background color of the Tag.
|
|
12
|
+
</p>
|
|
13
|
+
<div class="flex gap-2">
|
|
14
|
+
<el-tag v-for="(color, key) in colors" :key="key + color" :type="color">{{ color }}</el-tag>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
<template #footer><html-encode :tag="snippets.types" /> </template>
|
|
18
|
+
</el-card>
|
|
19
|
+
|
|
20
|
+
<el-card>
|
|
21
|
+
<template #header> Sizes </template>
|
|
22
|
+
<div class="flex flex-col gap-3 items-start">
|
|
23
|
+
<p>
|
|
24
|
+
Besides default size, Tag component provides three additional sizes for you to choose among different scenarios. Use attribute size to set additional sizes with
|
|
25
|
+
<el-text tag="mark">
|
|
26
|
+
{{ sizes.join(', ') }}
|
|
27
|
+
</el-text>
|
|
28
|
+
</p>
|
|
29
|
+
<div class="flex gap-2">
|
|
30
|
+
<el-tag v-for="(size, key) in sizes" :key="key + size" :size="size">{{ size }}</el-tag>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
<template #footer> <html-encode :tag="snippets.sizes" /> </template>
|
|
34
|
+
</el-card>
|
|
35
|
+
|
|
36
|
+
<el-card>
|
|
37
|
+
<template #header> Removable Tag </template>
|
|
38
|
+
<div class="flex flex-col gap-3 items-start">
|
|
39
|
+
<p>
|
|
40
|
+
<el-text tag="mark">closable</el-text> attribute can be used to define a removable tag. It accepts a Boolean. By default the removal of Tag has a fading animation. If you
|
|
41
|
+
don't want to use it, you can set the <el-text tag="mark">disable-transitions</el-text> attribute, which accepts a Boolean, to true. close event triggers when Tag is
|
|
42
|
+
removed.
|
|
43
|
+
</p>
|
|
44
|
+
<div class="flex gap-2">
|
|
45
|
+
<el-tag v-for="tag in tags" :key="tag.name" closable :type="tag.type">
|
|
46
|
+
{{ tag.name }}
|
|
47
|
+
</el-tag>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
<template #footer> <html-encode :tag="snippets.closable" /> </template>
|
|
51
|
+
</el-card>
|
|
52
|
+
|
|
53
|
+
<el-card>
|
|
54
|
+
<template #header> Edit Dynamically </template>
|
|
55
|
+
<div class="flex flex-col gap-3 items-start">
|
|
56
|
+
<p>You can use the <el-text tag="mark">close</el-text> event to add and remove tag dynamically.</p>
|
|
57
|
+
<div class="flex gap-2">
|
|
58
|
+
<el-tag v-for="tag in dynamicTags" :key="tag" closable :disable-transitions="false" @close="handleClose(tag)">
|
|
59
|
+
{{ tag }}
|
|
60
|
+
</el-tag>
|
|
61
|
+
<el-input v-if="inputVisible" ref="InputRef" v-model="inputValue" class="!w-20" size="mini" @keyup.enter="handleInputConfirm" @blur="handleInputConfirm" />
|
|
62
|
+
<el-button v-else class="button-new-tag" size="mini" @click="showInput"> + New Tag </el-button>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
<template #footer> <html-encode :tag="snippets.dynamic" /> </template>
|
|
66
|
+
</el-card>
|
|
67
|
+
|
|
68
|
+
<el-card>
|
|
69
|
+
<template #header> Theme </template>
|
|
70
|
+
<div class="flex flex-col gap-3 items-start">
|
|
71
|
+
<p>Tag provide three different themes: dark、light and plain Using effect to change, default is light</p>
|
|
72
|
+
<div class="flex flex-col gap-2">
|
|
73
|
+
<div class="flex gap-2">
|
|
74
|
+
<span>Dark</span>
|
|
75
|
+
<el-tag v-for="item in items" :key="item.label" :type="item.type" effect="dark">
|
|
76
|
+
{{ item.label }}
|
|
77
|
+
</el-tag>
|
|
78
|
+
</div>
|
|
79
|
+
<div class="flex gap-2 mt-4">
|
|
80
|
+
<span>Light</span>
|
|
81
|
+
<el-tag v-for="item in items" :key="item.label" :type="item.type" effect="light">
|
|
82
|
+
{{ item.label }}
|
|
83
|
+
</el-tag>
|
|
84
|
+
</div>
|
|
85
|
+
<div class="flex gap-2 mt-4">
|
|
86
|
+
<span>Plain</span>
|
|
87
|
+
<el-tag v-for="item in items" :key="item.label" :type="item.type" effect="plain">
|
|
88
|
+
{{ item.label }}
|
|
89
|
+
</el-tag>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
<template #footer> <html-encode :tag="snippets.theme" /> </template>
|
|
94
|
+
</el-card>
|
|
95
|
+
|
|
96
|
+
<el-card>
|
|
97
|
+
<template #header> Rounded </template>
|
|
98
|
+
<div class="flex flex-col gap-3 items-start">
|
|
99
|
+
<p>Tag can also be rounded like button.</p>
|
|
100
|
+
<div class="flex flex-col gap-2">
|
|
101
|
+
<div class="flex gap-2">
|
|
102
|
+
<el-tag v-for="item in items" :key="item.label" :type="item.type" effect="dark" round>
|
|
103
|
+
{{ item.label }}
|
|
104
|
+
</el-tag>
|
|
105
|
+
</div>
|
|
106
|
+
<div class="flex gap-2 mt-4">
|
|
107
|
+
<el-tag v-for="item in items" :key="item.label" :type="item.type" effect="light" round>
|
|
108
|
+
{{ item.label }}
|
|
109
|
+
</el-tag>
|
|
110
|
+
</div>
|
|
111
|
+
<div class="flex gap-2 mt-4">
|
|
112
|
+
<el-tag v-for="item in items" :key="item.label" :type="item.type" effect="plain" round>
|
|
113
|
+
{{ item.label }}
|
|
114
|
+
</el-tag>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
<template #footer> <html-encode :tag="snippets.rounded" /> </template>
|
|
119
|
+
</el-card>
|
|
120
|
+
|
|
121
|
+
<el-card>
|
|
122
|
+
<template #header> Checkable Tag </template>
|
|
123
|
+
<div class="flex flex-col gap-3 items-start">
|
|
124
|
+
<p>
|
|
125
|
+
Sometimes because of the business needs, we might need checkbox like tag, but button like checkbox cannot meet our needs, here comes
|
|
126
|
+
<el-text tag="mark">check-tag</el-text>. You can use type prop in 2.5.4. basic check-tag usage, the API is rather simple.
|
|
127
|
+
</p>
|
|
128
|
+
<div class="flex gap-2">
|
|
129
|
+
<div class="flex gap-2">
|
|
130
|
+
<el-check-tag checked>Checked</el-check-tag>
|
|
131
|
+
<el-check-tag :checked="checked" @change="onChange">Toggle me</el-check-tag>
|
|
132
|
+
</div>
|
|
133
|
+
<el-check-tag :checked="checked1" type="primary" @change="onChange1"> Tag 1 </el-check-tag>
|
|
134
|
+
<el-check-tag :checked="checked2" type="success" @change="onChange2"> Tag 2 </el-check-tag>
|
|
135
|
+
<el-check-tag :checked="checked3" type="info" @change="onChange3"> Tag 3 </el-check-tag>
|
|
136
|
+
<el-check-tag :checked="checked4" type="warning" @change="onChange4"> Tag 4 </el-check-tag>
|
|
137
|
+
<el-check-tag :checked="checked5" type="danger" @change="onChange5"> Tag 5 </el-check-tag>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
<template #footer> <html-encode :tag="snippets.checked" /> </template>
|
|
141
|
+
</el-card>
|
|
142
|
+
</div>
|
|
143
|
+
</template>
|
|
144
|
+
|
|
145
|
+
<script lang="ts" setup>
|
|
146
|
+
import type { InputInstance } from 'element-plus';
|
|
147
|
+
import type { TagProps } from 'element-plus';
|
|
148
|
+
import { ElInput } from 'element-plus';
|
|
149
|
+
import { nextTick, ref } from 'vue';
|
|
150
|
+
|
|
151
|
+
interface TagsItem {
|
|
152
|
+
name: string;
|
|
153
|
+
type: TagProps['type'];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
type Item = { type: TagProps['type']; label: string };
|
|
157
|
+
|
|
158
|
+
const checked = ref(false);
|
|
159
|
+
const checked1 = ref(true);
|
|
160
|
+
const checked2 = ref(true);
|
|
161
|
+
const checked3 = ref(true);
|
|
162
|
+
const checked4 = ref(true);
|
|
163
|
+
const checked5 = ref(true);
|
|
164
|
+
const onChange = (status: boolean) => {
|
|
165
|
+
checked.value = status;
|
|
166
|
+
};
|
|
167
|
+
const onChange1 = (status: boolean) => {
|
|
168
|
+
checked1.value = status;
|
|
169
|
+
};
|
|
170
|
+
const onChange2 = (status: boolean) => {
|
|
171
|
+
checked2.value = status;
|
|
172
|
+
};
|
|
173
|
+
const onChange3 = (status: boolean) => {
|
|
174
|
+
checked3.value = status;
|
|
175
|
+
};
|
|
176
|
+
const onChange4 = (status: boolean) => {
|
|
177
|
+
checked4.value = status;
|
|
178
|
+
};
|
|
179
|
+
const onChange5 = (status: boolean) => {
|
|
180
|
+
checked5.value = status;
|
|
181
|
+
};
|
|
182
|
+
const items = ref<Array<Item>>([
|
|
183
|
+
{ type: 'primary', label: 'Tag 1' },
|
|
184
|
+
{ type: 'secondary', label: 'Tag 2' },
|
|
185
|
+
{ type: 'neutral', label: 'Tag 2' },
|
|
186
|
+
{ type: 'success', label: 'Tag 2' },
|
|
187
|
+
{ type: 'info', label: 'Tag 3' },
|
|
188
|
+
{ type: 'warning', label: 'Tag 4' },
|
|
189
|
+
{ type: 'danger', label: 'Tag 5' },
|
|
190
|
+
]);
|
|
191
|
+
const tags = ref<TagsItem[]>([
|
|
192
|
+
{ name: 'Tag 1', type: 'primary' },
|
|
193
|
+
{ name: 'Tag 1', type: 'secondary' },
|
|
194
|
+
{ name: 'Tag 1', type: 'neutral' },
|
|
195
|
+
{ name: 'Tag 2', type: 'success' },
|
|
196
|
+
{ name: 'Tag 3', type: 'info' },
|
|
197
|
+
{ name: 'Tag 4', type: 'warning' },
|
|
198
|
+
{ name: 'Tag 5', type: 'danger' },
|
|
199
|
+
]);
|
|
200
|
+
const inputValue = ref('');
|
|
201
|
+
const dynamicTags = ref(['Tag 1', 'Tag 2', 'Tag 3']);
|
|
202
|
+
const inputVisible = ref(false);
|
|
203
|
+
const InputRef = ref<InputInstance>();
|
|
204
|
+
const handleClose = (tag: string) => {
|
|
205
|
+
dynamicTags.value.splice(dynamicTags.value.indexOf(tag), 1);
|
|
206
|
+
};
|
|
207
|
+
const showInput = () => {
|
|
208
|
+
inputVisible.value = true;
|
|
209
|
+
nextTick(() => {
|
|
210
|
+
InputRef.value!.input!.focus();
|
|
211
|
+
});
|
|
212
|
+
};
|
|
213
|
+
const handleInputConfirm = () => {
|
|
214
|
+
if (inputValue.value) {
|
|
215
|
+
dynamicTags.value.push(inputValue.value);
|
|
216
|
+
}
|
|
217
|
+
inputVisible.value = false;
|
|
218
|
+
inputValue.value = '';
|
|
219
|
+
};
|
|
220
|
+
</script>
|
|
221
|
+
|
|
222
|
+
<script lang="ts">
|
|
223
|
+
import { defineComponent } from 'vue';
|
|
224
|
+
|
|
225
|
+
export default defineComponent({
|
|
226
|
+
name: 'TimusTag',
|
|
227
|
+
data() {
|
|
228
|
+
return {
|
|
229
|
+
sizes: ['default', 'large', 'medium', 'small', 'mini'],
|
|
230
|
+
colors: ['primary', 'secondary', 'neutral', 'success', 'warning', 'info', 'danger'],
|
|
231
|
+
value: '',
|
|
232
|
+
snippets: {
|
|
233
|
+
types: `<el-tag type="success">tag</el-tag>`,
|
|
234
|
+
sizes: `<el-tag size="large">tag</el-tag>`,
|
|
235
|
+
closable: `<el-tag size="large" type="success" closable>tag</el-tag>`,
|
|
236
|
+
dynamic: `<el-tag closable :disable-transitions="false" @close="handleClose(tag)"> tag </el-tag>`,
|
|
237
|
+
theme: `
|
|
238
|
+
<el-tag effect="dark"> tag </el-tag>
|
|
239
|
+
<el-tag effect="light"> tag </el-tag>
|
|
240
|
+
<el-tag effect="plain"> tag </el-tag>
|
|
241
|
+
`,
|
|
242
|
+
rounded: `<el-tag round>tag</el-tag>`,
|
|
243
|
+
checked: `<el-check-tag :checked="checked1" type="primary" @change="onChange1"> Tag 1 </el-check-tag>`,
|
|
244
|
+
},
|
|
245
|
+
};
|
|
246
|
+
},
|
|
247
|
+
methods: {
|
|
248
|
+
capitalize(value: string): string {
|
|
249
|
+
const text = String(value);
|
|
250
|
+
|
|
251
|
+
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
});
|
|
255
|
+
</script>
|