Showing
1 changed file
with
17 additions
and
5 deletions
| 1 | +<!-- | ||
| 2 | + * @Author: hookehuyr hookehuyr@gmail.com | ||
| 3 | + * @Date: 2022-04-21 10:04:58 | ||
| 4 | + * @LastEditors: hookehuyr hookehuyr@gmail.com | ||
| 5 | + * @LastEditTime: 2022-06-01 17:07:58 | ||
| 6 | + * @FilePath: /tswj/src/components/MyButton/index.vue | ||
| 7 | + * @Description: | ||
| 8 | +--> | ||
| 1 | <template> | 9 | <template> |
| 2 | <div v-if="type === 'primary'" class="button-primary" @click="handle"> | 10 | <div v-if="type === 'primary'" class="button-primary" @click="handle"> |
| 3 | - <slot></slot> | 11 | + <slot /> |
| 4 | </div> | 12 | </div> |
| 5 | <div v-if="type === 'plain'" class="button-plain" @click="handle"> | 13 | <div v-if="type === 'plain'" class="button-plain" @click="handle"> |
| 6 | - <slot></slot> | 14 | + <slot /> |
| 7 | </div> | 15 | </div> |
| 8 | <div v-if="type === 'custom'" :style="customStyle" class="button-custom" @click="handle"> | 16 | <div v-if="type === 'custom'" :style="customStyle" class="button-custom" @click="handle"> |
| 9 | - <slot></slot> | 17 | + <slot /> |
| 10 | </div> | 18 | </div> |
| 11 | </template> | 19 | </template> |
| 12 | 20 | ||
| 13 | <script setup> | 21 | <script setup> |
| 14 | -import { ref, reactive, onMounted } from 'vue' | 22 | +import { onMounted } from 'vue' |
| 15 | const props = defineProps({ | 23 | const props = defineProps({ |
| 16 | type: String, | 24 | type: String, |
| 17 | - customStyle: Object | 25 | + customStyle: Object, |
| 26 | + disable: { | ||
| 27 | + type: Boolean, | ||
| 28 | + default: false | ||
| 29 | + } | ||
| 18 | }) | 30 | }) |
| 19 | const emit = defineEmits(['on-click']); | 31 | const emit = defineEmits(['on-click']); |
| 20 | const handle = () => { | 32 | const handle = () => { | ... | ... |
-
Please register or login to post a comment