Comments (12)
好的,十分感谢!(╹▽╹)
from vue-web-terminal.
项目中使用slot和依赖中使用slot是不太一样的,依赖使用slot引入到你项目中是经过我这边编译的,我编译时的vue-compiler规则不一样引入时的代码也会不一样,而你本地的slot是经过本地compiler编译的,自己使用上是ok的,但如果引入到别的项目是不确定的。出现这个问题的原因就是不同版本的compiler编出来的代码不一样造成。@littlepoi
好的,谢谢。因为项目限制我不能随意升级vue的版本,我再想想别的办法。
from vue-web-terminal.
我使用的是2.1.3版本,我是将demo中的LocalTerminal.vue文件拿出来使用了,但是界面显示就是这样的。
from vue-web-terminal.
你用2.1.6
还有这个问题吗?
from vue-web-terminal.
也有这个问题,目前不太明白是哪里的问题。我单独用这个组件是正常的,和项目一起跑就会这样。
from vue-web-terminal.
在线demohttps://tzfun.github.io/vue-web-terminal/用的就是这一份代码,版本是2.1.3,刚刚在sandbox创建了一个2.1.3版本的空工程 https://codesandbox.io/s/holy-monad-fzn3h4,也没有复现你的问题,怀疑是你所在环境影响到了,可以提供一下你的依赖列表吗
from vue-web-terminal.
package.json.txt
我有试过用demo的那个项目,把我的package.json复制过去,除了@vue/cli-plugin-babel这个包要使用4.5.0版本之外,其他的都没有问题,组件也可以正常使用。就是在项目里会出现这种问题。
from vue-web-terminal.
然后,我按照git上的文档创建demo,只有2.0.8版本可以正常使用。之后的版本都会出现这个undefined和文字无法显示的问题。
from vue-web-terminal.
初步猜测是 slot 组件的支持兼容问题,我先排查一下
from vue-web-terminal.
原因找到了,是Vue官方在2.6.13
版本对vue的slotRender修改导致,详情见:vuejs/vue#12153
本terminal插件是在2.6.14
环境编译的,如果你的项目中使用低于此版本的 vue和 vue-template-compiler 就会出现slot位置为undefined的问题。
解决办法:将项目中的 vue 和 vue-template-compiler 版本提升至 2.6.13 以上,比如2.6.14
from vue-web-terminal.
from vue-web-terminal.
项目中使用slot和依赖中使用slot是不太一样的,依赖使用slot引入到你项目中是经过我这边编译的,我编译时的vue-compiler规则不一样引入时的代码也会不一样,而你本地的slot是经过本地compiler编译的,自己使用上是ok的,但如果引入到别的项目是不确定的。出现这个问题的原因就是不同版本的compiler编出来的代码不一样造成。@littlepoi
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
- 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.