Counter.uvue 513 字节
Newer Older
DCloud-WZF's avatar
DCloud-WZF 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
<template>
	<view>
		<text class="counter-text">count: {{ count }}</text>
		<text class="uni-common-mt counter-btn" @click="increment"></text>
	</view>
</template>

<script lang="uts">
	export default {
		name: 'Counter',
		data() {
			return {
				count: 0
			}
		},
		methods: {
			increment() {
				this.count++
			}
		}
	}
</script>

<style>
	.counter-btn {
		height: 40px;
		line-height: 40px;
		border: 1px solid #ccc;
		border-radius: 4px;
		text-align: center;
	}
</style>