SweetAlert에 메시지 표시

6748 단어 JavaScriptSweetAlert

SweetAlert에 메시지 표시


기본 정보


일가


개요


자바스크립트의 표준 장비로 경보, 메시지를 보낼 수 있지만 시간을 들여 정보를 예쁘게 보여줘야 한다.

기본용법


그냥 문자를 보냈어요.



sweetAlertSample.js

function basicSample(){
    swal("基本の使い方");
}

제목 및 텍스트 추가



sweetAlertSample.js
function basicSample2(){
    swal("ここにタイトル!", "そして、ここにテキスト!");
}

아이콘 추가



sweetAlertSample.js
function basicSample3(){
    swal("アイコンつき!", "ボタンも付いてる!", "success");
}

아이콘 구분


사용할 수 있는 아이콘은 4가지입니다.

success



sweetAlertSample.js
function iconSample1(){
    swal({
        title: "success",
        text: "successのicon",
        icon: "success",
        button: "OK",
    });
}

error



sweetAlertSample.js
function iconSample2(){
    swal({
        title: "error",
        text: "errorのicon",
        icon: "error",
        button: "OK",
    });
}

info



sweetAlertSample.js
function iconSample3(){
    swal({
        title: "info",
        text: "infoのicon",
        icon: "info",
        button: "OK",
    });
}

warning



sweetAlertSample.js
function iconSample4(){
    swal({
        title: "warning",
        text: "warningのicon",
        icon: "warning",
        button: "OK",
    });
}

좋은 웹페이지 즐겨찾기