Skip to content

Commit 5f5668f

Browse files
committed
chore: add vue cli example
1 parent b3cd6e5 commit 5f5668f

File tree

17 files changed

+1297
-2333
lines changed

17 files changed

+1297
-2333
lines changed

examples/vite-vue2/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"dev": "cross-env DEBUG=unplugin-vue-components:* vite"
66
},
77
"dependencies": {
8-
"vue": "2.6.14",
9-
"vue-template-compiler": "2.6.14"
8+
"vue": "^2.6.14",
9+
"vue-template-compiler": "^2.6.14"
1010
},
1111
"devDependencies": {
1212
"cross-env": "^7.0.3",

examples/vue-cli/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
shamefully-hoist=true

examples/vue-cli/babel.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
presets: [
3+
'@vue/cli-plugin-babel/preset',
4+
],
5+
}

examples/vue-cli/package.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "vue-cli",
3+
"private": true,
4+
"scripts": {
5+
"build": "vue-tsc --noEmit && vue-cli-service build",
6+
"dev": "vue-cli-service serve",
7+
"lint": "vue-cli-service lint"
8+
},
9+
"dependencies": {
10+
"@vue/composition-api": "^1.1.3",
11+
"core-js": "^3.16.3",
12+
"vue": "^2.6.14"
13+
},
14+
"devDependencies": {
15+
"@vue/cli-plugin-babel": "^4.5.13",
16+
"@vue/cli-plugin-typescript": "^4.5.13",
17+
"@vue/cli-service": "^4.5.13",
18+
"typescript": "^4.3.5",
19+
"unplugin-icons": "^0.7.1",
20+
"unplugin-vue-components": "workspace:*",
21+
"unplugin-vue2-script-setup": "^0.5.4",
22+
"vue-template-compiler": "^2.6.14",
23+
"vue-tsc": "^0.3.0"
24+
}
25+
}

examples/vue-cli/public/index.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html lang="">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<title><%= htmlWebpackPlugin.options.title %></title>
8+
</head>
9+
<body>
10+
<noscript>
11+
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
12+
</noscript>
13+
<div id="app"></div>
14+
<!-- built files will be auto injected -->
15+
</body>
16+
</html>

examples/vue-cli/src/App.vue

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<template>
2+
<div class="block">
3+
<ComponentA msg="a" />
4+
<component-b msg="b" />
5+
<ComponentC msg="c" />
6+
<ComponentD />
7+
</div>
8+
</template>
9+
10+
<style scoped>
11+
.block {
12+
padding: 0px 20px 10px 20px;
13+
margin: 20px 20px;
14+
border: 1px solid #888;
15+
border-radius: 5px;
16+
}
17+
</style>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<template>
2+
<h3>Component A: {{ msg }}</h3>
3+
</template>
4+
5+
<script>
6+
export default {
7+
props: {
8+
msg: String,
9+
},
10+
}
11+
</script>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<template>
2+
<h3>Component B: {{ msg }}</h3>
3+
</template>
4+
5+
<script>
6+
export default {
7+
props: {
8+
msg: String,
9+
},
10+
}
11+
</script>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<template>
2+
<h3>Component D: <component-b msg="wrapper" /></h3>
3+
</template>
4+
5+
<script>
6+
export default {}
7+
</script>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<template>
2+
<h3>Component C: {{ msg }}</h3>
3+
</template>
4+
5+
<script>
6+
export default {
7+
props: {
8+
msg: String,
9+
},
10+
}
11+
</script>

0 commit comments

Comments
 (0)