index.vue 731 B

1234567891011121314151617181920212223242526
  1. <template>
  2. <el-dropdown class="vab-language" @command="handleCommand">
  3. <vab-icon icon="font-size-2" />
  4. <template #dropdown>
  5. <el-dropdown-menu>
  6. <el-dropdown-item v-for="item in fontSizeList" :key="item" :command="item">{{ item }}</el-dropdown-item>
  7. </el-dropdown-menu>
  8. </template>
  9. </el-dropdown>
  10. </template>
  11. <script lang="ts" setup>
  12. import { useSettingsStore } from '/@/store/modules/settings'
  13. defineOptions({
  14. name: 'VabFontSize',
  15. })
  16. const settingsStore = useSettingsStore()
  17. const { changeFontSize } = settingsStore
  18. const fontSizeList = ref<string[]>(['13px', '13.5px', '14px', '15px', '15.5px', '16px'])
  19. const handleCommand = (fontSize: string) => {
  20. changeFontSize(fontSize)
  21. }
  22. </script>