From 1a783e0a2068b1a99efb7a078f4a615f68dec18f Mon Sep 17 00:00:00 2001 From: heyujie <516346543@qq.com> Date: 星期一, 18 七月 2022 16:15:35 +0800 Subject: [PATCH] add desc --- src/views/index/components/productLeft.vue | 27 +++++++++++++++++++++++---- 1 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/views/index/components/productLeft.vue b/src/views/index/components/productLeft.vue index 9897cce..1f1a4b7 100644 --- a/src/views/index/components/productLeft.vue +++ b/src/views/index/components/productLeft.vue @@ -1,14 +1,21 @@ <template> - <div class="productLeft" :style="{ background: ` url(${data.img})` }"> + <div + class="productLeft" + :style="{ + background: ` url(${data.pic})`, + backgroundSize: '100% 100%', + backgroundRepeat: 'no-repeat', + }" + > <div class="inner"> <div class="title"> - {{ data.title }} + {{ data.name }} </div> <div class="des"> - {{ data.des }} + {{ data.desc }} </div> <div class="button"> - <router-link :to="data.router">鏌ョ湅鍏ㄩ儴</router-link> + <router-link to="/product">鏌ョ湅鍏ㄩ儴</router-link> </div> </div> </div> @@ -21,6 +28,18 @@ type: Object, }, }, + created() { + var reg = /^[0-9]/; + if (reg.test(this.data.pic)) { + this.pic = "http://" + this.data.pic; + } + this.pic = this.data.pic; + }, + data() { + return { + pic: "", + }; + }, }; </script> -- Gitblit v1.8.0