Update example to Vue 3. (#7314)

This commit is contained in:
Lee Robinson
2022-01-17 19:06:51 -06:00
committed by GitHub
parent 5bd0e0f6ca
commit ec6a645d3f
9 changed files with 2363 additions and 2114 deletions

View File

@@ -2,16 +2,16 @@
node_modules
/dist
# local env files
.env.local
.env.*.local
.env
.env.build
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea

View File

@@ -1 +0,0 @@
README.md

View File

@@ -1,6 +1,4 @@
![Vue.js Logo](https://github.com/vercel/vercel/blob/main/packages/frameworks/logos/vue.svg)
# Vue.js Example
# Vue.js
This directory is a brief example of a [Vue.js](https://vuejs.org/) app that can be deployed with Vercel and zero configuration.
@@ -12,18 +10,26 @@ Deploy your own Vue.js project with Vercel.
_Live Example: https://vue.examples.vercel.com_
### How We Created This Example
## Running Locally
To get started with Vue.js deployed with Vercel, you can use the [Vue CLI](https://cli.vuejs.org/guide/creating-a-project.html#vue-create) to initialize the project:
```shell
$ vue create
```
yarn install
```
### Deploying From Your Terminal
#### Compile and hot-reload for development
You can deploy your new Vue.js project with a single command from your terminal using [Vercel CLI](https://vercel.com/download):
```shell
$ vercel
```
yarn serve
```
#### Compile and minify for production
```
yarn build
```
#### Lint and fix files
```
yarn lint
```

View File

@@ -1,5 +1,5 @@
module.exports = {
presets: [
'@vue/app'
'@vue/cli-plugin-babel/preset'
]
}

View File

@@ -1,25 +1,22 @@
{
"name": "vue",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"dev": "vue-cli-service serve --port $PORT",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^2.6.5",
"vue": "^2.6.10"
"core-js": "^3.6.5",
"vue": "^3.0.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.9.0",
"@vue/cli-plugin-eslint": "^3.9.0",
"@vue/cli-service": "^3.9.0",
"babel-eslint": "^10.0.1",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"vue-template-compiler": "^2.6.10"
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0"
},
"eslintConfig": {
"root": true,
@@ -27,21 +24,17 @@
"node": true
},
"extends": [
"plugin:vue/essential",
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"rules": {},
"parserOptions": {
"parser": "babel-eslint"
}
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions"
"last 2 versions",
"not dead"
]
}

View File

@@ -5,11 +5,11 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>vue</title>
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but vue doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->

View File

@@ -1,15 +1,13 @@
<template>
<div id="app">
<img alt="Vue logo" src="./assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/>
</div>
</template>
<script>
import HelloWorld from './components/HelloWorld.vue'
export default {
name: 'app',
name: 'App',
components: {
HelloWorld
}
@@ -18,7 +16,7 @@ export default {
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;

View File

@@ -1,8 +1,4 @@
import Vue from 'vue'
import { createApp } from 'vue'
import App from './App.vue'
Vue.config.productionTip = false
new Vue({
render: h => h(App),
}).$mount('#app')
createApp(App).mount('#app')

File diff suppressed because it is too large Load Diff