Authored by 郭成尧

vue-code-better

@@ -7,9 +7,9 @@ @@ -7,9 +7,9 @@
7 data() { 7 data() {
8 return { 8 return {
9 msg: 'app' 9 msg: 'app'
10 - } 10 + };
11 } 11 }
12 - } 12 + };
13 </script> 13 </script>
14 14
15 <style> 15 <style>
@@ -13,22 +13,22 @@ @@ -13,22 +13,22 @@
13 <ul v-if="province.showList" class="address-ul"> 13 <ul v-if="province.showList" class="address-ul">
14 <li v-for="pprovince in provinces" 14 <li v-for="pprovince in provinces"
15 @click="switchAddress(pprovince.id, pprovince.caption)">{{pprovince.caption}} 15 @click="switchAddress(pprovince.id, pprovince.caption)">{{pprovince.caption}}
16 - <span v-if="pprovince.id === province.id" class="iconfont icon-V"></span></li> 16 + <span v-if="pprovince.id === province.id" class="iconfont icon-v"></span></li>
17 </ul> 17 </ul>
18 <ul v-if="city.showList" class="address-ul"> 18 <ul v-if="city.showList" class="address-ul">
19 <li v-for="pcity in citys" 19 <li v-for="pcity in citys"
20 @click="switchAddress(pcity.id, pcity.caption)">{{pcity.caption}} 20 @click="switchAddress(pcity.id, pcity.caption)">{{pcity.caption}}
21 - <span v-if="pcity.id === city.id" class="iconfont icon-V"></span></li> 21 + <span v-if="pcity.id === city.id" class="iconfont icon-v"></span></li>
22 </ul> 22 </ul>
23 <ul v-if="area.showList" class="address-ul"> 23 <ul v-if="area.showList" class="address-ul">
24 <li v-for="parea in areas" 24 <li v-for="parea in areas"
25 @click="switchAddress(parea.id, parea.caption)">{{parea.caption}} 25 @click="switchAddress(parea.id, parea.caption)">{{parea.caption}}
26 - <span v-if="parea.id === area.id" class="iconfont icon-V"></span></li> 26 + <span v-if="parea.id === area.id" class="iconfont icon-v"></span></li>
27 </ul> 27 </ul>
28 <ul v-if="street.showList" class="address-ul"> 28 <ul v-if="street.showList" class="address-ul">
29 <li v-for="pstreet in streets" 29 <li v-for="pstreet in streets"
30 @click="switchAddress(pstreet.id, pstreet.caption, true)">{{pstreet.caption}} 30 @click="switchAddress(pstreet.id, pstreet.caption, true)">{{pstreet.caption}}
31 - <span v-if="pstreet.id === street.id" class="iconfont icon-V"></span></li> 31 + <span v-if="pstreet.id === street.id" class="iconfont icon-v"></span></li>
32 </ul> 32 </ul>
33 </div> 33 </div>
34 </div> 34 </div>
@@ -36,7 +36,9 @@ @@ -36,7 +36,9 @@
36 </div> 36 </div>
37 </template> 37 </template>
38 <style> 38 <style>
39 -.icon-V:before { content: "\e6ea"; } 39 +.icon-v:before {
  40 + content: "\e6ea";
  41 +}
40 42
41 .address-select-component { 43 .address-select-component {
42 position: fixed; 44 position: fixed;
@@ -120,41 +122,41 @@ @@ -120,41 +122,41 @@
120 .address-content { 122 .address-content {
121 transform: translate(0, 0) translateZ(0); 123 transform: translate(0, 0) translateZ(0);
122 height: 620px; 124 height: 620px;
  125 + }
  126 + }
123 127
124 - .address-ul {  
125 - padding: 0;  
126 - margin: 0;  
127 - list-style: none;  
128 - height: 100%;  
129 - overflow: auto;  
130 - font-size: 24px;  
131 - color: #232326;  
132 -  
133 - li {  
134 - height: 80px;  
135 - line-height: 80px;  
136 - padding-left: 30px;  
137 - position: relative;  
138 - overflow: hidden;  
139 -  
140 - span {  
141 - color: #f23030;  
142 - font-size: 14px;  
143 - }  
144 - } 128 + .address-ul {
  129 + padding: 0;
  130 + margin: 0;
  131 + list-style: none;
  132 + height: 100%;
  133 + overflow: auto;
  134 + font-size: 24px;
  135 + color: #232326;
145 136
146 - li:after {  
147 - content: "";  
148 - width: 100%;  
149 - height: 1px;  
150 - position: absolute;  
151 - left: 0;  
152 - bottom: 0;  
153 - transform: scaleY(0.5);  
154 - -webkit-transform: scaleY(0.5);  
155 - } 137 + li {
  138 + height: 80px;
  139 + line-height: 80px;
  140 + padding-left: 30px;
  141 + position: relative;
  142 + overflow: hidden;
  143 +
  144 + span {
  145 + color: #f23030;
  146 + font-size: 14px;
156 } 147 }
157 } 148 }
  149 +
  150 + li:after {
  151 + content: "";
  152 + width: 100%;
  153 + height: 1px;
  154 + position: absolute;
  155 + left: 0;
  156 + bottom: 0;
  157 + transform: scaleY(0.5);
  158 + -webkit-transform: scaleY(0.5);
  159 + }
158 } 160 }
159 } 161 }
160 } 162 }
@@ -246,7 +248,8 @@ @@ -246,7 +248,8 @@
246 this.city.title = '请选择'; 248 this.city.title = '请选择';
247 this.city.showList = this.province.titleActive = true; 249 this.city.showList = this.province.titleActive = true;
248 this.province.showList = this.area.showList = this.street.showList = false; 250 this.province.showList = this.area.showList = this.street.showList = false;
249 - this.common.titleActive = this.city.titleActive = this.area.titleActive = this.street.titleActive = false; 251 + this.common.titleActive = this.city.titleActive =
  252 + this.area.titleActive = this.street.titleActive = false;
250 break; 253 break;
251 case 4: 254 case 4:
252 this.city.id = id; 255 this.city.id = id;
@@ -376,7 +379,7 @@ @@ -376,7 +379,7 @@
376 this.street.title = ''; 379 this.street.title = '';
377 break; 380 break;
378 default: 381 default:
379 - break 382 + break;
380 } 383 }
381 }, 384 },
382 }, 385 },