fix(exmaple): typescript example

[skip release]
This commit is contained in:
Clark Du 2018-11-27 11:29:00 +00:00
parent 5235471a9d
commit 7cf9f80c14
5 changed files with 27 additions and 27 deletions

View File

@ -0,0 +1,9 @@
module.exports = {
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true
}
}
}

View File

@ -18,16 +18,15 @@
import Vue from 'vue' import Vue from 'vue'
import Component from 'nuxt-class-component' import Component from 'nuxt-class-component'
import { Prop } from 'vue-property-decorator' import { Prop } from 'vue-property-decorator'
import { Action, namespace } from 'vuex-class' import { namespace } from 'vuex-class'
import * as people from '~/store/modules/people' import * as people from '~/store/modules/people'
const PeopleAction = namespace(people.name, Action) const People = namespace(people.name)
export default
@Component({}) @Component({})
class Card extends Vue { export default class Card extends Vue {
@Prop() person @Prop() person
@PeopleAction select @People.Action select
} }
</script> </script>

View File

@ -2,12 +2,12 @@
"version": "1.0.1", "version": "1.0.1",
"private": true, "private": true,
"dependencies": { "dependencies": {
"axios": "^0.17.1", "axios": "^0.18.0",
"nuxt-edge": "latest",
"nuxt-class-component": "^1.1.3", "nuxt-class-component": "^1.1.3",
"nuxt-edge": "latest",
"tachyons": "^4.9.1", "tachyons": "^4.9.1",
"vue-property-decorator": "^6.0.0", "vue-property-decorator": "^7.2.0",
"vuex-class": "^0.3.0" "vuex-class": "^0.3.1"
}, },
"scripts": { "scripts": {
"dev": "nuxt", "dev": "nuxt",
@ -16,7 +16,7 @@
"generate": "nuxt generate" "generate": "nuxt generate"
}, },
"devDependencies": { "devDependencies": {
"ts-loader": "^3.2.0", "ts-loader": "^5.3.1",
"typescript": "^2.6.2" "typescript": "^3.1.6"
} }
} }

View File

@ -21,22 +21,21 @@
import Vue from 'vue' import Vue from 'vue'
import Component from 'nuxt-class-component' import Component from 'nuxt-class-component'
import Card from '~/components/Card.vue' import Card from '~/components/Card.vue'
import { State, Getter, namespace } from 'vuex-class' import { namespace } from 'vuex-class'
import * as people from '~/store/modules/people' import * as people from '~/store/modules/people'
const PeopleState = namespace(people.name, State) const People = namespace(people.name)
const PeopleGetter = namespace(people.name, Getter)
export default
@Component({ @Component({
components: { components: {
Card Card
} }
}) })
class extends Vue { export default class extends Vue {
@PeopleState selected @People.State selected
@PeopleState people @People.State people
@PeopleGetter selectedPerson @People.Getter selectedPerson
} }
</script> </script>

View File

@ -17,14 +17,7 @@
"baseUrl": ".", "baseUrl": ".",
"allowJs": true, "allowJs": true,
"paths": { "paths": {
"~/": ["./"], "~/*": ["./*"]
"~/assets/*": ["./assets/*"],
"~/components/*": ["./components/*"],
"~/middleware/*": ["./middleware/*"],
"~/pages/*": ["./pages/*"],
"~/plugins/*": ["./plugins/*"],
"~/static/*": ["./static/*"],
"~/store/*": ["./store/*"]
} }
} }
} }