Blame view

src/components/Button.vue 689 Bytes
yangwei committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
<template>
  <button class="button" :class="nativeType" @click.prevent="handleClick" :type="nativeType">
    <slot></slot>
  </button>
</template>
<script>
export default {
  name: 'Button',
  props: {
    nativeType: {
      type: String,
      default: 'cx'
    },
  },
  methods: {
    handleClick (evt) {
      this.$emit('click', evt);
    }
  }
};
</script>
<style scoped lang="scss">
.button {
24
  width: 76px;
yangwei committed
25 26 27
  height: 32px;
  color: #ffffff;
  margin: 0 5px;
28
  cursor: pointer;
任超 committed
29
  border: 0
yangwei committed
30 31 32
}

.cx {
33 34
  background: url('../image/btn.png') no-repeat 0 -34px;
  background-size: cover;
yangwei committed
35 36 37
}

.cz {
38 39
  background: url('../image/btn.png') no-repeat 0 0;
  background-size: cover;
yangwei committed
40 41
}
</style>