提交 e6b7a868 编写于 作者: 奔跑的面条

perf: 优化导入失败提示

上级 0aa3f68f
...@@ -33,15 +33,23 @@ export const useFile = () => { ...@@ -33,15 +33,23 @@ export const useFile = () => {
negativeButtonProps: { type: 'info', ghost: false }, negativeButtonProps: { type: 'info', ghost: false },
// 新增 // 新增
onPositiveCallback: async () => { onPositiveCallback: async () => {
fileData = JSON.parse(fileData) try {
await updateComponent(fileData, false, true) fileData = JSON.parse(fileData)
window['$message'].success('导入成功!') await updateComponent(fileData, false, true)
window['$message'].success('导入成功!')
} catch (error) {
window['$message'].error('组件导入失败,请检查文件完整性!')
}
}, },
// 覆盖 // 覆盖
onNegativeCallback: async () => { onNegativeCallback: async () => {
fileData = JSON.parse(fileData) try {
await updateComponent(fileData, true, true) fileData = JSON.parse(fileData)
window['$message'].success('导入成功!') await updateComponent(fileData, true, true)
window['$message'].success('导入成功!')
} catch (error) {
window['$message'].error('组件导入失败,请检查文件完整性!')
}
} }
}) })
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册