This commit is contained in:
pipipi-pikachu 2021-01-01 17:08:24 +08:00
parent 9787261ce7
commit 2186fc0d97
3 changed files with 35 additions and 2 deletions

View File

@ -0,0 +1,33 @@
<template>
<APopover trigger="click" overlayClassName="popover">
<template v-slot:content>
<slot name="content"></slot>
</template>
<slot></slot>
</APopover>
</template>
<script>
import { Popover } from 'ant-design-vue'
export default {
name: 'popover',
components: {
APopover: Popover,
},
}
</script>
<style lang="scss">
.popover {
padding-top: 6px;
.ant-popover-arrow {
display: none;
}
.ant-popover-inner {
border: 1px solid #eee;
box-shadow: 3px 3px 3px rgba(#000, 0.15);
}
}
</style>

View File

@ -10,7 +10,7 @@ const schema = new Schema({
marks: schemaMarks, marks: schemaMarks,
}) })
export const createDocument = (content: string) => { const createDocument = (content: string) => {
const htmlString = `<div>${content}</div>` const htmlString = `<div>${content}</div>`
const parser = new window.DOMParser() const parser = new window.DOMParser()
const element = parser.parseFromString(htmlString, 'text/html').body.firstElementChild const element = parser.parseFromString(htmlString, 'text/html').body.firstElementChild

View File

@ -42,7 +42,7 @@ import { MutationTypes, State } from '@/store'
import { EditorView } from 'prosemirror-view' import { EditorView } from 'prosemirror-view'
import { PPTTextElement } from '@/types/slides' import { PPTTextElement } from '@/types/slides'
import { ContextmenuItem } from '@/components/Contextmenu/types' import { ContextmenuItem } from '@/components/Contextmenu/types'
import { initProsemirrorEditor, createDocument } from '@/prosemirror/' import { initProsemirrorEditor } from '@/prosemirror/'
import useElementShadow from '@/views/components/element/hooks/useElementShadow' import useElementShadow from '@/views/components/element/hooks/useElementShadow'
import useHistorySnapshot from '@/hooks/useHistorySnapshot' import useHistorySnapshot from '@/hooks/useHistorySnapshot'