Coder Social home page Coder Social logo

xinlei3166 / vitepress-theme-demoblock Goto Github PK

View Code? Open in Web Editor NEW
193.0 1.0 50.0 416 KB

一个基于 Vitepress 的主题插件,它可以帮助你在编写文档的时候增加 Vue 示例。

Home Page: https://xinlei3166.github.io/vitepress-demo/

License: MIT License

JavaScript 14.76% Vue 42.40% CSS 2.89% TypeScript 39.95%

vitepress-theme-demoblock's Introduction

vitepress-theme-demoblock

这是 3.x 版本的文档,已经采用 TypeScriptESM 规范重写,2.x 版本文档请看v2文档,1.x 版本文档请看v1文档

简介

vitepress-theme-demoblock 是一个基于 Vitepress 的主题插件,它可以帮助你在编写文档的时候增加 Vue 示例,它的诞生初衷是为了降低编写组件文档时增加一些相关示例的难度。

使用 Vitepress 编写组件示例有以下不足之处:

  • 1.组件示例和示例代码本质上一样,却需要写两遍。
  • 2.Vitepress 无法渲染 Markdown 中的代码块。

查看Demo

提示

由于 Vitepress 版本更新频繁,目前支持版本为 1.0.1

Vue 支持版本为 3.4.21

安装

npm install -D vitepress-theme-demoblock
yarn add -D vitepress-theme-demoblock
pnpm add -D vitepress-theme-demoblock

快速上手

.vitepress/config.js 文件中使用 demoblockPlugindemoblockVitePlugin 插件

import { demoblockPlugin, demoblockVitePlugin } from 'vitepress-theme-demoblock'

markdown: {
  config: (md) => {
    md.use(demoblockPlugin)
  }
},
vite: {
  plugins: [demoblockVitePlugin()]
}

.vitepress/theme/index.js 中使用 vitepress-theme-demoblock 主题,并注册组件(包含主题中默认的组件)。

import DefaultTheme from 'vitepress/theme'
import 'vitepress-theme-demoblock/dist/theme/styles/index.css'
import { useComponents } from './useComponents'

export default {
  ...DefaultTheme,
  enhanceApp(ctx) {
    DefaultTheme.enhanceApp(ctx)
    useComponents(ctx.app)
  }
}

package.json 配置命令 scriptsvitepress-rc 用来注册组件(--docsDir 指定docs目录,--componentsDir 指定组件注册目录), 如果 .vitepress 目录和 package.json 同级,--docsDir 设置为 .

"scripts": {
  "docs:dev": "yarn run register:components && vitepress dev docs",
  "docs:build": "yarn run register:components && vitepress build docs",
  "docs:serve": "vitepress serve docs",
  "register:components": "vitepress-rc"
}

更多用法

.md 文件中 使用 stylescript,参考下面例子:

# code snippet ...

<style>
body { color: red; }
</style>

<script setup>
console.log('vitepress-theme-demoblock setup')
</script>

<script>
console.log('vitepress-theme-demoblock')
</script>

从 v2 迁移

v3 在使用插件时需要使用一个 Vite 插件。

vite: {
  plugins: [demoblockVitePlugin()]
}

v3 不支持 :::demo 后面的描述。

v2 :::demo 使用 `type``plain``round`  `circle` 属性来定义 Button 的样式。
v3 :::demo

因使用了 Vite 插件,Vue 组件经过 @vitejs/plugin-vue-jsx 插件编译, 很多用法已经支持, 例如:setup、jsx、tsx、css v-bind 等等。插件之前的一些属性和方法都已删除,目前只保留了 customClass 属性。

多语言

.vitepress/config.js 文件中增加 demoblock 字段来支持多语言 (默认中文)

