Include SVG xml in Jade template

后端 未结 3 2085
感情败类
感情败类 2021-02-04 10:06

Is it possible to create a Jade mixin, which reads a file from the file system, and echoes it into the rendered HTML?

I tried this...

mixin svg(file)
            


        
3条回答
  •  你的背包
    2021-02-04 10:37

    I have better luck with object, such as

      a.svg(href='/')
        object(type="image/svg+xml" data="/img/#{data.menu.img}.svg")
          | #{data.menu.title}
    

提交回复
热议问题