Skip to content

Commit

Permalink
Optimize 'selected' event
Browse files Browse the repository at this point in the history
  • Loading branch information
jcc committed May 24, 2018
1 parent 4189986 commit 4febf48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/v-distpicker.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/Distpicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export default {
this.currentArea = this.placeholders.area
this.cities = this.determineValue(this.currentProvince, this.placeholders.province)
this.cleanList('areas')
if (this.cities === null) {
if (this.cities.length === 0) {
this.emit('selected')
this.tab = 1
this.showCityTab = false
Expand All @@ -193,7 +193,7 @@ export default {
getAreas() {
this.currentArea = this.placeholders.area
this.areas = this.determineValue(this.currentCity, this.placeholders.city, this.currentProvince)
if (this.areas === null) {
if (this.areas.length === 0) {
this.emit('selected')
this.tab = 2
this.showAreaTab = false
Expand Down

0 comments on commit 4febf48

Please sign in to comment.