From 6630b15a2c3ffdfcd99b164131b4668efb994ffa Mon Sep 17 00:00:00 2001 From: 刘嘉威 <daidaibg@163.com> Date: 星期一, 08 五月 2023 17:39:26 +0800 Subject: [PATCH] perf: 更新依赖 --- src/views/setting.vue | 52 ++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 44 insertions(+), 8 deletions(-) diff --git a/src/views/setting.vue b/src/views/setting.vue index d4f17ab..ca02c87 100644 --- a/src/views/setting.vue +++ b/src/views/setting.vue @@ -1,11 +1,20 @@ <script setup lang="ts"> import { useSettingStore } from "@/stores/index"; import { ref } from "vue"; +import {storeToRefs} from "pinia" const isScaleRadio = ref(false); +const leftBottomRadio=ref(true) +const rightBottomRadio=ref(true) const settingStore = useSettingStore(); +const {indexConfig}=storeToRefs(settingStore) + const init = () => { settingStore.initSetting(); isScaleRadio.value = settingStore.isScale; + + leftBottomRadio.value=indexConfig.value.leftBottomSwiper + rightBottomRadio.value=indexConfig.value.rightBottomSwiper + }; init(); const handleClose = () => {}; @@ -18,20 +27,20 @@ const isScaleChange = (flag: boolean) => { settingStore.setIsScale(flag); }; -const radiochange = (blag: boolean, type: string) => { - console.log(blag, type); +const radiochange = (blag: boolean) => { settingStore.setIsScale(blag); // this.$store.commit('setting/updateSwiper', { val, type }) - // if(type==='isScale'){ - // // this.$router.go(0) - // // location.reload() - // // window.location.href=window.location.href+"?t="+Date.now() - // } }; +const indexRadioChange=(flag: boolean)=>{ + settingStore.setIndexConfig({ + leftBottomSwiper: leftBottomRadio.value,//宸﹁疆鎾� + rightBottomSwiper:rightBottomRadio.value,//鍙充笅杞挱 + }); +} </script> <template> - <el-drawer v-model="settingStore.settingShow" direction="rtl"> + <el-drawer v-model="settingStore.settingShow" direction="rtl" size="360px"> <template #header> <h2 class="setting-title">璁剧疆</h2> </template> @@ -50,6 +59,33 @@ </el-radio-group> </div> </div> + <div class="left_shu">瀹炴椂鐩戞祴</div> + <div class="setting_item"> + <span class="setting_label"> + 璁惧鎻愰啋鑷姩杞: <span class="setting_label_tip"></span> + </span> + <div class="setting_content"> + <el-radio-group + v-model="leftBottomRadio" + @change="indexRadioChange" + > + <el-radio :label="true">鏄�</el-radio> + <el-radio :label="false">鍚�</el-radio> + </el-radio-group> + </div> + </div> + <div class="setting_item"> + <span class="setting_label"> 瀹炴椂棰勮杞挱: </span> + <div class="setting_content"> + <el-radio-group + v-model="rightBottomRadio" + @change="indexRadioChange" + > + <el-radio :label="true">鏄�</el-radio> + <el-radio :label="false">鍚�</el-radio> + </el-radio-group> + </div> + </div> </template> <!-- <template #footer> <div style="flex: auto"> -- Gitblit v1.8.0