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>
<div>
123
<Nuxt />
</div>
</template>

View File

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