xianniu-ui 0.9.6 → 0.9.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xianniu-ui",
3
- "version": "0.9.6",
3
+ "version": "0.9.8",
4
4
  "private": false,
5
5
  "main": "lib/xianniu-ui.umd.min.js",
6
6
  "scripts": {
@@ -1,7 +1,29 @@
1
1
  <template>
2
2
  <span class="xn-amount" :class="{ numerical: !isCapital }">
3
3
  <template v-if="!isCapital">
4
- <i class="xn-amount-prefix" :style="prefixStyle">{{ prefix }}</i>{{ formatValue | doPrecision(legalPrecision, isRoundUp) | doFormat(hasSeparator, separator) }}
4
+ <i
5
+ class="xn-amount-prefix"
6
+ :style="prefixStyle"
7
+ v-if="showPrefix && ($slots.prefix || prefix)"
8
+ >
9
+ <slot name="prefix">
10
+ {{ prefix }}
11
+ </slot>
12
+ </i>
13
+ <slot>{{
14
+ formatValue
15
+ | doPrecision(legalPrecision, isRoundUp)
16
+ | doFormat(hasSeparator, separator)
17
+ }}</slot
18
+ ><i
19
+ class="xn-amount-suffix"
20
+ :style="suffixStyle"
21
+ v-if="$slots.suffix || suffix"
22
+ >
23
+ <slot name="suffix">
24
+ {{ suffix }}
25
+ </slot>
26
+ </i>
5
27
  </template>
6
28
  <template v-else>
7
29
  {{ formatValue | doPrecision(4, isRoundUp) | doCapital }}
@@ -59,10 +81,22 @@ export default {
59
81
  type: String,
60
82
  default: "¥",
61
83
  },
84
+ showPrefix: {
85
+ type: Boolean,
86
+ default: true,
87
+ },
62
88
  prefixStyle: {
63
89
  type: Object,
64
90
  default: () => ({}),
65
91
  },
92
+ suffix: {
93
+ type: String,
94
+ default: "",
95
+ },
96
+ suffixStyle: {
97
+ type: Object,
98
+ default: () => ({}),
99
+ },
66
100
  },
67
101
  filters: {
68
102
  // 处理精度
@@ -1,6 +1,15 @@
1
1
  .xn-amount{
2
+ font-style: normal;
3
+ font-size: inherit;
4
+ line-height: inherit;
5
+ color: inherit;
6
+ text-decoration: inherit;
2
7
  &-prefix{
3
8
  font-style: normal;
4
9
  font-size: inherit;
5
10
  }
11
+ &-suffix{
12
+ font-style: normal;
13
+ font-size: inherit;
14
+ }
6
15
  }