| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  | <template> | 
					
						
							|  |  |  |   <svg | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |     v-if="svg || isInnerSvg" | 
					
						
							| 
									
										
										
										
											2018-12-04 16:38:45 +08:00
										 |  |  |     class="md-icon icon-svg" | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  |     :class="[`md-icon-${name}`, size]" | 
					
						
							| 
									
										
										
										
											2018-09-03 10:55:46 +08:00
										 |  |  |     :style="{fill: color}" | 
					
						
							|  |  |  |     @click="$emit('click', $event)" | 
					
						
							|  |  |  |   > | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  |     <use :xlink:href="`#${name}`"/> | 
					
						
							|  |  |  |   </svg> | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   <i | 
					
						
							|  |  |  |     v-else-if="name" | 
					
						
							| 
									
										
										
										
											2018-12-04 16:38:45 +08:00
										 |  |  |     class="md-icon icon-font" | 
					
						
							| 
									
										
										
										
											2019-01-28 22:07:04 +08:00
										 |  |  |     :class="[`md-icon-${name}`, name, size]" | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |     :style="{color}" | 
					
						
							|  |  |  |     @click="$emit('click', $event)" | 
					
						
							|  |  |  |   ></i> | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  | </template> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <script>
import loadSprite from './load-spirte' | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  | import defaultSvg from './default-svg-list' | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | export default { | 
					
						
							|  |  |  |   name: 'md-icon', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   props: { | 
					
						
							|  |  |  |     name: { | 
					
						
							|  |  |  |       type: String, | 
					
						
							|  |  |  |       default: '', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     size: { | 
					
						
							|  |  |  |       type: String, | 
					
						
							|  |  |  |       default: 'md', | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     color: { | 
					
						
							|  |  |  |       type: String, | 
					
						
							|  |  |  |       default: '', | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  |     svg: { | 
					
						
							|  |  |  |       type: Boolean, | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |       default: false, | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  |     }, | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  |   }, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   mounted() { | 
					
						
							|  |  |  |     loadSprite() | 
					
						
							|  |  |  |   }, | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   computed: { | 
					
						
							|  |  |  |     isInnerSvg() { | 
					
						
							|  |  |  |       return !!defaultSvg[this.name] | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |   }, | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
</script> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | <style lang="stylus"> | 
					
						
							|  |  |  | .md-icon | 
					
						
							|  |  |  |   background-size contain | 
					
						
							|  |  |  |   fill currentColor | 
					
						
							| 
									
										
										
										
											2018-09-28 17:46:34 +08:00
										 |  |  |   -webkit-backface-visibility hidden | 
					
						
							|  |  |  |   transform translateZ(0) scale(1.0, 1.0) | 
					
						
							| 
									
										
										
										
											2018-12-11 21:20:36 +08:00
										 |  |  |   // display flex
 | 
					
						
							|  |  |  |   // align-items center
 | 
					
						
							|  |  |  |   // justify-content center
 | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-26 16:04:04 +08:00
										 |  |  |   // size
 | 
					
						
							| 
									
										
										
										
											2018-12-04 16:38:45 +08:00
										 |  |  |   &.icon-font | 
					
						
							|  |  |  |     font-family  "Mand-Mobile-Icon" !important | 
					
						
							|  |  |  |     font-size 16px | 
					
						
							|  |  |  |     font-style normal | 
					
						
							|  |  |  |     font-weight normal | 
					
						
							|  |  |  |     font-variant normal | 
					
						
							|  |  |  |     text-transform none | 
					
						
							|  |  |  |     line-height 1 | 
					
						
							|  |  |  |     letter-spacing 0 | 
					
						
							|  |  |  |     speak none | 
					
						
							|  |  |  |     -webkit-font-smoothing antialiased | 
					
						
							|  |  |  |     -moz-osx-font-smoothing grayscale | 
					
						
							|  |  |  |     &.xss | 
					
						
							| 
									
										
										
										
											2022-09-22 18:43:27 +08:00
										 |  |  |       font-size icon-size-xxs | 
					
						
							| 
									
										
										
										
											2018-12-04 16:38:45 +08:00
										 |  |  |     &.xs | 
					
						
							|  |  |  |       font-size icon-size-xs | 
					
						
							|  |  |  |     &.sm | 
					
						
							|  |  |  |       font-size icon-size-sm | 
					
						
							|  |  |  |     &.md | 
					
						
							|  |  |  |       font-size icon-size-md | 
					
						
							|  |  |  |     &.lg | 
					
						
							|  |  |  |       font-size icon-size-lg | 
					
						
							|  |  |  |     &:before | 
					
						
							|  |  |  |       position relative | 
					
						
							|  |  |  |       z-index 2 | 
					
						
							| 
									
										
										
										
											2021-08-06 14:34:26 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-04 16:38:45 +08:00
										 |  |  |   &.icon-svg | 
					
						
							|  |  |  |     &.xss | 
					
						
							| 
									
										
										
										
											2022-09-22 18:43:27 +08:00
										 |  |  |       width icon-size-xxs | 
					
						
							|  |  |  |       vertical-height(icon-size-xxs) | 
					
						
							| 
									
										
										
										
											2018-12-04 16:38:45 +08:00
										 |  |  |     &.xs | 
					
						
							| 
									
										
										
										
											2022-09-22 18:43:27 +08:00
										 |  |  |       width icon-size-xs | 
					
						
							|  |  |  |       vertical-height(icon-size-xs) | 
					
						
							| 
									
										
										
										
											2018-12-04 16:38:45 +08:00
										 |  |  |     &.sm | 
					
						
							| 
									
										
										
										
											2022-09-22 18:43:27 +08:00
										 |  |  |       width icon-size-sm | 
					
						
							|  |  |  |       vertical-height(icon-size-sm) | 
					
						
							| 
									
										
										
										
											2018-12-04 16:38:45 +08:00
										 |  |  |     &.md | 
					
						
							| 
									
										
										
										
											2022-09-22 18:43:27 +08:00
										 |  |  |       width icon-size-md | 
					
						
							|  |  |  |       vertical-height(icon-size-md) | 
					
						
							| 
									
										
										
										
											2018-12-04 16:38:45 +08:00
										 |  |  |     &.lg | 
					
						
							| 
									
										
										
										
											2022-09-22 18:43:27 +08:00
										 |  |  |       width icon-size-lg | 
					
						
							|  |  |  |       vertical-height(icon-size-lg) | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | // name
 | 
					
						
							| 
									
										
										
										
											2021-08-06 14:34:26 +08:00
										 |  |  | .md-icon-arrow:before | 
					
						
							|  |  |  |   content "\e68d" | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  | .md-icon-rectangle:before | 
					
						
							| 
									
										
										
										
											2021-08-06 14:34:26 +08:00
										 |  |  |   content "\e68e" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-invisible:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e601" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-visible:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e602" | 
					
						
							|  |  |  | .md-icon-right:before | 
					
						
							| 
									
										
										
										
											2021-08-06 14:34:26 +08:00
										 |  |  |   content "\e68f" | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  | .md-icon-wrong:before | 
					
						
							| 
									
										
										
										
											2021-08-06 14:34:26 +08:00
										 |  |  |   content "\e604" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-info:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e605" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-service:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e606" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-edit:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e607" | 
					
						
							|  |  |  | .md-icon-refresh:before | 
					
						
							| 
									
										
										
										
											2021-08-06 14:34:26 +08:00
										 |  |  |   content "\e692" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-question:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e608" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-setting:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e609" | 
					
						
							|  |  |  | .md-icon-wait:before | 
					
						
							| 
									
										
										
										
											2021-08-06 14:34:26 +08:00
										 |  |  |   content "\e690" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-check:before | 
					
						
							| 
									
										
										
										
											2021-08-06 14:34:26 +08:00
										 |  |  |   content "\e60c" | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  | .md-icon-check-disabled:before | 
					
						
							| 
									
										
										
										
											2021-08-06 14:34:26 +08:00
										 |  |  |   content "\e636" | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  | .md-icon-checked:before, .md-icon-success:before | 
					
						
							| 
									
										
										
										
											2021-08-06 14:34:26 +08:00
										 |  |  |   content "\e60d" | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  | .md-icon-clear:before, .md-icon-fail:before | 
					
						
							|  |  |  |   content "\e60e" | 
					
						
							|  |  |  | .md-icon-info-solid:before | 
					
						
							| 
									
										
										
										
											2021-08-06 14:34:26 +08:00
										 |  |  |   content "\e635" | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  | .md-icon-warn:before | 
					
						
							|  |  |  |   content "\e60b" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-security:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e60f" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-rmb:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e610" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-scan:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e611" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-share:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e612" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-back:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e613" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-card-bag:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e614" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-message:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e615" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-order:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e616" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-balance:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e617" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-coupon:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e618" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-sort:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e619" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-address-book:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e61a" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-mobile-phone:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e61b" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-home:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e61c" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-discovery:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e61d" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-calendar:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e61e" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-user:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e61f" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-time:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e620" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-search:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e621" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-switch:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e622" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-camera:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e623" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-clock:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e624" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-profession:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e625" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-delete:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e626" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-id-card:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e627" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-filter:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e628" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-location:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e629" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-authentication:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e62a" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-motor-vehicle:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e62b" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-phone:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e62c" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | .md-icon-volumn:before | 
					
						
							| 
									
										
										
										
											2018-11-15 21:18:03 +08:00
										 |  |  |   content "\e62d" | 
					
						
							|  |  |  | .md-icon-arrow-left:before | 
					
						
							|  |  |  |   content "\e603" | 
					
						
							|  |  |  | .md-icon-arrow-right:before | 
					
						
							|  |  |  |   content "\e630" | 
					
						
							|  |  |  | .md-icon-arrow-up:before | 
					
						
							|  |  |  |   content "\e633" | 
					
						
							|  |  |  | .md-icon-arrow-down:before | 
					
						
							|  |  |  |   content "\e634" | 
					
						
							|  |  |  | .md-icon-close:before | 
					
						
							| 
									
										
										
										
											2021-08-06 14:34:26 +08:00
										 |  |  |   content "\e68c" | 
					
						
							| 
									
										
										
										
											2022-07-21 17:47:45 +08:00
										 |  |  | .md-icon-square-check:before | 
					
						
							|  |  |  |   content "\e695" | 
					
						
							|  |  |  | .md-icon-square-checked:before | 
					
						
							|  |  |  |   content "\e696" | 
					
						
							| 
									
										
										
										
											2018-10-10 15:03:30 +08:00
										 |  |  | @font-face | 
					
						
							|  |  |  |   font-family Mand-Mobile-Icon | 
					
						
							|  |  |  |   font-style normal | 
					
						
							|  |  |  |   font-weight normal | 
					
						
							| 
									
										
										
										
											2019-01-04 14:45:29 +08:00
										 |  |  |   /* chrome、firefox、opera、Safari, Android, iOS 4.2+ */ | 
					
						
							|  |  |  |   /* Version is required */ | 
					
						
							| 
									
										
										
										
											2019-03-21 23:58:49 +08:00
										 |  |  |   src icon-font-family | 
					
						
							| 
									
										
										
										
											2018-09-28 17:46:34 +08:00
										 |  |  | </style> |