Commit 0100133266fe8dcaa0521c6f5ca5a1e8f146861c

Authored by xiaofengsha
1 parent ff3d2a2e

添加inputNumber组件placeholder的示例代码

Showing 1 changed file with 3 additions and 0 deletions   Show diff stats
examples/routers/input-number.vue
@@ -50,6 +50,8 @@ @@ -50,6 +50,8 @@
50 <InputNumber v-model="valueNull" @on-change="change" :formatter="formatter" :parser="parser" style="width: 200px"></InputNumber> 50 <InputNumber v-model="valueNull" @on-change="change" :formatter="formatter" :parser="parser" style="width: 200px"></InputNumber>
51 51
52 <InputNumber v-model="value2" @on-focus="focus" style="width: 200px"></InputNumber> 52 <InputNumber v-model="value2" @on-focus="focus" style="width: 200px"></InputNumber>
  53 +
  54 + <InputNumber v-model="value3" style="width: 200px" placeholder="Enter something..."></InputNumber>
53 </div> 55 </div>
54 </template> 56 </template>
55 <script> 57 <script>
@@ -58,6 +60,7 @@ @@ -58,6 +60,7 @@
58 return { 60 return {
59 value1: 1800000, 61 value1: 1800000,
60 value2: 55, 62 value2: 55,
  63 + value3: 100,
61 valueNull:null, 64 valueNull:null,
62 formatter: (value) => `$ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ','), 65 formatter: (value) => `$ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ','),
63 parser: (value) => value.replace(/\$\s?|(,*)/g, ''), 66 parser: (value) => value.replace(/\$\s?|(,*)/g, ''),