web2py & vuejs

73 views
Skip to first unread message

Eric Quinones

unread,
Mar 17, 2020, 11:42:18 AM3/17/20
to web2py-developers
Hello 

I'm trying to use vuejs in web2py.

Someone knows how to use vuejs in web2py?

I have this file named 01.js

const VueApp = new Vue({
  el:'#ejemplo',
  data:{
    titulo:'Hola mundo con vue'
  }
});


in my view default index I have this:

    <div id="ejemplo">
        <h1>{{titulo}} </h1>
      </div>

The vue instance is working

I have this message in the console in chrome:


>VueApp.titulo
ueApp.titulo
"Hola mundo con vue"


How can I get the value from vue?

this is from the manual of vuejs   https://es-vuejs.github.io/vuejs.org/v2/guide/

<div id="app">
{{ message }}
</div>
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!'
}
})

Thanks in advance!

Alexandre Andrade

unread,
Mar 20, 2020, 1:19:32 PM3/20/20
to web2py-d...@googlegroups.com
py4web uses vue

py4web is the Massimo substitute for Web2py

--
-- mail from:GoogleGroups "web2py-developers" mailing list
make speech: web2py-d...@googlegroups.com
unsubscribe: web2py-develop...@googlegroups.com
details : http://groups.google.com/group/web2py-developers
the project: http://code.google.com/p/web2py/
official : http://www.web2py.com/
---
You received this message because you are subscribed to the Google Groups "web2py-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py-developers/9669c901-3c11-4d15-867f-76ffc803c4f8%40googlegroups.com.
--
Atenciosamente


Alexandre Andrade

Carlos Costa

unread,
Mar 21, 2020, 9:17:27 AM3/21/20
to web2py-d...@googlegroups.com
The first problem with have using Vue with web2py is related with delimiters.
Both use the same {{ }}

So you have to instruct one of them to use another delimiter.
I prefer to tell Vue to use another delimiter,  [[ ]]

<div id="app">
[[ message ]]
</div>

var app = new Vue({
el: '#app',
delimiters: ['[[' , ']]']
data: {
message: 'Hello Vue!'
}
})


--
At.

Carlos J. Costa
--------------------------------------------------------------
Cientista da Computação - Esp. Gestão em Telecom
Reply all
Reply to author
Forward
0 new messages