add some feature..
This commit is contained in:
@ -0,0 +1,59 @@
|
||||
<template>
|
||||
<div>
|
||||
{{ conversion }}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
|
||||
export default {
|
||||
name: 'akaunting-currency-conversion',
|
||||
|
||||
props: {
|
||||
currencyConversionText: {
|
||||
type: String,
|
||||
default: 'Currency conversion'
|
||||
},
|
||||
price: {
|
||||
type: String,
|
||||
default: 'sale'
|
||||
},
|
||||
currecyCode: {
|
||||
type: String,
|
||||
default: 'USD'
|
||||
},
|
||||
currencyRate: {
|
||||
default: 1.000,
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
conversion: '',
|
||||
};
|
||||
},
|
||||
|
||||
created() {
|
||||
this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace(':currency_rate', this.currencyRate);
|
||||
},
|
||||
|
||||
watch: {
|
||||
currencyConversionText: function (text) {
|
||||
this.conversion = text.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace('', this.currencyRate);
|
||||
},
|
||||
|
||||
price: function (price) {
|
||||
this.conversion = this.currencyConversionText.replace(':price', price).replace(':currency_code', this.currecyCode).replace(':currency_rate', this.currencyRate);
|
||||
},
|
||||
|
||||
currecyCode: function (currecyCode) {
|
||||
this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', currecyCode).replace(':currency_rate', this.currencyRate);
|
||||
},
|
||||
|
||||
currencyRate: function (currencyRate) {
|
||||
this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace(':currency_rate', currencyRate);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
@ -45,6 +45,7 @@
|
||||
:value="item.price"
|
||||
v-bind="money"
|
||||
masked
|
||||
disabled
|
||||
class="text-right disabled-money"
|
||||
></money>
|
||||
</div>
|
||||
|
@ -10,7 +10,7 @@
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<money :name="name" @input="input" :placeholder="placeholder" v-bind="money" :value="model" :disabled="disabled" :masked="masked" class="form-control"></money>
|
||||
<money :name="name" @input="input" :placeholder="placeholder" v-bind="money" :value="model" :disabled="disabled" :masked="masked" class="form-control" :class="moneyClass"></money>
|
||||
</div>
|
||||
|
||||
<div class="invalid-feedback d-block" v-if="error" v-html="error"></div>
|
||||
@ -27,14 +27,13 @@
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<money :name="name" @input="input" :placeholder="placeholder" v-bind="money" :value="model" :disabled="disabled" :masked="masked" class="form-control"></money>
|
||||
<money :name="name" @input="input" :placeholder="placeholder" v-bind="money" :value="model" :disabled="disabled" :masked="masked" class="form-control" :class="moneyClass"></money>
|
||||
</div>
|
||||
|
||||
<money v-else :name="name" @input="input" :placeholder="placeholder" v-bind="money" :value="model" :disabled="disabled" :masked="masked" class="form-control"></money>
|
||||
<money v-else :name="name" @input="input" :placeholder="placeholder" v-bind="money" :value="model" :disabled="disabled" :masked="masked" class="form-control" :class="moneyClass"></money>
|
||||
|
||||
<div class="invalid-feedback d-block" v-if="error" v-html="error"></div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -68,6 +67,11 @@ export default {
|
||||
type: String,
|
||||
description: "Prepend icon (left)"
|
||||
},
|
||||
moneyClass: {
|
||||
type: String,
|
||||
default: null,
|
||||
description: "Selectbox disabled status"
|
||||
},
|
||||
group_class: {
|
||||
type: String,
|
||||
default: null,
|
||||
|
2
resources/assets/js/mixins/global.js
vendored
2
resources/assets/js/mixins/global.js
vendored
@ -18,6 +18,7 @@ import AkauntingDate from './../components/AkauntingDate';
|
||||
import AkauntingRecurring from './../components/AkauntingRecurring';
|
||||
import AkauntingHtmlEditor from './../components/AkauntingHtmlEditor';
|
||||
import AkauntingCountdown from './../components/AkauntingCountdown';
|
||||
import AkauntingCurrencyConversion from './../components/AkauntingCurrencyConversion';
|
||||
|
||||
import NProgress from 'nprogress';
|
||||
import 'nprogress/nprogress.css';
|
||||
@ -46,6 +47,7 @@ export default {
|
||||
AkauntingRecurring,
|
||||
AkauntingHtmlEditor,
|
||||
AkauntingCountdown,
|
||||
AkauntingCurrencyConversion,
|
||||
[Select.name]: Select,
|
||||
[Option.name]: Option,
|
||||
[Steps.name]: Steps,
|
||||
|
Reference in New Issue
Block a user