Skip to content
This repository was archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
simplified events
Browse files Browse the repository at this point in the history
  • Loading branch information
Norman Köhring committed Mar 8, 2017
1 parent c09e6cf commit 5218fbc
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 29 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions src/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
:options='options'
@blur='$emit("blur")'
@focus='$emit("focus")'
@empty='$emit("empty")'
@complete='$emit("complete")'
@brand='$emit("brand", $event)'
@error='$emit("error", $event)'
@value='$emit("value", $event)'
@change='$emit("change", $event)'
/>
</template>

Expand Down
6 changes: 1 addition & 5 deletions src/CardCvc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
:options='options'
@blur='$emit("blur")'
@focus='$emit("focus")'
@empty='$emit("empty")'
@complete='$emit("complete")'
@brand='$emit("brand", $event)'
@error='$emit("error", $event)'
@value='$emit("value", $event)'
@change='$emit("change", $event)'
/>
</template>

Expand Down
6 changes: 1 addition & 5 deletions src/CardExpiry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
:options='options'
@blur='$emit("blur")'
@focus='$emit("focus")'
@empty='$emit("empty")'
@complete='$emit("complete")'
@brand='$emit("brand", $event)'
@error='$emit("error", $event)'
@value='$emit("value", $event)'
@change='$emit("change", $event)'
/>
</template>

Expand Down
6 changes: 1 addition & 5 deletions src/CardNumber.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
:options='options'
@blur='$emit("blur")'
@focus='$emit("focus")'
@empty='$emit("empty")'
@complete='$emit("complete")'
@brand='$emit("brand", $event)'
@error='$emit("error", $event)'
@value='$emit("value", $event)'
@change='$emit("change", $event)'
/>
</template>

Expand Down
9 changes: 1 addition & 8 deletions src/StripeElement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@ export default {
this._element = create(this.type, this.stripe, this.options)
this._element.on('blur', event => this.$emit('blur'))
this._element.on('focus', event => this.$emit('focus'))
this._element.on('change', event => {
if (event.empty) this.$emit('empty')
if (event.complete) this.$emit('complete')
if (event.brand) this.$emit('brand', event.brand)
if (event.error) this.$emit('error', event.error.code, event.error.message)
if (event.value) this.$emit('value', event.value)
// TODO: this.$emit('stripe:change', this.type, event) # One aggregated event needed?
})
this._element.on('change', event => this.$emit('change', event))
},
mounted () {
Expand Down

0 comments on commit 5218fbc

Please sign in to comment.