Skip to content

Make intro more newbie-friendly #241

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Next Next commit
Update README.md
Clarified how to run example and expected output
  • Loading branch information
realtebo authored Apr 19, 2019
commit 541b70dd45dd510f0e02805860971f5517a08c1d
16 changes: 16 additions & 0 deletions docs/guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ We will be using NPM throughout the guide, but feel free to use [Yarn](https://y

## Rendering a Vue Instance

Save the following code in a `.js` file, for example `render1.js`

``` js
// Step 1: Create a Vue instance
const Vue = require('vue')
Expand All @@ -41,6 +43,20 @@ renderer.renderToString(app).then(html => {
})
```

To run the code, from the prompt console of your OS execute

``` bash
node .\render1.js
```

You should see the following output. Row is duplicated if you keep both `re.dered.renderToString(..)`, otherwise you see only one row of output.

```
<div data-server-rendered="true">Hello World</div>
<div data-server-rendered="true">Hello World</div>
```


## Integrating with a Server

It is pretty straightforward when used inside a Node.js server, for example [Express](https://expressjs.com/):
Expand Down