Coder Social home page Coder Social logo

Comments (12)

littlepoi avatar littlepoi commented on August 21, 2024 1

好的,十分感谢!(╹▽╹)

from vue-web-terminal.

littlepoi avatar littlepoi commented on August 21, 2024 1

项目中使用slot和依赖中使用slot是不太一样的,依赖使用slot引入到你项目中是经过我这边编译的,我编译时的vue-compiler规则不一样引入时的代码也会不一样,而你本地的slot是经过本地compiler编译的,自己使用上是ok的,但如果引入到别的项目是不确定的。出现这个问题的原因就是不同版本的compiler编出来的代码不一样造成。@littlepoi

好的,谢谢。因为项目限制我不能随意升级vue的版本,我再想想别的办法。

from vue-web-terminal.

littlepoi avatar littlepoi commented on August 21, 2024

我使用的是2.1.3版本,我是将demo中的LocalTerminal.vue文件拿出来使用了,但是界面显示就是这样的。

from vue-web-terminal.

tzfun avatar tzfun commented on August 21, 2024

你用2.1.6还有这个问题吗?

from vue-web-terminal.

littlepoi avatar littlepoi commented on August 21, 2024

image
image
也有这个问题,目前不太明白是哪里的问题。我单独用这个组件是正常的,和项目一起跑就会这样。

from vue-web-terminal.

tzfun avatar tzfun commented on August 21, 2024

在线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.

littlepoi avatar littlepoi commented on August 21, 2024

package.json.txt
我有试过用demo的那个项目,把我的package.json复制过去,除了@vue/cli-plugin-babel这个包要使用4.5.0版本之外,其他的都没有问题,组件也可以正常使用。就是在项目里会出现这种问题。

from vue-web-terminal.

littlepoi avatar littlepoi commented on August 21, 2024

image
然后,我按照git上的文档创建demo,只有2.0.8版本可以正常使用。之后的版本都会出现这个undefined和文字无法显示的问题。

from vue-web-terminal.

tzfun avatar tzfun commented on August 21, 2024

初步猜测是 slot 组件的支持兼容问题,我先排查一下

from vue-web-terminal.

tzfun avatar tzfun commented on August 21, 2024

原因找到了,是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.

littlepoi avatar littlepoi commented on August 21, 2024

你好,我觉得还是有点问题
image
image
image
image
我现在使用的版本是2.1.0

from vue-web-terminal.

tzfun avatar tzfun commented on August 21, 2024

项目中使用slot和依赖中使用slot是不太一样的,依赖使用slot引入到你项目中是经过我这边编译的,我编译时的vue-compiler规则不一样引入时的代码也会不一样,而你本地的slot是经过本地compiler编译的,自己使用上是ok的,但如果引入到别的项目是不确定的。出现这个问题的原因就是不同版本的compiler编出来的代码不一样造成。@littlepoi

from vue-web-terminal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.