mirror of
https://github.com/youzan/vant.git
synced 2025-10-15 23:55:08 +00:00
增加单独禁用stepper input功能 (#146)
* fix: sku message key * fix: 改用goods_id当key * fix: 漏改一处 * feat: 增加单独禁用stepper input功能 * fix: update doc * fix: rename spec file
This commit is contained in:
@@ -60,6 +60,17 @@ describe('Stepper', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('only disable stepper input', () => {
|
||||
wrapper = mount(Stepper, {
|
||||
propsData: {
|
||||
disableInput: true
|
||||
}
|
||||
});
|
||||
|
||||
const input = wrapper.find('.van-stepper__input')[0];
|
||||
expect(input.hasAttribute('disabled', 'disabled')).to.be.true;
|
||||
});
|
||||
|
||||
it('update stepper value use v-model', (done) => {
|
||||
wrapper = mount(Stepper, {
|
||||
propsData: {
|
||||
@@ -96,7 +107,14 @@ describe('Stepper', () => {
|
||||
wrapper.vm.$nextTick(() => {
|
||||
expect(wrapper.vm.currentValue).to.equal(30);
|
||||
expect(eventStub.calledWith('input'));
|
||||
done();
|
||||
|
||||
// value设置非数字时,则使用设置的最小值(默认1)
|
||||
wrapper.vm.value = 'abc';
|
||||
wrapper.update();
|
||||
wrapper.vm.$nextTick(() => {
|
||||
expect(wrapper.vm.currentValue).to.equal(1);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user