样式调整
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { isExternal } from "@/utils/validate"
|
||||
import { isExternal } from "@/utils/validate";
|
||||
|
||||
const props = defineProps({
|
||||
src: {
|
||||
@@ -30,41 +30,41 @@ const props = defineProps({
|
||||
type: [Number, String],
|
||||
default: ""
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
const realSrc = computed(() => {
|
||||
if (!props.src) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
let real_src = props.src.split(",")[0]
|
||||
let real_src = props.src.split(",")[0];
|
||||
if (isExternal(real_src)) {
|
||||
return real_src
|
||||
return real_src;
|
||||
}
|
||||
return import.meta.env.VITE_APP_BASE_API + real_src
|
||||
})
|
||||
return import.meta.env.VITE_APP_BASE_API + real_src;
|
||||
});
|
||||
|
||||
const realSrcList = computed(() => {
|
||||
if (!props.src) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
let real_src_list = props.src.split(",")
|
||||
let srcList = []
|
||||
let real_src_list = props.src.split(",");
|
||||
let srcList = [];
|
||||
real_src_list.forEach(item => {
|
||||
if (isExternal(item)) {
|
||||
return srcList.push(item)
|
||||
return srcList.push(item);
|
||||
}
|
||||
return srcList.push(import.meta.env.VITE_APP_BASE_API + item)
|
||||
})
|
||||
return srcList
|
||||
})
|
||||
return srcList.push(import.meta.env.VITE_APP_BASE_API + item);
|
||||
});
|
||||
return srcList;
|
||||
});
|
||||
|
||||
const realWidth = computed(() =>
|
||||
typeof props.width == "string" ? props.width : `${props.width}px`
|
||||
)
|
||||
);
|
||||
|
||||
const realHeight = computed(() =>
|
||||
typeof props.height == "string" ? props.height : `${props.height}px`
|
||||
)
|
||||
);
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
Reference in New Issue
Block a user