123456789101112131415161718192021 |
- export default {
- install (vue) {
- const format = {
- price (price, currency = 'rmb') {
- const currencyList = {
- rmb: {
- icon: '¥',
- unit: '元',
- },
- }
- return currencyList[currency].icon +
- Number(price).toFixed(2) +
- currencyList[currency].unit
- },
- }
- vue.prototype.$format = format
- vue.format = format
- },
- }
|