mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-21 10:27:44 +08:00
Demo:增加是否允许拖拽文件进行导入的设置
This commit is contained in:
parent
b5209118b5
commit
01d332009c
@ -82,7 +82,8 @@ export default {
|
||||
cancel: 'Cancel',
|
||||
changeRichTextTip: 'This operation will clear all historical modification records and modify the mind map data. Do you want to continue?',
|
||||
changeRichTextTip2: 'Do you want to switch to rich text mode?',
|
||||
changeRichTextTip3: 'Do you want to switch to non rich text mode?'
|
||||
changeRichTextTip3: 'Do you want to switch to non rich text mode?',
|
||||
enableDragImport: 'Is it allowed to directly drag and drop files to the page for import'
|
||||
},
|
||||
color: {
|
||||
moreColor: 'More color'
|
||||
|
||||
@ -80,7 +80,8 @@ export default {
|
||||
cancel: '取消',
|
||||
changeRichTextTip: '该操作会清空所有历史修改记录,并且修改思维导图数据,是否继续?',
|
||||
changeRichTextTip2: '是否切换为富文本模式?',
|
||||
changeRichTextTip3: '是否切换为非富文本模式?'
|
||||
changeRichTextTip3: '是否切换为非富文本模式?',
|
||||
enableDragImport: '是否允许直接拖拽文件到页面进行导入'
|
||||
},
|
||||
color: {
|
||||
moreColor: '更多颜色'
|
||||
|
||||
@ -81,7 +81,8 @@ export default {
|
||||
cancel: '取消',
|
||||
changeRichTextTip: '該操作會清空所有曆史修改記錄,並且修改思維導圖數據,是否繼續?',
|
||||
changeRichTextTip2: '是否切換爲富文本模式?',
|
||||
changeRichTextTip3: '是否切換爲非富文本模式?'
|
||||
changeRichTextTip3: '是否切換爲非富文本模式?',
|
||||
enableDragImport: '是否允許直接拖拽文件到頁面進行導入'
|
||||
},
|
||||
color: {
|
||||
moreColor: '更多顏色'
|
||||
|
||||
@ -197,6 +197,7 @@ export default {
|
||||
isZenMode: state => state.localConfig.isZenMode,
|
||||
openNodeRichText: state => state.localConfig.openNodeRichText,
|
||||
isShowScrollbar: state => state.localConfig.isShowScrollbar,
|
||||
enableDragImport: state => state.localConfig.enableDragImport,
|
||||
useLeftKeySelectionRightKeyDrag: state =>
|
||||
state.localConfig.useLeftKeySelectionRightKeyDrag,
|
||||
isUseHandDrawnLikeStyle: state =>
|
||||
@ -430,7 +431,7 @@ export default {
|
||||
})
|
||||
})
|
||||
}
|
||||
// createNodePrefixContent: (node) => {
|
||||
// createNodePrefixContent: node => {
|
||||
// const el = document.createElement('div')
|
||||
// el.style.width = '50px'
|
||||
// el.style.height = '50px'
|
||||
@ -889,13 +890,14 @@ export default {
|
||||
|
||||
// 拖拽文件到页面导入
|
||||
onDragenter() {
|
||||
if (this.isDragOutlineTreeNode) return
|
||||
if (!this.enableDragImport || this.isDragOutlineTreeNode) return
|
||||
this.showDragMask = true
|
||||
},
|
||||
onDragleave() {
|
||||
this.showDragMask = false
|
||||
},
|
||||
onDrop(e) {
|
||||
if (!this.enableDragImport) return
|
||||
this.showDragMask = false
|
||||
const dt = e.dataTransfer
|
||||
const file = dt.files && dt.files[0]
|
||||
|
||||
@ -221,6 +221,16 @@
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 是否开启文件拖入页面导入的方式 -->
|
||||
<div class="row">
|
||||
<div class="rowItem">
|
||||
<el-checkbox
|
||||
v-model="localConfigs.enableDragImport"
|
||||
@change="updateLocalConfig('enableDragImport', $event)"
|
||||
>{{ $t('setting.enableDragImport') }}</el-checkbox
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 是否开启手绘风格 -->
|
||||
<div class="row" v-if="supportHandDrawnLikeStyle">
|
||||
<div class="rowItem">
|
||||
@ -392,7 +402,8 @@ export default {
|
||||
enableNodeRichText: true,
|
||||
localConfigs: {
|
||||
isShowScrollbar: false,
|
||||
isUseHandDrawnLikeStyle: false
|
||||
isUseHandDrawnLikeStyle: false,
|
||||
enableDragImport: false
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -437,7 +448,7 @@ export default {
|
||||
this.enableNodeRichText = this.localConfig.openNodeRichText
|
||||
this.mousewheelAction = this.localConfig.mousewheelAction
|
||||
this.mousewheelZoomActionReverse = this.localConfig.mousewheelZoomActionReverse
|
||||
;['isShowScrollbar', 'isUseHandDrawnLikeStyle'].forEach(key => {
|
||||
Object.keys(this.localConfigs).forEach(key => {
|
||||
this.localConfigs[key] = this.localConfig[key]
|
||||
})
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user