Comments (10)
对于ts支持的问题已经在 #18 回复了。vite配置支持compile with browser side就可以,如果是compile with server side无法通过编译,因为插件内部用到了浏览器window
相关接口,与Nuxt类似,在 #3 回复了Nuxt的处理办法。
另外,我是服务端Coder对前端用的ts玩的不是很溜,如果你有意改造ts可以自建分支改造然后提交PR。
from vue-web-terminal.
对于ts支持的问题已经在 #18 回复了。vite配置支持compile with browser side就可以,如果是compile with server side无法通过编译,因为插件内部用到了浏览器
window
相关接口,与Nuxt类似,在 #3 回复了Nuxt的处理办法。另外,我是服务端Coder对前端用的ts玩的不是很溜,如果你有意改造ts可以自建分支改造然后提交PR。
ok, 这周看看有没有空开搞
热更新导致白屏的问题我猜可以通过onUnmounted时候销毁来实现, 我看看是不是这个问题
from vue-web-terminal.
unmounted勾子也加了的,在vue3分支 /src/Terminal.js#L365
from vue-web-terminal.
unmounted勾子也加了的,在vue3分支 /src/Terminal.js#L365
噢噢, 还想问下,codemirror和highlightjs通过use时候传option实现, 是有啥特殊考虑吗,能不能通过props传入
from vue-web-terminal.
开了一个重构todo
#20
from vue-web-terminal.
噢噢, 还想问下,codemirror和highlightjs通过use时候传option实现, 是有啥特殊考虑吗,能不能通过props传入
当时是为了通过打包,因为有未定义的标签打包会出问题,不知道vue-cli能从哪里可以忽略掉这个检查,才这样做的,如果有其他更好的办法解决当然props更好一点
from vue-web-terminal.
当时是为了通过打包,因为有未定义的标签打包会出问题,不知道vue-cli能从哪里可以忽略掉这个检查,才这样做的,如果有其他更好的办法解决当然props更好一点
是不是就让外部通过slot实现就好了, vue-web-terminal内部不依赖highlightjs和codemirror两个组件, 这样也灵活一点
类似这样:
使用插槽插入模板(vue3):
<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在线体验那个代码在哪里呢, 想试下这两天改的有没有问题(改的还挺多的, 不过尽量保持了功能不变)
from 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();
}
}
from vue-web-terminal.
当时是为了通过打包,因为有未定义的标签打包会出问题,不知道vue-cli能从哪里可以忽略掉这个检查,才这样做的,如果有其他更好的办法解决当然props更好一点
是不是就让外部通过slot实现就好了, vue-web-terminal内部不依赖highlightjs和codemirror两个组件, 这样也灵活一点 类似这样: 使用插槽插入模板(vue3):
还想问下vue-web-terminal在线体验那个代码在哪里呢, 想试下这两天改的有没有问题(改的还挺多的, 不过尽量保持了功能不变)
用slot也可以其实,不在插件内部依赖更方便一点,vue3分支你先这样改吧,vue2分支我空了改一下。在线体验代码在demo分支,不过是vue2版本的,你可以建一个demo-vue3分支测试。
from vue-web-terminal.
tabKeyHandler这个事件和其他的实现方式不一样,如果有tabKeyHandler就不执行fillCmd了,是什么原因呢
是因为tabKeyHandler的作用就是替代插件自带的命令提示功能,结合命令提示的slot让使用者自己实现命令提示,比如:自定义实现按下tab键之后从服务端拿取命令名自动填充
from vue-web-terminal.
Related Issues (20)
- No way to customize autocomplete HOT 3
- clone后编译会直接报错 HOT 1
- 关于api设计的问题 HOT 2
- head support dbclick for fullscreen
- support Clipboard by right click
- export other function component
- Support rename HOT 4
- Multi instance dragging will only take effect for one instance HOT 2
- Support ANSI code filter HOT 2
- Remove the hump event name and change it to a dash name HOT 3
- vue3.0里使用报错 HOT 4
- 使用界面出现undefined,并且无法显示文字 HOT 12
- Make callbacks asynchronous HOT 3
- 窗口无法固定 HOT 3
- onKeydown事件在使用Flash时,失焦后失效 HOT 1
- 增加beforePush回调函数 HOT 3
- Show Header false not working. HOT 2
- ASCII码160 (NBSP)分割的命令行无法正常解析的问题 HOT 1
- 在type等于code模式下,回显带有xml标签信息时,xml标签没有正常显示,审查元素后发现xml标签被渲染成了dom元素。希望可以在code模式下正常显示xml标签信息 HOT 1
- 动态修改窗口大小 HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-web-terminal.