mirror of
https://github.com/xxxsf/vue3-h5-template.git
synced 2025-08-31 03:10:04 +08:00
30 lines
457 B
Vue
30 lines
457 B
Vue
<template>
|
|
<div class="thirdComponent">
|
|
<button v-on:click="increment">{{ counter }}</button>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'button-counter',
|
|
data: () => ({
|
|
counter: 0,
|
|
}),
|
|
methods: {
|
|
increment: function () {
|
|
this.counter += 1
|
|
this.$emit('increment')
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.thirdComponent{
|
|
display: inline-block;
|
|
}
|
|
button{
|
|
color: #41b883;
|
|
border-color: #41b883;
|
|
}
|
|
</style> |