@@ -4,7 +4,7 @@
.pos
.products-container
products-searcher
- products-grid
+ products-grid(:symbol="currency.symbol")
.cart-container
cart-total(:total="total" :symbol="currency.symbol")
cart-items(:symbol="currency.symbol")
@@ -17,6 +17,19 @@
default: () => {
return {}
}
+ },
+ symbol: {
+ type: String,
+ default: '$',
+ required: true
+ separator: {
+ default: '.'
+ decimals: {
+ type: Number,
+ default: 0
},
computed: {
@@ -29,7 +42,7 @@
methods: {
getPrice() {
- return accounting.formatMoney(this.data.list_price, '₲', 0, '.', ',')
+ return accounting.formatMoney(this.data.list_price, this.symbol, this.decimals, this.separator, ',')
drawImage() {
let ctx = this.$el.querySelector('.product-image').getContext('2d')
@@ -1,7 +1,7 @@
<template lang="pug">
.products-grid
template(v-for="product in products")
- product-card(:data="product")
+ product-card(:data="product" :symbol="symbol")
product-selector
</template>
@@ -13,6 +13,13 @@
import { mapGetters, mapActions } from 'vuex'
export default {
+ props: {
+ }
components: {
'product-card': ProductCard,
'product-selector': ProductSelector