Browse Source

Merge remote-tracking branch 'origin/master'

yby 2 months ago
parent
commit
0036921f2f
6 changed files with 9 additions and 179 deletions
  1. 3 82
      src/App.vue
  2. 0 16
      src/components/shopCar.vue
  3. 6 14
      src/router/index.js
  4. 0 33
      src/views/childS.vue
  5. 0 17
      src/views/pageOne.vue
  6. 0 17
      src/views/pageTwo.vue

+ 3 - 82
src/App.vue

@@ -1,90 +1,11 @@
 <template>
-  <div>
-    <router-link to="/p1">page1</router-link><router-link to="/p2">page2</router-link>
-    <router-view></router-view>
-    <childS :gydxmsg="gydxinfo" @changefathermsg="setgydxmsg" ref="child"></childS>
-    <button @click="usechildfun">调用子方法</button>
-    <div v-html="myhtml"></div>
-    <div >{{ gydxinfo }}</div>
-    <el-button type="primary" @click="change">change</el-button>
-    <div>当前添加商品信息:{{ fullInfo }}</div>
-    <el-row>
-      <el-col>
-        <el-input type="text" placeholder="商品名称" v-model="addGoodInfo.goodsName"></el-input>
-      </el-col>
-      <el-col>
-        <el-select placeholder="商品类型" v-model="addGoodInfo.type">
-          <el-option v-for="(item, index) in goodsType" :value="item" :key="index"></el-option>
-        </el-select>
-      </el-col>
-      <el-col>
-        <el-input type="text" placeholder="商品价格" v-model="addGoodInfo.price"></el-input>
-      </el-col>
-      <el-col>
-        <el-input type="text" placeholder="商品描述" v-model="addGoodInfo.info"></el-input>
-      </el-col>
-      <el-col>
-        <el-button @click="addGood">添加</el-button>
-      </el-col>
-    </el-row>
-    <el-table :data="goods">
-      <el-table-column prop="goodsName" label="商品名" width="180" />
-      <el-table-column prop="price" label="价格" width="180" />
-      <el-table-column prop="type" label="类型" />
-      <el-table-column prop="info" label="信息" />
-    </el-table>
-  </div>
+  <div></div>
 </template>
 
 <script>
-import childS from './views/childS'
-export default {
-  components:{childS},
-  data() {
-    return {
-      addGoodInfo: {
-        goodsName: '',
-        price: '',
-        type: '',
-        info: ''
-      },
-      goodsType: ['电子', '玩具', '烟酒', '零食'],
-
-      goods: [
-        { goodsName: '小米手机', price: 1000, type: '电子', info: '第一代' },
-        { goodsName: '华为手机', price: 2000, type: '电子', info: '第二代' },
-        { goodsName: '苹果手机', price: 3000, type: '电子', info: '第三代' },
-      ],
-      mytext: 'hhhhhh',
-      myhtml: '<a href="http://baidu.com">baidu</a>',
-      gydxinfo: '工业大学'
 
-    }
-  },
-  methods: {
-    usechildfun(){
-      this.$refs.child.setmag("hahahaha")
-    },
-    setgydxmsg(msg){
-      this.gydxinfo = msg;
-    },
-    addGood() {
-      this.goods.unshift(this.addGoodInfo)
-    },
-    change() {
-      this.gydxinfo = '长春工业大学'
-    }
-  },
-  computed: {
-    fullInfo() {
-      return this.addGoodInfo.goodsName + ' ' + this.addGoodInfo.type + ' ' + this.addGoodInfo.price + ' ' + this.addGoodInfo.info
-    },
-  },
-  watch: {
-    gydxinfo(newvalue, oldvalue) {
-      console.log(newvalue, '****', oldvalue);
-    }
-  }
+export default {
+  
 }
 </script>
 

+ 0 - 16
src/components/shopCar.vue

@@ -1,16 +0,0 @@
-<template>
-    <div>
-        
-    </div>
-    
-</template>
-
-<script>
-    export default {
-            
-    };
-</script>
-
-<style>
-
-</style>

+ 6 - 14
src/router/index.js

@@ -1,22 +1,14 @@
 import { createRouter, createWebHashHistory } from "vue-router";
 
-
-import p1 from '../views/pageOne.vue'
-import p2 from '../views/pageTwo.vue'
-
 const router = createRouter({
     history: createWebHashHistory(),
     routes: [
-        {
-            path: '/p1',
-            name: 'p1',
-            component: p1,
-        },
-        {
-            path: '/p2',
-            name: 'p2',
-            component: p2,
-        },
+        // {
+        //     path: '/p1',
+        //     name: 'p1',
+        //     component: p1,
+        // },
+        
     ]
 })
 

+ 0 - 33
src/views/childS.vue

@@ -1,33 +0,0 @@
-<template>
-    <div>
-        我是子组件,值为{{ gydxmsg }}{{ newmsg }}
-        <button @click="changefmsg">改变父组件</button>
-    </div>
-    
-</template>
-
-<script>
-    export default {
-        props:{
-            gydxmsg:String
-        },
-        data(){
-            return{
-                msg:'zzzzzzzzz',
-                newmsg:''
-            }
-        },
-        methods:{
-            changefmsg(){
-                this.$emit('changefathermsg', this.msg)
-            },
-            setmag(msg){
-                this.newmsg = msg
-            }
-        },
-    };
-</script>
-
-<style>
-
-</style>

+ 0 - 17
src/views/pageOne.vue

@@ -1,17 +0,0 @@
-<template>
-    <div class="main">
-        page1
-    </div>
-</template>
-
-<script>
-    export default {
-        
-    }
-</script>
-
-<style scoped>
-    .main{
-        background-color: rgb(9, 11, 11);
-    }
-</style>

+ 0 - 17
src/views/pageTwo.vue

@@ -1,17 +0,0 @@
-<template>
-    <div class="main">
-        page2
-    </div>
-</template>
-
-<script>
-    export default {
-        
-    }
-</script>
-
-<style scoped>
-    .main{
-        background-color: rgb(128, 210, 210);
-    }
-</style>