1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import InputNumber from '../src/index';
import '../assets/index.less';
export default {
data: function data() {
return {
precision: 2
};
},
methods: {
onChange: function onChange(value) {
console.log('onChange:', value);
this.value = value;
},
changeprecision: function changeprecision(e) {
this.precision = parseInt(e.target.value, 10);
}
},
render: function render() {
var h = arguments[0];
return h(
'div',
{ style: 'margin: 10px;' },
[h(InputNumber, {
attrs: { defaultValue: 1, precision: this.precision },
on: {
'change': this.onChange
}
}), h(
'p',
{ style: 'padding:10px 0' },
['precision:', h('input', {
attrs: { type: 'number' },
on: {
'input': this.changeprecision
},
domProps: {
'value': this.precision
}
})]
)]
);
}
};