Skip to content

Commit c8689a1

Browse files
committed
feat: preliminary support for Vue 2
1 parent 6259ea5 commit c8689a1

File tree

528 files changed

+1860
-12048
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

528 files changed

+1860
-12048
lines changed

default/package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@
77
"preview": "vite preview --port 5050"
88
},
99
"dependencies": {
10-
"vue": "^3.2.22"
10+
"@vue/composition-api": "^1.4.0",
11+
"vue": "^2.6.14"
1112
},
1213
"devDependencies": {
13-
"@vitejs/plugin-vue": "^1.10.0",
14-
"vite": "^2.6.14"
14+
"@vue/runtime-dom": "^3.2.22",
15+
"unplugin-vue2-script-setup": "^0.7.1",
16+
"vite": "^2.6.14",
17+
"vite-plugin-vue2": "^1.9.0",
18+
"vue-template-compiler": "^2.6.14"
1519
}
1620
}

default/src/App.vue

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ import TheWelcome from './components/TheWelcome.vue'
44
</script>
55

66
<template>
7-
<header>
8-
<img alt="Vue logo" class="logo" src="./assets/logo.svg" width="125" height="125" />
7+
<div id="app">
8+
<header>
9+
<img alt="Vue logo" class="logo" src="./assets/logo.svg" width="125" height="125" />
910

10-
<div class="wrapper">
11-
<HelloWorld msg="You did it!" />
12-
</div>
13-
</header>
11+
<div class="wrapper">
12+
<HelloWorld msg="You did it!" />
13+
</div>
14+
</header>
1415

15-
<main>
16-
<TheWelcome />
17-
</main>
16+
<main>
17+
<TheWelcome />
18+
</main>
19+
</div>
1820
</template>
1921

2022
<style>

