汐扬
汐扬
  • 发布:2020-01-09 14:20
  • 更新:2020-01-09 20:02
  • 阅读:4129

uni-app不支持svg文件显示吗?v-html显示不了svg图

分类:uni-app
SVG

<template>
<view class="content">
<!-- <image class="logo" src="/static/logo.png"></image> -->
<view class="text-area">
<text class="title" >{{title}}</text>
</view>
<view v-html="svgdata"></view>
</view>
</template>

<script>
export default {
data() {
return {
title: 'my project',
svgdata:"",
}
},
onLoad() {
this.handleopen()
},
methods: {
handleopen(){
console.log("11111")
uni.request({
url:'../static/201.svg',
success: function (res) {
console.log(res.data)
this.svgdata=res.data;

                }  
        })  
    },  
    }  
}  

</script>

<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}

.logo {  
    height: 200rpx;  
    width: 200rpx;  
    margin-top: 200rpx;  
    margin-left: auto;  
    margin-right: auto;  
    margin-bottom: 50rpx;  
}  

.text-area {  
    display: flex;  
    justify-content: center;  
}  

.title {  
    font-size: 36rpx;  
    color: #8f8f94;  
}  

</style>

2020-01-09 14:20 负责人:无 分享
已邀请:
DCloud_UNI_GSQ

DCloud_UNI_GSQ

不支持svg标签,可以在images使用

该问题目前已经被锁定, 无法添加新回复