GithubHelp home page GithubHelp logo

pkapi / dt-react-monaco-editor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dtstack/dt-react-monaco-editor

0.0 1.0 0.0 8.73 MB

Monaco editor for React.

Home Page: https://dtstack.github.io/dt-react-monaco-editor/

JavaScript 10.18% Shell 0.56% TypeScript 88.45% SCSS 0.82%

dt-react-monaco-editor's Introduction

🏠 简述

基于开源 monaco-editor,根据业务使用场景进行二次封装,极大的简化了代码,使编辑器部分代码可控性更高。

⚡ 安装

使用 npm

    npm i dt-react-monaco-editor --save

📖 如何使用

在线预览

https://DTStack.github.io/dt-react-monaco-editor/

webpack 配置

    1、
        rule.push( {
            test: /\.worker\.[jt]s$/,
            use: { loader: 'worker-loader' }
        })
    2、
        node = {
            fs: 'empty',
            module: "empty",
        };
    3、
        plugins.push(new webpack.ContextReplacementPlugin(
            /monaco-editor(\\|\/)esm(\\|\/)vs(\\|\/)editor(\\|\/)common(\\|\/)services/,
            __dirname
        ))

直接引入

    import { Editor } from 'dt-react-monaco-editor'
    <Editor
        value='// 初始注释'
        language="dtsql"
        options={{ readOnly: false }}
    />

🔧 本地开发

clone & npm install

    git clone 
    npm install

启动本地服务器

    npm run storybook

静态服务部署构建

    npm run build-storybook

📘 相关资料

dt-react-monaco-editor's People

Contributors

andyzjy avatar profbramble avatar wewoor avatar

Watchers

 avatar

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.