mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 16:12:12 +00:00
fix(exmaple): typescript example
[skip release]
This commit is contained in:
parent
5235471a9d
commit
7cf9f80c14
9
examples/typescript/.eslintrc.js
Normal file
9
examples/typescript/.eslintrc.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
module.exports = {
|
||||||
|
parserOptions: {
|
||||||
|
parser: 'babel-eslint',
|
||||||
|
sourceType: 'module',
|
||||||
|
ecmaFeatures: {
|
||||||
|
legacyDecorators: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -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>
|
||||||
|
@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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>
|
||||||
|
@ -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/*"]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user