Code Monkey home page Code Monkey logo

vue2-ace-bind's Introduction

vue2-ace-bind

A Vue2 component for binding the ace editor

Install

NPM

npm install vue2-ace-bind --save-dev

YARN

yarn add vue2-ace-bind -D

How to use

Import the component firstly

import aceEditor from "vue2-ace-bind";

Then import the language mode and theme which you want to use

import javascript from "brace/mode/javascript"
import sh from "brace/mode/sh"
import xcode from "brace/theme/xcode"
import terminal from "brace/theme/terminal"

The default config mode is bash and theme is terminal

Ace-editor's mode and theme list is here:

Register the component.

components: {
  editor
}

Use the component in template

<editor :content="variable"></editor>

The content is required,other props have the following defaults:

lang: sh
theme: terminal
height: 100%
width: 100%
options: {}

if you want to configure the ace-editor,just �define options in data.

<editor :content="variable" :options="options" ></editor>
option: {
    showLineNumbers: false,
    showFoldWidgets: true,
    showGutter: false,
    displayIndentGuides: false,
    showPrintMargin: false
    ....
}

The official doc is here: Configuring ACE.

vue2-ace-bind's People

Contributors

leozhang2018 avatar qiushui123 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.