add $askMdConfirmation helper

This commit is contained in:
axolotle 2022-11-23 16:18:16 +01:00
parent 153787a6a1
commit 9b650163e8

View file

@ -39,6 +39,19 @@ Vue.prototype.$askConfirmation = function (message, props) {
})
}
Vue.prototype.$askMdConfirmation = function (markdown, props, ok = false) {
const content = this.$createElement('vue-showdown', {
props: { markdown, flavor: 'github', options: { headerLevelStart: 4 } }
})
return this.$bvModal['msgBox' + (ok ? 'Ok' : 'Confirm')](content, {
okTitle: this.$i18n.t('yes'),
cancelTitle: this.$i18n.t('cancel'),
headerBgVariant: 'warning',
headerClass: store.state.theme ? 'text-white' : 'text-black',
centered: true,
...props
})
}
// Register global components
const requireComponent = require.context('@/components/globals', true, /\.(js|vue)$/i)