Gathering detailed insights and metrics for @dorjie/vue-code-view
Gathering detailed insights and metrics for @dorjie/vue-code-view
Gathering detailed insights and metrics for @dorjie/vue-code-view
Gathering detailed insights and metrics for @dorjie/vue-code-view
🖖A Vue 2 SFC REPL component just like `@vue/repl` .
npm install @dorjie/vue-code-view
Typescript
Module System
Node Version
NPM Version
56.8
Supply Chain
97
Quality
75
Maintenance
50
Vulnerability
98.6
License
TypeScript (48.92%)
Vue (31.01%)
CSS (10.51%)
HTML (9.57%)
Total Downloads
475
Last Day
3
Last Week
8
Last Month
27
Last Year
142
136 Stars
90 Commits
35 Forks
1 Watching
8 Branches
3 Contributors
Latest Version
0.5.2
Package Id
@dorjie/vue-code-view@0.5.2
Unpacked Size
14.54 MB
Size
6.83 MB
File Count
19
NPM Version
6.12.0
Node Version
12.13.0
Publised On
24 Jul 2023
Cumulative downloads
Total Downloads
Last day
0%
3
Compared to previous day
Last week
60%
8
Compared to previous week
Last month
200%
27
Compared to previous month
Last year
-57.4%
142
Compared to previous year
1
46
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.
demo address: https://andurils.github.io/vue-code-view/#/demo
codesandbox
example: vue-code-view-example
<style>
parsing and rendering.Markdown
file example rendering1npm i vue-code-view 2# or 3yarn add vue-code-view
Using vue cli
requires configuration in the vue.config.js
file, which supports the use of Vue builds that include the runtime compiler.
1module.exports = { 2 runtimeCompiler: true, 3 // or 4 chainWebpack: (config) => { 5 config.resolve.alias 6 .set("vue$", "vue/dist/vue.esm.js"); 7 }, 8};
Components are introduced in the entry file main.js
, and there is no need to manually introduce styles.
1import Vue from "vue"; 2import App from "./App.vue"; 3import CodeView from "vue-code-view"; 4 5Vue.use(CodeView); 6 7new Vue({ 8 router, 9 store, 10 render: (h) => h(App), 11}).$mount("#app");
Property | Description | Type | Default | Version |
---|---|---|---|---|
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+ |
Detailed changes for each release are documented in the release notes.
Inspired by shared links.
VCV is licensed under the terms of the MIT License.
Copyright (c) 2021-present Anduril
No vulnerabilities found.
No security vulnerabilities found.