How does WeChat Mini Programs display SVG?

1. Question:

The data returned by the

background is a link to the svg image, such as:" http://abc.com/a.svg". Now to render in Mini Program page, Mini Program has no SVG component.

2. Try to put the link directly in the src of the image component without displaying it.

3. Or how to convert the SVG code in Mini Program into the base64? available for the picture.
PC can use src= "data:image/svg+xml;base64," + the svg code that window.btoa (unescape (encodeURIComponent (wants to convert), but how to transfer it in Mini Program?

ask the god!


got it. It got complicated at first. It turns out that Mini Program api can be converted into base64. The code is as follows

  

just play svg with image src

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea88db-1ee6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea88db-1ee6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?