Created
August 11, 2024 19:19
-
-
Save TuVanDev/ee8ea5cb3f6a18338b5b62f4aeee21b2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="vue-test"> | |
| <h1>Loading message...</h1> | |
| </div> | |
| <script> | |
| require (['vue'], function(Vue) { | |
| 'use strict' | |
| new Vue({ | |
| el: '#vue-test', | |
| data: { | |
| message: 'This is a test' | |
| }, | |
| mounted() { | |
| // Replace the content of the h1 element with the Vue message | |
| const vueContentPlaceholder = document.querySelector('#vue-test h1'); | |
| vueContentPlaceholder.textContent = this.message; | |
| } | |
| }); | |
| }) | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment