You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`@vue/server-renderer`and`vue`must have matching versions.
19
-
-`@vue/server-renderer`relies on some Node.js native modules and therefore can only be used in Node.js. We may provide a simpler build that can be run in other JavaScript runtimes in the future.
Unlike a client-only Vue application, which is created using `createApp`, an SSR application needs to be created using `createSSRApp`:
23
+
`createApp` で作ったクライアント専用の Vue アプリケーションとは異なり、 SSR アプリケーションは `createSSRApp` で作る必要があります:
24
24
25
25
```js
26
26
const { createSSRApp } =require('vue')
@@ -35,7 +35,7 @@ const app = createSSRApp({
35
35
})
36
36
```
37
37
38
-
Now, we can use the `renderToString`function to render our application instance to a string. This function returns a Promise which resolves to the rendered HTML.
38
+
それでは、 `renderToString`関数を使い、アプリケーションのインスタンスを文字列にレンダリングしてみます。この関数は、レンダリングされた HTML に解決される Promise を返します。
39
39
40
40
```js{2,13}
41
41
const { createSSRApp } = require('vue')
@@ -53,9 +53,9 @@ const app = createSSRApp({
53
53
const appContent = await renderToString(app)
54
54
```
55
55
56
-
## Integrating with a Server
56
+
## サーバとの連携
57
57
58
-
To run an application, in this example we will use [Express](https://expressjs.com/):
Now, when running this Node.js script, we can see a static HTML page on `localhost:8080`. However, this code is not _hydrated_: Vue hasn't yet taken over the static HTML sent by the server to turn it into dynamic DOM that can react to client-side data changes. This will be covered in the [Client Side Hydration](hydration.html)section.
99
+
この Node.js スクリプトを実行すると、 `localhost:8080` で静的な HTML ページが表示されます。しかし、このコードは _Hydrate_ ではありません: Vue はまだサーバから送られてきた静的な HTML を引き継いでいて、クライアント側のデータ変更に反応できる動的な DOM に変えていません。これについては [クライアントサイド Hydration](hydration.html)セクションで説明します。
0 commit comments