1. vue-demonstration
Vue-based element docs's demo code style component, asily add examples to your vue project to show your code.
vue-demonstration
Package: vue-demonstration
Created by: savoygu
Last modified: Tue, 28 Jun 2022 19:19:56 GMT
Version: 1.0.4
License: MIT
Downloads: 19
Repository: https://github.com/savoygu/vue-demonstration

Install

npm install vue-demonstration
yarn add vue-demonstration

vue-demonstration

Vue-based element docs's demo code style component, easily add examples to your Vue project to show your code.

Install

 npm install vue-demonstration -S

Quick Start

  import Vue from 'vue'
 import VueDemo from 'vue-demonstration'
 
 Vue.component('vue-demonstration', VueDemo)

For more information, please refer to vue-demonstration in our documentation.

Usage

<template>
  <vue-demonstration
    title="标题"
    description="标题描述"
    anchor="锚点"
    tag="标题标签" <!-- h2 / h3-->
    :highlight="sourcecode">
    <template slot="source">
      <div>your code</div> <!-- 源代码-->
    </template>
    <template slot="explanation">
      代码描述
    </template>
  </vue-demonstration>
</template>
<script>
  const sourcecode = `<div>your code</div>`
  export default {
     data () {
        return {
          sourcecode
        }
     }
  }
</script>

If you want to add some javascript code to sourcecode,you need to put the sourcecode into a js file.

Build Setup

 # install dependencies
npm install

# serve with hot reload at localhost:8080
npm run demo:dev

# build for demo with minification
npm run demo:build

# build for gh-pages with minification
npm run demo:prepublish

# build for production with minification
npm run build

# generate gh-pages
npm run deploy

LICENSE

MIT

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin