Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue3-ace-editor

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue3-ace-editor

Like vue2-ace-editor but more functional and supports Vue 3

  • 2.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.9K
increased by3.58%
Maintainers
1
Weekly downloads
 
Created
Source

vue3-ace-editor

npm

A packaging of ace. Inspired by vue2-ace-editor, but supports Vue 3

How to use

  1. Install

    yarn add vue3-ace-editor
    
  2. Register it in components of Vue options

    import { VAceEditor } from 'vue3-ace-editor';
    
    export default {
        data,
        methods,
        ...
        components: {
            VAceEditor,
        },
    }
    
  3. Use the component in template

    <v-ace-editor
        v-model:value="content"
        @init="editorInit"
        lang="html"
        theme="chrome"
        style="height: 300px" />
    

    prop v-model:value is required. <v-ace-editor> has no height by default, its height must be specified manually

    prop lang, theme is same as ace-editor's doc

Deferences with vue2-ace-editor

  1. This component uses ace-builds directly, instead of the outdated wrapper brace
  2. DOM size changes are detected automatically using ResizeObserver, thus no width / height props needed.
  3. For easier usage, more props / events added / emitted.
    1. Prop readonly: This Boolean attribute indicates that the user cannot modify the value of the control.
    2. Prop placeholder: A hint to the user of what can be entered in the control.
    3. Prop wrap: Indicates whether the control wraps text
    4. Prop printMargin: A short hand of showPrintMargin and printMarginColumn
    5. All ace events emitted. Docs can be found here: https://ace.c9.io/#api=editor&nav=api
    6. Some commonly used methods focus, blur, selectAll provided as shortcuts.

Breaking change

Using of ace-builds/webpack-resolver is removed due to bug https://github.com/CarterLi/vue3-ace-editor/issues/3. You MUST import theme and mode yourself. eg.

import 'ace-builds/src-noconflict/mode-text';
import 'ace-builds/src-noconflict/theme-chrome';

Find all supported themes and modes in node_modules/ace-builds/src-noconflict

LICENSE

MIT

FAQs

Package last updated on 30 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc