Skip to content

Commit

Permalink
➖ Remove vue-property-decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
gluons committed Oct 15, 2017
1 parent 6377702 commit a688c6c
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 26 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
"vue": "^2.4.2",
"vue-class-component": "^5.0.2",
"vue-loader": "^13.0.4",
"vue-property-decorator": "^5.2.1",
"vue-template-compiler": "^2.4.2",
"webpack": "^3.7.1",
"webpack-merge": "^4.1.0"
Expand Down
23 changes: 18 additions & 5 deletions src/components/AddressForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<script lang="ts">
import Vue from 'vue';
import Component from 'vue-class-component';
import { Prop } from 'vue-property-decorator';
import store from '@/store';
Expand All @@ -25,20 +24,34 @@ import TypeaheadInput from './TypeaheadInput.vue';
@Component({
name: 'address-form',
props: {
subdistrictLabel: {
type: String,
default: 'ตำบล/แขวง'
},
districtLabel: {
type: String,
default: 'อำเภอ/เขต'
},
provinceLabel: {
type: String,
default: 'จังหวัด'
},
zipcodeLabel: {
type: String,
default: 'รหัสไปรษณีย์'
}
},
components: {
TypeaheadInput
},
store
})
export default class AddressForm extends Vue {
// Props
@Prop({ default: 'ตำบล/แขวง' })
subdistrictLabel: string;
@Prop({ default: 'อำเภอ/เขต' })
districtLabel: string;
@Prop({ default: 'จังหวัด' })
provinceLabel: string;
@Prop({ default: 'รหัสไปรษณีย์' })
zipcodeLabel: string;
// Hooks
Expand Down
20 changes: 15 additions & 5 deletions src/components/Autocomplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,31 @@ ul.typeahead-autocomplete(:style='style', v-if='hasData')
<script lang="ts">
import Vue from 'vue';
import Component from 'vue-class-component';
import { Prop } from 'vue-property-decorator';
import AddressEntry from '@/interface/AddressEntry';
import { addressToString, getDataItemKeys } from '@/lib/utils';
@Component({
name: 'autocomplete'
name: 'autocomplete',
props: {
target: {
type: String,
required: true
},
maxHeight: {
type: Number,
default: 200
},
selectedIndex: {
type: Number,
default: -1
}
}
})
export default class Autocomplete extends Vue {
// Props
@Prop({ required: true })
target: string; // A property name in data item.
@Prop({ default: 200 })
maxHeight: number; // Max autocomplete height.
@Prop({ default: -1 })
selectedIndex: number;
// Computed
Expand Down
10 changes: 7 additions & 3 deletions src/components/TypeaheadInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
<script lang="ts">
import Vue from 'vue';
import Component from 'vue-class-component';
import { Prop } from 'vue-property-decorator';
import AddressEntry from '@/interface/AddressEntry';
import { getPossibles } from '@/lib/datasource-utils';
Expand All @@ -46,6 +45,13 @@ const AUTOCOMPLETE_CLOSE_DELAY = 250;
@Component({
name: 'typeahead-input',
props: {
target: {
type: String,
required: true
},
label: String
},
components: {
Autocomplete
},
Expand All @@ -62,9 +68,7 @@ export default class TypeaheadInput extends Vue {
autocompleteCount: number = 0;
// Props
@Prop({ required: true })
target: string; // Name. It's an actual property name in address data.
@Prop()
label: string; // Input label.
// Computed
Expand Down
13 changes: 1 addition & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5415,10 +5415,6 @@ reduce-function-call@^1.0.1:
dependencies:
balanced-match "^0.4.2"

reflect-metadata@^0.1.9:
version "0.1.10"
resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.10.tgz#b4f83704416acad89988c9b15635d47e03b9344a"

regenerate@^1.2.1:
version "1.3.3"
resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f"
Expand Down Expand Up @@ -6600,7 +6596,7 @@ vue-add-globals@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/vue-add-globals/-/vue-add-globals-2.0.1.tgz#c9fba6faac44f679ec15d5a9637f518b181fc44d"

vue-class-component@^5.0.0, vue-class-component@^5.0.2:
vue-class-component@^5.0.2:
version "5.0.2"
resolved "https://registry.yarnpkg.com/vue-class-component/-/vue-class-component-5.0.2.tgz#3dcdc005c58c4e88d8ec2d46e01c74f4d90135c8"

Expand Down Expand Up @@ -6644,13 +6640,6 @@ vue-loader@^13.0.4:
vue-style-loader "^3.0.0"
vue-template-es2015-compiler "^1.5.3"

vue-property-decorator@^5.2.1:
version "5.3.0"
resolved "https://registry.yarnpkg.com/vue-property-decorator/-/vue-property-decorator-5.3.0.tgz#f0fa1d0efd3c569ff2009fe9546cd2fb33ed7f43"
dependencies:
reflect-metadata "^0.1.9"
vue-class-component "^5.0.0"

vue-style-loader@^3.0.0:
version "3.0.3"
resolved "https://registry.yarnpkg.com/vue-style-loader/-/vue-style-loader-3.0.3.tgz#623658f81506aef9d121cdc113a4f5c9cac32df7"
Expand Down

0 comments on commit a688c6c

Please sign in to comment.