你好,我如何使用 linearGradient 但没有 id 填充 svg。例如使用 id 的代码...
<svg class="block__submit">
<rect fill="url(#linear-gradient-2)" width="100%" height="100%" />
<text y="50%" x="50%" text-anchor="middle" dominant-baseline="central">
BUY
</text>
<defs>
<linearGradient id="linear-gradient-2">
<stop offset="0%" stop-color="#9c83aa" class="stop-start" />
<stop offset="100%" stop-color="#9c83aa" class="stop-end" />
</linearGradient>
</defs>
</svg>