LoginSignup
3
0

More than 3 years have passed since last update.

【SVG・CSS・Vue.js】SVGが画面サイズの変化時にちらつく場合の対処

Posted at

width・heightの設定を確認

svgのある画面でVue.jsにてv-bindで要素の表示・非表示を切り替えていたところ、
svgの中身がピクピクと小さくなったり大きくなったりする(ちらつく)場面に遭遇。
height・widthの片方を指定するとサイズが定まらず事象が起こる模様。

簡単な対処法にも関わらず手間取ったためメモします。

  // svgをwrapした要素
  #svg_img {
    width: 100px;
    height: 20px; // heightの指定が抜けていた
  }
3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0