mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
fix: 导出 PPTX 支持默认以外的其他尺寸比例
This commit is contained in:
parent
7149b08d72
commit
8bfe9c1daa
@ -20,7 +20,7 @@ interface ExportImageConfig {
|
||||
}
|
||||
|
||||
export default () => {
|
||||
const { slides, theme } = storeToRefs(useSlidesStore())
|
||||
const { slides, theme, viewportRatio } = storeToRefs(useSlidesStore())
|
||||
|
||||
const exporting = ref(false)
|
||||
|
||||
@ -335,6 +335,10 @@ export default () => {
|
||||
exporting.value = true
|
||||
const pptx = new pptxgen()
|
||||
|
||||
if (viewportRatio.value === 0.625) pptx.layout = 'LAYOUT_16x10'
|
||||
else if (viewportRatio.value === 0.75) pptx.layout = 'LAYOUT_4x3'
|
||||
else pptx.layout = 'LAYOUT_16x9'
|
||||
|
||||
const { color: bgColor, alpha: bgAlpha } = formatColor(theme.value.backgroundColor)
|
||||
pptx.defineSlideMaster({
|
||||
title: 'PPTIST_MASTER',
|
||||
|
@ -46,13 +46,13 @@ export default defineComponent({
|
||||
overflow: hidden;
|
||||
}
|
||||
.preview {
|
||||
width: calc(100% - 20px);
|
||||
width: 100%;
|
||||
height: calc(100% - 100px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
background-color: #2d2d30;
|
||||
color: #fff;
|
||||
background-color: #f9f9f9;
|
||||
color: #0451a5;
|
||||
}
|
||||
.btns {
|
||||
width: 300px;
|
||||
@ -72,9 +72,9 @@ export default defineComponent({
|
||||
::-webkit-scrollbar {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background-color: #2d2d30;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #777;
|
||||
background-color: #c1c1c1;
|
||||
}
|
||||
</style>
|
Loading…
x
Reference in New Issue
Block a user