Demo: update

This commit is contained in:
街角小林 2025-02-19 11:46:56 +08:00
parent 0ecae72fff
commit 6ec552d9fb
2 changed files with 15 additions and 2 deletions

View File

@ -91,8 +91,10 @@
slot="reference" slot="reference"
class="toolbarBtn" class="toolbarBtn"
:style="{ :style="{
marginLeft: dir === 'v' ? '0px' : '20px', marginLeft: dir === 'v' || rightHasBtn ? '0px' : '20px',
marginTop: dir === 'v' ? '10px' : '0px' marginTop: dir === 'v' ? '10px' : '0px',
marginRight: rightHasBtn ? '20px' : '0px',
marginBottom: dir === 'v' && rightHasBtn ? '10px' : '0px'
}" }"
:class="{ :class="{
disabled: activeNodes.length <= 0 || hasGeneralization disabled: activeNodes.length <= 0 || hasGeneralization
@ -128,6 +130,10 @@ export default {
dir: { dir: {
type: String, type: String,
default: '' default: ''
},
rightHasBtn: {
type: Boolean,
default: false
} }
}, },
data() { data() {

View File

@ -182,6 +182,7 @@
v-if="item === 'annotation' && supportMark" v-if="item === 'annotation' && supportMark"
:isDark="isDark" :isDark="isDark"
:dir="dir" :dir="dir"
:rightHasBtn="annotationRightHasBtn"
@setAnnotation="onSetAnnotation" @setAnnotation="onSetAnnotation"
></NodeAnnotationBtn> ></NodeAnnotationBtn>
<div <div
@ -246,6 +247,12 @@ export default {
return node.isGeneralization return node.isGeneralization
}) !== -1 }) !== -1
) )
},
annotationRightHasBtn() {
const index = this.list.findIndex(item => {
return item === 'annotation'
})
return index !== -1 && index < this.list.length - 1
} }
}, },
created() { created() {