- caaloghi, categorie
This commit is contained in:
37
src/components/CPrice/CPrice.ts
Executable file
37
src/components/CPrice/CPrice.ts
Executable file
@@ -0,0 +1,37 @@
|
||||
import { defineComponent, onMounted, ref, toRef, watch } from 'vue'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CPrice',
|
||||
props: {
|
||||
sale_price: {
|
||||
type: Number,
|
||||
},
|
||||
price: {
|
||||
type: Number,
|
||||
},
|
||||
bold: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
|
||||
setup(props) {
|
||||
|
||||
const real_price = ref(0)
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
if (props.sale_price)
|
||||
real_price.value = props.sale_price
|
||||
else
|
||||
real_price.value = props.price ? props.price : 0
|
||||
|
||||
})
|
||||
|
||||
return {
|
||||
tools,
|
||||
real_price,
|
||||
}
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user