mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-06 23:25:06 +08:00
多模块重构 12:修改项目名字,按照新的规则
This commit is contained in:
53
yudao-ui-app-v1/components/mix-price-view/mix-price-view.vue
Normal file
53
yudao-ui-app-v1/components/mix-price-view/mix-price-view.vue
Normal file
@ -0,0 +1,53 @@
|
||||
<template>
|
||||
<view class="mix-price-view" :style="{fontSize: size - 8 + 'rpx'}">
|
||||
<text>¥</text>
|
||||
<text class="price" :style="{fontSize: size + 'rpx'}">{{ priceArr[0] }}</text>
|
||||
<text>.{{ priceArr[1] }}</text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 价格显示组件
|
||||
*/
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
priceArr: []
|
||||
};
|
||||
},
|
||||
props: {
|
||||
price: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
size: {
|
||||
type: Number,
|
||||
default: 36
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
price(){
|
||||
this.render();
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.render();
|
||||
},
|
||||
methods: {
|
||||
render(){
|
||||
const price = parseFloat(this.price).toFixed(2);
|
||||
this.priceArr = (''+price).split('.');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.mix-price-view{
|
||||
color: $base-color;
|
||||
}
|
||||
.price{
|
||||
font-weight: 700;
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user