File tree Expand file tree Collapse file tree 2 files changed +30
-3
lines changed Expand file tree Collapse file tree 2 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ module.exports = {
14
14
[
15
15
require ( "../../index" ) ,
16
16
{
17
- layout : path . resolve ( __dirname , "../custom-layout" )
17
+ // uncomment this to use a custom layout
18
+ // layout: path.resolve(__dirname, "../custom-layout")
18
19
}
19
20
] ,
20
21
[
Original file line number Diff line number Diff line change @@ -13,11 +13,19 @@ yarn add -D vuepress-plugin-live
13
13
14
14
In ` .vuepress/config.js ` add ` ["live"] ` to the list of plugins
15
15
16
- ``` js{3,4,5}
16
+ ``` js{6,7,8,9,10,11,12}
17
+ const path = require("path");
18
+
17
19
module.exports = {
18
20
//...
19
21
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
+ ],
21
29
[
22
30
"@vuepress/register-components",
23
31
{
@@ -32,3 +40,21 @@ module.exports = {
32
40
]
33
41
};
34
42
```
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
+ ```
You can’t perform that action at this time.
0 commit comments