e 1 年間 前
コミット
504564790a

+ 2 - 2
vue2.0/vue高阶/hello_vue/src/App.vue

@@ -76,7 +76,7 @@ import Demo9 from './components/Demo9.vue';
 import Demo10 from './components/Demo10.vue';
 import Demo11 from './components/Demo11.vue';
 // 1.引入mixin
-import {mixin} from './utils/mixin'
+import {mixin} from './utils/mixin';
 export default {
   name:"App",
   data() {
@@ -86,7 +86,7 @@ export default {
       aaa:"111"
     }
   },
-  // 注册mixin
+  // 2.注册mixin
   mixin:[mixin],
   components:{
     Demo1,

+ 13 - 14
vue2.0/vue高阶/hello_vue/src/components/Demo11.vue

@@ -7,7 +7,7 @@
                 <div>{{item.title}}</div>
                 <div>查看更多</div>
             </div>
-            <div class="content">     
+            <div class="content">
                 <div class="bottom" v-for="(item1,index1) in item.productDtoList" :key="index1">
                     <img :src="item1.pic" alt="">
                     <div class="word">{{item1.prodName}}</div>
@@ -20,7 +20,6 @@
 </template>
 
 <script>
-// 引入
 import axios from 'axios';
 export default {
     data() {
@@ -29,19 +28,19 @@ export default {
         }
     },
     created() {
-        // Promise({
-
-        // }).then({
-
-        // }).catch({
-
-        // })
-        // get方法 http://shop-api.edu.koobietech.com/prod/tagProdList
+        /**
+         * Promise({
+         * 
+         * }).then({
+         * 
+         * }).catch({
+         * 
+         * })
+         */
         axios.get("http://shop-api.edu.koobietech.com/prod/tagProdList")
         .then(response => {
             console.log(response,'成功')
             this.list = response.data.data;
-            console.log(this.list,'列表')
         })
         .catch(err => {
             console.log(err,'失败')
@@ -50,7 +49,7 @@ export default {
 }
 </script>
 
-<style lang="scss" scoped>
+<style lang="scss">
 .main {
     width: 100%;
     display: flex;
@@ -80,9 +79,9 @@ export default {
             }
             .price {
                 font-size: 14px;
-                color: #f00;
+                color:#f00;
                 span {
-                    font-size: 16px;
+                    font-size:16px;
                 }
             }
         }

+ 2 - 2
vue2.0/vue高阶/hello_vue/src/main.js

@@ -6,8 +6,8 @@ import App from './App.vue'
 Vue.config.productionTip = false
 // 引入mixin
 import {mixin} from './utils/mixin'
-// 挂载
-Vue.mixin(mixin)
+// 挂载mixin
+Vue.mixin(mixin);
 // 实例化Vue
 new Vue({
   // 渲染页面

+ 3 - 3
vue2.0/vue高阶/hello_vue/src/utils/mixin.js

@@ -1,8 +1,8 @@
 export const mixin = {
-    methods:{
+    methods: {
         showTitle() {
-            alert("选中了")
-            console.log("我的标题是" + this.aaa)
+            alert("选中了");
+            console.log("我的标题是" + this.aaa);
         }
     },
     mounted() {