diff --git a/mo-home.js b/mo-home.js index 87fcaf7..c0616bf 100644 --- a/mo-home.js +++ b/mo-home.js @@ -1,13 +1,40 @@ -{/* Leer más */} - - -const app = createApp({ - data() { - return { - readMoreText: "Leer más", - readMoreIcon: "fa fa-arrow-right", - } - } - }) +jQuery(document).ready(function(){ -app.mount('#mo-home-vue-app') + var READMORELANG, READLESSLANG; + const app = Vue.createApp({ + data() { + return { + readMoreActive: false, + readMoreText: "Leer más", + readMoreIcon: "fa fa-arrow-right", + } + }, + mounted(){ + READMORELANG = jQuery(".readMoreBtn").data("readmorelang"); + READLESSLANG = jQuery(".readMoreBtn").data("readlesslang"); + + + }, + methods:{ + readMore(){ + if (this.readMoreActive){ + this.readMoreText = READMORELANG; + this.readMoreIcon = "fa fa-arrow-right"; + + }else{ + this.readMoreText = READLESSLANG; + this.readMoreIcon = "fa fa-minus"; + } + this.readMoreActive = ! this.readMoreActive; + + jQuery(".d-none").toggle("fast", function(){ + + }); + + + } + } + }) + app.mount('#mo-home-vue-app') + +}); \ No newline at end of file diff --git a/test.html b/test.html index 5920477..9c4e54a 100644 --- a/test.html +++ b/test.html @@ -4,28 +4,66 @@ - Document + Vue Tests + -
- {{ readMoreText }} +
+ This is a hidden text. Named for some obscure action to be active on the web. +
+ Now it's time to rock & roll!
- +
+ {{ readMoreText }} +
+ \ No newline at end of file