Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
5f1a6cdc
Commit
5f1a6cdc
authored
Jul 05, 2021
by
无木
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(demo): demo default expanded tree table
演示默认展开树形表格数据
parent
02d3dca5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
index.vue
src/views/demo/system/menu/index.vue
+10
-3
No files found.
src/views/demo/system/menu/index.vue
View file @
5f1a6cdc
<
template
>
<div>
<BasicTable
@
register=
"registerTable"
>
<BasicTable
@
register=
"registerTable"
@
fetch-success=
"onFetchSuccess"
>
<template
#toolbar
>
<a-button
type=
"primary"
@
click=
"handleCreate"
>
新增菜单
</a-button>
</
template
>
...
...
@@ -27,7 +27,7 @@
</div>
</template>
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
'
vue
'
;
import
{
defineComponent
,
nextTick
}
from
'
vue
'
;
import
{
BasicTable
,
useTable
,
TableAction
}
from
'
/@/components/Table
'
;
import
{
getMenuList
}
from
'
/@/api/demo/system
'
;
...
...
@@ -42,7 +42,7 @@
components
:
{
BasicTable
,
MenuDrawer
,
TableAction
},
setup
()
{
const
[
registerDrawer
,
{
openDrawer
}]
=
useDrawer
();
const
[
registerTable
,
{
reload
}]
=
useTable
({
const
[
registerTable
,
{
reload
,
expandAll
}]
=
useTable
({
title
:
'
菜单列表
'
,
api
:
getMenuList
,
columns
,
...
...
@@ -50,6 +50,7 @@
labelWidth
:
120
,
schemas
:
searchFormSchema
,
},
isTreeTable
:
true
,
pagination
:
false
,
striped
:
false
,
useSearchForm
:
true
,
...
...
@@ -87,6 +88,11 @@
reload
();
}
function
onFetchSuccess
()
{
// 演示默认展开所有表项
nextTick
(
expandAll
);
}
return
{
registerTable
,
registerDrawer
,
...
...
@@ -94,6 +100,7 @@
handleEdit
,
handleDelete
,
handleSuccess
,
onFetchSuccess
,
};
},
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment