Skip to content

Commit 38645bd

Browse files
author
cjfff
committed
feat: add the editor attrs props entry
1 parent 47824a2 commit 38645bd

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

demo/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<a
55
href="https://github.com/vue-styleguidist/vue-live/tree/master/demo"
66
>Check out the source for this demo</a>
7-
<h2>With imported components</h2>
8-
<VueLive :code="codeTemplate" :layout="CustomLayout" :components="registeredComponents" />
7+
<h2>With imported components and the code-editor lineNumers</h2>
8+
<VueLive :editorProps="{lineNumbers: true}" :code="codeTemplate" :layout="CustomLayout" :components="registeredComponents" />
99
<h2>Display Single File Components</h2>
1010
<VueLive :code="codeSfc" :layout="CustomLayout" />
1111
<h2>Pure JavaScript code</h2>

src/VueLive.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
:components="components"
1010
>
1111
<template v-slot:editor>
12-
<PrismEditor v-model="stableCode" @change="updatePreview" :language="prismLang" />
12+
<PrismEditor v-model="stableCode" @change="updatePreview" :language="prismLang" v-bind="editorProps" />
1313
</template>
1414
<template v-slot:preview>
1515
<Preview
@@ -100,6 +100,15 @@ export default {
100100
layoutProps: {
101101
type: Object,
102102
default: undefined
103+
},
104+
/**
105+
* they can change the vue-prism-editor props
106+
* there props will use to the vue-prism-editor example { lineNumbers }
107+
* more https://github.com/koca/vue-prism-editor
108+
*/
109+
editorProps: {
110+
type: Object,
111+
default: () => ({})
103112
}
104113
},
105114
data() {

0 commit comments

Comments
 (0)