Terminal for vue3.
更新内容
- 💡 引入更多的
.d.ts
,对Vue3版本的TS开发更友好 #72 - 💡 调整组件安装的方式,引入更多配置项:本地存储名配置、每个实例记忆指令数配置等 #133
- 💡 移除 highlight 和 codemirror 默认配置方式 #132
- 🐛 修复中文、日文等组合输入法导致光标错位的问题 #130 #107 #108 #82
- 🐛 修复 focus 方法与 点击unfocus事件冲突的问题 #131
⚠️ 使用变更
main
中引入方法改为
import { createTerminal } from 'vue-web-terminal'
const app = createApp(App)
app.use(createTerminal())
app.mount('#app')
createTerminal
方法返回一个 VueWebTerminal
对象,全局配置均通过此对象进行设置,自定义主题配置也相应调整。
// Export css file content
import customTheme from '/your-style-dir/terminal-custom-theme1.css?inline';
import { createTerminal } from 'vue-web-terminal'
import type { VueWebTerminal } from 'vue-web-terminal'
const terminal: VueWebTerminal = createTerminal()
// default is 'terminal'
terminal.configStoreName('my-terminal-storage')
// default is 100
terminal.configMaxStoredCommandCountPerInstance(200)
// configure custom theme
terminal.configTheme('my-custom-theme', customTheme)
app.use(terminal)