File tree Expand file tree Collapse file tree 3 files changed +13
-29
lines changed Expand file tree Collapse file tree 3 files changed +13
-29
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ The simplest way to render components is as a VueJs template:
1414
1515``` vue
1616<template>
17- <VueLive :code="`<date-picker />`" :components="{ DatePicker }">
17+ <VueLive :code="`<date-picker />`" :components="{ DatePicker }" @error="(e) => handleError(e)" >
1818</template>
1919
2020<script>
@@ -35,34 +35,6 @@ export default {
3535
3636Check out the [ demo] ( http://vue-live.surge.sh ) for alternative syntaxes to write your showcases.
3737
38- ## Configuration
39-
40- ``` js
41- module .exports = {
42- // ...
43- plugins: [
44- [
45- ' live' ,
46- {
47- // to use a custom layout for your vue components
48- layout: path .resolve (__dirname , " ../custom-layout" )
49- }
50- ],
51- [
52- " @vuepress/register-components" ,
53- {
54- components: [
55- {
56- name: " vue-slider" ,
57- path: path .resolve (__dirname , " ../vue-slider" )
58- }
59- ]
60- }
61- ]
62- ]
63- }
64- ```
65-
6638## How to contribute
6739
6840``` sh
Original file line number Diff line number Diff line change @@ -97,6 +97,12 @@ export default {
9797 });
9898 },
9999 handleError (e ) {
100+ /**
101+ * Emitted every time the component rendered throws an error
102+ * Catches runtime and compilation errors
103+ * @event
104+ * @property { Error } - the error thrown
105+ */
100106 this .$emit (" error" , e);
101107 if (e .constructor === VueLiveParseTemplateError) {
102108 e .message = ` Cannot parse template expression: ${ e .expression } \n\n ${ e .message } ` ;
Original file line number Diff line number Diff line change 1919 />
2020 </template >
2121 <template v-slot :preview >
22+ <!--
23+ * Emitted every time the component rendered throws an error
24+ * Catches runtime and compilation errors
25+ * @event error
26+ * @property { Error } - the error thrown
27+ -->
2228 <Preview
2329 :key =" codeKey"
2430 :code =" model"
You can’t perform that action at this time.
0 commit comments