Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
live-management-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haojie
live-management-web
Commits
da4bf505
Commit
da4bf505
authored
Jul 29, 2023
by
haojie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加互动弹窗关闭时初始化对应的数据
parent
d80f3fa7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
4 deletions
+27
-4
src/components/CustomTabs/index.tsx
+15
-2
src/components/Dialog.vue
+6
-1
src/pages/createInteract/components/AddInteractDialog.vue
+6
-1
No files found.
src/components/CustomTabs/index.tsx
View file @
da4bf505
import
{
defineComponent
,
nextTick
,
onMounted
,
reactive
,
ref
,
provide
,
useSlots
}
from
'vue'
;
import
{
defineComponent
,
nextTick
,
onMounted
,
reactive
,
ref
,
provide
,
useSlots
,
watch
}
from
'vue'
;
import
'./index.less'
;
export
default
defineComponent
({
...
...
@@ -23,12 +23,13 @@ export default defineComponent({
provide
(
'currentTab'
,
currentTab
);
// 获取tab_panel的props
const
getTitles
=
()
=>
{
const
c_titles
=
use_slots
.
default
!
().
map
(({
props
})
=>
{
const
c_titles
=
use_slots
.
default
!
().
map
(({
props
}
,
index
)
=>
{
if
(
props
)
{
const
{
label
,
name
}
=
props
;
return
{
label
,
name
,
index
,
};
}
});
...
...
@@ -88,6 +89,18 @@ export default defineComponent({
});
};
watch
(
()
=>
props
.
modelValue
,
(
v
)
=>
{
// 找到对应的下标
let
index
=
titles
.
value
.
findIndex
((
item
:
any
)
=>
item
.
name
==
v
);
if
(
index
!==
-
1
)
{
// 更新tab_bar的位置
onChange
(
titles
.
value
[
index
].
name
,
titles
.
value
[
index
].
index
);
}
},
);
// 切换tab
const
onChange
=
(
name
:
string
,
index
:
number
)
=>
{
currentTab
.
value
=
name
;
...
...
src/components/Dialog.vue
View file @
da4bf505
...
...
@@ -6,6 +6,7 @@
class=
"c-dialog-default"
:destroyOnClose=
"destroyOnClose"
:placement=
"placement"
@
close=
"onClose"
>
<slot></slot>
<div
class=
"header-default"
>
...
...
@@ -44,7 +45,7 @@ const props = withDefaults(
className
:
''
,
},
);
const
emit
=
defineEmits
([
'update:modelValue'
,
'confirm'
]);
const
emit
=
defineEmits
([
'update:modelValue'
,
'confirm'
,
'close'
]);
const
visible
=
ref
(
props
.
modelValue
);
watch
(
...
...
@@ -64,6 +65,10 @@ watch(
const
onConfirm
=
()
=>
{
emit
(
'confirm'
);
};
const
onClose
=
()
=>
{
emit
(
'close'
);
};
</
script
>
<
style
lang=
"less"
>
...
...
src/pages/createInteract/components/AddInteractDialog.vue
View file @
da4bf505
<
template
>
<Dialog
v-model=
"visible"
className=
"reset-interact-dialog"
:footer=
"true"
:destroyOnClose=
"false"
>
<Dialog
v-model=
"visible"
className=
"reset-interact-dialog"
:footer=
"true"
:destroyOnClose=
"false"
@
close=
"onClose"
>
<template
#
header
>
<template
v-if=
"type == 'add'"
>
新增互动内容
</
template
>
<
template
v-else
>
修改互动内容
</
template
>
...
...
@@ -249,6 +249,11 @@ const openSoundColor = () => {
}
};
// 弹窗关闭
const
onClose
=
()
=>
{
clearData
();
};
// 已选择的内容
const
tonesItemChange
=
(
item
:
any
)
=>
{
tonesInfo
.
value
=
item
;
...
...
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