-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
希望支持ts #19
Comments
unmounted勾子也加了的,在vue3分支 /src/Terminal.js#L365 |
噢噢, 还想问下,codemirror和highlightjs通过use时候传option实现, 是有啥特殊考虑吗,能不能通过props传入 |
开了一个重构todo |
当时是为了通过打包,因为有未定义的标签打包会出问题,不知道vue-cli能从哪里可以忽略掉这个检查,才这样做的,如果有其他更好的办法解决当然props更好一点 |
是不是就让外部通过slot实现就好了, vue-web-terminal内部不依赖highlightjs和codemirror两个组件, 这样也灵活一点 <Terminal>
<template #code="message">
<highlightjs ref="highlightjs" autodetect :code="message.content" />
</template>
</Terminal> <Terminal>
<template #code="message">
<codemirror :value="message.content" :options="yourCodemirrorOptions" />
</template>
</Terminal> 还想问下vue-web-terminal在线体验那个代码在哪里呢, 想试下这两天改的有没有问题(改的还挺多的, 不过尽量保持了功能不变) |
tabKeyHandler这个事件和其他的实现方式不一样,如果有tabKeyHandler就不执行fillCmd了,是什么原因呢 if (isActive()) {
if (cursorConf.show) {
if (event.key.toLowerCase() === "tab") {
if (!props.tabKeyHandler) {
fillCmd();
} else {
props.tabKeyHandler(event);
}
event.preventDefault();
} else if (document.activeElement !== cmdInput.value) {
cmdInput.value?.focus();
}
} |
用slot也可以其实,不在插件内部依赖更方便一点,vue3分支你先这样改吧,vue2分支我空了改一下。在线体验代码在demo分支,不过是vue2版本的,你可以建一个demo-vue3分支测试。 |
是因为tabKeyHandler的作用就是替代插件自带的命令提示功能,结合命令提示的slot让使用者自己实现命令提示,比如:自定义实现按下tab键之后从服务端拿取命令名自动填充 |
这么好的项目居然是后端大佬搞的。 |
面相需求编程 😄 ,TS确实玩的不是很熟,等过段时间看看能不能用TS改造一下,之前有个朋友做了一部分但后来不知什么原因搁置了,如果有兴趣一起参与建设的话,欢迎加我微信交流:beifeng-tz |
TS改造进度在 #57 中更新 |
Feature or optimization description
希望支持ts; 另外vue3分支的是不是可以切到vite
Applicable scene
The text was updated successfully, but these errors were encountered: