first commit
This commit is contained in:
commit
de235efdc9
23
.gitignore
vendored
Normal file
23
.gitignore
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
24
README.md
Normal file
24
README.md
Normal file
@ -0,0 +1,24 @@
|
||||
# wodexiangmu
|
||||
|
||||
## Project setup
|
||||
```
|
||||
npm install
|
||||
```
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
npm run serve
|
||||
```
|
||||
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
|
||||
### Lints and fixes files
|
||||
```
|
||||
npm run lint
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
5
babel.config.js
Normal file
5
babel.config.js
Normal file
@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@vue/cli-plugin-babel/preset'
|
||||
]
|
||||
}
|
19
jsconfig.json
Normal file
19
jsconfig.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "esnext",
|
||||
"baseUrl": "./",
|
||||
"moduleResolution": "node",
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"src/*"
|
||||
]
|
||||
},
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"scripthost"
|
||||
]
|
||||
}
|
||||
}
|
19343
package-lock.json
generated
Normal file
19343
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
45
package.json
Normal file
45
package.json
Normal file
@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "wodexiangmu",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"core-js": "^3.8.3",
|
||||
"element-ui": "^2.15.6",
|
||||
"vue": "^2.6.14",
|
||||
"vue-router": "^3.5.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.12.16",
|
||||
"@babel/eslint-parser": "^7.12.16",
|
||||
"@vue/cli-plugin-babel": "~5.0.0",
|
||||
"@vue/cli-plugin-eslint": "~5.0.0",
|
||||
"@vue/cli-service": "~5.0.0",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-plugin-vue": "^8.0.3",
|
||||
"vue-template-compiler": "^2.6.14"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"env": {
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"plugin:vue/essential",
|
||||
"eslint:recommended"
|
||||
],
|
||||
"parserOptions": {
|
||||
"parser": "@babel/eslint-parser"
|
||||
},
|
||||
"rules": {}
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not dead"
|
||||
]
|
||||
}
|
BIN
public/favicon.ico
Normal file
BIN
public/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
17
public/index.html
Normal file
17
public/index.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<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><%= htmlWebpackPlugin.options.title %></title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||
</noscript>
|
||||
<div id="aaa"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
61
src/App.vue
Normal file
61
src/App.vue
Normal file
@ -0,0 +1,61 @@
|
||||
// .vue 文件 vue 的组件
|
||||
// html css js
|
||||
|
||||
//
|
||||
|
||||
|
||||
// 组件
|
||||
|
||||
//
|
||||
<template>
|
||||
<div class="aaaa">
|
||||
|
||||
<router-view></router-view>
|
||||
<!-- 监听子组件的事件 -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 导出
|
||||
// new Vue
|
||||
// 组件
|
||||
// data:{
|
||||
// name:"这是name"
|
||||
// }
|
||||
export default {
|
||||
name: 'App',
|
||||
// 注册组件
|
||||
components:{
|
||||
},
|
||||
methods: {
|
||||
dianwo() {
|
||||
// alert("事件")
|
||||
this.name = "这是新的sname"
|
||||
},
|
||||
aaa(canshu,canshuer,canshusan){
|
||||
console.log("子组件被点击了")
|
||||
console.log("传过来的值是",canshu)
|
||||
console.log("传过来的值2是",canshuer)
|
||||
console.log("传过来的值3是",canshusan)
|
||||
},
|
||||
zijideshijian(xingcan,xingcan2){
|
||||
console.log("事件被触发了")
|
||||
console.log(xingcan)
|
||||
console.log(xingcan2)
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
name: "这是name",
|
||||
jiage:0
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
BIN
src/assets/logo.png
Normal file
BIN
src/assets/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
59
src/components/HelloWorld.vue
Normal file
59
src/components/HelloWorld.vue
Normal file
@ -0,0 +1,59 @@
|
||||
<template>
|
||||
<div class="hello">
|
||||
<h1>{{ msg }}</h1>
|
||||
<p>
|
||||
这是hello world
|
||||
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
|
||||
</p>
|
||||
<h3>Installed CLI Plugins</h3>
|
||||
<ul>
|
||||
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
|
||||
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
|
||||
</ul>
|
||||
<h3>Essential Links</h3>
|
||||
<ul>
|
||||
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
|
||||
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
|
||||
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
|
||||
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
|
||||
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
|
||||
</ul>
|
||||
<h3>Ecosystem</h3>
|
||||
<ul>
|
||||
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
|
||||
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
|
||||
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
|
||||
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
|
||||
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
// 组件的名子
|
||||
name: 'HelloWorld',
|
||||
props: {
|
||||
msg: String
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||
// 后面会有影响
|
||||
<style scoped>
|
||||
h3 {
|
||||
margin: 40px 0 0;
|
||||
}
|
||||
ul {
|
||||
list-style-type: none;
|
||||
padding: 0;
|
||||
}
|
||||
li {
|
||||
display: inline-block;
|
||||
margin: 0 10px;
|
||||
}
|
||||
a {
|
||||
color: #42b983;
|
||||
}
|
||||
</style>
|
14
src/components/aaa.vue
Normal file
14
src/components/aaa.vue
Normal file
@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<div>
|
||||
<div>这是aaaa</div>
|
||||
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"AaaCom"
|
||||
}
|
||||
</script>
|
40
src/components/zujian.vue
Normal file
40
src/components/zujian.vue
Normal file
@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<div>
|
||||
商品
|
||||
计数: {{count}}
|
||||
<button @click="dianwo">点我</button>
|
||||
<button @click="jian">减</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"ZuJian",
|
||||
data(){
|
||||
return {
|
||||
count:0
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
dianwo(){
|
||||
// console.log("事件触发")
|
||||
this.count++
|
||||
// vue 自带的
|
||||
// 父传子 属性
|
||||
// 子传父 事件
|
||||
// 触发 父级的事件
|
||||
this.$emit("abc",this.count,"第二个参数")
|
||||
// 子传父
|
||||
// this.$emit("aaa",2222,1111,6666)
|
||||
},
|
||||
jian(){
|
||||
this.count--
|
||||
// this.$emit("aaa",this.count)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
56
src/main.js
Normal file
56
src/main.js
Normal file
@ -0,0 +1,56 @@
|
||||
// js 导入 模块式开发
|
||||
|
||||
import Vue from 'vue'
|
||||
// 导入 App.vue
|
||||
import App from './App.vue'
|
||||
// import zujian from "./components/zujian.vue"
|
||||
import HelloWorld from "./components/HelloWorld.vue"
|
||||
import aaa from "./components/aaa.vue"
|
||||
import VueRouter from "vue-router"
|
||||
import index from "./pages/index.vue"
|
||||
import ElementUI from 'element-ui';
|
||||
import 'element-ui/lib/theme-chalk/index.css';
|
||||
|
||||
|
||||
Vue.use(ElementUI);
|
||||
|
||||
// vuerouter 插件
|
||||
|
||||
Vue.use(VueRouter)
|
||||
// 路径 => 页面(组件)
|
||||
const routes = [{
|
||||
path:"/abc",
|
||||
component:HelloWorld
|
||||
},{
|
||||
path:"/agfahg",
|
||||
component:aaa
|
||||
},
|
||||
{
|
||||
path:"/nav",
|
||||
component:() => import("./pages/nav.vue"),
|
||||
children:[{
|
||||
path:"user",
|
||||
component: () => import("./pages/user.vue")
|
||||
// path:"/user",
|
||||
// component: () => import("./pages/user.vue")
|
||||
// 加了'/'就是绝对路径 后面不需要写父级路径 @click="$router.push('/user')"
|
||||
// 不加'/'就是相对路径 后面就需要写父级路径 @click="$router.push('/nav/user')
|
||||
},
|
||||
{
|
||||
path:"/",
|
||||
component: index
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
|
||||
const router = new VueRouter({
|
||||
routes // (缩写) 相当于 routes: routes
|
||||
})
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
new Vue({
|
||||
render: h => h(App),
|
||||
router
|
||||
}).$mount('#aaa')
|
15
src/pages/index.vue
Normal file
15
src/pages/index.vue
Normal file
@ -0,0 +1,15 @@
|
||||
<template>
|
||||
<div>
|
||||
这是首页
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"PageIndex",
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
59
src/pages/nav.vue
Normal file
59
src/pages/nav.vue
Normal file
@ -0,0 +1,59 @@
|
||||
<template>
|
||||
<div class="nav">
|
||||
<div style="width:256px">
|
||||
<el-menu
|
||||
default-active="2"
|
||||
class="el-menu-vertical-demo"
|
||||
@open="handleOpen"
|
||||
@close="handleClose"
|
||||
background-color="#545c64"
|
||||
text-color="#fff"
|
||||
active-text-color="#ffd04b"
|
||||
style="height: 100vh;">
|
||||
<el-submenu index="1">
|
||||
<template slot="title">
|
||||
<i class="el-icon-location"></i>
|
||||
<span>导航一</span>
|
||||
</template>
|
||||
<el-menu-item-group>
|
||||
<template slot="title">分组一</template>
|
||||
<el-menu-item index="1-1">选项1</el-menu-item>
|
||||
<el-menu-item index="1-2">选项2</el-menu-item>
|
||||
</el-menu-item-group>
|
||||
<el-menu-item-group title="分组2">
|
||||
<el-menu-item index="1-3">选项3</el-menu-item>
|
||||
</el-menu-item-group>
|
||||
<el-submenu index="1-4">
|
||||
<template slot="title">选项4</template>
|
||||
<el-menu-item index="1-4-1">选项1</el-menu-item>
|
||||
</el-submenu>
|
||||
</el-submenu>
|
||||
<el-menu-item index="2" @click="$router.push('/nav')">
|
||||
<i class="el-icon-menu"></i>
|
||||
<span slot="title">导航二</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="3" disabled>
|
||||
<i class="el-icon-document"></i>
|
||||
<span slot="title">导航三</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="4" @click="$router.push('/nav/user')">
|
||||
<i class="el-icon-setting"></i>
|
||||
<span slot="title">导航四</span>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
</div>
|
||||
<div style="width: 100%">
|
||||
<router-view></router-view>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name:"navPage",
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.nav {
|
||||
display: flex;
|
||||
}
|
||||
</style>
|
30
src/pages/user.vue
Normal file
30
src/pages/user.vue
Normal file
@ -0,0 +1,30 @@
|
||||
<template>
|
||||
<div>这是user
|
||||
<button @click="back" class="app">返回上一页</button>
|
||||
<button @click="next">去下一页</button>
|
||||
<button @click="getquery" >获取传参</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"PageUser",
|
||||
methods:{
|
||||
back(){
|
||||
this.$router.go(-4)
|
||||
},
|
||||
next(){
|
||||
this.$router.go(1)
|
||||
},
|
||||
getquery(){
|
||||
console.log(this.$route.query.canshuming)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.app{
|
||||
background-color: aqua;
|
||||
}
|
||||
</style>
|
4
vue.config.js
Normal file
4
vue.config.js
Normal file
@ -0,0 +1,4 @@
|
||||
const { defineConfig } = require('@vue/cli-service')
|
||||
module.exports = defineConfig({
|
||||
transpileDependencies: true
|
||||
})
|
BIN
vuecli.xmind
Normal file
BIN
vuecli.xmind
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user