Help us understand the problem. What is going on with this article?

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

More than 1 year has passed since last update.

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

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

と書きます。

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

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

と書きます。

window.onloadwindow:onload

.:の違いでした。

bo-san
まだまだ見習いの情報技術者
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away