0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Vue3で画面初期表示時に取得するコードの桁数を元に表示される、入力欄のサイズを調整する方法

Posted at

~実装の考え方~
画面初期表示時に取得するコードの桁数を元に、テキストボックスのwidthを計算し、CSSで反映させるようにした

~コード~
Point:'document.getElementById'で該当項目のid属性を取得し、widthを上書きする

// コードの桁数を取得
this.disp.ketasuu = val[0].xxxcd.length;
let size = 30 + this.disp.ketasuu * 10;
var elem = document.getElementById("zzzz");

// 表示幅をコードに合わせて調整
elem.style.width = size + "px";
0
1
1

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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?