-
Notifications
You must be signed in to change notification settings - Fork 88
vue2 → vue3
Guide
Vue 2 to 3
vue-router 3 to 4
vuex 3 to 4
vuex to pinia
@vue/test-utils 1 to 2
Vue CLI 4 to 5
webpack 4 to 5
web-dev-server 3 to 4
Element 2.x to Element Plus
Vuetify upgrade-guide
Not required for vue3 support
- javascript to TypeScript
- OptionsAPI to CompositionAPI
Vue Composition APIの使い方を解説!Vue2との違いと書き換え - webpack 4 to 5
-
sass-loader
Change 11.0.0 or later(minimum supported webpack version is 5)
-
sass-loader
- Vue CLI 4 to 5
Migrate from v4 - Vue CLI to vite
Vue CLI から Vite へ移行した時の記録
vue-cliをviteに移行する
Vue-CliからViteへ移行する
Vue CLIで作成したプロジェクトをViteに置き換える
Vue CLI で作成した Vuetify アプリを Vite / Vitest に移行する
Vue 2 から 3 へ移行しようとしたらいちばん大変なのが Vuetify 2 から 3 への移行だった話 Vue2.7→Vue3へ移行
polyfill plugin
https://www.npmjs.com/package/node-polyfill-webpack-plugin
Vue 3 - How to add Polyfills to ChainWebpack
npm i node-polyfill-webpack-plugin
migration tools
gogo code
@originjs/vue-codemod
webpack-to-vite
Vue Options to Composition API Converter
miyaoka/vue-composition-converter
fazulk/vue-composition-converter
kalimahapps/vue-options-to-compositio
Bring <script setup> to Vue 2
memo
-
vue
Change 3.x
Vue 3 Migration Guide
MedPeerをVue 3にアップデートしました
Vue3 に向けて取り組み続けていること
Vue3にアップグレードしてフロントエンドを改善した話
Vue3&TypeScript導入してよかった点悪かった点
VUE2からVUE3への移行-FILTERの廃止を修正
Viteに移行した話とVue-demiでVue2と3両対応のコンポーネントを作った話
Vue 2の開発を出来るだけVue 3に近づけるための基本テクニック
【Vue 3】Vue 2との違いについて
スタートアップCTOがVue3とVue2の違い・Vue3の注目機能を分かりやすくまとめ🙌!Vue3の導入を悩んでいるなら必見です
Migrating Vue 2 to Vue 3
Vue2のプロジェクトをVue3へマイグレーションする
Vue2 から Vue3 への移行 & Vite 導入の記録
【Vue.js】2系から3系へのステップアップ
機能開発を止めずに、500コンポーネント規模の Vue 3 移行を完了させた開発プロセス
Vue 2で書かれた個人プロジェクトをVue 3に書き換えてみた
Vue2からVue3への変化と慣れていくためのTips
Vue2のプロジェクトはVue3に上げるべき…?
既存のVue.jsプラグインがVue 3で使えない場合の対応
既存のVue.jsプロジェクトをVue 3へ移行したときに必要だった修正まとめ
LINE MUSIC のパフォーマンスを向上させた Vue3 マイグレーション
破壊的変更を乗り越えてVue3移行達成した話
ラボルで実施した、Vue2→Vue3移行手順と注意点を公開します!
いかにして600個以上のコンポーネントがあったVue2を約1ヶ月でVue3に置き換えたか
Vue2→Vue3に移行した話
Vue2からVue3への移行
Vue2からVue3への移行手順
Vue2からVue3への変更例
Vue2系からVue3系へバージョンアップ
before | after | files |
---|---|---|
destroyed | unmounted | components/DateTime.vue components/config/ConfigTest.vue ConfigBuilder.vue |
v-slot:reference | #reference | |
v-slot:option-label | #option-label | |
v-slot:label | #label | |
v-slot:embeddedItem | #embeddedItem | |
v-slot="scope" | #default="scope" | |
@click.native | @click | |
@submit.native.prevent | @submit.prevent | |
:visible.sync | v-model:visible | |
@paste.native | @paste | |
emits: ['input'] | emits: ['update:modelValue'], | |
this.$emit('input', | this.$emit('update:modelValue', |
package
name | vue2 | vue3 | memo |
---|---|---|---|
vue | 2.7.14 | 3.x | |
vue-router | 3.x | 4.x | Vue 3 Support |
vuex | 3.x | 4.x | Vue 3 Support |
vue-template-compiler | 2.7.14 | @vue/compiler-sfc | Vue 3 Support |
vue-loader | 15.x | 16.x or 17.x | Vue 3 Support |
@vue/cli-service | 5.0.8 | 5.0.8 | 4.5.0 or later |
@vue/cli-plugin-babel | 5.0.8 | 5.0.8 | 4.5.0 or later |
@vue/cli-plugin-eslint | 5.0.8 | 5.0.8 | 4.5.0 or later |
@vue/cli-plugin-unit-mocha | 5.0.8 | 5.0.8 | 4.5.0 or later |
@vue/eslint-config-airbnb | 6.x | 9.x | |
@vue/test-utils | 1.x | 2.0.0 or later | Vue 3 Support |
eslint | 8.x | 8.x | |
webpack | 5.x | 5.x | |
node-sass | 9.x | node-sass 9.x or sass | |
eslint-plugin-vue | 9.x | 9.x | 7.0.0 or later |
element-ui | 2.x | element-plus | Vue 3 Support |
vue-at | 2.5.1 | 3.0.0-alpha.2 | Vue 3 Support |
vue-echarts | 6.6.1 | 6.6.1 | Vue 3 Support |
vuex-persist | 3.1.3 | 3.1.3 | Vue 3 Support |
emoji-mart-vue-fast | 15.0.0 | 15.0.0 | Vue 3 Support |
vue-json-pretty | 1.x | 2.0.0 or later | Vue 3 Support |
vue-prism-component | 1.x | 2.0.0 or later | Vue 3 Support |
@fortawesome/vue-fontawesome | 2.x | 3.0.0 or later | Vue 3 Support |
vue-native-websocket | 2.0.15 | vue-native-websocket-vue3 | |
vue-treeselect | 0.4.0 | @tanbo800/vue3-treeselect | |
vue-split-panel | 1.x | coder-vue3-split-panel | |
vue-query-builder | 0.6.1 | × | Not Vue3 Support https://github.com/nsano-rururu/vue-query-builder/tree/v0.6.1vue3 |
vue-js-cron | 1.0.5 | latest | Vue3 Support |
-
vue-router
Change 4.0.0 or later
router.js
- import Router from 'vue-router';
+ import { createRouter, createWebHistory } from 'vue-router';
- export default new Router({
- mode: 'history',
- base: process.env.BASE_URL,
+ const router = createRouter({
+ history: createWebHistory(process.env.BASE_URL),
・
・
・
});
+ export default router;
-
vuex
Change 4.0.0 or later
store/index.js
import VuexPersistence from 'vuex-persist';
- import Vuex from 'vuex';
+ import { createStore } from 'vuex';
import configs from './configs';
import server from './server';
import metadata from './metadata';
import appconfig from './appconfig';
import elastalert from './elastalert';
import config from './config';
import ui from './ui';
- Vue.use(Vuex);
const vuexLocal = new VuexPersistence({
storage: window.localStorage,
reducer: state => ({ ui: state.ui }),
key: 'praeco-vuex'
});
- export default new Vuex.Store({
+ export default createStore({
modules: {
configs,
server,
metadata,
appconfig,
elastalert,
config,
ui
},
plugins: [vuexLocal.plugin]
});
-
vue-template-compiler
Change @vue/compiler-sfc -
element-ui
Change Element Plus
https://element-plus.org/en-US/guide/migration.html
Element Plus Breaking Changes (English version) #5658
npm install -D unplugin-vue-components unplugin-auto-import
vue.config.js
const AutoImport = require('unplugin-auto-import/webpack'); // add
const Components = require('unplugin-vue-components/webpack'); // add
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers'); // add
plugins: [
// add
AutoImport.default({
resolvers: [ElementPlusResolver()],
}),
// add
Components.default({
resolvers: [ElementPlusResolver()],
}),
],
npm install @element-plus/icons-vue
npm i -D unplugin-icons
https://github.com/antfu/unplugin-icons
vue.config.js
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [
require('unplugin-icons/webpack').default({ /* options */ }),
],
},
}
- icon="el-icon-arrow-right"
+ :icon="ElIconArrowRight"
- icon="el-icon-arrow-down"
+ :icon="ElIconArrowDown"
+ import {
+ ArrowRight as ElIconArrowRight,
+ ArrowDown as ElIconArrowDown,
+ } from '@element-plus/icons-vue';
- icon="el-icon-delete"
+ :icon="ElIconDelete"
+ import { Delete as ElIconDelete } from '@element-plus/icons-vue';
- <i v-if="!testPopoverVisible" class="el-icon-caret-bottom el-icon-right" />
+ <el-icon v-if="!testPopoverVisible" class="el-icon-right"><el-icon-caret-bottom /></el-icon>
- <i v-if="testPopoverVisible" class="el-icon-caret-top el-icon-right" />
+ <el-icon v-if="testPopoverVisible" class="el-icon-right"><el-icon-caret-top /></el-icon>
- <i class="el-icon-loading" />
+ <el-icon><el-icon-loading /></el-icon>
- <el-button icon="el-icon-edit" plain type="primary">
+ <el-button :icon="ElIconEdit" plain type="primary">
- <el-button icon="el-icon-plus" plain type="primary">
+ <el-button :icon="ElIconPlus" plain type="primary">
+ import {
+ Plus as ElIconPlus,
+ Edit as ElIconEdit,
+ Delete as ElIconDelete,
+ } from '@element-plus/icons-vue';
- <el-button icon="el-icon-delete" plain type="danger" @click="showDeleteConfirm">
+ <el-button :icon="ElIconDelete" plain type="danger" @click="showDeleteConfirm">
- <i v-if="!silencePopoverVisible" class="el-icon-caret-bottom el-icon-right" />
+ <el-icon v-if="!silencePopoverVisible" class="el-icon-right">
+ <el-icon-caret-bottom />
+ </el-icon>
- <i v-if="silencePopoverVisible" class="el-icon-caret-top el-icon-right" />
+ <el-icon v-if="silencePopoverVisible" class="el-icon-right">
+ <el-icon-caret-top />
+ </el-icon>
- <i v-if="!silencePopoverVisible" class="el-icon-caret-bottom el-icon-right" />
- <i v-if="silencePopoverVisible" class="el-icon-caret-top el-icon-right" />
+ <el-icon v-if="!silencePopoverVisible" class="el-icon-right">
+ <el-icon-caret-bottom />
+ </el-icon>
+ <el-icon v-if="silencePopoverVisible" class="el-icon-right">
+ <el-icon-caret-top />
+ </el-icon>
- icon="el-icon-time" />
+ :icon="ElIconClock" />
- icon="el-icon-edit"
+ :icon="ElIconEdit"
+ import {
+ CaretBottom as ElIconCaretBottom,
+ CaretTop as ElIconCaretTop,
+ Loading as ElIconLoading,
+ Clock as ElIconClock,
+ } from '@element-plus/icons-vue';
+ components: {
+ ElIconCaretBottom,
+ ElIconCaretTop,
+ ElIconLoading,
+ },
ElNotification
- import { Notification } from 'element-ui';
+ import { ElNotification } from 'element-plus';
- Vue.config.errorHandler = function(err, vm, info) {
+ app.config.errorHandler = function(err, vm, info) {
logger().error(err);
console.error(err, vm, info);
- Notification.error({
+ ElNotification({
message: err.toString(),
title: 'Internal error',
- duration: 0
+ duration: 0,
+ type: 'error'
});
};
el-time-select
- :picker-options="{
- start: '00:00',
- step: '00:15',
- end: '23:59'
- }"
+ start="00:00"
+ step="00:15"
+ end="23:59"
-
- v6.0.0 is supporting eslint 8
-
eslint-plugin-vue
Change 7.0.0 or later -
vue-at
Change 3.0.0-alpha.2 -
vue-echarts
Vue 3 Support -
vuex-persist
Vue 3 Support
- import { Picker, Emoji, EmojiIndex } from 'emoji-mart-vue-fast';
+ import { Picker, Emoji, EmojiIndex } from 'emoji-mart-vue-fast/src';
-
vue-json-pretty
Change 2.0.0 or later -
vue-prism-component
Change 2.0.0 or later -
@fortawesome/vue-fontawesome
Change 3.0.0 or later -
@vue/test-utils Change 2.0.0 or later
Migrating from Vue Test Utils v1 -
vue-query-builder
Not Vue3 Support
Fork and plan to support vue3
https://github.com/nsano-rururu/vue-query-builder -
vue-native-websocket
Not Vue3 Support
Change to vue-native-websocket-vue3 -
@riophae/vue-treeselect
Not Vue3 Support -
vue-split-panel
Not Vue3 Support
Change to coder-vue3-split-panel -
vue-js-cron
Change vue-js-cron@latest