refactor: number-diff.vue to composition api

This commit is contained in:
Norm 2022-09-10 12:25:58 -04:00
parent 70c12158f7
commit ebc4daa6c2
Signed by untrusted user: norm
GPG key ID: 7123E30E441E80DE

View file

@ -4,30 +4,17 @@
</span>
</template>
<script lang="ts">
import { computed, defineComponent } from 'vue';
<script lang="ts" setup>
import { computed } from 'vue';
import number from '@/filters/number';
export default defineComponent({
props: {
value: {
type: Number,
required: true,
},
},
const props = defineProps<{
value: number;
}>();
setup(props) {
const isPlus = computed(() => props.value > 0);
const isMinus = computed(() => props.value < 0);
const isZero = computed(() => props.value === 0);
return {
isPlus,
isMinus,
isZero,
number,
};
},
});
</script>
<style lang="scss" scoped>