InputNumber add editable property.

This commit is contained in:
梁灏 2017-10-11 09:29:16 +08:00
parent 9271ce9d42
commit 7309b43422
3 changed files with 9 additions and 5 deletions

View file

@ -6,7 +6,7 @@
<!--<div @click="changeMax">change max</div>--> <!--<div @click="changeMax">change max</div>-->
<!--<Input-number disabled :max="10" :min="1" :step="1.2" v-model="v2"></Input-number>--> <!--<Input-number disabled :max="10" :min="1" :step="1.2" v-model="v2"></Input-number>-->
<!--<Input-number :max="10" :min="1" v-model="obj.v"></Input-number>--> <!--<Input-number :max="10" :min="1" v-model="obj.v"></Input-number>-->
<InputNumber :max="10" :min="1" :step="1.2" v-model="value2"></InputNumber> <InputNumber :editable="false" :max="10" :min="1" :step="1.2" v-model="value2"></InputNumber>
<InputNumber :precision="1" :max="10" :min="1" :step="0.1" v-model="value1"></InputNumber> <InputNumber :precision="1" :max="10" :min="1" :step="0.1" v-model="value1"></InputNumber>
</div> </div>
</template> </template>

View file

@ -182,15 +182,15 @@
watch: { watch: {
hours (val) { hours (val) {
if (!this.compiled) return; if (!this.compiled) return;
this.scroll('hours', this.hoursList.findIndex(obj => obj.text == val)); this.scroll('hours', this.hoursList.findIndex(obj => obj.text == val));
}, },
minutes (val) { minutes (val) {
if (!this.compiled) return; if (!this.compiled) return;
this.scroll('minutes', this.minutesList.findIndex(obj => obj.text == val)); this.scroll('minutes', this.minutesList.findIndex(obj => obj.text == val));
}, },
seconds (val) { seconds (val) {
if (!this.compiled) return; if (!this.compiled) return;
this.scroll('seconds', this.secondsList.findIndex(obj => obj.text == val)); this.scroll('seconds', this.secondsList.findIndex(obj => obj.text == val));
} }
}, },
mounted () { mounted () {

View file

@ -25,7 +25,7 @@
@blur="blur" @blur="blur"
@keydown.stop="keyDown" @keydown.stop="keyDown"
@change="change" @change="change"
:readonly="readonly" :readonly="readonly || !editable"
:name="name" :name="name"
:value="precisionValue"> :value="precisionValue">
</div> </div>
@ -102,6 +102,10 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
editable: {
type: Boolean,
default: true
},
name: { name: {
type: String type: String
}, },