LoginSignup
3
3

More than 3 years have passed since last update.

vueで出会う「$」について

Posted at

vue.jsを扱っていると、時々「$」に出会います。
例えば

db.collection("twits").doc(this.$props.id),

これは何なのかわからなかったので調べました。

その他でも説明されていますが、これはvueが元々持っているネイティブのプロパティを使う場合に必要となるものです。

props というプロパティは元々vueに備わっているものなので、 $ が必要ということです。

ちなみに main.js にある $mount は、elプロパティと同じことを行うことができるメソッドです。
$mount は引数を取り、テンプレートをマウントしたい要素を決めることが可能です。

また一つ学びました。

3
3
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
3