@mixd-id/web-scaffold 0.1.240411019 → 0.1.240411021

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mixd-id/web-scaffold",
3
3
  "private": false,
4
- "version": "0.1.240411019",
4
+ "version": "0.1.240411021",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -191,7 +191,13 @@ export default{
191
191
  }
192
192
 
193
193
  if(Array.isArray(this.src)){
194
- const imgSrc = this.src[this.$device.mediaIndex]
194
+ let imgSrc
195
+ for(let i = this.$device.mediaIndex ; i >= 0 ; i--){
196
+ if(this.src[i]){
197
+ imgSrc = this.src[i]
198
+ break
199
+ }
200
+ }
195
201
  setSrc(imgSrc)
196
202
  }
197
203
  else if(this.src){
@@ -272,6 +272,15 @@ export const componentMixin = {
272
272
  document.body.appendChild(guide)
273
273
  },
274
274
 
275
+ imageSrc(url){
276
+ if(typeof url === 'string'){
277
+ if(url.indexOf('://') < 0 && url.substring(0, 1) !== '/'){
278
+ url = ((import.meta.env.VITE_IMAGE_HOST ?? '') + '/' + url)
279
+ }
280
+ }
281
+ return url
282
+ }
283
+
275
284
  },
276
285
 
277
286
  mounted(){