From ee5dcf88260000d788c9fdc8f3633ef2df923236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=9B=BD=E6=99=A8?= <1650944868@qq.com> Date: Wed, 23 Jun 2021 21:34:34 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20210621/new_file.css" | 33 ++++ .../20210621/new_file.html" | 146 ++++++++++++++++++ 2 files changed, 179 insertions(+) create mode 100644 "\346\235\250\345\233\275\346\231\250/20210621/new_file.css" create mode 100644 "\346\235\250\345\233\275\346\231\250/20210621/new_file.html" diff --git "a/\346\235\250\345\233\275\346\231\250/20210621/new_file.css" "b/\346\235\250\345\233\275\346\231\250/20210621/new_file.css" new file mode 100644 index 00000000..dd242429 --- /dev/null +++ "b/\346\235\250\345\233\275\346\231\250/20210621/new_file.css" @@ -0,0 +1,33 @@ +.block{ + width: 800px; + height: auto;/*高度自适应*/ + min-height: 30px;/*最小高度指的是没有数据前title那一行的数据*/ + border: 1px silver solid; + margin: auto;/*居中显示*/ +} +.title{ + display: flex;/*设置伸缩盒*/ + flex-direction: row;/*让里面的元素在一行显示*/ +} +.title>div{ + flex: 1px;/*分配空间*/ + height: 30px;/*设置高度是想垂直显示用*/ + border: 1px solid silver; + text-align: center;/*居中显示*/ + line-height: 30px;/*垂直显示*/ +} + +.h_list{ + display: flex;/*设置伸缩盒*/ + flex-direction: row;/*让里面的元素在一行显示*/ +} +.h_list>div{/*分配空间 居中*/ + flex: 1; + text-align: center; + line-height: 80px; + border: 1px solid silver; +} +.txt {/*num里label的宽*/ + width: 30px; + display: inline-block; +} diff --git "a/\346\235\250\345\233\275\346\231\250/20210621/new_file.html" "b/\346\235\250\345\233\275\346\231\250/20210621/new_file.html" new file mode 100644 index 00000000..393ad5a8 --- /dev/null +++ "b/\346\235\250\345\233\275\346\231\250/20210621/new_file.html" @@ -0,0 +1,146 @@ + + + + + 购物车 + + + + +
+ +
+ +
全选/反选
+
名称
+
单价
+
数量
+
小计
+
操作
+
+
+
+
+
{{item.name}}
+
{{item.price}}
+
+ {{item.num}} +
+
{{item.price*item.num}}
+
+
+
+

+ 金额总计:{{sum}} +

+

+ 商品数量:{{count}} +

+ +
+ + + + + -- Gitee From c2a2cf608b1b5b3c1165f60453810ac5719d0789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=9B=BD?= <杨国> Date: Thu, 24 Jun 2021 11:44:58 +0800 Subject: [PATCH 2/3] 11 --- .../20210621/1.html" | 34 ++++---- .../20210621/new_file.html" | 81 ++++++++++++++----- 2 files changed, 76 insertions(+), 39 deletions(-) diff --git "a/\346\235\250\345\233\275\346\231\250/20210621/1.html" "b/\346\235\250\345\233\275\346\231\250/20210621/1.html" index 0a17dad6..125a8549 100644 --- "a/\346\235\250\345\233\275\346\231\250/20210621/1.html" +++ "b/\346\235\250\345\233\275\346\231\250/20210621/1.html" @@ -26,13 +26,8 @@ } }, props:['price'], - template:`
`, - methods:{ - add:function(){ - // console.log(app.price) - app.list.push({name:app.price}); - } - } + template:`
`, + }); Vue.component('co-ul',{ @@ -42,13 +37,9 @@ } }, props:['list','index'], - template:'
  • {{list.name}}
  • ', + template:'
  • {{list.name}}
  • ', + - methods:{ - btnDelete:function(index){ - app.list.splice(index,1); - } - } }); let app = new Vue({ @@ -60,12 +51,17 @@ {id:2,name:"吃饭"}, ], }, - // methods:{ - // add:function(){ - // console.log(this.price); - // this.list.push({name:this.price}) - // } - // } + methods:{ + add:function(){ + console.log(this.price); + this.list.push({name:this.price}) + }, + + btnDelete:function(index){ + this.list.splice(index,1); + } + + } }); diff --git "a/\346\235\250\345\233\275\346\231\250/20210621/new_file.html" "b/\346\235\250\345\233\275\346\231\250/20210621/new_file.html" index 393ad5a8..ebf37316 100644 --- "a/\346\235\250\345\233\275\346\231\250/20210621/new_file.html" +++ "b/\346\235\250\345\233\275\346\231\250/20210621/new_file.html" @@ -8,28 +8,19 @@
    + + -
    + -
    全选/反选
    + + +

    金额总计:{{sum}} @@ -42,6 +33,43 @@

    - - - - - - - - -
    -

    - 金额总计:{{sum}} -

    -

    - 商品数量:{{count}} -

    - + + + + +
    - -