Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shershen08/vue-terminal-ui
🖥Terminal UI emulator VueJS component
https://github.com/shershen08/vue-terminal-ui
Last synced: about 2 months ago
JSON representation
🖥Terminal UI emulator VueJS component
- Host: GitHub
- URL: https://github.com/shershen08/vue-terminal-ui
- Owner: shershen08
- Created: 2018-05-29T10:50:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-02T08:08:08.000Z (about 5 years ago)
- Last Synced: 2024-04-24T14:58:45.395Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 203 KB
- Stars: 55
- Watchers: 3
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vuejs terminal UI emulator
Vuejs component for displaying UI element that acts as console terminal. Actual terminal logic code forked from [Ptty](https://github.com/pachanka/Ptty).
## Demo/sandbox available here:
[![Edit Vue Template](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/4xxxkznk74)## Install
`npm i vue-terminal-ui --save`
## Usage
```
// import plugin
import VueTerminal from 'vue-terminal-ui'// add to components section
components{
VueTerminal
},
// add method to call on command is typed
methods: {
onCliCommand(data, resolve, reject){
// typed command is available in data.text
// don't forget to resolve or reject the Promise
setTimeout(()=> {
resolve('')
}, 300)
}
},
// use in template
```## Properties & Events
*props*
- `intro` (String) - intro text when terminal starts;
- `console-sign`(String) - starting symbol for each command line, eg. `my-folder/master $` or just `>>`;
- `allow-arbitrary`(Boolean) - allow type any command in addition to basic ones, then `@command` will be called;
- `height`(String) - UI block height, eg. `500px`;*event*
- `@command` - callback function to call with command; accepts text, and resolve/reject callbacks
## ToDo
- get rid of jQuery dependancy
## License
MIT