title: [Nuxt.js/Typescript]how to get data from vuex?
body: <p>I'm a Typescript newbie. I set Objective Data to Vuex store, but I can't get it.</p>
  
  <p>This is the Objective data of Users(in other words, <code>account</code>).</p>
  
  <pre><code># models/User.ts
  
  export interface IUser {
    email: string | null
    name: string | null
  }
  
  export class UserClass implements IUser {
    email: string | null
    name: string | null
  
    constructor(email: string | null, name: string | null) {
      this.email = email
      this.name = name
    }
  }
  </code></pre>
  
  <pre><code># store/accounts.ts
  
  import { UserClass } from '~/models/User'
  
  @Module({ stateFactory: true, namespaced: true, name: 'account'})
  export default class Account extends VuexModule {
    user: UserClass | null = null
  
    get currentUser() {
      return this.user
    }
  
    @Mutation
    storeUser(user: UserClass | null){
      this.user = user
    }
  
    @Action({})
    setUser(user: UserClass | null){
      this.storeUser(user)
    }
  }
  </code></pre>
  
  <pre><code># utils/store-accessor.ts
  
  import { Store } from 'vuex'
  import { getModule } from 'vuex-module-decorators'
  import Account from '~/store/account'
  
  let accountStore: Account
  
  function initializeStore(store: Store&lt;any&gt;): void {
    accountStore = getModule(Account, store))
  }
  export { initializeStore, accountStore }
  </code></pre>
  
  <pre><code># components/Sample.vue
  
  &lt;template&gt;
    &lt;div&gt;
      &lt;p&gt;NAME: {{currentUser.email}}&lt;/p&gt;    // ★error !
    &lt;/div&gt;
  &lt;/template&gt;
  export default class SampleCmp extends Vue {
    @Prop() currentUser: UserClass | null = accountStore.currentUser
  }
  </code></pre>
  
  <p>I want to get email like above <code>currentUser．email</code>, but got error <code>Cannot read property 'email' of null</code>.
  If it set just <code>currentUser</code>, the stored data like <code>{email: hogehoge@test.com, name: dummy}</code> is output to page as it is.</p>
  
  <p>what should I do ? please help !</p>
  
  <p>regards.</p>