Skip to content

[RU] Update with last fixes #31

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

Merged
merged 3 commits into from
May 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ru/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function createStore () {
},
actions: {
fetchItem ({ commit }, id) {
// возвращаем Promise через store.dispatch()
// возвращаем Promise через `store.dispatch()`
// чтобы мы могли понять когда данные будут загружены
return fetchItem(id).then(item => {
commit('setItem', { id, item })
Expand Down Expand Up @@ -122,10 +122,10 @@ export default context => {
router.onReady(() => {
const matchedComponents = router.getMatchedComponents()
if (!matchedComponents.length) {
reject({ code: 404 })
return reject({ code: 404 })
}

// вызов asyncData() на всех соответствующих компонентах
// вызов `asyncData()` на всех соответствующих компонентах
Promise.all(matchedComponents.map(Component => {
if (Component.asyncData) {
return Component.asyncData({
Expand Down Expand Up @@ -179,7 +179,7 @@ if (window.__INITIAL_STATE__) {
// Добавляем хук маршрута для обработки asyncData.
// Выполняем его после разрешения первоначального маршрута,
// чтобы дважды не загружать данные, которые у нас уже есть.
// Используем router.beforeResolve(), чтобы все асинхронные компоненты были разрешены.
// Используем `router.beforeResolve()`, чтобы все асинхронные компоненты были разрешены.
router.beforeResolve((to, from, next) => {
const matched = router.getMatchedComponents(to)
const prevMatched = router.getMatchedComponents(from)
Expand Down
2 changes: 1 addition & 1 deletion ru/routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default context => {
const matchedComponents = router.getMatchedComponents()
// нет подходящих маршрутов, отклоняем с 404
if (!matchedComponents.length) {
reject({ code: 404 })
return reject({ code: 404 })
}

// Promise должен разрешиться экземпляром приложения, который будет отрендерен
Expand Down
2 changes: 1 addition & 1 deletion ru/structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ import { createApp } from './app'

const { app } = createApp()

// предполагается, что у корневого элемента в шаблоне App.vue есть элемент с id="app"
// предполагается, что у корневого элемента в шаблоне App.vue есть элемент с `id="app"`
app.$mount('#app')
```

Expand Down