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 :

  1. if above file executed using .html, works expected. chrome dev tools detects vue application
  2. if above file executed using .jsp, works expected. chrome dev tools detects vue application(http://localhost:8080/example.jsp)
  3. 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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -