mirror of
https://gitee.com/dromara/go-view.git
synced 2025-10-13 14:02:10 +08:00
feat: 修复背景图 顶栏图路径错误
This commit is contained in:
parent
abb99c6f77
commit
ee54a366f0
BIN
src/assets/images/chart/decorates/TimeCommon1.png
Normal file
BIN
src/assets/images/chart/decorates/TimeCommon1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
@ -3,7 +3,7 @@
|
||||
<n-image
|
||||
:object-fit="fit"
|
||||
preview-disabled
|
||||
:src="`/src/assets/images/chart/customponents/${dataset}`"
|
||||
:src="imageInfo"
|
||||
:fallback-src="requireErrorImg()"
|
||||
:width="w"
|
||||
lazy
|
||||
@ -13,10 +13,11 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { PropType, toRefs } from 'vue'
|
||||
import { PropType, toRefs, ref } from 'vue'
|
||||
import { requireErrorImg } from '@/utils'
|
||||
import { CreateComponentType } from '@/packages/index.d'
|
||||
// import background from '@/assets/customComponents/theme1/backgrond.jpg'
|
||||
import { fetchImages } from '@/packages'
|
||||
|
||||
const props = defineProps({
|
||||
chartConfig: {
|
||||
@ -28,6 +29,13 @@ const props = defineProps({
|
||||
const { w, h } = toRefs(props.chartConfig.attr)
|
||||
const { dataset, fit, borderRadius } = toRefs(props.chartConfig.option)
|
||||
|
||||
let imageInfo = ref('')
|
||||
// 获取图片
|
||||
const fetchImageUrl = async () => {
|
||||
imageInfo.value = await fetchImages(props.chartConfig.chartConfig)
|
||||
}
|
||||
fetchImageUrl()
|
||||
|
||||
const getStyle = (radius: number) => {
|
||||
return {
|
||||
borderRadius: `${radius}px`,
|
||||
|
@ -3,7 +3,7 @@
|
||||
<n-image
|
||||
:object-fit="fit"
|
||||
preview-disabled
|
||||
:src="`/src/assets/images/chart/decorates/${dataset}`"
|
||||
:src="imageInfo"
|
||||
:fallback-src="requireErrorImg()"
|
||||
:width="w"
|
||||
lazy
|
||||
@ -13,9 +13,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { PropType, toRefs } from 'vue'
|
||||
import { PropType, ref, toRefs } from 'vue'
|
||||
import { requireErrorImg } from '@/utils'
|
||||
import { CreateComponentType } from '@/packages/index.d'
|
||||
import { fetchImages } from "@/packages/index";
|
||||
|
||||
const props = defineProps({
|
||||
chartConfig: {
|
||||
@ -27,6 +28,13 @@ const props = defineProps({
|
||||
const { w, h } = toRefs(props.chartConfig.attr)
|
||||
const { dataset, fit, borderRadius } = toRefs(props.chartConfig.option)
|
||||
|
||||
let imageInfo = ref('')
|
||||
// 获取图片
|
||||
const fetchImageUrl = async () => {
|
||||
imageInfo.value = await fetchImages(props.chartConfig.chartConfig)
|
||||
}
|
||||
fetchImageUrl()
|
||||
|
||||
const getStyle = (radius: number) => {
|
||||
return {
|
||||
borderRadius: `${radius}px`,
|
||||
|
Loading…
x
Reference in New Issue
Block a user