npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

vue-editor-ace

v1.0.0

Published

Ace Editor Of Vue.

Downloads

136

Readme

vue-editor-ace

中文

install

use npm or yarn install package.

npm install vue-editor-ace --save

How to use

  1. import and sign it in components.

    ...
    import Vue from 'vue';
    import AceEditor from 'vue-editor-ace';
    ...
    Vue.use(AceEditor);
    ...
  2. use component.

    <AceEditor v-model="context" :config="config" />
       
    ...
    data: {
        context: 'print("Hello World")',
        config: {
            lang: 'dart',
        }
    }

    prop v-model and config is required. other config option check this
    tips: AceEditor default is height: 100% width:100%.you can add wrapper limit component size.

    <div style="height:100px;width: 100px;">
        <AceEditor v-model="context" :config="config" />
    </div>
  3. get ACE instance or use methods.

    // add ref to tag attribute.
    <AceEditor ref="myAce" ... />
       
    // component
    let component = this.$refs.myAce;
    // ace instance
    let ace = this.$refs.myAce.$ace;

    methods list

  4. Event

     <AceEditor 
        @init="handleInit"
        @firstInit="handleFirstInit"
        @change="handleChange"  
        ... />
     ...
     {
        handleInit(ace) {
           // very initialization
           // do something.
           // you can require custom extension. 
           // or ....
        },
        handleFirstInit(ace) {
           // the component first initialization.
           // you can do something ...
        },
        handleChange(ace) {
            // run in value change.
            // you can get value in ace.getValue()
            // ...
        }
     }

Config Options

    const defaultConfig = {
        // Language
        lang: 'javascript',
        // Theme
        theme: 'monokai',
        // only read.
        readOnly: false,
        // enable Autocompletion
        autoCompletion: false,
        showPrintMargin: false,
        useWrapMode: true,
        useSoftTabs: true,
        tabSize: 4,
        // enable vim keyboard
        useVim: false,
        // enable emmet.
        useEmmet: false,
        // enable beautify code.
        useBeautifyCode: false,
        // set cursor position.
        cursorPosition: {row: 0, column: 0},
        // set page position (scroll).
        pagePosition: 0
    };

Methods

Prompt : let ace = this.$refs['myAce'];

reload

for safety. component does not actively reset the editor.
you can use reload method .

ace.reload();
setCursorPosition

change current cursor and page position.

let cfg = {
    cursorPosition : { row: 0 , col : 0 },
    pagePosition : 0
}

ace.setCursorPosition(cfg);
getCursorPosition

get current cursor and page Position.

let result = ace.getCursorPosition();
addCommand

add command.
tip: command in safari is not working

ace.addCommand({
    name: 'Save-file',
    bindKey: {
        win: 'Ctrl-S',
        mac: 'Command-S'
    },
    exec: (editor) => {
        // do something...
    },
    readOnly: true // false if this command should not apply in readOnly mode
});
removeCommand

remove exists command

ace.removeCommand('Save-file');

beautifyCode

reformat current editor code.

ace.beautifyCode();