Skip to content

Commit d4ff0db

Browse files
committed
docs: build a better demo
1 parent 2945b39 commit d4ff0db

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vue-live.surge.sh

demo/App.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
<template>
22
<main style="text-align:center;">
33
<h1>Vue Live renders vue code directly in the browser</h1>
4+
<h2>With imported components</h2>
5+
<VueLive :code="`<date-picker />`" :layout="CustomLayout" :components="registeredComponents"/>
46
<h2>Display Single File Components</h2>
57
<VueLive :code="codeSfc" :layout="CustomLayout"/>
6-
<h2>Try using templates</h2>
7-
<VueLive :code="codeTemplate" :layout="CustomLayout"/>
88
<h2>Pure JavaScript code</h2>
99
<VueLive :code="codeJs" :layout="CustomLayout"/>
10-
<h2>With imported components</h2>
11-
<VueLive :code="`<date-picker />`" :layout="CustomLayout" :components="registeredComponents"/>
1210
</main>
1311
</template>
1412
<script>

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"license": "MIT",
55
"scripts": {
66
"serve": "vue-cli-service serve",
7-
"build": "vue-cli-service build --target lib --entry ./src/index.js",
7+
"build": "cross-env LIB_MAKING=true vue-cli-service build --target lib --entry ./src/index.js",
8+
"build:demo": "vue-cli-service build",
89
"lint": "vue-cli-service lint",
910
"test:unit": "vue-cli-service test:unit"
1011
},
@@ -32,6 +33,7 @@
3233
"babel-core": "7.0.0-bridge.0",
3334
"babel-eslint": "^10.0.1",
3435
"babel-jest": "^23.6.0",
36+
"cross-env": "^5.2.0",
3537
"eslint": "^5.16.0",
3638
"eslint-plugin-vue": "^5.0.0",
3739
"raw-loader": "^2.0.0",

vue.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = {
66
.add("./demo/main.js");
77

88
config.resolve.alias.set("vue$", "vue/dist/vue.esm.js");
9-
if (process.env.NODE_ENV === "production") {
9+
if (process.env.NODE_ENV === "production" && process.env.LIB_MAKING) {
1010
config.externals(
1111
[
1212
"acorn",

yarn.lock

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2675,6 +2675,14 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
26752675
safe-buffer "^5.0.1"
26762676
sha.js "^2.4.8"
26772677

2678+
cross-env@^5.2.0:
2679+
version "5.2.0"
2680+
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.2.0.tgz#6ecd4c015d5773e614039ee529076669b9d126f2"
2681+
integrity sha512-jtdNFfFW1hB7sMhr/H6rW1Z45LFqyI431m3qU6bFXcQ3Eh7LtBuG3h74o7ohHZ3crrRkkqHlo4jYHFPcjroANg==
2682+
dependencies:
2683+
cross-spawn "^6.0.5"
2684+
is-windows "^1.0.0"
2685+
26782686
cross-spawn@^5.0.1, cross-spawn@^5.1.0:
26792687
version "5.1.0"
26802688
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
@@ -5179,7 +5187,7 @@ is-whitespace@^0.3.0:
51795187
resolved "https://registry.yarnpkg.com/is-whitespace/-/is-whitespace-0.3.0.tgz#1639ecb1be036aec69a54cbb401cfbed7114ab7f"
51805188
integrity sha1-Fjnssb4DauxppUy7QBz77XEUq38=
51815189

5182-
is-windows@^1.0.2:
5190+
is-windows@^1.0.0, is-windows@^1.0.2:
51835191
version "1.0.2"
51845192
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
51855193
integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==

0 commit comments

Comments
 (0)