Last active
January 18, 2019 18:39
-
-
Save kimagure44/cbbf7c78d2f78c55e98e069b3504aa18 to your computer and use it in GitHub Desktop.
This file contains 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
<!DOCTYPE html> | |
<html lang="es"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Hola VUE</title> | |
</head> | |
<body> | |
<!-- Definimos el tag que usaremos para la instancia de VUE (contexto donde puede acceder VUE) --> | |
<div id="container"> | |
<!-- Modelo, usandpo "{{}}" VUE cuando encuentre las llaves va a buscar en el modelo para sustituir por el valor --> | |
<h1>{{ mensaje }}</h1> | |
</div> | |
<!-- Incluir VUE --> | |
<script src='https://cdn.jsdelivr.net/npm/vue'></script> | |
<!-- | |
Para evitar tener multiples ficheros y ver el ejemplo mas claro | |
añadire el código JS dentro del propio HTML | |
--> | |
<script> | |
// Instancia de VUE | |
var app = new Vue({ | |
// Elemento que afecta VUE | |
el: "#container", | |
// Modelo, la fuente de datos | |
data: { | |
mensaje: "Hola mundo, VUE" | |
} | |
}) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment