兰宝车间质量管理系统-前端
LiuHao
2023-04-02 251d2411f235e23209d57173857e05b637729ce8
src/components/SizeSelect/index.vue
@@ -1,3 +1,23 @@
<script setup lang="ts">
import useAppStore from "@/store/modules/app";
import { ComponentInternalInstance } from "vue";
const appStore = useAppStore();
const size = computed(() => appStore.size);
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const sizeOptions = ref([
  { label: "较大", value: "large" },
  { label: "默认", value: "default" },
  { label: "稍小", value: "small" },
]);
const handleSetSize = (size: string) => {
  proxy?.$modal.loading("正在设置布局大小,请稍候...");
  appStore.setSize(size);
  setTimeout("window.location.reload()", 1000);
}
</script>
<template>
  <div>
    <el-dropdown trigger="click" @command="handleSetSize">
@@ -15,28 +35,7 @@
  </div>
</template>
<script setup>
import useAppStore from "@/store/modules/app";
const appStore = useAppStore();
const size = computed(() => appStore.size);
const route = useRoute();
const router = useRouter();
const { proxy } = getCurrentInstance();
const sizeOptions = ref([
  { label: "较大", value: "large" },
  { label: "默认", value: "default" },
  { label: "稍小", value: "small" },
]);
function handleSetSize(size) {
  proxy.$modal.loading("正在设置布局大小,请稍候...");
  appStore.setSize(size);
  setTimeout("window.location.reload()", 1000);
}
</script>
<style lang='scss' scoped>
<style lang="scss" scoped>
.size-icon--style {
  font-size: 18px;
  line-height: 50px;