default/src/components/HelloWorld.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ defineProps({
1313
<h3>
1414
You’ve successfully created a project with
1515
<a target="_blank" href="https://vitejs.dev/">Vite</a> +
16-
<a target="_blank" href="https://v3.vuejs.org/">Vue 3</a>.
16+
<a target="_blank" href="https://vuejs.org/">Vue 2</a>.
1717
</h3>
1818
</div>
1919
</template>

default/src/components/TheWelcome.vue

Lines changed: 64 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -8,77 +8,79 @@ import SupportIcon from './icons/IconSupport.vue'
88
</script>
99

1010
<template>
11-
<WelcomeItem>
12-
<template #icon>
13-
<DocumentationIcon />
14-
</template>
15-
<template #heading>Documentation</template>
11+
<div>
12+
<WelcomeItem>
13+
<template #icon>
14+
<DocumentationIcon />
15+
</template>
16+
<template #heading>Documentation</template>
1617

17-
Vue’s
18-
<a target="_blank" href="https://v3.vuejs.org/">official documentation</a>
19-
provides you with all information you need to get started.
20-
</WelcomeItem>
18+
Vue’s
19+
<a target="_blank" href="https://v3.vuejs.org/">official documentation</a>
20+
provides you with all information you need to get started.
21+
</WelcomeItem>
2122

22-
<WelcomeItem>
23-
<template #icon>
24-
<ToolingIcon />
25-
</template>
26-
<template #heading>Tooling</template>
23+
<WelcomeItem>
24+
<template #icon>
25+
<ToolingIcon />
26+
</template>
27+
<template #heading>Tooling</template>
2728

28-
This project is served and bundled with
29-
<a href="https://vitejs.dev/guide/features.html" target="_blank">Vite</a>. The recommended IDE
30-
setup is <a href="https://code.visualstudio.com/" target="_blank">VSCode</a> +
31-
<a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>. If you need to test
32-
your components and web pages, check out
33-
<a href="https://www.cypress.io/" target="_blank">Cypress</a> and
34-
<a href="https://docs.cypress.io/guides/component-testing/introduction" target="_blank"
35-
>Cypress Component Testing</a
36-
>.
29+
This project is served and bundled with
30+
<a href="https://vitejs.dev/guide/features.html" target="_blank">Vite</a>. The recommended IDE
31+
setup is <a href="https://code.visualstudio.com/" target="_blank">VSCode</a> +
32+
<a href="https://github.com/johnsoncodehk/volar" target="_blank">Volar</a>. If you need to
33+
test your components and web pages, check out
34+
<a href="https://www.cypress.io/" target="_blank">Cypress</a> and
35+
<a href="https://docs.cypress.io/guides/component-testing/introduction" target="_blank"
36+
>Cypress Component Testing</a
37+
>.
3738

38-
<br />
39+
<br />
3940

40-
More instructions are available in <code>README.md</code>.
41-
</WelcomeItem>
41+
More instructions are available in <code>README.md</code>.
42+
</WelcomeItem>
4243

43-
<WelcomeItem>
44-
<template #icon>
45-
<EcosystemIcon />
46-
</template>
47-
<template #heading>Ecosystem</template>
44+
<WelcomeItem>
45+
<template #icon>
46+
<EcosystemIcon />
47+
</template>
48+
<template #heading>Ecosystem</template>
4849

49-
Get official tools and libraries for your project:
50-
<a target="_blank" href="https://next.vuex.vuejs.org/">Vuex</a>,
51-
<a target="_blank" href="https://next.router.vuejs.org/">Vue Router</a>,
52-
<a target="_blank" href="https://next.vue-test-utils.vuejs.org/">Vue Test Utils</a>, and
53-
<a target="_blank" href="https://github.com/vuejs/devtools">Vue Dev Tools</a>. If you need more
54-
resources, we suggest paying
55-
<a target="_blank" href="https://github.com/vuejs/awesome-vue">Awesome Vue</a>
56-
a visit.
57-
</WelcomeItem>
50+
Get official tools and libraries for your project:
51+
<a target="_blank" href="https://vuex.vuejs.org/">Vuex</a>,
52+
<a target="_blank" href="https://router.vuejs.org/">Vue Router</a>,
53+
<a target="_blank" href="https://vue-test-utils.vuejs.org/">Vue Test Utils</a>, and
54+
<a target="_blank" href="https://github.com/vuejs/devtools">Vue Dev Tools</a>. If you need
55+
more resources, we suggest paying
56+
<a target="_blank" href="https://github.com/vuejs/awesome-vue">Awesome Vue</a>
57+
a visit.
58+
</WelcomeItem>
5859

59-
<WelcomeItem>
60-
<template #icon>
61-
<CommunityIcon />
62-
</template>
63-
<template #heading>Community</template>
60+
<WelcomeItem>
61+
<template #icon>
62+
<CommunityIcon />
63+
</template>
64+
<template #heading>Community</template>
6465

65-
Got stuck? Ask your question on
66-
<a target="_blank" href="https://chat.vuejs.org">Vue Land</a>, our official Discord server, or
67-
<a target="_blank" href="https://stackoverflow.com/questions/tagged/vue.js">StackOverflow</a>.
68-
You should also subscribe to
69-
<a target="_blank" href="https://news.vuejs.org">our mailing list</a> and follow the official
70-
<a target="_blank" href="https://twitter.com/vuejs">@vuejs</a>
71-
twitter account for latest news in the Vue world.
72-
</WelcomeItem>
66+
Got stuck? Ask your question on
67+
<a target="_blank" href="https://chat.vuejs.org">Vue Land</a>, our official Discord server, or
68+
<a target="_blank" href="https://stackoverflow.com/questions/tagged/vue.js">StackOverflow</a>.
69+
You should also subscribe to
70+
<a target="_blank" href="https://news.vuejs.org">our mailing list</a> and follow the official
71+
<a target="_blank" href="https://twitter.com/vuejs">@vuejs</a>
72+
twitter account for latest news in the Vue world.
73+
</WelcomeItem>
7374

74-
<WelcomeItem>
75-
<template #icon>
76-
<SupportIcon />
77-
</template>
78-
<template #heading>Support Vue</template>
75+
<WelcomeItem>
76+
<template #icon>
77+
<SupportIcon />
78+
</template>
79+
<template #heading>Support Vue</template>
7980

80-
As an independent project, Vue relies on community backing for its sustainability. You can help
81-
us by
82-
<a target="_blank" href="https://vuejs.org/support-vuejs/">becoming a sponsor</a>.
83-
</WelcomeItem>
81+
As an independent project, Vue relies on community backing for its sustainability. You can
82+
help us by
83+
<a target="_blank" href="https://vuejs.org/support-vuejs/">becoming a sponsor</a>.
84+
</WelcomeItem>
85+
</div>
8486
</template>

default/src/main.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
import { createApp } from 'vue'
1+
import Vue from 'vue'
2+
import VueCompositionAPI from '@vue/composition-api'
3+
24
import App from './App.vue'
35

4-
createApp(App).mount('#app')
6+
Vue.use(VueCompositionAPI)
7+
8+
const app = new Vue({
9+
render: (h) => h(App)
10+
})
11+
12+
app.$mount('#app')

default/vite.config.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
import { fileURLToPath } from 'url'
22

33
import { defineConfig } from 'vite'
4-
import vue from '@vitejs/plugin-vue'
4+
import { createVuePlugin as vue2 } from 'vite-plugin-vue2'
5+
import scriptSetup from 'unplugin-vue2-script-setup/vite'
56

67
// https://vitejs.dev/config/
78
export default defineConfig({
8-
plugins: [vue()],
9+
plugins: [
10+
vue2({
11+
jsx: true
12+
}),
13+
scriptSetup()
14+
],
915
resolve: {
1016
alias: {
1117
'@': fileURLToPath(new URL('./src', import.meta.url))

jsx-pinia-with-tests/.gitignore

Lines changed: 0 additions & 27 deletions
This file was deleted.

jsx-pinia-with-tests/README.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

jsx-pinia-with-tests/cypress.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

jsx-pinia-with-tests/cypress/fixtures/example.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

jsx-pinia-with-tests/cypress/integration/example.spec.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

jsx-pinia-with-tests/cypress/jsconfig.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

jsx-pinia-with-tests/cypress/plugins/index.js

Lines changed: 0 additions & 28 deletions
This file was deleted.

jsx-pinia-with-tests/cypress/support/commands.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)