diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-09-13 19:59:06 +1000 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-09-13 20:00:17 +1000 |
| commit | 23b5cc80ba02936659564dd03b173d3214ce5978 (patch) | |
| tree | cdf6a183d1a0bfcb45a924585b764c723dd67b55 /src/components/IconButton.vue | |
| parent | e382d4173c990a49a9ef3db1b3681763a3e2e908 (diff) | |
Use Vue Composition API and ESLint
Diffstat (limited to 'src/components/IconButton.vue')
| -rw-r--r-- | src/components/IconButton.vue | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/src/components/IconButton.vue b/src/components/IconButton.vue index 5684fb0..9357e97 100644 --- a/src/components/IconButton.vue +++ b/src/components/IconButton.vue @@ -5,24 +5,19 @@ </div> </template> -<script lang="ts"> -import {defineComponent, PropType} from 'vue'; +<script setup lang="ts"> +import {computed} from 'vue'; -export default defineComponent({ - props: { - size: {type: Number, default: 36}, - disabled: {type: Boolean, default: false}, - }, - computed: { - styles(): Record<string,string> { - return { - minWidth: this.size + 'px', - maxWidth: this.size + 'px', - minHeight: this.size + 'px', - maxHeight: this.size + 'px', - padding: (this.size / 5) + 'px', - }; - }, - }, +const props = defineProps({ + size: {type: Number, default: 36}, + disabled: {type: Boolean, default: false}, }); + +const styles = computed(() => ({ + minWidth: props.size + 'px', + maxWidth: props.size + 'px', + minHeight: props.size + 'px', + maxHeight: props.size + 'px', + padding: (props.size / 5) + 'px', +})); </script> |
