File tree Expand file tree Collapse file tree 8 files changed +23
-34
lines changed
Expand file tree Collapse file tree 8 files changed +23
-34
lines changed Original file line number Diff line number Diff line change 11import { createApp } from 'vue' ;
22import App from './vue/App.vue' ;
3- import MyWidget from './vue/MyWidget.vue' ;
43
54// Mount the main app if the element exists
65const appElement = document . getElementById ( 'vue-app' ) ;
76if ( appElement ) {
87 createApp ( App ) . mount ( '#vue-app' ) ;
98}
109
11- // Mount the widget if the element exists
12- const widgetElement = document . getElementById ( 'my-widget' ) ;
13- if ( widgetElement ) {
14- createApp ( MyWidget ) . mount ( '#my-widget' ) ;
15- }
Original file line number Diff line number Diff line change 11<template >
22 <div >
3- <h1 >Hello from Vue!</h1 >
3+ <h2 >Hello from Vue</h2 >
4+ <p >{{ message }}</p >
45 </div >
56</template >
67
78<script >
89export default {
9- name: ' App'
10+ name: ' App' ,
11+ data () {
12+ return {
13+ message: ' This is a reusable component!'
14+ }
15+ },
16+ created () {
17+ console .log (' App component created' );
18+ },
19+ mounted () {
20+ console .log (' App component mounted' );
21+ },
22+ updated () {
23+ console .log (' App component updated' );
24+ }
1025}
1126 </script >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1212 "webpack-notifier" : " ^1.15.0"
1313 },
1414 "dependencies" : {
15- "vue" : " 3 "
15+ "vue" : " ^3.5.16 "
1616 },
1717 "scripts" : {
1818 "prepare" : " husky install"
Original file line number Diff line number Diff line change 1919{# Optionally include Bootstrap JS if you use interactive components #}
2020<script src =" https://code.jquery.com/jquery-3.5.1.slim.min.js" ></script >
2121<
script src =
" https://cdn.jsdelivr.net/npm/[email protected] /dist/js/bootstrap.bundle.min.js" ></
script >
22- {{ encore_entry_script_tags(' app' ) }}
22+ <script src =" {{ asset(' build/runtime.js' ) }}" ></script >
23+ <script src =" {{ asset(' build/app.js' ) }}" ></script >
2324</body >
2425</html >
Original file line number Diff line number Diff line change 2525 <button type =" submit" class =" btn btn-primary btn-block" >Sign in</button >
2626 </form >
2727 </div >
28- <div id =" my-widget " ></div >
28+ <div id =" vue-app " ></div >
2929{% endblock %}
Original file line number Diff line number Diff line change @@ -3,12 +3,8 @@ const Encore = require('@symfony/webpack-encore');
33Encore
44 . setOutputPath ( 'public/build/' )
55 . setPublicPath ( '/build' )
6- . enableVueLoader ( )
76 . addEntry ( 'app' , './assets/app.js' )
8- . cleanupOutputBeforeBuild ( )
9- . enableBuildNotifications ( )
10- . enableSourceMaps ( ! Encore . isProduction ( ) )
11- . enableVersioning ( Encore . isProduction ( ) )
7+ . enableVueLoader ( )
128 . enableSingleRuntimeChunk ( )
139;
1410
Original file line number Diff line number Diff line change @@ -2835,7 +2835,7 @@ vue-template-compiler@^2.7.14:
28352835 de-indent "^1.0.2"
28362836 he "^1.2.0"
28372837
2838- vue@3 :
2838+ vue@^3.5.16 :
28392839 version "3.5.16"
28402840 resolved "https://registry.yarnpkg.com/vue/-/vue-3.5.16.tgz#f0cde88c2688354f00ff2d77eb295c26440f8c7a"
28412841 integrity sha512-rjOV2ecxMd5SiAmof2xzh2WxntRcigkX/He4YFJ6WdRvVUrbt6DxC1Iujh10XLl8xCDRDtGKMeO3D+pRQ1PP9w==
You can’t perform that action at this time.
0 commit comments