57
38

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 5 years have passed since last update.

vue.jsでウィンドウ読み込み時に関数実行したいときの書き方

Posted at

一般的にjava scriptでウィンドウ読むときは

window.onload = function() {
  alert('Hello World!');
};

と書きます。

これを、Vue.jsに適用させる場合は、

methods: {
  window:onload = function() {  
   alert('koko');
  },
}

と書きます。

window.onloadwindow:onload

.:の違いでした。

57
38
4

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
57
38

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?