Skip to content

[RU] Translation update #1795

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 15 commits into from
Oct 10, 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
2 changes: 1 addition & 1 deletion docs/ru/advanced/navigation-guards.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ router.beforeEach((to, from, next) => {

- **`next(false)`**: отмена перехода. Если URL был изменён (вручную пользователем, или кнопкой "назад"), он будет сброшен на соответствующий пути `from`.

- **`next('/')` или `next({ path: '/' })`**: редирект на другой путь. Текущий переход будет отменён, и процесс начнётся заново для нового пути.
- **`next('/')` или `next({ path: '/' })`**: перенаправление на другой путь. Текущий переход будет отменён, и процесс начнётся заново для нового пути. Вы можете передать любой объект местоположения в `next`, который позволяет вам указывать опции такие как `replace: true`, `name: 'home'` и любой другой параметр используемый во [входном параметре `to` компонента `router-link`](../api/router-link.md) или [`router.push`](../api/router-instance.md#methods)

- **`next(error)`**: (добавлено в версии 2.4.0+) если аргумент, переданный `next` является экземпляром `Error`, навигация будет прервана и ошибка будет передана в коллбек, зарегистрированный через `router.onError()`.

Expand Down
28 changes: 23 additions & 5 deletions docs/ru/essentials/history-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,24 @@ location / {
#### Node.js

```js
const http = require("http")
const fs = require("fs")
const http = require('http')
const fs = require('fs')
const httpPort = 80

http.createServer((req, res) => {
fs.readFile("index.htm", "utf-8", (err, content) => {
fs.readFile('index.htm', 'utf-8', (err, content) => {
if (err) {
console.log('Невозможно открыть файл "index.htm".')
}

res.writeHead(200, {
"Content-Type": "text/html; charset=utf-8"
'Content-Type': 'text/html; charset=utf-8'
})

res.end(content)
})
}).listen(httpPort, () => {
console.log("Сервер запущен на: http://localhost:%s", httpPort)
console.log('Сервер запущен на: http://localhost:%s', httpPort)
})
```

Expand Down Expand Up @@ -102,6 +102,24 @@ rewrite {
}
```

#### Хостинг Firebase

Добавьте в файл `firebase.json`:

```
{
"hosting": {
"public": "dist",
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
```

## Предостережение

При таком подходе возникает одно неприятное последствие: сервер больше не будет выдавать ошибки 404, так как обслуживание всех путей отдаётся на откуп клиентскому роутингу. Частично эту проблему можно решить, указав путь по умолчанию во Vue-router:
Expand Down
2 changes: 2 additions & 0 deletions docs/ru/essentials/redirect-and-alias.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ const router = new VueRouter({
})
```

Обратите внимание, что [сторожевые хуки](../advanced/navigation-guards.md) не применяются на маршруте, который служит для перенаправления, только на его цель. В приведённом ниже примере добавление хуков `beforeEnter` или `beforeLeave` на маршрут `/a` не будет иметь никакого эффекта.

Для демонстрации более сложных возможностей, обратите внимание на [этот пример](https://github.com/vuejs/vue-router/blob/dev/examples/redirect/app.js).

### Псевдонимы
Expand Down