Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
traceSourceMb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yanyanhong
traceSourceMb
Commits
bbb096e2
Commit
bbb096e2
authored
Sep 27, 2020
by
yyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moreAction 提取
parent
928ed1bf
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
37 deletions
+79
-37
MoreAction.vue
src/components/MoreAction.vue
+51
-0
index.ts
src/components/index.ts
+10
-0
Add.vue
src/views/template/Add.vue
+18
-37
No files found.
src/components/MoreAction.vue
0 → 100644
View file @
bbb096e2
<
template
>
<van-popup
v-model=
"showAction"
round
class=
"more-action"
position=
"bottom"
>
<van-grid
:column-num=
"3"
:gutter=
"10"
:border=
"false"
>
<van-grid-item
v-for=
"(
{icon, text, action}, index) in menuList"
:key="index"
icon="photo-o"
:text="text"
@click="actionHandler(action)"
>
<template
#
icon
>
<common-svg
:name=
"icon"
:width=
"'44px'"
:height=
"'44px'"
></common-svg>
</
template
>
</van-grid-item>
</van-grid>
<van-button
block
round
@
click=
"cancel"
>
取消
</van-button>
</van-popup>
</template>
<
script
lang=
"ts"
>
import
{
Component
,
Prop
,
PropSync
,
Vue
,
Emit
,
Inject
,
Model
}
from
'vue-property-decorator'
;
import
{
ChainStatus
}
from
'@/const/enum'
;
import
{
ChainStatusStr
}
from
'@/const/constants'
;
@
Component
({
name
:
'MoreAction'
,
components
:
{
},
})
export
default
class
MoreAction
extends
Vue
{
@
PropSync
(
'show'
,
{
type
:
Boolean
,
required
:
true
})
private
showAction
!
:
boolean
;
@
Prop
({
type
:
Array
,
default
:
()
=>
[]})
private
menuList
!
:
any
[];
private
actionHandler
(
action
:
any
)
{
this
.
showAction
=
false
;
action
();
}
@
Emit
(
'cancel'
)
private
cancel
()
{
this
.
showAction
=
false
;
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
</
style
>
src/components/index.ts
View file @
bbb096e2
import
{
importAll
}
from
'@/utils/utils'
;
const
components
=
importAll
(
require
.
context
(
'@/components/'
,
true
,
/
\.
vue$/
));
import
{
List
,
Image
,
Empty
,
Field
,
Dialog
,
GridItem
,
Grid
,
Button
,
Popup
}
from
'vant'
;
export
default
{
install
(
Vue
:
any
)
{
Vue
.
component
(
List
.
name
,
List
);
Vue
.
component
(
Image
.
name
,
Image
);
Vue
.
component
(
Empty
.
name
,
Empty
);
Vue
.
component
(
Field
.
name
,
Field
);
Vue
.
component
(
GridItem
.
name
,
GridItem
);
Vue
.
component
(
Grid
.
name
,
Grid
);
Vue
.
component
(
Button
.
name
,
Button
);
Vue
.
component
(
Popup
.
name
,
Popup
);
Vue
.
component
(
Dialog
.
Component
.
name
,
Dialog
.
Component
);
Object
.
keys
(
components
).
forEach
((
key
:
string
)
=>
{
Vue
.
component
(
key
,
components
[
key
]);
});
...
...
src/views/template/Add.vue
View file @
bbb096e2
...
...
@@ -47,43 +47,7 @@
<transition
name=
"van-slide-up"
>
<preview-template
:data=
"data"
v-if=
"preview"
@
cancel=
"preview = false"
@
employ=
"employ"
></preview-template>
</transition>
<van-popup
v-model=
"showAction"
round
class=
"more-action"
position=
"bottom"
>
<van-grid
:column-num=
"3"
:gutter=
"10"
:border=
"false"
>
<van-grid-item
icon=
"photo-o"
text=
"在上添加"
@
click=
"addBefore"
>
<template
#
icon
>
<common-svg
name=
"zaishangtianjia"
:width=
"'44px'"
:height=
"'44px'"
></common-svg>
</
template
>
</van-grid-item>
<van-grid-item
icon=
"photo-o"
text=
"在下添加"
@
click=
"addAfter"
>
<
template
#
icon
>
<common-svg
name=
"zaixiatianjia"
:width=
"'44px'"
:height=
"'44px'"
></common-svg>
</
template
>
</van-grid-item>
<van-grid-item
icon=
"photo-o"
text=
"删除"
@
click=
"delWord"
>
<
template
#
icon
>
<common-svg
name=
"shanchu4"
:width=
"'44px'"
:height=
"'44px'"
></common-svg>
</
template
>
</van-grid-item>
</van-grid>
<van-button
block
round
@
click=
"showAction = false;"
>
取消
</van-button>
</van-popup>
<more-action
:show
.
sync=
"showAction"
:menuList=
"menuList"
></more-action>
</div>
</
template
>
<
script
lang=
"ts"
>
...
...
@@ -383,6 +347,23 @@ export default class Add extends Vue {
return
obj
[
`obj
${
this
.
level
}
`
];
}
private
showAction
:
boolean
=
false
;
private
menuList
:
any
[]
=
[
{
icon
:
'zaishangtianjia'
,
text
:
'在上添加'
,
action
:
this
.
addBefore
.
bind
(
this
),
},
{
icon
:
'zaixiatianjia'
,
text
:
'在下添加'
,
action
:
this
.
addAfter
.
bind
(
this
),
},
{
icon
:
'shanchu4'
,
text
:
'删除'
,
action
:
this
.
delWord
.
bind
(
this
),
},
];
private
currentIndex
:
number
=
-
1
;
private
parentIndex
:
number
=
-
1
;
private
flag
:
string
=
''
;
...
...
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