This commit is contained in:
min.jiang 2024-07-02 05:52:58 +08:00
parent 73ea1e43e6
commit d699077d45
2 changed files with 114 additions and 91 deletions

View File

@ -11,6 +11,7 @@
@mouseup.stop="selectionEnd" @mouseup.stop="selectionEnd"
/> />
<div v-if="!disabled" class="editor-control" :style="editorCtrlStyle"> <div v-if="!disabled" class="editor-control" :style="editorCtrlStyle">
<transition-group appear name="fade-transform" mode="out-in">
<template v-if="!inputing"> <template v-if="!inputing">
<div v-for="(item, index) in iconList" :key="index" class="editor-item"> <div v-for="(item, index) in iconList" :key="index" class="editor-item">
<button <button
@ -92,7 +93,7 @@
</template> </template>
<template v-if="inputing"> <template v-if="inputing">
<div class="editor-item"> <div class="editor-item">
<button class="item-icon item-icon-back" @click="backAction"> <button class="item-icon item-icon-back" @click="backAction" data-info="back">
<svg-icon icon="fe-back" class-name="icon" /> <svg-icon icon="fe-back" class-name="icon" />
</button> </button>
</div> </div>
@ -101,6 +102,8 @@
<svg-icon icon="msg-enter" class-name="item-enter-icon" /> <svg-icon icon="msg-enter" class-name="item-enter-icon" />
</div> </div>
</template> </template>
</transition-group>
</div> </div>
</div> </div>
</template> </template>
@ -225,6 +228,8 @@ export default {
} else { } else {
this.selectedRange = null this.selectedRange = null
this.editorCtrlStyle = { display: 'none' } this.editorCtrlStyle = { display: 'none' }
this.inputing = false
this.linkUrl = ''
// this.commandStates = [] // this.commandStates = []
} }
}, },
@ -267,6 +272,7 @@ export default {
}, },
backAction() { backAction() {
this.inputing = false this.inputing = false
this.linkUrl = ''
this.$refs.editor.focus() this.$refs.editor.focus()
this.restoreSelection() this.restoreSelection()
}, },
@ -281,6 +287,7 @@ export default {
this.selectedRange.surroundContents(a_node) this.selectedRange.surroundContents(a_node)
this.backAction() this.backAction()
this.$refs.editor.blur() this.$refs.editor.blur()
this.linkUrl = ''
this.editorCtrlStyle = { display: 'none' } this.editorCtrlStyle = { display: 'none' }
}, },
getSelect() { getSelect() {
@ -593,4 +600,23 @@ export default {
.editor-body ol { .editor-body ol {
padding-left: 40px; padding-left: 40px;
} }
/* fade-transform */
.fade-transform-leave-active,
.fade-transform-enter-active {
transition: all 300;
}
.fade-transform-enter-from {
opacity: 0;
transform: translateX(-50px);
}
.fade-transform-leave-to {
opacity: 0;
transform: translateX(50px);
}
.fade-transform-active {
position: absolute;
}
</style> </style>

View File

@ -25,7 +25,6 @@
<p class="error-msg">{{ message }}</p> <p class="error-msg">{{ message }}</p>
</div> </div>
</div> </div>
<freeleaps-editor v-model:content="message" style="margin-top: 20px" />
</template> </template>
<script> <script>
@ -35,10 +34,8 @@ import {
// userProfileValidator, // userProfileValidator,
} from '@/utils/index' } from '@/utils/index'
import { signinActionEnum } from '@/types/index' import { signinActionEnum } from '@/types/index'
import FreeleapsEditor from '../../components/FreeleapsEditor.vue'
export default { export default {
components: { FreeleapsEditor },
name: 'FrontDoor', name: 'FrontDoor',
props: {}, props: {},
data() { data() {