Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9ff4f1f7
authored
Dec 07, 2023
by
owen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商城装修:修复同一类型的组件切换时,右侧属性面板不更新的问题
parent
a7512ba2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletions
+7
-1
src/components/DiyEditor/components/ComponentLibrary.vue
+3
-1
src/components/DiyEditor/index.vue
+2
-0
src/components/DiyEditor/util.ts
+2
-0
No files found.
src/components/DiyEditor/components/ComponentLibrary.vue
View file @
9ff4f1f7
...
...
@@ -82,7 +82,9 @@ watch(
// 克隆组件
const
handleCloneComponent
=
(
component
:
DiyComponent
<
any
>
)
=>
{
return
cloneDeep
(
component
)
const
instance
=
cloneDeep
(
component
)
instance
.
uid
=
new
Date
().
getTime
()
return
instance
}
</
script
>
...
...
src/components/DiyEditor/index.vue
View file @
9ff4f1f7
...
...
@@ -111,6 +111,7 @@
view-class=
"p-[var(--el-card-padding)] p-b-[calc(var(--el-card-padding)+var(--el-card-padding))] property"
>
<component
:key=
"selectedComponent?.uid || selectedComponent?.id"
:is=
"selectedComponent?.id + 'Property'"
v-model=
"selectedComponent.property"
/>
...
...
@@ -296,6 +297,7 @@ const handleMoveComponent = (index: number, direction: number) => {
/** 复制组件 */
const
handleCopyComponent
=
(
index
:
number
)
=>
{
const
component
=
cloneDeep
(
pageComponents
.
value
[
index
])
component
.
uid
=
new
Date
().
getTime
()
pageComponents
.
value
.
splice
(
index
+
1
,
0
,
component
)
}
/**
...
...
src/components/DiyEditor/util.ts
View file @
9ff4f1f7
...
...
@@ -5,6 +5,8 @@ import { TabBarProperty } from '@/components/DiyEditor/components/mobile/TabBar/
// 页面装修组件
export
interface
DiyComponent
<
T
>
{
// 用于区分同一种组件的不同实例
uid
:
number
// 组件唯一标识
id
:
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