Skip to content

Commit 3d77797

Browse files
committed
initial commit
0 parents  commit 3d77797

File tree

13 files changed

+10640
-0
lines changed

13 files changed

+10640
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist
2+
.DS_Store
3+
node_modules

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# vue-next-webpack-preview
2+
3+
> Minimal webpack setup for Vue 3 (alpha)
4+
5+
This is for preview purposes only. There might be bugs and undocumented behavior differences from v2, which are expected.
6+
7+
Also note that if you are using VSCode, Vetur isn't updated to take advantage of Vue 3's typing yet so intellisense in Vue files may not be fully functional (especially in templates).
8+
9+
### Prerequisites
10+
- Node & NPM
11+
12+
### Install
13+
```sh
14+
npm install
15+
```
16+
### Usage
17+
##### Develop
18+
```sh
19+
# run dev server at localhost:8080
20+
npm run dev
21+
```
22+
##### Build
23+
```sh
24+
# transpile js for deployment
25+
npm run build
26+
```

index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<link rel="stylesheet" href="/dist/main.css">
2+
<div id="app"></div>
3+
<script src="/dist/main.js"></script>

package-lock.json

Lines changed: 6198 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"private": true,
3+
"scripts": {
4+
"dev": "webpack-dev-server",
5+
"build": "webpack --env.prod"
6+
},
7+
"dependencies": {
8+
"vue": "^3.0.0-alpha.10",
9+
"vue-router": "4.0.0-alpha.4"
10+
},
11+
"devDependencies": {
12+
"@vue/compiler-sfc": "^3.0.0-alpha.10",
13+
"css-loader": "^3.4.2",
14+
"file-loader": "^6.0.0",
15+
"mini-css-extract-plugin": "^0.9.0",
16+
"url-loader": "^4.0.0",
17+
"vue-loader": "^16.0.0-alpha.3",
18+
"webpack": "^4.42.1",
19+
"webpack-cli": "^3.3.11",
20+
"webpack-dev-server": "^3.10.3"
21+
}
22+
}

src/App.vue

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<template>
2+
<div id='root'>
3+
<img src='./logo.png' />
4+
<div id='nav'>
5+
<router-link to='/'> Home</router-link>
6+
<router-link to='/contact'>Contact </router-link>
7+
</div>
8+
<router-view />
9+
</div>
10+
</template>
11+
12+
<script>
13+
import { ref } from 'vue'
14+
15+
export default {
16+
17+
}
18+
</script>
19+
20+
<style scoped>
21+
22+
#root {
23+
text-align: center;
24+
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
25+
}
26+
27+
img {
28+
width: 200px;
29+
}
30+
31+
#nav {
32+
font-size: 1.5em;
33+
margin-bottom: 30px;
34+
}
35+
36+
a {
37+
text-decoration: none;
38+
margin: 30px 25px;
39+
color: #333;
40+
}
41+
42+
a:hover {
43+
text-decoration: underline;
44+
color:
45+
}
46+
47+
</style>

src/logo.png

12.5 KB
Loading

src/main.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { createApp } from 'vue'
2+
import App from './App.vue'
3+
import router from './router'
4+
5+
const app = createApp(App)
6+
7+
app.use(router)
8+
9+
app.mount('#app')

src/router/index.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { createRouter, createWebHistory } from 'vue-router'
2+
import Home from '../views/Home.vue'
3+
import Contact from '../views/Contact.vue'
4+
5+
const routerHistory = createWebHistory()
6+
7+
const router = createRouter({
8+
history: routerHistory,
9+
routes: [
10+
{
11+
path: '/',
12+
component: Home
13+
},
14+
{
15+
path: '/contact',
16+
component: Contact
17+
}
18+
]
19+
})
20+
21+
export default router

src/views/Contact.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div>
3+
Contact
4+
</div>
5+
</template>

0 commit comments

Comments
 (0)