ant-design-vue/components/vc-input-number/demo/small-step.jsx

37 lines
682 B
Vue
Raw Normal View History

2019-01-12 03:33:27 +00:00
import InputNumber from '../src/index';
import '../assets/index.less';
2018-04-04 04:04:49 +00:00
export default {
2019-01-12 03:33:27 +00:00
data() {
2018-04-04 04:04:49 +00:00
return {
value: 0.000000001,
2019-01-12 03:33:27 +00:00
};
2018-04-04 04:04:49 +00:00
},
methods: {
2019-01-12 03:33:27 +00:00
onChange(value) {
console.log('onChange:', value);
this.value = value;
2018-04-04 04:04:49 +00:00
},
2019-01-12 03:33:27 +00:00
toggleDisabled() {
this.disabled = !this.disabled;
2018-04-04 04:04:49 +00:00
},
2019-01-12 03:33:27 +00:00
toggleReadOnly() {
this.readOnly = !this.readOnly;
2018-04-04 04:04:49 +00:00
},
},
2019-01-12 03:33:27 +00:00
render() {
2018-04-04 04:04:49 +00:00
return (
2019-01-12 03:33:27 +00:00
<div style="margin: 10px;">
2018-04-04 04:04:49 +00:00
<InputNumber
min={-10}
max={10}
step={0.000000001}
2019-01-12 03:33:27 +00:00
style="width: 100px"
2018-04-04 04:04:49 +00:00
value={this.value}
onChange={this.onChange}
/>
</div>
2019-01-12 03:33:27 +00:00
);
2018-04-04 04:04:49 +00:00
},
2019-01-12 03:33:27 +00:00
};