Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
EditableTextarea.js
README.md

README.md

📝 EditableTextarea component

Renderless controlable component that updates the content of a textarea.

Demo screenshot

Demo

Installation

Install dependencies

npm install lodash -D

Copy/paste the code in a new EditableTextarea.js file.

Add it to any component that needs it.

import EditableTextarea from './path/to/EditableTextarea.js'

export default {
    components: { EditableTextarea },
}

Usage

<editable-textarea ref="editor">
    <textarea></textarea>
</editable-textarea>
// Wrap selection between '**'
this.$refs.editor.wrapWith('**')

// If selection is empty, adds **placeholder**
this.$refs.editor.wrapWith('**', 'placeholder')
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.