mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
ts: add useAutoModal typing
This commit is contained in:
parent
026ccb68ed
commit
3e60b96ee0
1 changed files with 9 additions and 6 deletions
|
@ -1,18 +1,21 @@
|
||||||
|
import type { OrchestratedModal } from 'bootstrap-vue-next'
|
||||||
|
import { BModal, useModalController } from 'bootstrap-vue-next'
|
||||||
import { h } from 'vue'
|
import { h } from 'vue'
|
||||||
import { useModalController, BModal } from 'bootstrap-vue-next'
|
import { useI18n } from 'vue-i18n'
|
||||||
import { VueShowdown } from 'vue-showdown'
|
import { VueShowdown } from 'vue-showdown'
|
||||||
|
|
||||||
export function useAutoModal() {
|
export function useAutoModal() {
|
||||||
|
const { t } = useI18n()
|
||||||
const { confirm, show } = useModalController()
|
const { confirm, show } = useModalController()
|
||||||
|
|
||||||
return function (
|
return function (
|
||||||
message,
|
message: string,
|
||||||
props_,
|
props_: OrchestratedModal = {},
|
||||||
{ markdown = false, cancelable = true } = {},
|
{ markdown = false, cancelable = true } = {},
|
||||||
) {
|
) {
|
||||||
const props = {
|
const props: OrchestratedModal = {
|
||||||
okTitle: this.$t('ok'),
|
okTitle: t('ok'),
|
||||||
cancelTitle: this.$t('cancel'),
|
cancelTitle: t('cancel'),
|
||||||
centered: true,
|
centered: true,
|
||||||
okOnly: !cancelable,
|
okOnly: !cancelable,
|
||||||
...(markdown
|
...(markdown
|
||||||
|
|
Loading…
Reference in a new issue