@@ -10,28 +10,36 @@ A lightweight playground for live editing VueJs code in the browser
1010
1111## Usage
1212
13+ Install the dependency:
14+
15+ ` npm install --save vue-live `
16+
1317The simplest way to render components is as a VueJs template:
1418
1519``` vue
1620<template>
17- <VueLive :code="`<date-picker />`" :components="{ DatePicker }" @error="(e) => handleError(e)">
21+ <VueLive
22+ :code="`<date-picker />`"
23+ :components="{ DatePicker }"
24+ @error="(e) => handleError(e)"
25+ />
1826</template>
1927
2028<script>
2129import { VueLive } from "vue-live";
2230// import the css separately for easier SSR
23- import "vue-live/lib/vue-live.esm.css"
24- import DatePicker from "vuejs-datepicker"
31+ import "vue-live/lib/vue-live.esm.css";
32+ import DatePicker from "vuejs-datepicker";
2533
2634export default {
27- components: { VueLive },
28- data(){
29- return {
30- // make DatePicker available in template
31- DatePicker
32- }
33- }
34- }
35+ components: { VueLive },
36+ data() {
37+ return {
38+ // make DatePicker available in template
39+ DatePicker,
40+ };
41+ },
42+ };
3543</script>
3644```
3745
@@ -57,22 +65,20 @@ module.exports = {
5765};
5866```
5967
60- in [ vue.config.js] ( https://cli.vuejs.org/guide/webpack.html )
61-
68+ In a [ Vue CLI] ( https://cli.vuejs.org/ ) project use [ vue.config.js] ( https://cli.vuejs.org/guide/webpack.html ) .
6269
6370``` js
6471module .exports = {
65- configureWebpack: {
66- resolve: {
67- alias: {
68- vue$: " vue/dist/vue.esm-browser .js" ,
69- }
70- }
71- }
72- }
72+ configureWebpack: {
73+ resolve: {
74+ alias: {
75+ vue$: " vue/dist/vue.esm.js" ,
76+ },
77+ },
78+ },
79+ };
7380```
7481
75-
7682in [ nuxt.config.js] ( https://nuxtjs.org/faq/extend-webpack/ )
7783
7884``` js
0 commit comments