Позвоните на новый модал из ссылки нижнего колонтитула SweetAlert2 - PullRequest
0 голосов
/ 30 апреля 2020

Мне было интересно, как я мог бы назвать еще один модал SweetAler2 из ссылки нижнего колонтитула?

Как: footer: 'Living on the edge? Get the <a id="download-preview" onclick="swal.showPreviewDownload();">preview</a>.',

Проблема в том, что это делает onclick буквально, у меня нет нашел любой ресурс, чтобы помочь мне.

Я использую SweetAlert2 с vue -sweetalert2 .

Это мой метод, он не полностью выполнен (на самом деле, это очень WIP с различными экспериментальными вещами) но он заморожен, пока я не выясню, что я запрашиваю:

methods: {
    showDownloads() {
        this.$swal({
            title: "Get Tachiyomi for Android",
            html:
                "Requires Android 4.1 or newer.",
            confirmButtonText:
                "Download",
            confirmButtonAriaLabel: "Download",
            footer: `Living on the edge? Get the <a id="download-preview" onclick="swal.showPreviewDownload();">preview</a>.`,
            showCloseButton: true,
            showCancelButton: false,
            focusConfirm: false,
            customClass: {
                actions: "download-actions",
                cancelButton: "download-dev-button",
                closeButton: "download-close-button",
                confirmButton: "download-stable-button",
                container: "download-container",
                content: "download-content",
                header: "download-header",
                footer: "download-footer",
                icon: "download-icon",
                popup: "download-popup",
                title: "download-title"
            },
            showClass: {
                popup: "animated zoomIn fastest"
            },
            hideClass: {
                popup: "animated zoomOut faster"
            }
        }).then(result => {
            if (result.value) {
                this.$swal({
                    title: "Tachiyomi is being downloaded",
                    icon: "success",
                    focusConfirm: false,
                    timer: 5000,
                    timerProgressBar: true,
                    customClass: {
                        actions: "download-actions",
                        confirmButton: "download-confirm-button",
                        container: "download-container",
                        header: "download-header",
                        footer: "download-footer",
                        title: "download-title downloading"
                    },
                    showClass: {
                        popup: "animated pulse faster"
                    },
                    hideClass: {
                        popup: "animated zoomOut faster"
                    }
                });
                window.location.assign(
                    this.$data.browserDownloadUrl ||
                        "https://github.com/inorichi/tachiyomi/releases/latest"
                );
                window.ga(
                    "send",
                    "event",
                    "Button",
                    "Click",
                    "Download - Tachiyomi"
                );
            }
        });
        $("#download-preview").click(function () {
            window.location.assign(
                "https://tachiyomi.kanade.eu/latest"
            );
            window.ga(
                "send",
                "event",
                "Button",
                "Click",
                "Download - Tachiyomi Preview"
            );
        });
    }
},

Очень благодарен за любую помощь, ура!

...