Skip to content

Commit d7d1186

Browse files
committed
docs: add jsx example
1 parent 8ffd8c4 commit d7d1186

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

demo/App.vue

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
href="https://github.com/vue-styleguidist/vue-live/tree/master/demo"
66
>Check out the source for this demo</a>
77
<h2>With imported components</h2>
8-
<VueLive :code="codeTemplate" :layout="CustomLayout" :components="registeredComponents"/>
8+
<VueLive :code="codeTemplate" :layout="CustomLayout" :components="registeredComponents" />
99
<h2>Display Single File Components</h2>
10-
<VueLive :code="codeSfc" :layout="CustomLayout"/>
10+
<VueLive :code="codeSfc" :layout="CustomLayout" />
1111
<h2>Pure JavaScript code</h2>
12-
<VueLive :code="codeJs" :layout="CustomLayout"/>
12+
<VueLive :code="codeJs" :layout="CustomLayout" />
1313
<h2>Use the requires prop to make libraries and packages available in the browser</h2>
14-
<VueLive :code="codeChicago" :layout="CustomLayout" :requires="chicagoRequires"/>
14+
<VueLive :code="codeChicago" :layout="CustomLayout" :requires="chicagoRequires" />
1515
<h2>With a custom update delay of 2 seconds</h2>
1616
<VueLive
1717
:code="`<input type='button' value='update me' />`"
@@ -20,14 +20,20 @@
2020
/>
2121
<h2>Default Layout</h2>
2222
<div style="width:950px; max-width:95vw; margin:20px auto;">
23-
<VueLive :code="`<input type='button' value='I am Groot' />`"/>
23+
<VueLive :code="`<input type='button' value='I am Groot' />`" />
2424
</div>
2525
<h2>Custom Layout</h2>
2626
<div>
27-
<p>Attributes available for custom layout: <code>code: String</code>, <code>language: String</code></p>
28-
<VueLive :code="`<input type='button' value='I am Groot' />`" :layout="CustomLayout"/>
27+
<p>
28+
Attributes available for custom layout:
29+
<code>code: String</code>,
30+
<code>language: String</code>
31+
</p>
32+
<VueLive :code="`<input type='button' value='I am Groot' />`" :layout="CustomLayout" />
2933
</div>
30-
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
34+
<h2>It even supports jsx</h2>
35+
<VueLive :code="realjsx" :layout="CustomLayout" :jsx="true" />
36+
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet" />
3137
</main>
3238
</template>
3339
<script>
@@ -36,6 +42,7 @@ import CustomLayout from "./CustomLayout";
3642
import DatePicker from "vuejs-datepicker";
3743
import codeSfc from "!!raw-loader!./assets/Button.vue";
3844
import codeJs from "!!raw-loader!./assets/input.js";
45+
import realjsx from "!!raw-loader!./assets/real.jsx";
3946
import codeTemplate from "!!raw-loader!./assets/PureTemplate.html";
4047
import codeChicago from "!!raw-loader!./assets/Chicago.jsx";
4148
import all from "./assets/chicagoNeighbourhoods";
@@ -54,7 +61,8 @@ export default {
5461
codeJs,
5562
codeChicago,
5663
CustomLayout,
57-
chicagoRequires: { "./chicagoNeighbourhoods": all }
64+
chicagoRequires: { "./chicagoNeighbourhoods": all },
65+
realjsx
5866
};
5967
}
6068
};

demo/assets/real.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const args = {
2+
type: "button",
3+
value: "update me"
4+
};
5+
6+
export default {
7+
render() {
8+
return <input {...args} />;
9+
}
10+
};

0 commit comments

Comments
 (0)