meixioacomponent 0.3.34 → 0.3.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28291,7 +28291,7 @@
28291
28291
  }
28292
28292
 
28293
28293
  .el-button--bg-icon i {
28294
- font-size: 20px !important;
28294
+ font-size: 18px !important;
28295
28295
  }
28296
28296
 
28297
28297
  .el-button--bg-icon.is-current {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meixioacomponent",
3
- "version": "0.3.34",
3
+ "version": "0.3.37",
4
4
  "private": false,
5
5
  "author": "YuRi",
6
6
  "main": "lib/meixioacomponent.umd.min.js",
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="base-img-wrap">
2
+ <div class="base-img-wrap" :class="[shape]">
3
3
  <img
4
4
  alt=""
5
5
  :src="src"
@@ -13,7 +13,7 @@
13
13
  <baseSkeletonVue
14
14
  v-if="loading"
15
15
  :lines="[1]"
16
- :shape="`rect`"
16
+ :shape="shape"
17
17
  ></baseSkeletonVue>
18
18
  <div class="img-error-wrap" v-if="isError">
19
19
  <base-icon
@@ -26,18 +26,18 @@
26
26
  </template>
27
27
 
28
28
  <script>
29
- import useImg from "../../../config/use/UseImg";
30
- import baseSkeletonVue from "../baseSkeleton/baseSkeleton.vue";
29
+ import useImg from '../../../config/use/UseImg'
30
+ import baseSkeletonVue from '../baseSkeleton/baseSkeleton.vue'
31
31
  export default {
32
- name: "baseImg",
32
+ name: 'baseImg',
33
33
  data() {
34
34
  return {
35
35
  isError: false,
36
36
  loading: true,
37
- };
37
+ }
38
38
  },
39
39
  created() {
40
- this.init();
40
+ this.init()
41
41
  },
42
42
  components: {
43
43
  baseSkeletonVue,
@@ -46,98 +46,104 @@ export default {
46
46
  // cover,fill,contain,
47
47
  fit: {
48
48
  type: String,
49
- default: "cover",
49
+ default: 'cover',
50
50
  },
51
51
  src: {
52
52
  type: String,
53
53
  },
54
54
  error: {
55
55
  type: String,
56
- default: "图片加载失败",
56
+ default: '图片加载失败',
57
57
  },
58
58
  event: {
59
59
  type: Boolean,
60
60
  default: false,
61
61
  },
62
+ shape: {
63
+ type: String,
64
+ default: 'rect',
65
+ },
62
66
  },
63
67
  computed: {
64
68
  imgStyle() {
65
69
  return {
66
70
  objectFit: this.$props.fit,
67
- cursor: this.$props.event ? "zoom-in" : "default",
68
- };
71
+ cursor: this.$props.event ? 'zoom-in' : 'default',
72
+ }
69
73
  },
70
74
  imgShow() {
71
75
  if (this.$props.src) {
72
- return true;
76
+ return true
73
77
  }
74
- return false;
78
+ this.loading = false
79
+ this.isError = true
80
+ return false
75
81
  },
76
82
  },
77
83
  methods: {
78
84
  init() {
79
85
  if (!this.$props.src) {
80
- this.loading = true;
86
+ this.loading = true
81
87
  }
82
88
  },
83
89
  loadEd() {
84
- this.loading = false;
90
+ this.loading = false
85
91
  },
86
92
  errorEd() {
87
93
  //console.log(this.$props.src)
88
94
  //console.log("imgError");
89
- this.loading = false;
90
- this.isError = true;
95
+ this.loading = false
96
+ this.isError = true
91
97
  },
92
98
  viewImg() {
93
- if (!this.$props.event || this.loading || this.isError) return;
94
- let parent = this.$parent;
99
+ if (!this.$props.event || this.loading || this.isError) return
100
+ let parent = this.$parent
95
101
  if (!parent) {
96
- useImg.toView([this.$props.src]);
97
- return;
102
+ useImg.toView([this.$props.src])
103
+ return
98
104
  }
99
- let tags = parent.$options._componentTag;
100
- if (tags == "baseUploadItemVue") {
101
- useImg.toView([this.$props.src]);
105
+ let tags = parent.$options._componentTag
106
+ if (tags == 'baseUploadItemVue') {
107
+ useImg.toView([this.$props.src])
102
108
  } else {
103
- let parentChildrenList = parent.$children;
104
- let name = this.$options.name;
109
+ let parentChildrenList = parent.$children
110
+ let name = this.$options.name
105
111
  let filterList = parentChildrenList.filter((item) => {
106
- return item.$options.name == name;
107
- });
108
- let imgList = [];
109
- let thisIndex = null;
110
- let thisSrc = this.$props.src;
112
+ return item.$options.name == name
113
+ })
114
+ let imgList = []
115
+ let thisIndex = null
116
+ let thisSrc = this.$props.src
111
117
  filterList.forEach((item, index) => {
112
- let itemSrc = item.$props.src;
118
+ let itemSrc = item.$props.src
113
119
  if (itemSrc == thisSrc) {
114
- thisIndex = index;
120
+ thisIndex = index
115
121
  }
116
- imgList.push(itemSrc);
117
- });
118
- this.viewListImg(thisIndex, imgList);
122
+ imgList.push(itemSrc)
123
+ })
124
+ this.viewListImg(thisIndex, imgList)
119
125
  }
120
126
  },
121
127
 
122
128
  viewListImg(index, imgList) {
123
- let templateList = [...imgList];
129
+ let templateList = [...imgList]
124
130
  if (index == 0) {
125
- useImg.toView(templateList);
126
- return;
131
+ useImg.toView(templateList)
132
+ return
127
133
  }
128
- let start = templateList.splice(index);
129
- let remain = templateList.splice(0, index);
130
- useImg.toView(start.concat(remain));
134
+ let start = templateList.splice(index)
135
+ let remain = templateList.splice(0, index)
136
+ useImg.toView(start.concat(remain))
131
137
  },
132
138
  },
133
139
 
134
140
  watch: {
135
141
  src: function (newVal, oldVal) {
136
- this.isError = false;
137
- this.loading = true;
142
+ this.isError = false
143
+ this.loading = true
138
144
  },
139
145
  },
140
- };
146
+ }
141
147
  </script>
142
148
 
143
149
  <style lang="less" scoped>
@@ -157,4 +163,7 @@ export default {
157
163
  justify-content: center;
158
164
  }
159
165
  }
166
+ .cir {
167
+ border-radius: 50%;
168
+ }
160
169
  </style>
@@ -28291,7 +28291,7 @@
28291
28291
  }
28292
28292
 
28293
28293
  .el-button--bg-icon i {
28294
- font-size: 20px !important;
28294
+ font-size: 18px !important;
28295
28295
  }
28296
28296
 
28297
28297
  .el-button--bg-icon.is-current {