补充全局主题的在线字体

This commit is contained in:
pipipi-pikachu 2021-01-29 10:51:33 +08:00
parent 29db40288e
commit b68912314d
1 changed files with 13 additions and 3 deletions

View File

@ -106,9 +106,16 @@
:value="theme.fontName" :value="theme.fontName"
@change="value => updateTheme({ fontName: value })" @change="value => updateTheme({ fontName: value })"
> >
<SelectOption v-for="font in availableFonts" :key="font.en" :value="font.en"> <SelectOptGroup label="系统字体">
<span :style="{ fontFamily: font.en }">{{font.zh}}</span> <SelectOption v-for="font in availableFonts" :key="font.en" :value="font.en">
</SelectOption> <span :style="{ fontFamily: font.en }">{{font.zh}}</span>
</SelectOption>
</SelectOptGroup>
<SelectOptGroup label="在线字体">
<SelectOption v-for="font in webFonts" :key="font.name" :value="font.name">
<span>{{font.name}}</span>
</SelectOption>
</SelectOptGroup>
</Select> </Select>
</div> </div>
<div class="row"> <div class="row">
@ -177,12 +184,14 @@ import { computed, defineComponent } from 'vue'
import { MutationTypes, useStore } from '@/store' import { MutationTypes, useStore } from '@/store'
import { Slide, SlideBackground, SlideTheme } from '@/types/slides' import { Slide, SlideBackground, SlideTheme } from '@/types/slides'
import { PRESET_THEMES } from '@/configs/theme' import { PRESET_THEMES } from '@/configs/theme'
import { WEB_FONTS } from '@/configs/font'
import useHistorySnapshot from '@/hooks/useHistorySnapshot' import useHistorySnapshot from '@/hooks/useHistorySnapshot'
import ColorButton from './common/ColorButton.vue' import ColorButton from './common/ColorButton.vue'
import { getImageDataURL } from '@/utils/image' import { getImageDataURL } from '@/utils/image'
const themes = PRESET_THEMES const themes = PRESET_THEMES
const webFonts = WEB_FONTS
export default defineComponent({ export default defineComponent({
name: 'slide-style-panel', name: 'slide-style-panel',
@ -305,6 +314,7 @@ export default defineComponent({
applyBackgroundAllSlide, applyBackgroundAllSlide,
themes, themes,
theme, theme,
webFonts,
updateTheme, updateTheme,
applyThemeAllSlide, applyThemeAllSlide,
} }