Skip to content

Commit 0c1d277

Browse files
committedDec 12, 2024
feat: add more element-plus components demo
1 parent dd19733 commit 0c1d277

File tree

7 files changed

+95
-26
lines changed

7 files changed

+95
-26
lines changed
 

‎app/assets/scss/element/index.scss

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ $-colors: (
33
'base': rgba(107,33,168, 1),
44
),
55
'success': (
6-
'base': #67c23a,
6+
'base': green,
77
),
88
'warning': (
9-
'base': #e6a23c,
9+
'base': #f9a23c,
1010
),
1111
'danger': (
12-
'base': #f56c6c,
12+
'base': #ff3300,
1313
),
1414
'error': (
1515
'base': #f56c6c,

‎app/components/TheExamples.vue

+7-23
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<script setup lang="ts">
2-
import zhCn from "element-plus/es/locale/lang/zh-cn";
32
4-
const timeValue = ref("");
53
const hello = () => ElMessage.info("hello world");
64
const helloSuccess = () => ElMessage.success("hello world");
75
@@ -47,25 +45,11 @@ const colorMode = computed({
4745

4846
<TheCounter class="m-4" />
4947

50-
<br >
51-
52-
<el-icon class="cursor-pointer">
53-
<el-icon-grape />
54-
</el-icon>
55-
<el-icon class="cursor-pointer">
56-
<ElIconIceCream />
57-
</el-icon>
58-
<el-icon class="cursor-pointer mb-4">
59-
<ElIconIceDrink />
60-
</el-icon>
61-
62-
<br >
63-
64-
<el-config-provider :locale="zhCn">
65-
<el-date-picker
66-
v-model="timeValue"
67-
type="date"
68-
placeholder="请选择日期"
69-
/>
70-
</el-config-provider>
48+
<div class="flex flex-col gap-2 items-center justify-center">
49+
<ExampleDatePickers />
50+
<ExampleIcons />
51+
<ExampleButtons />
52+
<ExampleSwitches />
53+
<ExampleTags />
54+
</div>
7155
</template>

‎app/components/example/Buttons.vue

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<script setup lang="ts">
2+
const count = ref(0)
3+
</script>
4+
5+
<template>
6+
<div class="my-2 flex flex-wrap items-center justify-center text-center">
7+
<el-button @click="count++">
8+
count is: {{ count }}
9+
</el-button>
10+
<el-button type="primary" @click="count++">
11+
count is: {{ count }}
12+
</el-button>
13+
<el-button type="success" @click="count++">
14+
count is: {{ count }}
15+
</el-button>
16+
<el-button type="warning" @click="count++">
17+
count is: {{ count }}
18+
</el-button>
19+
<el-button type="danger" @click="count++">
20+
count is: {{ count }}
21+
</el-button>
22+
<el-button type="info" @click="count++">
23+
count is: {{ count }}
24+
</el-button>
25+
</div>
26+
</template>
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
<script setup lang="ts">
3+
import zhCn from "element-plus/es/locale/lang/zh-cn";
4+
5+
const timeValue = ref("");
6+
</script>
7+
8+
<template>
9+
<el-config-provider :locale="zhCn">
10+
<el-date-picker
11+
v-model="timeValue"
12+
type="date"
13+
placeholder="请选择日期"
14+
/>
15+
</el-config-provider>
16+
</template>

‎app/components/example/Icons.vue

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<template>
2+
<div class="pt-4 flex gap-2">
3+
<el-icon class="cursor-pointer">
4+
<el-icon-grape />
5+
</el-icon>
6+
<el-icon class="cursor-pointer">
7+
<ElIconIceCream />
8+
</el-icon>
9+
<el-icon class="cursor-pointer mb-4">
10+
<ElIconIceDrink />
11+
</el-icon>
12+
</div>
13+
</template>

‎app/components/example/Switches.vue

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<script setup lang="ts">
2+
const value1 = ref(true)
3+
</script>
4+
5+
<template>
6+
<div>
7+
<el-switch v-model="value1" />
8+
<el-switch
9+
v-model="value1"
10+
class="m-2"
11+
style="--ep-switch-on-color: black; --ep-switch-off-color: gray;"
12+
/>
13+
</div>
14+
</template>

‎app/components/example/Tags.vue

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<template>
2+
<div>
3+
<el-tag type="success" class="m-1">
4+
Tag 1
5+
</el-tag>
6+
<el-tag type="warning" class="m-1">
7+
Tag 1
8+
</el-tag>
9+
<el-tag type="danger" class="m-1">
10+
Tag 1
11+
</el-tag>
12+
<el-tag type="info" class="m-1">
13+
Tag 1
14+
</el-tag>
15+
</div>
16+
</template>

0 commit comments

Comments
 (0)
Failed to load comments.