0
0

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

vue3の基本構文①
オブジェクト作成からマウントまで
コード内に流れを記載。

<!DOCTYPE html>
<html>

<head>
    <title>My first Vue app</title>
    <script src="https://unpkg.com/vue@next"></script>
</head>

<body>
    <h1>Vue3</h1>
    <div id="app">
        <!--④appdataオブジェクトのアプリケーションからmessageを表示 -->
        {{ message }}
    </div>

    <script>
        //①appdataにdata内のmessageを代入
        const appdata = {
            data() {
                return {
                    message: 'Hello World'
                }
            }
        }
        //②Vue.createApp(appdata)→appdataオブジェクトをつかってアプリケーションを作成
        //③.mount('#app')→アプリケーションを#appにマウントする
        Vue.createApp(appdata).mount('#app')
    </script>
</body>

</html>
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?