-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: web and node model typescript support
- Loading branch information
Showing
10 changed files
with
54 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
// export default { | ||
// computed: { | ||
// article() { | ||
// return this.$store.state.article; | ||
// } | ||
// }, | ||
// methods: { | ||
// fetchApi({ state, dispatch, commit }, params) { | ||
// // params = params || state.route.params; | ||
// // return dispatch(SET_ARTICLE_DETAIL, { id : params.id }); | ||
// }, | ||
// }, | ||
// beforeMount() { | ||
// this.fetchApi(this.$store, this.$route.params); | ||
// } | ||
// } | ||
import { Vue, Component } from 'vue-property-decorator'; | ||
import Article from '../../../../../../model/article'; | ||
import { | ||
Getter, | ||
Action | ||
} from 'vuex-class'; | ||
|
||
@Component | ||
export default class Detail extends Vue { | ||
@Getter('article') article?: Article; | ||
@Action('getArticle') getArticle: any; | ||
beforeMount() { | ||
const { id } = this.$route.params; | ||
this.getArticle({ id }); | ||
} | ||
// fetchApi() { | ||
// this.getArticle({ id }); | ||
// } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,4 @@ | |
<style> | ||
</style> | ||
<script type="ts" src="./index.ts"></script> | ||
<script lang="ts" src="./index.ts"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import Article from '../../../../../model/article'; | ||
|
||
export default interface AdminState { | ||
articleTotal: number; | ||
articleList: any; | ||
article: any; | ||
articleList: Article[]; | ||
article: Article | null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters