Skip to content

Commit

Permalink
fix(vstateselect): avoid mutating 'items' prop
Browse files Browse the repository at this point in the history
Avoid direct mutation of the 'items' prop
  • Loading branch information
morphatic committed Sep 8, 2019
1 parent f7c7ef1 commit 36aac5e
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/VStateSelect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ interface options extends InstanceType<typeof base> {
* about here.
*/
foo: string
/**
* !Props inherited from VAutocomplete
*/
items: Object[]
}
// Extend VAutocomplete to define the VStateSelect component
export default base.extend<options>().extend({
Expand All @@ -41,14 +37,16 @@ export default base.extend<options>().extend({
data: () => ({
usaStates: new UsaStates(),
}),
computed: {},
watch: {},
mounted () {
this.items = this.usaStates.format({
$text: 'name',
$value: 'abbr',
})
computed: {
allItems (): object[] {
return this.usaStates.format({
$text: 'name',
$value: 'abbr',
})
},
},
watch: {},
mounted () {},
methods: {
bar () {
return 'baz'
Expand Down

0 comments on commit 36aac5e

Please sign in to comment.