themeConfig: {
  // demoblock locales
  demoblock: {
    'root': {
      'view-source': 'View source',
        'hide-source': 'Hide source',
        'edit-in-editor': 'Edit in Playground',
        'edit-on-github': 'Edit on GitHub',
        'copy-code': 'Copy code',
        'copy-success': 'Copy success',
        'copy-error': 'Copy error',
    },
    'zh': {
      'view-source': '查看源代码',
        'hide-source': '隐藏源代码',
        'edit-in-editor': '在 Playground 中编辑',
        'edit-on-github': '在 Github 中编辑',
        'copy-code': '复制代码',
        'copy-success': '复制成功',
        'copy-error': '复制失败'
    }
  }
}

自定义主题

通过配置 customClass 类名称,自定义 demoblock 样式

markdown: {
  config: (md) => {
    md.use(demoblockPlugin, {
      customClass: 'demoblock-custom'
    })
  }
}

通过重写 css-variables,自定义 demoblock 样式

:root {
  --demoblock-border: var(--vp-c-divider);
  --demoblock-control: #909399;
  --demoblock-control-bg: var(--vp-c-bg);
}

html.dark {
  --demoblock-control: #A3A6AD;
}

配置主题色

:root {
  --vp-c-brand-1: hsl(237, 100%, 70%);
  --vp-c-brand-2: hsl(237, 100%, 73%);
  --vp-c-brand-3: hsl(237, 100%, 70%);
  --vp-c-brand-soft: hsl(237, 100%, 70%, 14%);
}

使用第三方组件库

这个插件主要是针对自己的组件库来使用的,第三方的组件库直接导入使用即可(例如 element-plus )。

.vitepress/theme/index.js 文件中加入以下代码:

import DefaultTheme from 'vitepress/theme'
import 'element-plus/dist/index.css'
// import ElementPlus from 'element-plus'
// import cn from 'element-plus/lib/locale/lang/zh-cn'

export default {
  ...DefaultTheme,
  enhanceApp(ctx) {
    DefaultTheme.enhanceApp(ctx)
    // ctx.app.use(ElementPlus, { locale: cn })
  }
}

使用的时候,导入 element-plus 组件即可:

<template>
  <div class="card-wrap">
    <div class="card">{{ title }}</div>
    <el-button type="primary" @click="onClick">点击</el-button>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { ElMessage, ElButton } from 'element-plus'

const title = ref('vitepress-theme-demoblock')

const onClick = () => {
  ElMessage('消息')
}
</script>

也可以安装 unplugin-auto-importunplugin-vue-components ,配合 Vite 实现自动导入。

感谢

参考:element-ui, element-plus, vite-plugin-markdown-preview, nova-next

vitepress-theme-demoblock's People

Contributors

bywwcnll avatar jecyu avatar lizhen789 avatar saber-kurama avatar situc avatar xinlei3166 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

vitepress-theme-demoblock's Issues

引入 ant-design-vue 二次开发的组件库,组件库中的自定义 hooks 会报错

开发环境信息
macOS monterey 12.6
node 16.11.0
ant-design-vue 3.2.11

最小化重现
https://github.com/az031120103/test

复现步骤
git clone https://github.com/az031120103/test.git
npm run dev:ui
npm run dev:docs

实际发生
Form 组件的自定义 hooks useConfigInject 报错:

useConfigInject.js:71 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getPrefixCls')
at WEBPACK_DEFAULT_EXPORT (useConfigInject.js:71:1)
at setup (Form.js:118:43)
at callWithErrorHandling (runtime-core.esm-bundler.js:157:22)
at setupStatefulComponent (runtime-core.esm-bundler.js:7246:29)
at setupComponent (runtime-core.esm-bundler.js:7201:11)
at mountComponent (runtime-core.esm-bundler.js:5524:13)
at processComponent (runtime-core.esm-bundler.js:5499:17)
at patch (runtime-core.esm-bundler.js:5101:21)
at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js:5638:21)
at ReactiveEffect.run (reactivity.esm-bundler.js:187:25)

v-model:value 在生产环境下报错

在::: demo 中使用 <script setup>typescriptv-model:value 语法在 dev 模式运行时可正常使用,build 后部署会报错并无法使用。

