11<template >
2- <div class =" container" >
3- <h1 >Custom theme example (on demand)</h1 >
4-
2+ <div class =" container" style =" justify-content :normal ;" >
3+ <el-row justify =" end" style =" height :32px ;" >
4+ <el-form-item label =" 暗黑模式" >
5+ <el-switch v-model =" switchVal" @change =" toggleDark()" inline-prompt active-text =" 否" inactive-text =" 是" />
6+ </el-form-item >
7+ </el-row >
58 <el-row >
6- <el-button @click =" onClick" >Default</el-button >
7- <el-button type =" primary" @click =" onClick" >Primary</el-button >
8- <el-button type =" success" @click =" onClick" >Success</el-button >
9- <el-button type =" info" @click =" onClick" >Info</el-button >
10- <el-button type =" warning" @click =" onClick" >Warning</el-button >
11- <el-button type =" danger" @click =" onClick" >Danger</el-button >
9+ <!-- 左半屏幕 -->
10+ <el-col :span =" 12" >
11+ <div class =" LeftMain" >
12+ <WaveGen msg =" 波形发生器控制面板" />
13+ </div >
14+ </el-col >
15+ <!-- 右半屏幕 -->
16+ <el-col :span =" 12" >
17+ </el-col >
1218 </el-row >
1319
14- <el-radio-group v-model =" radioVal" >
15- <el-radio-button label =" New York" ></el-radio-button >
16- <el-radio-button label =" Washington" ></el-radio-button >
17- <el-radio-button label =" Los Angeles" ></el-radio-button >
18- <el-radio-button label =" Chicago" ></el-radio-button >
19- </el-radio-group >
20-
21- <div >
22- <el-switch v-model =" switchVal" ></el-switch >  ;
23- <el-switch
24- v-model =" switchVal"
25- active-color =" #13ce66"
26- inactive-color =" #ff4949"
27- />
28- </div >
29-
30- <div >
31- <el-select >
32- <el-option value =" test" >test</el-option >
33- </el-select >
34-   ;
35- <el-date-picker ></el-date-picker >
36- </div >
37-
38- <el-slider v-model =" sliderVal" ></el-slider >
39-
40- <p >
41- It is a example built by vite.  ; More info see
42- <a
43- href =" https://github.com/element-plus/unplugin-element-plus"
44- target =" _blank"
45- >unplugin-element-plus</a
46- >.
47- </p >
4820 </div >
4921</template >
22+ <style >
5023
24+ .LeftMain {
25+ width : 100% ;
26+ height : 100% ;
27+ }
28+
29+ .el-row {
30+ margin-bottom : 0px ;
31+ }
32+ </style >
5133<script setup lang="ts">
5234import { ref } from ' vue'
5335import {
54- ElButton ,
55- ElDatePicker ,
5636 ElNotification ,
57- ElOption ,
58- ElRadioButton ,
59- ElRadioGroup ,
6037 ElRow ,
61- ElSelect ,
62- ElSlider ,
38+ ElCol ,
6339 ElSwitch ,
40+ ElFormItem
6441} from ' element-plus'
6542
66- const radioVal = ref (' New York' )
43+ // 自动切换暗黑模式
44+ import { useDark , useToggle } from ' @vueuse/core'
45+ const isDark = useDark ()
46+ const toggleDark = useToggle (isDark )
47+
6748const switchVal = ref (true )
68- const sliderVal = ref ( 50 )
49+
6950
7051function onClick() {
7152 ElNotification ({
@@ -76,3 +57,13 @@ function onClick() {
7657 })
7758}
7859 </script >
60+ <script lang="ts">
61+ import WaveGen from ' ./components/WaveGen.vue'
62+ export default {
63+ name: ' App' ,
64+ components: {
65+ // 2.声明或注册组件
66+ WaveGen
67+ }
68+ }
69+ </script >
0 commit comments