File tree Expand file tree Collapse file tree 5 files changed +49
-7
lines changed
src/ThemeBundle/Resources/views/Layout Expand file tree Collapse file tree 5 files changed +49
-7
lines changed Original file line number Diff line number Diff line change 1+ export const VueConfig = {
2+ delimiters : [ '[[' , ']]' ]
3+ } ;
Original file line number Diff line number Diff line change @@ -17,11 +17,6 @@ const legacyIndex = Routing.generate('legacy_index');
1717const mainUrl = Routing . generate ( 'web.main' ) ;
1818const webAjax = Routing . generate ( 'web.ajax' ) ;
1919
20- /*console.log(homePublicUrl);
21- console.log(legacyIndex);
22- console.log(mainUrl);
23- console.log(webAjax);*/
24-
2520var ajax_url = webAjax + 'chat.ajax.php' ;
2621var online_button = '<img src="' + homePublicUrl + 'img/statusonline.png">' ;
2722var offline_button = '<img src="' + homePublicUrl + 'img/statusoffline.png">' ;
@@ -31,7 +26,36 @@ var disconnect_lang = '{{ "ChatDisconnected"|get_lang }}';*/
3126var connect_lang = 'ChatConnected' ;
3227var disconnect_lang = 'ChatDisconnected' ;
3328
29+ // Import Vue and Components
30+ import Vue from 'vue' ;
31+ import { VueConfig } from './VueConfig' ;
32+ import Example from './components/Example'
33+
34+
3435$ ( function ( ) {
36+ // Create App Aplication Vue
37+ new Vue (
38+ Object . assign ( VueConfig , {
39+ el : '#app_header' ,
40+ components : { Example} ,
41+ data ( ) {
42+ return {
43+ chamilo : ''
44+ }
45+ } ,
46+ methods : {
47+ getConsole ( ) {
48+ console . log ( "Hello Vuejs" ) ;
49+ }
50+ } , created ( ) {
51+ this . chamilo = "Hello Chamilo" ;
52+ this . getConsole ( ) ;
53+ console . log ( this . chamilo ) ;
54+ }
55+ } )
56+ ) ;
57+
58+
3559 var webCidReq = '&cidReq=' + $ ( 'body' ) . attr ( 'data-course-code' ) ;
3660 window . webCidReq = webCidReq ;
3761
Original file line number Diff line number Diff line change 1+ <template >
2+ <div >
3+ <p >This is an example of a new components in VueJs</p >
4+ </div >
5+ </template >
6+ <script >
7+ export default {
8+ name: " example"
9+ }
10+ </script >
11+ <style scoped>
12+ </style >
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ $(function () {
6666 });
6767});
6868</script >
69- <header class =" app-header navbar" >
69+ <header id = " app_header " class =" app-header navbar" >
7070 <button class =" navbar-toggler sidebar-toggler d-lg-none mr-auto" type =" button" data-toggle =" sidebar-show" >
7171 <span class =" navbar-toggler-icon" ></span >
7272 </button >
@@ -85,6 +85,9 @@ $(function () {
8585 {{ " Course catalog" | trans }}
8686 </a >
8787 </li >
88+ <li >
89+ [[ chamilo ]]
90+ </li >
8891 <form class =" form-inline my-2 my-lg-0" >
8992 <input class =" form-control mr-sm-2" type =" search" placeholder =" Search" aria-label =" Search" >
9093 <button class =" btn btn-outline-success my-2 my-sm-0" type =" submit" >Search</button >
Original file line number Diff line number Diff line change 3131 // .enableVersioning(Encore.isProduction())
3232
3333 . enableSassLoader ( )
34-
34+ . enableVueLoader ( )
3535 . autoProvidejQuery ( )
3636;
3737
You can’t perform that action at this time.
0 commit comments