Created
June 2, 2018 15:34
-
-
Save jonathanjd/6ecd857577315c8725f4a113f649ecfd to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/livabef
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <div id="app"> | |
| {{ nombreCompleto }} | |
| <br> | |
| {{ edadShow }} | |
| </div> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.3/vue.js"></script> | |
| <script id="jsbin-javascript"> | |
| new Vue({ | |
| el: "#app", | |
| data: { | |
| nombre: "Jonathan", | |
| apellido: "Duran", | |
| edad: 31 | |
| }, | |
| computed: { | |
| nombreCompleto: { //nombreCompleto Inicio | |
| set:function(newValue) { | |
| var names = newValue.split(' ') | |
| this.firstName = names[0] | |
| this.lastName = names[names.length - 1] | |
| }, | |
| get:function() { | |
| return this.nombre + " " + this.apellido; | |
| } | |
| },//nombreCompleto Final | |
| edadShow: function() {//edadShow | |
| return "Mi Edad es:" + this.edad; | |
| } | |
| } | |
| }); | |
| </script> | |
| <script id="jsbin-source-javascript" type="text/javascript">new Vue({ | |
| el: "#app", | |
| data: { | |
| nombre: "Jonathan", | |
| apellido: "Duran", | |
| edad: 31 | |
| }, | |
| computed: { | |
| nombreCompleto: { //nombreCompleto Inicio | |
| set:function(newValue) { | |
| var names = newValue.split(' ') | |
| this.firstName = names[0] | |
| this.lastName = names[names.length - 1] | |
| }, | |
| get:function() { | |
| return this.nombre + " " + this.apellido; | |
| } | |
| },//nombreCompleto Final | |
| edadShow: function() {//edadShow | |
| return "Mi Edad es:" + this.edad; | |
| } | |
| } | |
| });</script></body> | |
| </html> |
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
| new Vue({ | |
| el: "#app", | |
| data: { | |
| nombre: "Jonathan", | |
| apellido: "Duran", | |
| edad: 31 | |
| }, | |
| computed: { | |
| nombreCompleto: { //nombreCompleto Inicio | |
| set:function(newValue) { | |
| var names = newValue.split(' ') | |
| this.firstName = names[0] | |
| this.lastName = names[names.length - 1] | |
| }, | |
| get:function() { | |
| return this.nombre + " " + this.apellido; | |
| } | |
| },//nombreCompleto Final | |
| edadShow: function() {//edadShow | |
| return "Mi Edad es:" + this.edad; | |
| } | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment