javascript - Vue is not detected when JSP is loaded through struts -
example jsp :
<!doctype html> <html lang="en-us" > <head> <script src="vue.min.js"></script> </head> <body> sample heading <div class="container" id="maindiv"> {{firstname}} </div> </body> <script type="text/javascript"> vue.config.devtools = true; var app = new vue({ el: '#maindiv', data: { firstname: 'name', lastname: 'lname', description: 'desc' } }); </script> </html>
the following options tried :
- if above file executed using .html, works expected. chrome dev tools detects vue application
- if above file executed using .jsp, works expected. chrome dev tools detects vue application(http://localhost:8080/example.jsp)
- if above file executed using .jsp , jsp loaded through form submission http://localhost:8080/example.do , success redirected example.jsp, doesn't work.
output in case 1 , 2 :
sample heading
name
output in case 3 :
sample heading.
- ideally supposed display "name" well.
- if inspect element, shows "".
- in inspect element, if select "app.firstname" able see value "name"
- lets say, if add "", vue still unable display component's template. if app.$ref -- {} in case 3 , app.$ref -- {container:...} in case 1 , 2
has tried similar scenarios ? wondering making vue not load data.
any in resolving issue appreciated.
thanks in advance
Comments
Post a Comment