@indielayer/vue-live-demo

A component for live editing Vue single file components in the browser with real time preview.
7,142
Install
npm install @indielayer/vue-live-demo
Latest Version:1.1.2
Vue:2
Last Updated:Feb 11, 2021
Links: npm
Maintainer: jpntex
Indielayer

Building digital products and empowering online companies


Vue Live Demo - SFC Editor

npm (scoped with tag) npm

Vue Live Demo used on Indielayer

DEMO - https://indielayer.github.io/vue-live-demo/

Getting Started

Do you want to add to your own projects? There you go:

  1. Add this package to your dependencies
$ npm i @indielayer/vue-live-demo
# or
$ yarn add @indielayer/vue-live-demo
  1. Usage:
<template>
  <div style="padding-top: 100px">

    <vue-live-demo
      :code="code"
      :show-code="showCode"
      :components="components"
    />

  </div>
</template>

<script>
import VueLiveDemo from '@indielayer/vue-live-demo'

// Components you wish to add on the demo
// import RandomComponent from './RandomComponent.vue'

export default {
  components: {
    VueLiveDemo
  },
  data() {
    return {
      // components you wish to add on the demo
      components: {
        // RandomComponent,
      },
      code: `<template><div>hello</div></template>`,
      showCode: true
    }
  }
}
</script>

Missing features - TODO

  • import other scripts in the Single File Component

License

MIT license - Indielayer

Related Packages

@codemirror/lang-vue

Vue template support for the CodeMirror code editor

71,371,417 29
@brezel/vue-inbrowser-compiler

compile vue single file components right in your browser

7,076
vue-cm

CodeMirror component for Vue.js

969 45
vue-inbrowser-compiler-independent-utils

the part of vue-inbrowser-compiler-utils that contains no vue dependency

33,578,628 2,491
vue-inbrowser-compiler-utils

use this with vue-inbrowser-compiler to allow jsx compilation

1,428,302 2,491

Version History

Version Released Vue License
1.1.2 ^2.6.11
1.1.1 ^2.6.11
1.1.0 ^2.6.11
1.0.0 ^2.6.11