Skip to content

Commit 2945b39

Browse files
committed
docs: enhance demo
1 parent 1da6dbd commit 2945b39

File tree

6 files changed

+26
-11
lines changed

6 files changed

+26
-11
lines changed

demo/App.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
<VueLive :code="codeTemplate" :layout="CustomLayout"/>
88
<h2>Pure JavaScript code</h2>
99
<VueLive :code="codeJs" :layout="CustomLayout"/>
10-
<h2>and even a weird hybrid format</h2>
10+
<h2>With imported components</h2>
11+
<VueLive :code="`<date-picker />`" :layout="CustomLayout" :components="registeredComponents"/>
1112
</main>
1213
</template>
1314
<script>
1415
import VueLive from "../src/VueLive";
1516
import CustomLayout from "./CustomLayout";
17+
import DatePicker from "vuejs-datepicker";
1618
// eslint-disable-next-line import/no-webpack-loader-syntax
1719
import codeSfc from "!!raw-loader!./assets/Button.vue";
1820
import codeJs from "!!raw-loader!./assets/input.js";
@@ -23,6 +25,7 @@ export default {
2325
components: { VueLive },
2426
data() {
2527
return {
28+
registeredComponents: { DatePicker },
2629
codeSfc,
2730
codeTemplate,
2831
codeJs,

demo/CustomLayout.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,18 @@
1515
margin: 30px auto;
1616
border-radius: 10px;
1717
border: 1px solid #ccc;
18-
overflow: hidden;
1918
}
2019
2120
.preview-code > div {
2221
width: 100%;
2322
}
23+
24+
.preview-code > div:first-child {
25+
border-radius: 10px 0 0 10px;
26+
overflow: hidden;
27+
}
28+
29+
.preview-code > div:last-child {
30+
padding: 30px;
31+
}
2432
</style>

demo/assets/PureTemplate.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<div style="text-align:center;">
2-
<h1>pure template</h1>
3-
<h2>pure template</h2>
4-
<h3>pure template</h3>
5-
<h4>pure template</h4>
6-
</div>
1+
<h1>pure template</h1>
2+
<h2>pure template</h2>
3+
<h3>pure template</h3>
4+
<h4>pure template</h4>

demo/assets/input.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
new Vue({
22
template: `
3-
<div style="padding:30px">
3+
<div>
44
<input v-model="value" type="checkbox" :name="cname">
55
<h1 v-if="value">I am checked</h1>
6-
</div>`,
6+
</div>`,
77
data() {
88
return {
99
cname: "myCheck",

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
"babel-jest": "^23.6.0",
3535
"eslint": "^5.16.0",
3636
"eslint-plugin-vue": "^5.0.0",
37-
"raw-loader": "^2.0.0"
37+
"raw-loader": "^2.0.0",
38+
"vuejs-datepicker": "^1.5.4"
3839
},
3940
"eslintConfig": {
4041
"root": true,

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9484,6 +9484,11 @@ vue@^2.6.10:
94849484
resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.10.tgz#a72b1a42a4d82a721ea438d1b6bf55e66195c637"
94859485
integrity sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ==
94869486

9487+
vuejs-datepicker@^1.5.4:
9488+
version "1.5.4"
9489+
resolved "https://registry.yarnpkg.com/vuejs-datepicker/-/vuejs-datepicker-1.5.4.tgz#dacdb5eb5ef44342c67cb59b93a0d5da9c1809b3"
9490+
integrity sha512-AVzgu3pb/fF/Sj3qu8YPnp7KhtsXkm8TSnBEcyYsWb1bMJr5FdPCxuIzISgw5kq0It7HkVJUGXQ4CiCwq9hhww==
9491+
94879492
w3c-hr-time@^1.0.1:
94889493
version "1.0.1"
94899494
resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045"

0 commit comments

Comments
 (0)