{"action":"opened","issue":{"url":"https://api.github.com/repos/Glebbond/theme19/issues/14","repository_url":"https://api.github.com/repos/Glebbond/theme19","labels_url":"https://api.github.com/repos/Glebbond/theme19/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/Glebbond/theme19/issues/14/comments","events_url":"https://api.github.com/repos/Glebbond/theme19/issues/14/events","html_url":"https://github.com/Glebbond/theme19/issues/14","id":324295987,"number":14,"title":"Обращение к store из компонента","user":{"login":"storonaot","id":20354982,"avatar_url":"https://avatars3.githubusercontent.com/u/20354982?v=4","gravatar_id":"","url":"https://api.github.com/users/storonaot","html_url":"https://github.com/storonaot","followers_url":"https://api.github.com/users/storonaot/followers","following_url":"https://api.github.com/users/storonaot/following{/other_user}","gists_url":"https://api.github.com/users/storonaot/gists{/gist_id}","starred_url":"https://api.github.com/users/storonaot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/storonaot/subscriptions","organizations_url":"https://api.github.com/users/storonaot/orgs","repos_url":"https://api.github.com/users/storonaot/repos","events_url":"https://api.github.com/users/storonaot/events{/privacy}","received_events_url":"https://api.github.com/users/storonaot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-18T07:14:10Z","updated_at":"2018-05-18T07:14:10Z","closed_at":null,"author_association":"NONE","body":"Внутри компонента для удобного обращения к  store нужно заимпортиртить методы из Vuex\r\n\r\n`import {mapGetters, mapActions} from ‘vuex’`\r\n\r\nВнутри компонента это выглядит так:\r\n```javascript\r\nexport default {\r\n    computed: {\r\n        ...mapGetters(['editModeMenu', 'clientWidth']),\r\n        currentView() {\r\n            return this.editModeMenu.filter((x) => x.alias === this.currentTab)[0].view\r\n        }\r\n    },\r\n    methods: {\r\n        ...mapMutations(['setClientWidth']),\r\n        changeUrl(tab) {\r\n            this.$router.replace(`/edit/${tab}`)\r\n         }\r\n    }\r\n}\r\n```\r\n"}}
{"actor":{"display_login":"storonaot"}}