我有Laravel/惰性应用程序,我在app.js中使用全球导入的app.js。它适用于每一个组件。但现在,我想在组件上使用,但我无法找到甜警报的有效解决方案。我试过几种方法,但甜言蜜语还是没用的。
我试过:
const swal = inject($swal),
Import VueSweetAlert2 from 'vue-sweetalert2';
Import Swal from 'vue-sweetalert2';
Import swal from 'vue-sweetalert2';还有其他的方法。
如何在SweetAlert中使用?
谢谢。帕托
发布于 2022-08-09 04:48:16
<script setup>
import { inject } from 'vue'
const swal = inject('$swal')
function showDialog(event) {
swal.fire({
icon: 'success',
title: 'done',
showConfirmButton: false,
timer: 1500
});
}
</script>https://stackoverflow.com/questions/71394739
复制相似问题