Browse Source

feat:小组件-数字翻牌-增加精度参数
小组件-数字翻牌-增加精度参数

王志强 3 years ago
parent
commit
5abfcfdd1b

+ 1 - 0
.gitignore

@@ -3,3 +3,4 @@ node_modules
 dist
 dist-ssr
 *.local
+.vscode

+ 1 - 0
src/packages/components/Decorates/Mores/Number/config.ts

@@ -7,6 +7,7 @@ export const option = {
   from: 50000,
   to: 100000,
   dur: 3,
+  precision: 0,
   showSeparator: true,
   numberSize: 24,
   numberColor: '#4a9ef8',

+ 7 - 0
src/packages/components/Decorates/Mores/Number/config.vue

@@ -28,6 +28,13 @@
           <n-text>展示分割符</n-text>
         </n-space>
       </SettingItem>
+      <SettingItem name="精度">
+        <n-input-number
+          v-model:value="optionData.precision"
+          size="small"
+          :min="0"
+        ></n-input-number>
+      </SettingItem>
     </SettingItemBox>
 
     <SettingItemBox name="数值">

+ 2 - 0
src/packages/components/Decorates/Mores/Number/index.vue

@@ -11,6 +11,7 @@
         :to="to"
         :duration="dur * 1000"
         :show-separator="showSeparator"
+        :precision="precision"
       ></n-number-animation>
     </span>
     <template #suffix>
@@ -42,6 +43,7 @@ const {
   suffixColor,
   from,
   to,
+  precision,
   numberSize,
   numberColor,
 } = toRefs(props.chartConfig.option)