增加 @types/react-native,移除不用的代码
This commit is contained in:
parent
56da24070e
commit
1bf5216671
|
|
@ -1,2 +0,0 @@
|
|||
import Dialog from './index.mp';
|
||||
export default Dialog;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import Dialog from './index.mp';
|
||||
export default Dialog;
|
||||
console.log('不应该走到这里[utils/dialog]');
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
declare const Message: {
|
||||
info(options: Record<string, any>): any;
|
||||
success(options: Record<string, any>): any;
|
||||
warning(options: Record<string, any>): any;
|
||||
error(options: Record<string, any>): any;
|
||||
confirm(options: Record<string, any>): any;
|
||||
hide(context: any): void;
|
||||
};
|
||||
export default Message;
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
const DialogType = {
|
||||
info: 'info',
|
||||
success: 'success',
|
||||
warning: 'warning',
|
||||
error: 'error',
|
||||
confirm: 'confirm',
|
||||
};
|
||||
function getInstance(context, selector = '#oak-dialog') {
|
||||
const instance = context.selectComponent(selector);
|
||||
if (!instance) {
|
||||
return Promise.reject(new Error('未找到Dialog组件, 请检查selector是否正确'));
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
function showDialog(options, type = DialogType.info) {
|
||||
const options2 = { ...options };
|
||||
const { context } = options2;
|
||||
delete options.context;
|
||||
const instance = getInstance(context);
|
||||
instance.resetData(() => {
|
||||
instance.setData(Object.assign({ type }, options), instance.show);
|
||||
});
|
||||
return instance;
|
||||
}
|
||||
const Message = {
|
||||
info(options) {
|
||||
return showDialog(options, DialogType.info);
|
||||
},
|
||||
success(options) {
|
||||
return showDialog(options, DialogType.success);
|
||||
},
|
||||
warning(options) {
|
||||
return showDialog(options, DialogType.warning);
|
||||
},
|
||||
error(options) {
|
||||
return showDialog(options, DialogType.error);
|
||||
},
|
||||
confirm(options) {
|
||||
return showDialog(options, DialogType.confirm);
|
||||
},
|
||||
hide(context) {
|
||||
const instance = getInstance(context);
|
||||
if (!instance) {
|
||||
return;
|
||||
}
|
||||
instance.linHide();
|
||||
},
|
||||
};
|
||||
export default Message;
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
import { Modal } from 'antd';
|
||||
export default Modal;
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
import { Modal } from 'antd';
|
||||
export default Modal;
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
import Message from './index.mp';
|
||||
export default Message;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import Message from './index.mp';
|
||||
export default Message;
|
||||
console.log('不应该走到这里[utils/message]');
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
declare const Message: {
|
||||
info(options: Record<string, any>): any;
|
||||
success(options: Record<string, any>): any;
|
||||
warning(options: Record<string, any>): any;
|
||||
error(options: Record<string, any>): any;
|
||||
hide(context: any): void;
|
||||
};
|
||||
export default Message;
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
const MessageType = {
|
||||
info: 'info',
|
||||
success: 'success',
|
||||
warning: 'warning',
|
||||
error: 'error',
|
||||
};
|
||||
function getInstance(context, selector = '#oak-message') {
|
||||
const instance = context.selectComponent(selector);
|
||||
if (!instance) {
|
||||
return Promise.reject(new Error('未找到Message组件, 请检查selector是否正确'));
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
function showMessage(options, theme = MessageType.info) {
|
||||
const options2 = { ...options };
|
||||
const { context } = options2;
|
||||
delete options.context;
|
||||
const instance = getInstance(context);
|
||||
instance.resetData(() => {
|
||||
instance.setData(Object.assign({ theme }, options), instance.show);
|
||||
});
|
||||
return instance;
|
||||
}
|
||||
const Message = {
|
||||
info(options) {
|
||||
return showMessage(options, MessageType.info);
|
||||
},
|
||||
success(options) {
|
||||
return showMessage(options, MessageType.success);
|
||||
},
|
||||
warning(options) {
|
||||
return showMessage(options, MessageType.warning);
|
||||
},
|
||||
error(options) {
|
||||
return showMessage(options, MessageType.error);
|
||||
},
|
||||
hide(context) {
|
||||
const instance = getInstance(context);
|
||||
if (!instance) {
|
||||
return;
|
||||
}
|
||||
instance.hide();
|
||||
},
|
||||
};
|
||||
export default Message;
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
import { message } from 'antd';
|
||||
export default message;
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
import { message } from 'antd';
|
||||
export default message;
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
import Dialog from './index.mp';
|
||||
export default Dialog;
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const tslib_1 = require("tslib");
|
||||
const index_mp_1 = tslib_1.__importDefault(require("./index.mp"));
|
||||
exports.default = index_mp_1.default;
|
||||
console.log('不应该走到这里[utils/dialog]');
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
declare const Message: {
|
||||
info(options: Record<string, any>): any;
|
||||
success(options: Record<string, any>): any;
|
||||
warning(options: Record<string, any>): any;
|
||||
error(options: Record<string, any>): any;
|
||||
confirm(options: Record<string, any>): any;
|
||||
hide(context: any): void;
|
||||
};
|
||||
export default Message;
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const DialogType = {
|
||||
info: 'info',
|
||||
success: 'success',
|
||||
warning: 'warning',
|
||||
error: 'error',
|
||||
confirm: 'confirm',
|
||||
};
|
||||
function getInstance(context, selector = '#oak-dialog') {
|
||||
const instance = context.selectComponent(selector);
|
||||
if (!instance) {
|
||||
return Promise.reject(new Error('未找到Dialog组件, 请检查selector是否正确'));
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
function showDialog(options, type = DialogType.info) {
|
||||
const options2 = { ...options };
|
||||
const { context } = options2;
|
||||
delete options.context;
|
||||
const instance = getInstance(context);
|
||||
instance.resetData(() => {
|
||||
instance.setData(Object.assign({ type }, options), instance.show);
|
||||
});
|
||||
return instance;
|
||||
}
|
||||
const Message = {
|
||||
info(options) {
|
||||
return showDialog(options, DialogType.info);
|
||||
},
|
||||
success(options) {
|
||||
return showDialog(options, DialogType.success);
|
||||
},
|
||||
warning(options) {
|
||||
return showDialog(options, DialogType.warning);
|
||||
},
|
||||
error(options) {
|
||||
return showDialog(options, DialogType.error);
|
||||
},
|
||||
confirm(options) {
|
||||
return showDialog(options, DialogType.confirm);
|
||||
},
|
||||
hide(context) {
|
||||
const instance = getInstance(context);
|
||||
if (!instance) {
|
||||
return;
|
||||
}
|
||||
instance.linHide();
|
||||
},
|
||||
};
|
||||
exports.default = Message;
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
import { Modal } from 'antd';
|
||||
export default Modal;
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const antd_1 = require("antd");
|
||||
exports.default = antd_1.Modal;
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
import Message from './index.mp';
|
||||
export default Message;
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const tslib_1 = require("tslib");
|
||||
const index_mp_1 = tslib_1.__importDefault(require("./index.mp"));
|
||||
exports.default = index_mp_1.default;
|
||||
console.log('不应该走到这里[utils/message]');
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
declare const Message: {
|
||||
info(options: Record<string, any>): any;
|
||||
success(options: Record<string, any>): any;
|
||||
warning(options: Record<string, any>): any;
|
||||
error(options: Record<string, any>): any;
|
||||
hide(context: any): void;
|
||||
};
|
||||
export default Message;
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const MessageType = {
|
||||
info: 'info',
|
||||
success: 'success',
|
||||
warning: 'warning',
|
||||
error: 'error',
|
||||
};
|
||||
function getInstance(context, selector = '#oak-message') {
|
||||
const instance = context.selectComponent(selector);
|
||||
if (!instance) {
|
||||
return Promise.reject(new Error('未找到Message组件, 请检查selector是否正确'));
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
function showMessage(options, theme = MessageType.info) {
|
||||
const options2 = { ...options };
|
||||
const { context } = options2;
|
||||
delete options.context;
|
||||
const instance = getInstance(context);
|
||||
instance.resetData(() => {
|
||||
instance.setData(Object.assign({ theme }, options), instance.show);
|
||||
});
|
||||
return instance;
|
||||
}
|
||||
const Message = {
|
||||
info(options) {
|
||||
return showMessage(options, MessageType.info);
|
||||
},
|
||||
success(options) {
|
||||
return showMessage(options, MessageType.success);
|
||||
},
|
||||
warning(options) {
|
||||
return showMessage(options, MessageType.warning);
|
||||
},
|
||||
error(options) {
|
||||
return showMessage(options, MessageType.error);
|
||||
},
|
||||
hide(context) {
|
||||
const instance = getInstance(context);
|
||||
if (!instance) {
|
||||
return;
|
||||
}
|
||||
instance.hide();
|
||||
},
|
||||
};
|
||||
exports.default = Message;
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
import { message } from 'antd';
|
||||
export default message;
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const antd_1 = require("antd");
|
||||
exports.default = antd_1.message;
|
||||
|
|
@ -59,6 +59,7 @@
|
|||
"@types/node": "^20.6.0",
|
||||
"@types/react": "^18.2.1",
|
||||
"@types/react-dom": "^18.2.14",
|
||||
"@types/react-native": "^0.72.8",
|
||||
"@types/sha1": "^1.1.3",
|
||||
"@types/uuid": "^9.0.6",
|
||||
"@types/wechat-miniprogram": "^3.4.5",
|
||||
|
|
|
|||
|
|
@ -1,54 +0,0 @@
|
|||
const DialogType = {
|
||||
info: 'info',
|
||||
success: 'success',
|
||||
warning: 'warning',
|
||||
error: 'error',
|
||||
confirm: 'confirm',
|
||||
};
|
||||
|
||||
function getInstance(context: any, selector = '#oak-dialog') {
|
||||
const instance = context.selectComponent(selector);
|
||||
if (!instance) {
|
||||
return Promise.reject(
|
||||
new Error('未找到Dialog组件, 请检查selector是否正确')
|
||||
);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
function showDialog(options: Record<string, any>, type = DialogType.info) {
|
||||
const options2 = { ...options };
|
||||
const { context } = options2;
|
||||
delete options.context;
|
||||
const instance = getInstance(context);
|
||||
instance.resetData(() => {
|
||||
instance.setData(Object.assign({ type }, options), instance.show);
|
||||
});
|
||||
return instance;
|
||||
}
|
||||
|
||||
const Message = {
|
||||
info(options: Record<string, any>) {
|
||||
return showDialog(options, DialogType.info);
|
||||
},
|
||||
success(options: Record<string, any>) {
|
||||
return showDialog(options, DialogType.success);
|
||||
},
|
||||
warning(options: Record<string, any>) {
|
||||
return showDialog(options, DialogType.warning);
|
||||
},
|
||||
error(options: Record<string, any>) {
|
||||
return showDialog(options, DialogType.error);
|
||||
},
|
||||
confirm(options: Record<string, any>) {
|
||||
return showDialog(options, DialogType.confirm);
|
||||
},
|
||||
hide(context: any) {
|
||||
const instance = getInstance(context);
|
||||
if (!instance) {
|
||||
return;
|
||||
}
|
||||
instance.linHide();
|
||||
},
|
||||
};
|
||||
|
||||
export default Message;
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
import Dialog from './index.mp';
|
||||
|
||||
export default Dialog;
|
||||
console.log('不应该走到这里[utils/dialog]');
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import { Modal } from 'antd';
|
||||
|
||||
export default Modal;
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
const MessageType = {
|
||||
info: 'info',
|
||||
success: 'success',
|
||||
warning: 'warning',
|
||||
error: 'error',
|
||||
};
|
||||
|
||||
function getInstance(context: any, selector = '#oak-message') {
|
||||
const instance = context.selectComponent(selector);
|
||||
if (!instance) {
|
||||
return Promise.reject(
|
||||
new Error('未找到Message组件, 请检查selector是否正确')
|
||||
);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
function showMessage(options: Record<string, any>, theme = MessageType.info) {
|
||||
const options2 = { ...options };
|
||||
const { context } = options2;
|
||||
delete options.context;
|
||||
const instance = getInstance(context);
|
||||
instance.resetData(() => {
|
||||
instance.setData(Object.assign({ theme }, options), instance.show);
|
||||
});
|
||||
return instance;
|
||||
}
|
||||
|
||||
const Message = {
|
||||
info(options: Record<string, any>) {
|
||||
return showMessage(options, MessageType.info);
|
||||
},
|
||||
success(options: Record<string, any>) {
|
||||
return showMessage(options, MessageType.success);
|
||||
},
|
||||
warning(options: Record<string, any>) {
|
||||
return showMessage(options, MessageType.warning);
|
||||
},
|
||||
error(options: Record<string, any>) {
|
||||
return showMessage(options, MessageType.error);
|
||||
},
|
||||
hide(context: any) {
|
||||
const instance = getInstance(context);
|
||||
if (!instance) {
|
||||
return;
|
||||
}
|
||||
instance.hide();
|
||||
},
|
||||
};
|
||||
|
||||
export default Message;
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
import Message from './index.mp';
|
||||
|
||||
export default Message;
|
||||
console.log('不应该走到这里[utils/message]');
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
import { message } from 'antd';
|
||||
|
||||
export default message;
|
||||
Loading…
Reference in New Issue