Skip to content

Pysdbi/vue-3-alerts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Vue 3


Alerts Использваоние:

<script setup lang="ts">
import { useAlerts } from "@/composables/useAlerts"

const activeAlert = useAlerts().getActiveAlert
const err = (): void => {
  const { onOk } = useAlerts().error("a")
  onOk(() => alert("СУПЕР"))
}
</script>

<template>
 <Modal
    v-if="activeAlert"
    v-model="activeAlert.isShow"
  >
    <div>type: {{ activeAlert.type }}</div>
    <div>msg: {{ activeAlert.msg }}</div>
    <div>isConfirm: {{ activeAlert.isConfirm }}</div>
    <button @click="activeAlert?.onOkFunc">
      Ok
    </button>
  </Modal>
</template>

Releases

No releases published

Packages

No packages published