Skip to content

Commit 202fafc

Browse files
authored
Merge pull request #69 from unlayer/vue-v3
Upgrade to Vue v3
2 parents da302b4 + 0d3eb5a commit 202fafc

File tree

9 files changed

+19825
-33819
lines changed

9 files changed

+19825
-33819
lines changed

Diff for: babel.config.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
module.exports = {
2-
presets: [
3-
'@vue/app'
4-
]
5-
}
2+
presets: ['@vue/cli-plugin-babel/preset'],
3+
};

Diff for: jsconfig.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"module": "esnext",
5+
"baseUrl": "./",
6+
"moduleResolution": "node",
7+
"paths": {
8+
"@/*": [
9+
"src/*"
10+
]
11+
},
12+
"lib": [
13+
"esnext",
14+
"dom",
15+
"dom.iterable",
16+
"scripthost"
17+
]
18+
}
19+
}

Diff for: package-lock.json

+13,854-25,467
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-email-editor",
3-
"version": "1.0.0",
3+
"version": "2.0.0",
44
"main": "./dist/vue-email-editor.common.js",
55
"scripts": {
66
"serve": "vue-cli-service serve",
@@ -10,14 +10,18 @@
1010
"release": "npm run build-bundle && npm publish"
1111
},
1212
"dependencies": {
13-
"vue": "^2.5.17"
13+
"core-js": "^3.8.3",
14+
"vue": "^3.2.13"
1415
},
1516
"devDependencies": {
16-
"@vue/cli-plugin-babel": "^3.0.5",
17-
"@vue/cli-plugin-eslint": "^3.0.5",
18-
"@vue/cli-service": "^3.0.5",
19-
"vue-router": "^3.3.2",
20-
"vue-template-compiler": "^2.5.17"
17+
"@babel/core": "^7.12.16",
18+
"@babel/eslint-parser": "^7.12.16",
19+
"@vue/cli-plugin-babel": "~5.0.0",
20+
"@vue/cli-plugin-eslint": "~5.0.0",
21+
"@vue/cli-service": "~5.0.0",
22+
"eslint": "^7.32.0",
23+
"eslint-plugin-vue": "^8.0.3",
24+
"vue-router": "^4.0.16"
2125
},
2226
"files": [
2327
"dist/*",
@@ -32,22 +36,18 @@
3236
"node": true
3337
},
3438
"extends": [
35-
"plugin:vue/essential",
39+
"plugin:vue/vue3-essential",
3640
"eslint:recommended"
3741
],
38-
"rules": {},
3942
"parserOptions": {
40-
"parser": "babel-eslint"
41-
}
42-
},
43-
"postcss": {
44-
"plugins": {
45-
"autoprefixer": {}
46-
}
43+
"parser": "@babel/eslint-parser"
44+
},
45+
"rules": {}
4746
},
4847
"browserslist": [
4948
"> 1%",
5049
"last 2 versions",
51-
"not ie <= 8"
50+
"not dead",
51+
"not ie 11"
5252
]
5353
}

Diff for: src/components/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1+
import { createApp } from 'vue/dist/vue.esm-bundler.js';
2+
13
import EmailEditor from './EmailEditor.vue';
24

35
const Components = {
46
EmailEditor,
57
};
68

9+
const app = createApp({});
10+
11+
Object.keys(Components).forEach((name) => {
12+
app.component(name, Components[name]);
13+
});
14+
715
export { EmailEditor };
816
export default Components;

Diff for: src/main.js

+15-16
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
1-
import Vue from 'vue/dist/vue.js'
2-
import VueRouter from 'vue-router'
1+
import { createApp } from 'vue';
2+
import { createRouter, createWebHistory } from 'vue-router';
33

4-
import Example from './views/Example.vue'
5-
import DesignList from './views/DesignList.vue'
6-
import DesignEdit from './views/DesignEdit.vue'
7-
8-
Vue.config.productionTip = false
4+
import Example from './views/Example.vue';
5+
import DesignList from './views/DesignList.vue';
6+
import DesignEdit from './views/DesignEdit.vue';
97

108
const routes = [
119
{ path: '/', component: Example },
1210
{ path: '/dashboard', component: DesignList },
1311
{ path: '/dashboard/new', component: DesignEdit },
1412
{ path: '/dashboard/edit/:designId', component: DesignEdit },
15-
]
13+
];
14+
15+
const router = createRouter({
16+
history: createWebHistory(),
17+
routes,
18+
});
1619

17-
const router = new VueRouter({
18-
mode: 'history',
19-
routes
20-
})
20+
const app = createApp({});
2121

22-
Vue.use(VueRouter)
22+
app.use(router);
23+
app.mount('#app');
2324

24-
new Vue({
25-
router
26-
}).$mount('#app')
25+
export default app;

Diff for: src/views/Example.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { EmailEditor } from '../components'
1818
import sample from '../data/sample.json';
1919
2020
export default {
21-
name: 'example',
21+
name: 'exampleView',
2222
components: {
2323
EmailEditor
2424
},

Diff for: vue.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const { defineConfig } = require('@vue/cli-service');
2+
module.exports = defineConfig({
3+
transpileDependencies: true,
4+
});

0 commit comments

Comments
 (0)