1
0

feat: update to new slot syntax

Prepare for vue 3
This commit is contained in:
Dominik Pschenitschni
2021-08-19 19:55:13 +02:00
committed by kolaente
parent 77f8b27dc6
commit 4454e6cf22
18 changed files with 104 additions and 106 deletions

View File

@ -1,33 +1,24 @@
<template>
<notifications position="bottom left" :max="2" class="global-notification">
<template slot="body" slot-scope="props">
<template #body="{ item, close }">
<div
:class="[
'vue-notification-template',
'vue-notification',
props.item.type,
item.type,
]"
@click="close(props)"
@click="close()"
>
<div
class="notification-title"
v-if="props.item.title"
>
{{ props.item.title }}
</div>
<div
class="notification-content"
>
<template v-for="(t, k) in props.item.text">
{{ t }}<br :key="k"/>
</template>
<div v-if="item.title" class="notification-title">{{ item.title }}</div>
<div class="notification-content">
<template v-for="(t, k) in item.text">{{ t }}<br :key="k"/></template>
</div>
<div
class="buttons is-right"
v-if="
props.item.data &&
props.item.data.actions &&
props.item.data.actions.length > 0
item.data &&
item.data.actions &&
item.data.actions.length > 0
"
>
<x-button
@ -36,7 +27,7 @@
:shadow="false"
class="is-small"
type="secondary"
v-for="(action, i) in props.item.data.actions"
v-for="(action, i) in item.data.actions"
>
{{ action.title }}
</x-button>
@ -49,11 +40,6 @@
<script>
export default {
name: 'notification',
methods: {
close(props) {
props.close()
},
},
}
</script>