add modal

This commit is contained in:
MarcZierle 2022-01-11 17:37:12 +01:00
parent b8297a4edd
commit 33f3b825bf
2 changed files with 45 additions and 22 deletions

View File

@ -1,11 +1,27 @@
<template>
<n-config-provider :theme="null">
<n-message-provider>
<div id="nav">
<router-link to="/">Startseite</router-link> |
<router-link to="/about">Das sind wir</router-link>
</div>
<router-view />
</n-message-provider>
</n-config-provider>
</template>
<script>
import { defineComponent } from 'vue'
import {darkTheme} from 'naive-ui'
export default defineComponent({
setup() {
return { darkTheme }
}
})
</script>
<style lang="scss">
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;

View File

@ -5,30 +5,26 @@
Check me out, BOY!
</p>
<n-space vertical>
<n-steps :current="status" :status="currentStatus">
<n-step
title="I Me Mine"
description="All through the day, I me mine I me mine, I me mine"
<n-button type="primary" @click="showModal = true">Start Me up</n-button>
<n-modal
v-model:show="showModal"
:mask-closable="false"
preset="dialog"
title="Dialog"
content="Are you sure?"
positive-text="Confirm"
@positive-click="onPositiveClick"
@negative-click="onNegativeClick"
negative-text="Cancel"
/>
<n-step
title="Let It Be"
description="When I find myself in times of trouble Mother Mary comes to me"
/>
<n-step
title="Come Together"
description="Here come old flat top He come grooving up slowly"
/>
<n-step
title="Something"
description="Something in the way she moves Attracts me like no other lover"
/>
</n-steps>
</n-space>
</div>
</template>
<script>
import { useMessage } from 'naive-ui'
export default {
name: "HelloWorld",
props: {
@ -36,9 +32,20 @@ export default {
},
data() {
return {
currentStatus: "error",
status: 3
message: useMessage(),
showModal: false
}
},
methods: {
onPositiveClick () {
this.message.success('Submit')
this.showModal = false
},
onNegativeClick () {
this.message.success('Cancel')
this.showModalRef = false
}
}
};
</script>