svgdotjs / svg.js

The lightweight library for manipulating and animating SVG
https://svgjs.dev
Other
11.01k stars 1.07k forks source link

There are some problems with SVG3.0 used in micro front-end and non-micro front-end projects #1189

Closed mengbo-ji closed 3 years ago

mengbo-ji commented 3 years ago

For support questions, please use stackoverflow with the tag svg.js or head to our chat over at gitter, if you have a bug report or feature request, use those templates. 1.Under non-micro front end: image 2.Micro front end: image

Description: In both cases, the code is the same, and my text is no longer displayed. Ask for help

mengbo-ji commented 3 years ago

code: image

mengbo-ji commented 3 years ago

How is tspan generated? I noticed that their labels were different. and

Fuzzyma commented 3 years ago

The first example has a tspan (which is allowed) and the second has text in text (which is not allowed). Dont know how you managed to do that

When you call .text a text element with one tspan per line is generated. If you dont want these tspans you can also use plain instead of text which will give you a text element without the tspan.

mengbo-ji commented 3 years ago

The first example has a tspan (which is allowed) and the second has text in text (which is not allowed). Dont know how you managed to do that

When you call .text a text element with one tspan per line is generated. If you dont want these tspans you can also use plain instead of text which will give you a text element without the tspan.

I am also very surprised, the code is above, but Is rendered, one is tspan and one text

mengbo-ji commented 3 years ago

great! I can render text under the micro front end with .plain. .text still does not generate tspan

mengbo-ji commented 3 years ago

firefox is displayed, I guess it may be a problem with chrome

Fuzzyma commented 3 years ago

What on earth is the micro front end? Is this some other library? In this case, you have to report the issue there and not here!

mengbo-ji commented 3 years ago

What on earth is the micro front end? Is this some other library? In this case, you have to report the issue there and not here!

Aha, he is this [(https://github.com/aliyun/alibabacloud-alfa)]

mengbo-ji commented 3 years ago

What on earth is the micro front end? Is this some other library? In this case, you have to report the issue there and not here!

Aha, he is this [(https://github.com/aliyun/alibabacloud-alfa)]

I think what you said is reasonable, it may be a problem with the micro front end, I will contact their members, thank you