c5_labsci/fapp/ciyon_ap/components/ciy-showmoney/ciy-showmoney.vue

63 lines
1.1 KiB
Vue

<template>
<view style="display:inline-block;" :style="ciystyle">
<text :style="intstyle">{{p1}}</text>
<text :style="decstyle">{{p2}}</text>
<text :style="decstyle">{{unit}}</text>
</view>
</template>
<style scoped>
</style>
<script>
export default {
props: {
value: {
type: [String, Number],
default: 0
},
dec0: {
type: Boolean,
default: false
},
unit: {
type: String,
default: ''
},
ciystyle: {
type: [String, Object],
default: ''
},
intstyle: {
type: String,
default: ''
},
decstyle: {
type: String,
default: 'font-size:0.7em;'
},
},
data() {
return {};
},
watch: {},
computed: {
p1() {
if (this.unit == '万元')
return this.toint(this.value / 1000000);
else
return this.toint(this.value / 100);
},
p2() {
if (this.unit == '万元')
return this.tonumdec(this.value / 1000000, this.dec0, 3);
else if (this.unit == '元')
return this.tonumdec(this.value / 100, this.dec0, 2);
else
return this.tonumdec(this.value / 100, this.dec0, 2);
}
},
mounted() {},
methods: {}
}
</script>