两种方式
第一种、将svg转换成base64格式的,在线svg转base64工具地址为:
转换好后:
wxss代码
.svg-demo-container {
margin: 50rpx;
width: 300rpx;
display: flex;
align-items: center;
}
.svg-demo-text {
color: #888896;
font-size: 26rpx;
margin-left: 9rpx;
}
.icon-open-new {
background-image: url("data:image/svg+xml, %3Csvg height='24' width='24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M19 19H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z'/%3E%3C/svg%3E");
background-size: cover;
}
.icon {
display: inline-block;
width: 50rpx;
height: 50rpx;
}wxml<view class="svg-demo-container">第二种、直接将svg文件放在远程服务器上,采用http的方式调用
<text class="icon-open-new icon"></text>
<text class="svg-demo-text">在新窗口打开</text>
</view>
上面的代码可以改成
.icon-open-new {
background:url(http://repo.bfw.wiki/bfwrepo/svg/sun.svg);
background-size: cover;
}网友回复
有没有不依赖embedding向量的RAG技术?
有没有支持实时打断语音通话并后台帮你执行任何的ai模型?
开源ai大模型文件格式GGUF、MLX、Safetensors、 ONNX 有什么区别?
出海挣钱支付收款PayPal、Wise 、PingPong、Stripe如何选择?
如何实现类似google的图片隐形水印添加和识别技术?
linux上如何运行任意windows程序?
ai能写出比黑客还厉害的零日漏洞等攻击工具攻击任意软件系统工程?
js如何获取浏览器的音频上下文指纹、Canvas指纹、WebGL渲染特征?
为啥ai开始抛弃markdown文本,重新偏好html文本了?
网站有没有办法鉴别访问请求是由ai操控chrome-devtools-mcp发出的?


