Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getter property type not recognized #197

Closed
elaith9 opened this issue Nov 10, 2019 · 0 comments
Closed

Getter property type not recognized #197

elaith9 opened this issue Nov 10, 2019 · 0 comments

Comments

@elaith9
Copy link

elaith9 commented Nov 10, 2019

This is my module, I'm using dynamic modules:

import { Module, VuexModule, getModule } from 'vuex-module-decorators'
import { store } from '@/store'
import { UserSettings } from '@/models/user-settings'

@Module({
    dynamic: true,
    namespaced: true,
    name: 'user-settings',
    store,
})
class UserSettingsStore extends VuexModule {
    model = new UserSettings()

    get layers() : Layer[] {
        return this.model.layers
    }
}

export const userSettingsStore = getModule(UserSettingsStore)

This is the component where I'm trying to access getter property

import { Component, Vue } from 'vue-property-decorator'
import { userSettingsStore } from '../../store/modules/user-settings.store'

@Component
export default class EditLayerMenu extends Vue {

  get isEditMode(){
    return userSettingsStore.layers.find(x => x.editMode === true)
  }
}

I don't get any autocomplete for property "layers" and it's recognized as any[] instead of Layer[]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants