<template> <div class="coutter-wrapper"> <button type="button" @click="plus">+</button> <button type="button">{{ result }}</button> <button type="button" @click="minus">-</button> </div></template><script>export default { data() { return { result: 0, } }, methods: { minus() { this.result--; this.$emit(‘input‘, {res: this.result, other: ‘--‘}) }, plus() { this.result++; this.$emit(‘input‘, {res: this.result, other: ‘++‘}) } }}</script><style lang="stylus" scoped> button border 0 outline 0 border-radius 3px button:nth-child(2) width 200px</style>原文:http://www.cnblogs.com/gerry/p/6964802.html