frontend-web/src/components/HelloWorld.vue
2022-01-11 17:37:12 +01:00

70 lines
1.2 KiB
Vue

<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
Check me out, BOY!
</p>
<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"
/>
</div>
</template>
<script>
import { useMessage } from 'naive-ui'
export default {
name: "HelloWorld",
props: {
msg: String,
},
data() {
return {
message: useMessage(),
showModal: false
}
},
methods: {
onPositiveClick () {
this.message.success('Submit')
this.showModal = false
},
onNegativeClick () {
this.message.success('Cancel')
this.showModalRef = false
}
}
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>