Skip to content

Commit

Permalink
fix(Checkbox): add event change
Browse files Browse the repository at this point in the history
  • Loading branch information
vvpvvp committed Dec 3, 2018
1 parent aa3dde3 commit 72bf4f1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
14 changes: 14 additions & 0 deletions doc/components/component/form/checkbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,19 @@
<td>全局config <code>dict.titleName</code></td>
</tr>
</table>

<h3>Checkbox 事件</h3>
<table class="table">
<tr>
<th>事件</th>
<th>说明</th>
<th>返回数据</th>
</tr>
<tr>
<td>change</td>
<td>当数据产生变动的时候触发</td>
<td>当前绑定的v-model值</td>
</tr>
</table>
</div>
</template>
14 changes: 14 additions & 0 deletions doc/components_en/component/form/checkbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,19 @@
<td>config <code>dict.titleName</code></td>
</tr>
</table>

<h3>Radio Event</h3>
<table class="table">
<tr>
<th>Event</th>
<th>Description</th>
<th>Return value</th>
</tr>
<tr>
<td>change</td>
<td>When data changed</td>
<td>v-model value</td>
</tr>
</table>
</div>
</template>
1 change: 1 addition & 0 deletions src/components/checkbox/checkbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export default {
let key = option[this.key];
value = utils.toggleValue(value, key);
}
this.$emit('change', value);
this.$emit('input', value);
let event = document.createEvent("CustomEvent");
event.initCustomEvent("setvalue", true, true, value);
Expand Down

0 comments on commit 72bf4f1

Please sign in to comment.