All Projects → andurils → vue-code-view

andurils / vue-code-view

Licence: MIT license
A Vue 2 component like Vue SFC REPL `@vue/repl` : u can edit, run and preview the code effect display in real time on the web page.

Programming Languages

javascript
184084 projects - #8 most used programming language
Vue
7211 projects
CSS
56736 projects
SCSS
7915 projects

Projects that are alternatives of or similar to vue-code-view

CodeINN
CodeINN is an instant code editor 📃, that makes programming and development easier. Practice quickly and directly from your web browser, without any setup needed. CodeINN gives the perfect environment to developers technologists, coders computers, and geeks 🤓 to do more with their tech.
Stars: ✭ 39 (-41.79%)
Mutual labels:  playground, code-editor
aik
Frontend Playground
Stars: ✭ 43 (-35.82%)
Mutual labels:  playground, repl
Vue Codemirror
⌨️ @codemirror component for @vuejs
Stars: ✭ 2,115 (+3056.72%)
Mutual labels:  code-editor, vue2
Inim
Interactive Nim Shell / REPL / Playground
Stars: ✭ 407 (+507.46%)
Mutual labels:  playground, repl
Codemagic
Codemagic.gr is a powerful online code editor for web development
Stars: ✭ 94 (+40.3%)
Mutual labels:  playground, code-editor
Gistlyn
Run Roslyn Gists
Stars: ✭ 75 (+11.94%)
Mutual labels:  playground, repl
go-playground
GNU/Emacs mode that setup local Go playground for code snippets like play.golang.org or even better :)
Stars: ✭ 64 (-4.48%)
Mutual labels:  playground, repl
Widgetsplayground
前端组件管理系统
Stars: ✭ 150 (+123.88%)
Mutual labels:  playground, vue2
vue-template-babel-compiler
Enable Optional Chaining(?.), Nullish Coalescing(??) and many new ES syntax for Vue.js SFC based on Babel
Stars: ✭ 106 (+58.21%)
Mutual labels:  vue2, sfc
code editor unity
A code editor for MY-BASIC, powered by the Unity3D engine. With this you may create your own Code Editor, Debugger and IDE for different scripting languages.
Stars: ✭ 13 (-80.6%)
Mutual labels:  code-editor
tdesign-vue-starter
A starter-kit for TDesign Vue UI components.
Stars: ✭ 199 (+197.01%)
Mutual labels:  vue2
lavas-cnode
A PWA for cnodejs.org written by Baidu-Lavas.
Stars: ✭ 13 (-80.6%)
Mutual labels:  vue2
element-schema-form
A schema-based element-ui form component for Vue2.x.
Stars: ✭ 31 (-53.73%)
Mutual labels:  vue2
GravityTagCloudView
A tag cloud view with gravity.
Stars: ✭ 22 (-67.16%)
Mutual labels:  playground
macos-snippets
Snip is a lightweight snippets manager app for macOS
Stars: ✭ 238 (+255.22%)
Mutual labels:  code-editor
SFC-foundations
SFC bringing change to the society. Drop a ⭐
Stars: ✭ 111 (+65.67%)
Mutual labels:  sfc
goplay
The Go Playground (https://play.golang.org/) client
Stars: ✭ 75 (+11.94%)
Mutual labels:  playground
JShellStandalone
Provides a standalone version of the JShell REPL. Anything needed to run JShell independently is contained, so there is no need to install the full JDK. A minimal Java runtime is embedded and compressed using the jlink tool.
Stars: ✭ 36 (-46.27%)
Mutual labels:  repl
huginn
Programming language with no quirks, so simple every child can master it.
Stars: ✭ 41 (-38.81%)
Mutual labels:  repl
element-ui-demo
A element-ui admin base on vue2
Stars: ✭ 18 (-73.13%)
Mutual labels:  vue2

Vue Code View(VCV)

Build Status GitHub license npm npm bundle size npm

English | 简体中文

A lightweight code interaction component based on vue 2.x, which can edit, run and preview the code effect display in real time on the web page.

When reading docs that contain a lot of code, many project docs implement a render representation of the sample code via the markdown loader, but it is static. When we want to debug code, we generally need to open the local IDE or open online editor websites such as codepen, codesandbox, and it is also subject to whether the computer has a development environment installed or whether the network connection is smooth.

So can there be such a component that can support editing code in the page, edit, run and preview the code effect display in real time in the web page?

Special thanks to the component react-code-view, based on which the vue version of the component was written! Using this component, you can edit the running code and preview the effect in real time by using the multi-sample code in the vue page or the markdown document.

Online Demo

示例

demo address: https://andurils.github.io/vue-code-view/#/demo

codesandbox example: vue-code-view-example

Features

  • 💻 Code can be edited online and preview the effect in real time.
  • 🎨 Support sample code highlighting, configure themes.
  • 🌈 Support <style> parsing and rendering.
  • 📑 Support Markdown file example rendering

📦 Install

npm i vue-code-view
# or
yarn add vue-code-view

🔨 Configure

Using vue cli requires configuration in the vue.config.js file, which supports the use of Vue builds that include the runtime compiler.

module.exports = {
  runtimeCompiler: true,
  // or
  chainWebpack: (config) => { 
    config.resolve.alias
      .set("vue$", "vue/dist/vue.esm.js");
  },
}; 

💻 Usage

Components are introduced in the entry file main.js, and there is no need to manually introduce styles.

import Vue from "vue";
import App from "./App.vue";
import CodeView from "vue-code-view";

Vue.use(CodeView);

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");

API

Attributes

参数 说明 类型 默认值 版本
themeMode code editor theme mode,default light `` | dark ``
showCode show the code editor , only layout value is top takes effect boolean false
source source code string -
layout render view layout top | right | left top 0.4.0

Changelog

Detailed changes for each release are documented in the release notes.

💡 Inspired

links.

License

VCV is licensed under the terms of the MIT License

Copyright (c) 2021-present Anduril

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].