12345678910111213141516171819202122 |
- <template>
- <div v-if="value!=0" style="display: inline">,{{ text }}<span :class="classes"> {{ Math.abs(value) }}</span></div>
- </template>
- <script>
- export default {
- name: 'under-over-text',
- props: ['value'],
- computed: {
- text() {
- return this.value > 0 ? '超' : '缺'
- },
- classes() {
- return this.value > 0 ? ['f-red', 'bold'] : ['f-warning', 'bold']
- }
- }
- }
- </script>
- <style scoped>
- </style>
|