1. 程式人生 > 其它 >element 彈框顯示

element 彈框顯示

程式碼

this.$confirm('此操作將永久刪除該檔案, 是否繼續?', '提示', {
                    confirmButtonText: '確定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    $.ajax({
                        url:base_url+'/SS/camera/deleteCamera',
                        type: 'post',
                        contentType:'application/x-www-form-urlencoded',
                        dataType:'json',
                        data: {
                            id: row.id
                        },
                        async: true,
                        success:function(res){
                            console.log('res',res)
                            // 重新整理頁面
                            that.getAllCamera()
                        },fail:function(){
                        }
                    });
                    // this.$message({
                    //     type: 'success',
                    //     message: '刪除成功!'
                    // });
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消刪除'
                    });
                });