报错内容
屏幕截图 2021-12-04 122741

在 ::: demo 中的用法
屏幕截图 2021-12-04 123220

组件中使用 emits('update:value',value) 抛出事件
屏幕截图 2021-12-04 123311

报错handleErrorFromBinding(ctx)

版本信息:
"vitepress": "1.0.0-alpha.28",
"vitepress-theme-demoblock": "2.0.2",
vue: 3.2.44

报错信息:

node:fs:585
handleErrorFromBinding(ctx);
^

Error: ENOENT: no such file or directory, open 'D:\projects\new-energy-base.prettierrc'
at Object.openSync (node:fs:585:3)
at Object.readFileSync (node:fs:453:35)
at format (file:///D:/projects/new-energy-base/node_modules/.pnpm/[email protected]_aukpcd4tcdec3kaf6goa6mffd4/node_modules/vitepress-theme-demoblock/dist/bin/help.mjs:9:34)
at registerComponents (file:///D:/projects/new-energy-base/node_modules/.pnpm/[email protected]_aukpcd4tcdec3kaf6goa6mffd4/node_modules/vitepress-theme-demoblock/dist/bin/vitepress-register-components.mjs:65:28)
at file:///D:/projects/new-energy-base/node_modules/.pnpm/[email protected]_aukpcd4tcdec3kaf6goa6mffd4/node_modules/vitepress-theme-demoblock/dist/bin/vitepress-register-components.mjs:68:1
at ModuleJob.run (node:internal/modules/esm/module_job:197:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:337:24) {
errno: -4058,
syscall: 'open',
code: 'ENOENT',
path: 'D:\projects\new-energy-base\.prettierrc'

看了下 bin/help.mjs文件,里面读取.prettierrc路径使用的是cwd, 所以读取的是我个人项目的根路径, 需要把vitepress-theme-demoblock根目录下的.prettierrc文件拷贝到个人项目根目录才行

md 分包

一个md太长了 能不能分成多个 合并进去 像酱紫类似的调用一下
`:::demo

button/basic

:::`

style标签 scoped 不生效

    "vitepress": "^1.0.0-alpha.8",
    "vitepress-theme-demoblock": "^1.4.2",

md文件中的style scoped不生效,比如下面的content会影响全局的content样式.

<template>
  <div class="content">内容</div>
</template>
<style scoped>
.content {
  height: 300px;
}
</style>

demo插槽使用的时候报错

按照示例去配置了一下,引用的自己的组件,如果不使用demo插槽,不会报错,用了插槽后会报[plugin:vitepress] Cannot read properties of undefined (reading 'sfcBlocks'),http请求也会报一个500,还有一个hashmap 404的错误

从1.0.7更新到1.0.7以上版本会报错,1.0.7不会

image

vue版本3.1.1
demo示例代码如下

:::demo 使用`left`,`right`来定义`Search`搜索图标位置, 默认`right`

      ```vue
      <template>
        <div>
          <d-search iconPosition="left" style="width: 200px"></d-search>
        </div>
      </template>
      ```
:::

d-search已经全局注册

setup模式,变量无法绑定到模板上

<template>
  {{ form.name }}
</template>
<script setup lang="ts">
import { reactive } from 'vue';
const form = reactive({
  name: 'test',
});
</script>

报错:form.md:15 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'name')
且:import { reactive } from 'vue';引入方式不支持双引号

[优化]使用vitepress-theme-demoblock之后,文档的启动变慢了(全量引入lodash-es导致的)

通过分析浏览器请求,发现在vitepress dev docs启动之后,浏览器请求多了非常多lodash-es的js文件(将近1000个),这会导致页面白屏时间长达数秒。

通过分析源码,发现components/Demo.vue文件中引入了lodash-es库的throttle方法,这种写法是全量引入lodash-es,所以会导致这个问题~

import { throttle } from 'lodash-es'

希望能优化下,改成按需加载lodash-es的方法。

在demoblock中使用setup setup语法糖报错

image

在:::demo中,只使用渲染组件没问题,但我想弄个响应式数据绑定到组件,那我就要定义一个ref,所以我需要在script中引入ref:import { ref } from 'vue',但现在会报错,说我有不期待的{,不知道这个怎么解决
Unexpected "{"
35 |
36 | const { defineComponent: _defineComponent } = Vue
37 | import { ref } from "vue";
| ^
38 |
39 |

:::demo 通过 options 修改

(加个文字,不然会渲染成格式块)```vue
<template>
  <w-qrcode :options="options"></w-qrcode>
</template>

<script setup lang="ts">
import { ref } from "vue";

const options = ref({
  color: {
    dark: "#00ff00",
  },
});
</script>
(加个文字,不然会渲染成格式块)```

:::

报错:The plugin "externalize-deps" was triggered by this import

可能是 docs 文件夹下有 vite.config.ts 文件导致的:

import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vite';

export default defineConfig(async () => {
  return {
    resolve: {
      alias: {
        '@': fileURLToPath(new URL('../src', import.meta.url)),
        '@public': fileURLToPath(new URL('../public', import.meta.url)),
      },
    },
    css: {
      postcss: '../configs/.postcssrc.yml',
    },
  };
});

运行 pnpm run docs:dev 后报错:

The plugin "externalize-deps" was triggered by this import
docs/.vitepress/config.ts:5:7:
      5 │ } from 'vitepress-theme-demoblock';

style不支持:deep深度选择器

在md中使用scss以及:deep深度选择器,实际上样式没有渲染,相同的代码到正常的页面是可以渲染的,是不是不支持:deep?

:::demo 支持 css 预编译器处理

首先非常感谢作者写了这个插件,挺好用。这里提一个建议。

  1. 测试示例:vitepress-theme-demoblock
    ,修改 docs/guide/index.md,使用 scss 方式编写样式无生效,期望生效。
<style lang="scss">
.card-wrap {
  text-align: center;
  background: red;
  .card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 500;
    color: var(--c-brand);
    background: #fff;
    border: 1px solid var(--c-brand);
    height: 80px;
    width: 600px;
    background: yellow;
  }
}
</style>
  1. 查看了源文件 utils、render,发现是 utils.js 的 stripStyle 函数处理正则表达式不会匹配 <style lang="scss"></style> 的字符串, 最终 render 的处理也只考虑 <style><style> 模式。不知道作者能否支持预编译器的适配。

无法解析jsx语法

直接在 MD文件里面写 Vue组件,Vue组件如果是带有jsx语法,会无法渲染,如:

<template #item="{ element }"> <a-card :title="element.name" :extra="<a>More</a>" :style="{ width: 200, height: 150 }"> Inner Card content </a-card> </template>

:extra参数无法渲染

不支持html代码的显示隐藏

不支持html代码的显示隐藏,希望能修复。我这样修复的,供参考。

<template>
  <div
    ref="demoBlock"
    :class="['demo-block', blockClass, customClass ? customClass : '', { hover }]"
    @mouseenter="hover = true"
    @mouseleave="hover = false"
  >
    <div ref="source" class="source"> <!-- <div class="source"> -->
      <slot />
    </div>
    <!-- ... -->
  </div>
</template>
<script>
// components/Demo.vue
// ...
export default {
  // ...
  setup(props) {
    // ...
    const onClickControl = () => {
      isExpanded.value = !isExpanded.value
      hover.value = isExpanded.value
      // add code
      const hasHtml = source.value.querySelector('.language-html')
      if (hasHtml) {
        if (isExpanded.value) hasHtml.style.display = 'block'
        else hasHtml.style.display = 'none'
      }
      // add end
    }
    // ...
    const source = ref(null) // add
    const highlight = ref(null)
    // ...
    return {
      // ...
      copyText,
      source, // add
      highlight,
      // ...
    }
  }
}
</script>
<!-- ... -->
<style>
.highlight div[class*='language-'] {
  margin: 0 !important;
}
/* add */
.source .language-html {
  display: none;
}
</style>

无法在MD文档 import 第三方库

<template>
  <xl-button>默认按钮</xl-button>
  <xl-button type="primary">主要按钮</xl-button>
  <xl-button type="success">成功按钮</xl-button>
  <xl-button type="info">信息按钮</xl-button>
  <xl-button type="warning">警告按钮</xl-button>
  <xl-button type="danger">危险按钮</xl-button>
</template>

<script>
 import { Button }  from 'ant-design-vue'
 </script>

报错:

[vite] Internal server error: Transform failed with 1 error: /vitepress-demo/docs/components/button.md:159:11: ERROR: Unexpected "{" Plugin: vite:vue File: /Users/bou/working/code/vue-pro/vitepress-demo/docs/components/button.md:159:11

markdown里面不支持引入其他模块吗

[plugin:vite:vue] Transform failed with 1 error:
/Users/yangzongliu/Downloads/promise-ui-master/docs/components/button/index.md:431:11: ERROR: Unexpected "{"

Unexpected "{"
429| }
430|
431| import { useData } from 'vitepress'
| ^
432| const { ref } = Vue

