Skip to content

Commit 13d277d

Browse files
author
Barthelemy Ledoux
committed
docs: update docs and example
1 parent 0f1c01c commit 13d277d

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

docs/.vuepress/config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ module.exports = {
1414
[
1515
require("../../index"),
1616
{
17-
layout: path.resolve(__dirname, "../custom-layout")
17+
// uncomment this to use a custom layout
18+
// layout: path.resolve(__dirname, "../custom-layout")
1819
}
1920
],
2021
[

docs/Install.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,19 @@ yarn add -D vuepress-plugin-live
1313

1414
In `.vuepress/config.js` add `["live"]` to the list of plugins
1515

16-
```js{3,4,5}
16+
```js{6,7,8,9,10,11,12}
17+
const path = require("path");
18+
1719
module.exports = {
1820
//...
1921
plugins: [
20-
["live"],
22+
[
23+
"live",
24+
{
25+
// optional: use layout to customize how the live editor is going to look like
26+
layout: path.resolve(__dirname, "./myCustomLayout.vue")
27+
}
28+
],
2129
[
2230
"@vuepress/register-components",
2331
{
@@ -32,3 +40,21 @@ module.exports = {
3240
]
3341
};
3442
```
43+
44+
### Options
45+
46+
#### `layout` (optional)
47+
48+
Absolute path to the layout vue-live is going to use.
49+
NOTA: the layout should have 2 slots named `preview` and `editor`.
50+
51+
Example layout (simplest):
52+
53+
```vue
54+
<template functional>
55+
<div>
56+
<slot name="preview"></slot>
57+
<slot name="editor"></slot>
58+
</div>
59+
</template>
60+
```

0 commit comments

Comments
 (0)