简体   繁体   English

我不能在我的 vue.js 项目中使用类型化的 js

[英]I can't use typed js in my vue js project

When I try to call typed in my main.js, the router and the typed are down:当我尝试在我的 main.js 中调用 typed 时,路由器和 typed 都关闭了:

import { createApp } from 'vue'
import App from './App.vue'
import router from '@/router'
import VueTypedJs from 'vue-typed-js'

const app = createApp(App);

app.use(router);
app.use(VueTypedJs);
app.mount('#app');

Do you know why?你知道为什么吗?

I try different way to call vue typed js but any can resolve this issue !我尝试了不同的方式来调用 vue 类型的 js,但任何方式都可以解决这个问题!

For sure I install before: npm install --save vue-typed-js and I use it ( that from the doc, exemple ):我之前肯定安装过:npm install --save vue-typed-js 并且我使用了它(来自文档,例如):

<vue-typed-js :strings="['First text', 'Second Text']">
  <h1 class="typing"></h1>
</vue-typed-js>

The last contribution on vue-typed-js has been more than 3.5 years ago (April 2019).上一次对vue-typed-js的贡献已经是 3.5 多年前(2019 年 4 月)了。

Which means it only works with Vue2.这意味着它只适用于 Vue2。 It might be possible to make it work with Vue3, but you'll likely need to write the integration plugin yourself.它可能与 Vue3 一起使用,但您可能需要自己编写集成插件


Note: I'm guessing someone will take the time to write a Vue3 compatible version at some point.注意:我猜有人会在某个时候花时间编写 Vue3 兼容版本。 Please let me know, so I can keep the answer relevant.请让我知道,这样我才能保持答案的相关性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM