Skip to content

Commit 6d446f8

Browse files
committed
fix(element-not-found): 添加element为null时的判断
1 parent 967a971 commit 6d446f8

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

packages/canvas/container/src/container.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,13 @@ const setSelectRect = (
468468

469469
const getElementDurationTime = (elementId?: string) => {
470470
const element = elementId ? querySelectById(elementId) : getDocument().body
471+
let delayTime = 0
472+
473+
if (!element) {
474+
return delayTime
475+
}
471476
const transitionDuration = window.getComputedStyle(element).getPropertyValue('transition-duration')
472477
const transitionDelay = window.getComputedStyle(element).getPropertyValue('transition-delay')
473-
let delayTime = 0
474478
const getMaxMillisecondNumber = (arr: string[]) => {
475479
const millisecondNumber = arr.map((item) => {
476480
if (item.endsWith('ms')) {

packages/workspace/application-center/src/Main.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,12 @@ export default {
191191
if (state.orderBy === 'last_updated_time') {
192192
params.orderBy = state.orderBy
193193
}
194-
fetchApplicationList(Object.fromEntries(Object.entries(params).filter(([, value]) => !!value))).then((res) => {
195-
appList.value = res.apps || []
196-
state.total = res.total
197-
})
194+
fetchApplicationList(Object.fromEntries(Object.entries(params).filter(([, value]) => Boolean(value)))).then(
195+
(res) => {
196+
appList.value = res.apps || []
197+
state.total = res.total
198+
}
199+
)
198200
}
199201
200202
const creatApp = () => {

packages/workspace/template-center/src/Main.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export default {
170170
industryId: state.industry,
171171
framework: state.framework
172172
}
173-
fetchTemplateList(Object.fromEntries(Object.entries(params).filter(([, value]) => !!value)))
173+
fetchTemplateList(Object.fromEntries(Object.entries(params).filter(([, value]) => Boolean(value))))
174174
.then((res) => {
175175
templateList.value = res.apps || []
176176
state.total = res.total

0 commit comments

Comments
 (0)