<template>
    <div class="ht-base-input-number-format-demo">
        格式化金额：<ht-base-input-number
          :max="10000"
          v-model="value9"
          :formatter="value => `$ ${value}`.replace(/B(?=(d{3})+(?!d))/g, ',')"
          :parser="value => value.replace(/$s?|(,*)/g, '')"></ht-base-input-number>

        <span style="display: inline-block; margin-left: 15px;"></span>

        格式化百分比：<ht-base-input-number
          :max="100"
          v-model="value10"
          :formatter="value => `${value}%`"
          :parser="value => value.replace('%', '')"></ht-base-input-number>
    </div>
</template>

<script>
  export default {
    name: 'HtBaseInputNumberFormatDemo',
    data () {
      return {
        value9: 1000,
        value10: 100
      }
    }
  }
</script>
<style>
    .ht-base-input-number-format-demo {

    }
</style>

