mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +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 Component from 'nuxt-class-component'
|
||||
import { Prop } from 'vue-property-decorator'
|
||||
import { Action, namespace } from 'vuex-class'
|
||||
import { namespace } from 'vuex-class'
|
||||
|
||||
import * as people from '~/store/modules/people'
|
||||
|
||||
const PeopleAction = namespace(people.name, Action)
|
||||
const People = namespace(people.name)
|
||||
|
||||
export default
|
||||
@Component({})
|
||||
class Card extends Vue {
|
||||
export default class Card extends Vue {
|
||||
@Prop() person
|
||||
@PeopleAction select
|
||||
@People.Action select
|
||||
}
|
||||
</script>
|
||||
|
@ -2,12 +2,12 @@
|
||||
"version": "1.0.1",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"axios": "^0.17.1",
|
||||
"nuxt-edge": "latest",
|
||||
"axios": "^0.18.0",
|
||||
"nuxt-class-component": "^1.1.3",
|
||||
"nuxt-edge": "latest",
|
||||
"tachyons": "^4.9.1",
|
||||
"vue-property-decorator": "^6.0.0",
|
||||
"vuex-class": "^0.3.0"
|
||||
"vue-property-decorator": "^7.2.0",
|
||||
"vuex-class": "^0.3.1"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "nuxt",
|
||||
@ -16,7 +16,7 @@
|
||||
"generate": "nuxt generate"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ts-loader": "^3.2.0",
|
||||
"typescript": "^2.6.2"
|
||||
"ts-loader": "^5.3.1",
|
||||
"typescript": "^3.1.6"
|
||||
}
|
||||
}
|
||||
|
@ -21,22 +21,21 @@
|
||||
import Vue from 'vue'
|
||||
import Component from 'nuxt-class-component'
|
||||
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'
|
||||
|
||||
const PeopleState = namespace(people.name, State)
|
||||
const PeopleGetter = namespace(people.name, Getter)
|
||||
const People = namespace(people.name)
|
||||
|
||||
export default
|
||||
@Component({
|
||||
components: {
|
||||
Card
|
||||
}
|
||||
})
|
||||
class extends Vue {
|
||||
@PeopleState selected
|
||||
@PeopleState people
|
||||
@PeopleGetter selectedPerson
|
||||
export default class extends Vue {
|
||||
@People.State selected
|
||||
@People.State people
|
||||
@People.Getter selectedPerson
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -17,14 +17,7 @@
|
||||
"baseUrl": ".",
|
||||
"allowJs": true,
|
||||
"paths": {
|
||||
"~/": ["./"],
|
||||
"~/assets/*": ["./assets/*"],
|
||||
"~/components/*": ["./components/*"],
|
||||
"~/middleware/*": ["./middleware/*"],
|
||||
"~/pages/*": ["./pages/*"],
|
||||
"~/plugins/*": ["./plugins/*"],
|
||||
"~/static/*": ["./static/*"],
|
||||
"~/store/*": ["./store/*"]
|
||||
"~/*": ["./*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user