Skip to content

Commit

Permalink
fix: $notify报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
haixin-fang committed Mar 19, 2024
1 parent 997dac1 commit 42669d1
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 61 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = {
ElMessage: "readonly",
ElMessageBox: "readonly",
ElLoading: "readonly",
ElNotification: "readonly"
},
extends: ["plugin:vue/vue3-essential", "eslint:recommended", "@vue/typescript/recommended", "@vue/prettier/@typescript-eslint"],
parser: "vue-eslint-parser",
Expand Down
3 changes: 2 additions & 1 deletion packages/editor/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
// Generated by unplugin-auto-import
export {}
declare global {

const ElMessage: typeof import('element-plus/es')['ElMessage']
const ElNotification: typeof import('element-plus/es')['ElNotification']
}
3 changes: 3 additions & 0 deletions packages/editor/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,7 @@ declare module 'vue' {
Shape: typeof import('./src/components/Shape.vue')['default']
Workspace: typeof import('./src/components/Workspace.vue')['default']
}
export interface ComponentCustomProperties {
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
}
}
2 changes: 1 addition & 1 deletion packages/editor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "starfish-editor",
"version": "1.1.11",
"version": "1.1.12",
"main": "dist/starfish-editor.umd.js",
"style": "dist/style.css",
"module": "dist/starfish-editor.es.js",
Expand Down
10 changes: 0 additions & 10 deletions packages/editor/src/common/ConditionSelect/ConditionTanc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,6 @@ export default {
value: "常量",
label: "常量",
},
// {
// rule: [],
// value: "字段",
// label: "字段",
// },
// {
// rule: [],
// value: "请求参数",
// label: "请求参数",
// },
],
};
},
Expand Down
14 changes: 9 additions & 5 deletions packages/editor/src/components/PropsPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default defineComponent({
ControllEditSize,
jsonEnter: defineAsyncComponent({
loader: () => import("./jsonEditor.vue"),
loadingComponent: Loading
loadingComponent: Loading,
}),
globalFormComponent: defineAsyncComponent({
loader: () => import("./globalFormList.vue"),
Expand Down Expand Up @@ -168,8 +168,10 @@ export default defineComponent({
return new Promise((resolve) => {
ruleForm.value.validate((valid: boolean) => {
if (!valid) {
window.VApp.$notify.error({
title: content,
ElNotification({
title: "Error",
message: content,
type: "error",
});
resolve(false);
} else {
Expand Down Expand Up @@ -259,8 +261,10 @@ export default defineComponent({
formStore?.set("previewShow", ispreview);
formStore?.set("preview", false);
} else if (ispreview) {
window.VApp.$notify.success({
title: type ? "已自动保存" : "保存成功",
ElNotification({
title: "Success",
message: type ? "已自动保存" : "保存成功",
type: "success",
});
}
}
Expand Down
1 change: 1 addition & 0 deletions playground/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
export {}
declare global {
const ElMessage: typeof import('element-plus/es')['ElMessage']
const ElNotification: typeof import('element-plus/es')['ElNotification']
}
43 changes: 0 additions & 43 deletions playground/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,11 @@ export {}

declare module 'vue' {
export interface GlobalComponents {
ElAlert: typeof import('element-plus/es')['ElAlert']
ElAside: typeof import('element-plus/es')['ElAside']
ElButton: typeof import('element-plus/es')['ElButton']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
ElCol: typeof import('element-plus/es')['ElCol']
ElCollapse: typeof import('element-plus/es')['ElCollapse']
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
ElContainer: typeof import('element-plus/es')['ElContainer']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDivider: typeof import('element-plus/es')['ElDivider']
ElDrawer: typeof import('element-plus/es')['ElDrawer']
ElDropdown: typeof import('element-plus/es')['ElDropdown']
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElFooter: typeof import('element-plus/es')['ElFooter']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElMain: typeof import('element-plus/es')['ElMain']
ElOption: typeof import('element-plus/es')['ElOption']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSlider: typeof import('element-plus/es')['ElSlider']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTimeSelect: typeof import('element-plus/es')['ElTimeSelect']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree']
ElUpload: typeof import('element-plus/es')['ElUpload']
Form: typeof import('./src/components/Form.vue')['default']
Home: typeof import('./src/components/Home.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
}
export interface ComponentCustomProperties {
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
}
}
2 changes: 1 addition & 1 deletion playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"@element-plus/icons-vue": "^2.0.8",
"element-plus": "^2.2.12",
"starfish-editor": "^1.1.11",
"starfish-editor": "^1.1.12",
"starfish-form": "^1.2.7",
"vite": "^4.5.2",
"vue": "^3.2.37",
Expand Down

0 comments on commit 42669d1

Please sign in to comment.