- 2020.07.13 ~ 2020.08.28
- Vue.js
- HTML
- SCSS
- TypeScript
- ESLint
npm install
npm run serve
npm run build
npm run test:unit
npm run lint
export type SizeType = 'normal' | 'small' | 'big' | 'full';
export type AlignType = 'center' | 'left';
export interface UIOptionType {
size?: SizeType;
align?: AlignType;
negativeMessage?: string;
positiveMessage?: string;
}
const uiOption: UIOptionType = {
size: 'normal', // default: normal
align: 'center', // default: center
positiveMessage: '확인', //default: 확인
negativeMessage: '취소',
};
const content: string = 'DESCRIPTION';
const title: string = 'TITLE';
this.$modal.on(uiOption, content, title);
const uiOption: UIOptionType = {
size: 'normal', // default: normal
align: 'center', // default: center
positiveMessage: '확인', //default: 확인
negativeMessage: '취소',
};
const content: string = 'DESCRIPTION';
const title: string = 'TITLE';
try {
await this.$promiseModal.on(uiOption, content, title);
// resolve - click positive message button
} catch (e) {
// reject - click negative message button
}
const uiOption: UIOptionType = {
size: 'normal', // default: normal
align: 'center', // default: center
positiveMessage: '확인', //default: 확인
negativeMessage: '취소',
};
const content: string = 'DESCRIPTION';
const title: string = 'TITLE';
const buttons: string[] = ['1', '2', '3'];
try {
const idx = await this.$promiseModal.on(uiOption, content, title, buttons);
// resolve - click positive message button
// idx: index of clicked button
switch (idx) {
case 0: // do 1
break;
case 1: // do 2
break;
case 2: // do 3
break;
default: // do else
}
} catch (e) {
// reject - click negative message button
}