init button

This commit is contained in:
Novembert 2021-12-05 20:23:00 +01:00
parent 173070b376
commit c5eff87f33
3 changed files with 29 additions and 2 deletions

21
components/Button.vue Normal file
View File

@ -0,0 +1,21 @@
<template>
<button @click="emitClick">
{{ text }}
</button>
</template>
<script>
export default {
props: {
text: {
type: String,
default: ''
}
},
methods: {
emitClick () {
this.$emit('eclick')
}
}
}
</script>

View File

@ -1,6 +1,5 @@
<template> <template>
<div> <div>
123
<Nuxt /> <Nuxt />
</div> </div>
</template> </template>

View File

@ -1,9 +1,16 @@
<template> <template>
<div class="test"> <div class="test">
test test
<Button text="Hello World" @eclick="submitPhoto" />
</div> </div>
</template> </template>
<script> <script>
export default {} export default {
methods: {
submitPhoto () {
console.log('test')
}
}
}
</script> </script>