-
Notifications
You must be signed in to change notification settings - Fork 35
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
api/nuxt has been translated #47
base: translation-ru
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,46 @@ | ||
--- | ||
title: "API: Nuxt(options)" | ||
description: You can use Nuxt.js programmatically to use it as a middleware giving you the freedom of creating your own server for rendering your web applications. | ||
title: "API: Nuxt(опции)" | ||
description: Вы можете программно использовать Nuxt.js, чтобы использовать его как middleware. Это даёт вам свободу создания своего собственного сервера для рендеринга ваших веб-приложений. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. программно использовать чтобы использовать. Перефразировать как-то надо There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. для отрисовки — вместо рендеринга пишем |
||
--- | ||
|
||
# Using Nuxt.js Programmatically | ||
# Программное использование Nuxt.js | ||
|
||
You might want to use your own server with your middleware and your API. That's why you can use Nuxt.js programmatically. | ||
Возможно, вы захотите использовать свой собственный сервер с вамиши middleware и вашим API. Вот почему вы можете программно использовать Nuxt.js . | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Поэтому вы сможете использовать программно |
||
|
||
You can require Nuxt.js like this: | ||
Вы можете импортировать Nuxt.js следующим образом: | ||
|
||
```js | ||
const { Nuxt, Builder } = require('nuxt') | ||
``` | ||
|
||
## Nuxt Constructor | ||
## Nuxt конструктор | ||
|
||
Чтобы узнать о возможных опциях для Nuxt.js, см. раздел конфигурации. | ||
|
||
To see the list of options to give to Nuxt.js, see the configuration section. | ||
|
||
```js | ||
// Require `Nuxt` And `Builder` modules | ||
// Импорт `Nuxt` и `Builder` модулей | ||
const { Nuxt, Builder } = require('nuxt') | ||
|
||
// Require Nuxt config | ||
// Импорт Nuxt опций | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. скорее импорт конфигурации nuxt |
||
const config = require('./nuxt.config.js') | ||
|
||
// Create a new Nuxt instance | ||
// Создать новый экземпляр Nuxt | ||
const nuxt = new Nuxt(config) | ||
|
||
// Enable live build & reloading on dev | ||
// Включить live сборку и перезагрузить в режим разработки | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. с режимом горячей перезагрузки модулей |
||
if (nuxt.options.dev) { | ||
new Builder(nuxt).build() | ||
} | ||
|
||
// We can use `nuxt.render(req, res)` or `nuxt.renderRoute(route, context)` | ||
// Мы можем использовать `nuxt.render(req, res)` или `nuxt.renderRoute(route, context)` | ||
``` | ||
|
||
You can take a look at the [nuxt-express](https://github.com/nuxt/express) and [adonuxt](https://github.com/nuxt/adonuxt) starters to get started quickly. | ||
Вы можете взглянуть на [nuxt-express](https://github.com/nuxt/express) и [adonuxt](https://github.com/nuxt/adonuxt) стартовые шаблоны для быстрого старта. | ||
|
||
### Debug logs | ||
### Debug логи | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Логи для отладки |
||
|
||
If you want to display nuxt.js logs, you can add to the top of your file: | ||
Если вы хотите отображать nuxt.js логи, то вы можете добавить наверх вашего файла следующее выражение: | ||
|
||
```js | ||
process.env.DEBUG = 'nuxt:*' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это точно в скобках не должно переводиться