src/views/home/components/switchBox.vue
@@ -1,5 +1,5 @@ <template> <g class="pointer" :transform="'translate(' + offset.join(',') + ')'"> <g class="pointer" ref="g" :transform="'translate(' + offset.join(',') + ')'" @click="handlerClick"> <!-- 圆角矩形 --> <path :d="createRoundRectPath(small ? 64 : 84, 68, 10)" @@ -113,6 +113,9 @@ C ${cp7[0]} ${cp7[1]}, ${p0[0]} ${p0[1]}, ${cp0[0]} ${cp0[1]} Z`; }, handlerClick() { this.$emit('click', this.$refs.g); } }, mounted() {},