File tree Expand file tree Collapse file tree 11 files changed +41
-242
lines changed Expand file tree Collapse file tree 11 files changed +41
-242
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ See deployed app of this template [here](https://nuxt-typescript-starter.netlify
2727- π¦ ** Vuex** store management with intense typing usage example
2828- π ** Axios** ready (With a sample to NewsAPI request)
2929- β ** DotEnv** ready ofcourse!
30- - π¨ Expressive, Dynamic, Robust CSS with ** Stylus** support
3130- π ** Jest** integration ready Unit Test with 100% coverage as starting point (Vuetify and Vuex Integration included!)
3231- β¨ ** Progressive Web App** by default (Installable / Add to homescreen)
3332
Original file line number Diff line number Diff line change 77 </div >
88</template >
99
10- <style lang="stylus" scoped>
10+ <style scoped>
1111.VueToNuxtLogo {
1212 display : inline-block ;
1313 animation : turn 2s linear forwards 1s ;
Original file line number Diff line number Diff line change 22 <img class =" VuetifyLogo" alt =" Vuetify Logo" src =" /vuetify-logo.svg" />
33</template >
44
5- <style lang="stylus" scoped>
5+ <style scoped>
66.VuetifyLogo {
77 height : 180px ;
88 width : 180px ;
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export default class ErrorLayout extends Vue {
3535}
3636 </script >
3737
38- <style lang="stylus" scoped>
38+ <style scoped>
3939h1 {
4040 font-size : 20px ;
4141}
Original file line number Diff line number Diff line change 99 "build" : " nuxt build" ,
1010 "generate" : " nuxt generate" ,
1111 "start" : " nuxt start" ,
12- "lint" : " eslint --ext .js ,.vue --ignore-path .gitignore ." ,
12+ "lint" : " eslint --ext .ts ,.vue --ignore-path .gitignore ." ,
1313 "test" : " jest"
1414 },
1515 "dependencies" : {
1818 "@nuxtjs/pwa" : " ^3.0.0-0" ,
1919 "nuxt" : " 2.15.8" ,
2020 "nuxt-property-decorator" : " ^2.7.2" ,
21- "stylus" : " ^0.54.8" ,
22- "stylus-loader" : " ^3.0.2" ,
2321 "vuex" : " ^3.5.1"
2422 },
2523 "devDependencies" : {
26- "@fullhuman/postcss-purgecss" : " ^4.0.3" ,
2724 "@nuxt/typescript-build" : " ^2.1.0" ,
2825 "@nuxtjs/eslint-config-typescript" : " ^1.0.0" ,
2926 "@nuxtjs/eslint-module" : " ^1.0.0" ,
Original file line number Diff line number Diff line change 11<template >
22 <v-layout >
33 <v-flex class =" text-center" >
4- <img src =" /v.png" alt =" Vuetify.js" class =" mb-5" />
54 <blockquote class =" blockquote" >
65 “ ; First, solve the problem. Then, write the code.” ;
76 <footer >
1514</template >
1615
1716<script lang="ts">
18- import { Vue } from ' nuxt-property-decorator' ;
17+ import { Vue , Component } from ' nuxt-property-decorator' ;
1918
19+ @Component
2020export default class Inspire extends Vue {
2121 readonly name: string = ' inspire' ;
22+ layout() {
23+ return ' default' ;
24+ }
2225}
2326 </script >
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ export default class News extends Vue {
5656}
5757 </script >
5858
59- <style lang="stylus" scoped>
59+ <style scoped>
6060.image-preview {
6161 width : 100% ;
6262}
Original file line number Diff line number Diff line change 1111// state defined as function
1212export const state = ( ) => ( {
1313 pageTitle : ''
14- } )
14+ } ) ;
1515
1616// mutations defined as object
1717export const mutations = {
1818 setPageTitle ( state : any , param : string ) {
19- state . pageTitle = param
19+ state . pageTitle = param ;
2020 }
21- }
21+ } ;
2222
2323// this is root of store, mutations defined must unique
2424export const actions = {
2525 setPageTitle ( store : any , param : string ) {
26- store . commit ( 'setPageTitle' , param )
26+ store . commit ( 'setPageTitle' , param ) ;
2727 }
28- }
28+ } ;
Original file line number Diff line number Diff line change 11// βThe first step is to establish that something is possible; then probability will occurβ
22// - Elon Musk
33
4- import axios from 'axios'
5- import { Article , NewsapiResponse , NewsState } from '~/@types'
4+ import axios from 'axios' ;
5+ import { Article , NewsapiResponse , NewsState } from '~/@types' ;
66
77// =================================================
88// State
@@ -25,16 +25,16 @@ export const state = (): NewsState => ({
2525 'https://www.teslarati.com/wp-content/uploads/2020/07/ANASIS-II-Falcon-9-B1058-LC-40-072020-SpaceX-JRTI-landing-2-c-1024x465.jpg'
2626 }
2727 ]
28- } )
28+ } ) ;
2929
3030// =================================================
3131// Mutations
3232// =================================================
3333export const mutations = {
3434 setArticles ( state : NewsState , param : Article [ ] ) : void {
35- state . articles = param
35+ state . articles = param ;
3636 }
37- }
37+ } ;
3838
3939// =================================================
4040// Actions
@@ -46,11 +46,11 @@ export const actions = {
4646 url : `https://newsapi.org/v2/top-headlines?country=us&category=technology&apiKey=${ process . env . NEWS_API_KEY } `
4747 } )
4848 . then ( async ( response : NewsapiResponse ) => {
49- await store . commit ( 'setArticles' , response . data . articles )
50- return true
49+ await store . commit ( 'setArticles' , response . data . articles ) ;
50+ return true ;
5151 } )
5252 . catch ( ( error ) => {
53- return error . response
54- } )
53+ return error . response ;
54+ } ) ;
5555 }
56- }
56+ } ;
Original file line number Diff line number Diff line change 2121 "~/*" : [" ./*" ],
2222 "@/*" : [" ./*" ]
2323 },
24- "types" : [" @types/node" , " @types/jest" ]
24+ "types" : [" @types/node" , " @types/jest" , " @nuxtjs/vuetify " ]
2525 },
2626 "exclude" : [" node_modules" , " .nuxt" , " dist" ]
2727}
You canβt perform that action at this time.
0 commit comments