vue.js - 将项目从 Vue2 升级到 Vue3 的最佳方式

标签 vue.js npm vuejs2 vuejs3

我想将我的项目升级到vue3

这是一个symfony应用程序,在前端使用vue作为独立组件

我以前从未做过重大升级,不太确定最好的程序是什么?

  • 我应该卸载 vue2 然后安装 vue3 吗?

  • 我应该只安装 vue3 吗?

  • 我应该直接修改我的 package.json 吗?

    "dependencies": {
      "axios": "^0.20.0",
      "elm-pep": "^1.0.6",
      "moment": "^2.27.0",
      "postcss-loader": "^3.0.0",
      "raw-loader": "^4.0.1",
      "svg-url-loader": "^6.0.0",
      "toastr": "^2.1.4",
      "vue": "^2.6.12",
      "vue-date-pick": "^1.4.1",
      "vue-material-design-icons": "^4.9.0",
      "vue2-editor": "^2.10.2",
      "vuelayers": "^0.12.0-dev.9"
    }
    

最佳答案

根据 migration guide

INFO
We are still working on a dedicated Migration Build of Vue 3 with Vue 2 compatible behavior and runtime warnings of incompatible usage. If you are planning to migrate a non-trivial Vue 2 app, we strongly recommend waiting for the Migration Build for a smoother experience.

现在很难从 Vue 2 手动迁移大型应用程序,因为大多数库还不支持 Vue 3,例如 vuelayers。迁移应考虑库/组件的升级。

关于vue.js - 将项目从 Vue2 升级到 Vue3 的最佳方式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65041318/

相关文章:

vue.js - 从 v-select 获取项目文本

node.js - 为什么我必须使用 "npm start x"启动某些脚本,而其他脚本仅使用 "npm x"启动?

vue.js - 在 vuejs 中扩展事件监听器

javascript - Node.js - 首先对从字母开始且长度较长的字符串进行排序,然后是从小到大的数字开始的字符串

javascript - 如何在 VueJS 中添加自定义排序?

css - 发布的 vue 组件没有 css (NPM)

node.js - VS Code 中安装错误 - eslint

angularjs - 当我运行 "npm start"时正在运行哪些 js 文件?

vue.js - 简单的 Vue.js 计算属性说明

php - 如何将url参数传递给Vuejs