首页
开源
资讯
活动
开源许可证
软件工程云服务
软件代码质量检测云服务
持续集成与部署云服务
社区个性化内容推荐服务
贡献审阅人推荐服务
群体化学习服务
重睛鸟代码扫描工具
登录
注册
代码拉取完成,页面将自动刷新
Watch
22
Star
304
Fork
93
弄个锤子
/
vue3-tree-org
Fork 仓库
加载中
取消
确认
代码
Issues
32
Pull Requests
0
Wiki
1
统计
更新失败,请稍后重试!
Issues
/
详情
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
各位大佬,为什么右键菜单一直出不来?defineMenus函数进得去,onmenus函数不行
待办的
#I9ABMH
也无风雨丶
创建于
2024-03-21 11:46
``` <template> <div style="height: 400px;"> <vue3-tree-org :data="props.data" ref="treeOrg" center :horizontal="horizontal" :collapsable="collapsable" :label-style="style" :scalable="false" :only-one-node="onlyOneNode" :tool-bar="false" :define-menus="defineMenus" @on-contextmenu="onMenus" @on-node-click="onNodeClick" :node-add="nodeAdd"> </vue3-tree-org> </div> </template> <script setup> import { ref } from 'vue' const props = defineProps({ data: { type: Object, default: () => ({}), } }) const horizontal = false const collapsable = false const onlyOneNode = false const expandAll = true const disaled = false const treeOrg = ref() const onNodeClick = (e, data) => { console.log('click', e, data); } const nodeAdd = (node) => { console.log('add--------'); } function defineMenus(e, node) { console.log('自定义菜单-----------------', e, node); return [ { name: '新建子节点', command: 'add' }, { name: '编辑', command: 'edit' }, ] } // const defineMenus = ref([ // { name: '新建子节点', command: 'add' }, // { name: '编辑', command: 'edit' }, // ]) const onMenus = ({ node, command }) => { console.log(node, command, 22222); } </script> <style scoped> .tree-org-node__text { text-align: left; font-size: 14px; .custom-content { padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid currentColor; } } </style>`这里输入代码` ```
``` <template> <div style="height: 400px;"> <vue3-tree-org :data="props.data" ref="treeOrg" center :horizontal="horizontal" :collapsable="collapsable" :label-style="style" :scalable="false" :only-one-node="onlyOneNode" :tool-bar="false" :define-menus="defineMenus" @on-contextmenu="onMenus" @on-node-click="onNodeClick" :node-add="nodeAdd"> </vue3-tree-org> </div> </template> <script setup> import { ref } from 'vue' const props = defineProps({ data: { type: Object, default: () => ({}), } }) const horizontal = false const collapsable = false const onlyOneNode = false const expandAll = true const disaled = false const treeOrg = ref() const onNodeClick = (e, data) => { console.log('click', e, data); } const nodeAdd = (node) => { console.log('add--------'); } function defineMenus(e, node) { console.log('自定义菜单-----------------', e, node); return [ { name: '新建子节点', command: 'add' }, { name: '编辑', command: 'edit' }, ] } // const defineMenus = ref([ // { name: '新建子节点', command: 'add' }, // { name: '编辑', command: 'edit' }, // ]) const onMenus = ({ node, command }) => { console.log(node, command, 22222); } </script> <style scoped> .tree-org-node__text { text-align: left; font-size: 14px; .custom-content { padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid currentColor; } } </style>`这里输入代码` ```
评论 (
0
)
也无风雨丶
创建了
任务
也无风雨丶
修改了
描述
原值
<template>
<div style="height: 400px;">
<vue3-tree-org :data="props.data" ref="treeOrg" center :horizontal="horizontal" :collapsable="collapsable"
:label-style="style" :scalable="false" :only-one-node="onlyOneNode" :tool-bar="false" :define-menus="defineMenus"
@on
-
contextmenu="onMenus" :on-nod
e
-click="onNod
e
Click" :node-add
="
n
o
deAdd">
</vue3-tree-org>
</div>
</template>
<
scri
p
t s
e
tup>
import { ref } from 'vue'
const props = defineProps({
data: {
t
y
p
e: Object,
default: () => ({}),
}
})
const horizontal = false
const collapsable = false
const
onlyOneNode = false
const
expandAll =
true
const
disaled = false
const
treeOrg
=
ref()
const onNodeClick = (e, data) => {
consol
e
.lo
g
('click', e, data);
}
const nodeAdd = (node) => {
console.log('add--------');
}
function defineMenus(e, node) {
console.log('自定义菜单-----------------', e, node);
re
t
ur
n
[
{ name: '新建子节点', command: 'add' },
{ name: '编辑', command: 'edit' },
]
}
// const defineMenus = ref([
// { name: '新建子节点', command: 'add' },
//
{ nam
e
: '编辑', command: 'edit' },
//
])
const onMenus = ({ node, command }) => {
console.log(node, command, 22222);
}
</script>
<
style scoped>
.tree-org-node__text {
t
ext-align: left;
font-size: 14px;
.custom-content {
padding-bottom: 8px;
margin-bo
t
tom: 8px;
bor
d
er-bot
t
om: 1px solid currentColor;
}
}
</style>
新值
```
<template>
<div style="height: 400px;">
<vue3
-
tree-org :data="props.data" r
e
f="treeOrg" c
e
nter :horizontal
="
h
o
rizontal" :collapsable="collapsable"
:label-style="style" :scalable="false" :only-one-node="onlyOneNode" :tool-bar="false" :define-menus="defineMenus"
@on-contextmenu="onMenus" :on-node-click="onNodeClick" :node-add="nodeAdd">
</vue3-tree-org>
</div>
<
/tem
p
lat
e
>
<script setup>
import { ref } from 'vue'
cons
tp
rops = defineProps({
data: {
type: Object,
default: () => ({}),
}
})
const
horizontal = false
const
collapsable
= false
const
onlyOneNode = false
const expandAll = true
const
disaled
=
false
const tr
e
eOr
g
= ref()
const onNodeClick = (e, data) => {
console.log('click', e, data);
}
const nodeAdd = (node) => {
console.log('add--------');
}
func
t
io
n
defineMenus(e, node) {
console.log('自定义菜单-----------------', e, node);
return [
{ name: '新建子节点', command: 'add' },
{ name: '编辑', command: 'edit' },
]
}
//
const d
e
fineMenus = ref([
//
{ name: '新建子节点', command: 'add' },
// { name: '编辑', command: 'edit' },
// ])
const onMenus = ({ node, command }) => {
console.log(node, command, 22222);
}
<
/script>
<s
t
yle scoped>
.tree-org-node__text {
text-align: left;
font-size: 14px;
.custom-con
t
ent {
pad
d
ing-bo
t
tom: 8px;
margin-bottom: 8px;
border-bottom: 1px solid currentColor;
}
}
</style>`这里输入代码`
```
也无风雨丶
修改了
描述
原值
```
<template>
<div style="height: 400px;">
<vue3-tree-org :data="props.data" ref="treeOrg" center :horizontal="horizontal" :collapsable="collapsable"
:label-style="style" :scalable="false" :only-one-node="onlyOneNode" :tool-bar="false" :define-menus="defineMenus"
@on-contextmenu="onMenus"
:
on-node-click="onNodeClick" :node-add="nodeAdd">
</vue3-tree-org>
</div>
</template>
<script setup>
import { ref } from 'vue'
const props = defineProps({
data: {
type: Object,
default: () => ({}),
}
})
const horizontal = false
const collapsable = false
const onlyOneNode = false
const expandAll = true
const disaled = false
const treeOrg = ref()
const onNodeClick = (e, data) => {
console.log('click', e, data);
}
const nodeAdd = (node) => {
console.log('add--------');
}
function defineMenus(e, node) {
console.log('自定义菜单-----------------', e, node);
return [
{ name: '新建子节点', command: 'add' },
{ name: '编辑', command: 'edit' },
]
}
// const defineMenus = ref([
// { name: '新建子节点', command: 'add' },
// { name: '编辑', command: 'edit' },
// ])
const onMenus = ({ node, command }) => {
console.log(node, command, 22222);
}
</script>
<style scoped>
.tree-org-node__text {
text-align: left;
font-size: 14px;
.custom-content {
padding-bottom: 8px;
margin-bottom: 8px;
border-bottom: 1px solid currentColor;
}
}
</style>`这里输入代码`
```
新值
```
<template>
<div style="height: 400px;">
<vue3-tree-org :data="props.data" ref="treeOrg" center :horizontal="horizontal" :collapsable="collapsable"
:label-style="style" :scalable="false" :only-one-node="onlyOneNode" :tool-bar="false" :define-menus="defineMenus"
@on-contextmenu="onMenus"
@
on-node-click="onNodeClick" :node-add="nodeAdd">
</vue3-tree-org>
</div>
</template>
<script setup>
import { ref } from 'vue'
const props = defineProps({
data: {
type: Object,
default: () => ({}),
}
})
const horizontal = false
const collapsable = false
const onlyOneNode = false
const expandAll = true
const disaled = false
const treeOrg = ref()
const onNodeClick = (e, data) => {
console.log('click', e, data);
}
const nodeAdd = (node) => {
console.log('add--------');
}
function defineMenus(e, node) {
console.log('自定义菜单-----------------', e, node);
return [
{ name: '新建子节点', command: 'add' },
{ name: '编辑', command: 'edit' },
]
}
// const defineMenus = ref([
// { name: '新建子节点', command: 'add' },
// { name: '编辑', command: 'edit' },
// ])
const onMenus = ({ node, command }) => {
console.log(node, command, 22222);
}
</script>
<style scoped>
.tree-org-node__text {
text-align: left;
font-size: 14px;
.custom-content {
padding-bottom: 8px;
margin-bottom: 8px;
border-bottom: 1px solid currentColor;
}
}
</style>`这里输入代码`
```
展开全部操作日志
折叠全部操作日志
登录
后才可以发表评论
状态
待办的
待办的
进行中
已完成
已关闭
负责人
未设置
标签
未设置
标签管理
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
未关联
v4.0.0
master
gh-pages2.0
center
develop
gh-pages
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
参与者(1)