vue 可以引入,其他 模块 无法引入

希望style中也增加替换功能

在使用过程中需要导入一些组件中的css文件,但无法直接像导入js中那样通过替换来完成。

image
希望通过替换,把上面注释的替换成下面的真实路径。
就像下面js这样。
image
image

Illegal tag name. Use '&lt;' to print '<'. 文档内容解析报错

2:40:33 PM [vitepress] Internal server error: Illegal tag name. Use '<' to print '<'.
Plugin: vite:vue
File: /Users/vijay/Desktop/project/work/aries-vue3-components/packages/docs/components/aries-upload/index.md:21:4
19 | ```vue
20 |
21 |
| ^
22 |
23 |
at createCompilerError (/Users/vijay/Desktop/project/work/aries-vue3-components/node_modules/.pnpm/registry.npmmirror.com+@VUE[email protected]/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:19:19)
at emitError (/Users/vijay/Desktop/project/work/aries-vue3-components/node_modules/.pnpm/registry.npmmirror.com+@VUE[email protected]/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js:1594:29)

【以上是报错内容,v3.0.3版本,下面是我的文档内容:】
aries-upload/index.md

AriesUpload 上传

介绍

一个基于 Vue3 和 Ant Design Vue 的文件上传组件。提供上传前的钩子函数进行自定义校验,并可以自定义上传的服务器端点。上传过程中会有加载标识,上传完成后,文件名会以超链接的形式展示,点击链接可以打开文件。同时,组件还提供删除文件的功能,点击删除图标,会移除已上传的文件。

安装

npm install @aries/fusionui-aries-upload

在项目中使用

import { AriesUpload } from '@aries/fusionui-aries-upload'

基础用法

:::demo 默认使用 @aries/pro-oss 包中的 oss.uploadByConan(file)上传,从斑马sts接口 通过ali-oss-sdk上传

<template>
  <aries-upload v-model:value="url" />
</template>

<script setup lang="ts">
import { ref } from 'vue'

// const url = ref<string>("")
</script>

:::

自定义上传接口

:::demo 自定义上传接口

<template>
  <aries-upload v-model:value="url"  :action="uploadFile" />
</template>

<script lang="ts" setup>
import { ref } from 'vue'
// // import oss from '@aries/pro-oss'

// const url = ref("")

// const uploadFile = async (file) => {
//   // return await oss.uploadByConan(file)
// }

</script>

:::

[建议]展开/收起的图标显示不了

由于我们的组件库里面使用了自己的字体图标库,覆盖了demoblock这边的font-family,导致图标不显示,建议使用更通用的svg方式,demoblock这边其实只有几个图标没必要引入一套字体图标库进来。

image

2.0.2版本下载 install run doc:dev 报错启动不了

node:internal/errors:491
    ErrorCaptureStackTrace(err);
    ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'C:\workspace\study_pc\vitepress-theme-demoblock-2.0.2\dist\bin\vitepress-register-components.mjs' imported from C:\workspace\study_pc\vitepress-theme-demoblock-2.0.2\bin\vitepress-register-components.js
    at new NodeError (node:internal/errors:400:5)
    at finalizeResolution (node:internal/modules/esm/resolve:326:11)
    at moduleResolve (node:internal/modules/esm/resolve:945:10)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:842:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ESMLoader.import (node:internal/modules/esm/loader:525:22)
    at importModuleDynamically (node:internal/modules/esm/translators:110:35)
    at importModuleDynamicallyCallback (node:internal/process/esm_loader:35:14) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v18.13.0

md中引入其他组件报错

<template>
  <add-circle />
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import { AddCircle } from 'chintui-icons'
export default defineComponent({
  components: {
    AddCircle,
  },
})
</script>

import { AddCircle } from 'chintui-icons' 这行报错 error: Unexpected "{"

[bug]代码展开/收起的操作区未遮挡语言的问题

滚动页面滚动条,展开/收起的操作区会自动固定在底部这个功能体验非常好!点个赞!不过有一个小小的样式问题,就是语言(比如vue)这个文字现在没有被遮挡,露出在外面了,这个不太好~
image

[bug]: 引入element-plus中文包,build时报错

当运行build时(vitepress dev正常,把vitepress-theme-demoblock插件去除或不引入语言包正常),报如下错误:

/Users/wuqiulin/Documents/work/bsnl/bs-material/node_modules/element-plus/es/locale/lang/zh-cn.js:1
export default {
^^^^^^

SyntaxError: Unexpected token 'export'
   at Object.compileFunction (node:vm:352:18)
   at wrapSafe (node:internal/modules/cjs/loader:1025:15)
   at Module._compile (node:internal/modules/cjs/loader:1059:27)
   at Object.Module._extensions..js (node:internal/modules/cjs/loader:1147:10)
   at Module.load (node:internal/modules/cjs/loader:975:32)
   at Function.Module._load (node:internal/modules/cjs/loader:822:12)
   at Module.require (node:internal/modules/cjs/loader:999:19)
   at require (node:internal/modules/cjs/helpers:102:18)
   at Module.<anonymous> (/Users/wuqiulin/Documents/work/bsnl/bs-material/node_modules/vitepress/dist/client/app/temp/app.js:28:10)
   at Module._compile (node:internal/modules/cjs/loader:1095:14)
error Command failed with exit code 1.

代码

  • .vitepress/index.js
// components
import DefaultTheme from 'vitepress/theme'
import ElementPlus from 'element-plus'
import Demo from 'vitepress-theme-demoblock/components/Demo.vue'
import DemoBlock from 'vitepress-theme-demoblock/components/DemoBlock.vue'

// lang
import cn from 'element-plus/es/locale/lang/zh-cn'

// styles
import 'element-plus/dist/index.css'

export default {
  ...DefaultTheme,
  enhanceApp({ app }) {
    // register global components
    // app.component('MyGlobalComponent' /* ... */)

    app.component('Demo', Demo)
    app.component('DemoBlock', DemoBlock)
    app.use(ElementPlus, { locale: cn, size: 'small' })
  }
}
  • .vitepress/config.js 中md配置
const { demoBlockPlugin } = require('vitepress-theme-demoblock')
      md.use(demoBlockPlugin, {
        cssPreprocessor: 'scss',
        scriptImports: [
          "import * as ElementPlus from 'element-plus'"
        ],
        scriptReplaces: [
          {
            searchValue:
              /const ({ defineComponent as _defineComponent }) = Vue/g,
            replaceValue: 'const { defineComponent: _defineComponent } = Vue'
          },
          {
            searchValue: /import ({.*}) from 'element-plus'/g,
            replaceValue: (s, s1) => `const ${s1} = ElementPlus`
          }        ]
      })

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.