Skip to content

Commit 0df1818

Browse files
committed
[input] fix v-model binding
1 parent 5427139 commit 0df1818

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

dist/vue-typed-ui.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -626,12 +626,12 @@ var Input = function (_InputBase2) {
626626
}
627627

628628
createClass(Input, [{
629-
key: 'valueChanged',
630-
value: function valueChanged(val) {
631-
this.target().val(val);
632-
}
633-
}, {
634629
key: 'target',
630+
631+
// @Watch('value')
632+
// valueChanged(val) {
633+
// this.target().val(val)
634+
// }
635635
value: function target() {
636636
return $(this.$el).find('input');
637637
}
@@ -651,6 +651,9 @@ var Input = function (_InputBase2) {
651651
var input = ch('input', {
652652
class: this.css,
653653
attrs: attrs,
654+
domProps: {
655+
value: this.value
656+
},
654657
on: {
655658
input: this.emiter('input'),
656659
change: this.emiter('change')
@@ -690,7 +693,6 @@ var Input = function (_InputBase2) {
690693
}]);
691694
return Input;
692695
}(_InputBase);
693-
__decorate([vueTyped.Watch('value')], Input.prototype, "valueChanged", null);
694696
Input = __decorate([vueTyped.Component()], Input);
695697

696698
/**

src/components/form-inputs/input/index.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,8 @@ import { IInput } from '../../../../lib/interface';
1010
@Component()
1111
export class Input extends _InputBase implements IInput {
1212

13-
@Watch('value')
14-
valueChanged(val) {
15-
this.target().val(val)
16-
}
1713

18-
target() : JQuery {
14+
target(): JQuery {
1915
return $(this.$el).find('input')
2016
}
2117

@@ -33,9 +29,12 @@ export class Input extends _InputBase implements IInput {
3329
attrs['disabled'] = true
3430
}
3531

36-
let input = ch('input', {
32+
let input = ch('input', {
3733
class: this.css,
3834
attrs,
35+
domProps: {
36+
value: this.value
37+
},
3938
on: {
4039
input: this.emiter('input'),
4140
change: this.emiter('change')

0 commit comments

Comments
 (0)