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 1
1
import { createApp } from 'vue' ;
2
2
import App from './vue/App.vue' ;
3
- import MyWidget from './vue/MyWidget.vue' ;
4
3
5
4
// Mount the main app if the element exists
6
5
const appElement = document . getElementById ( 'vue-app' ) ;
7
6
if ( appElement ) {
8
7
createApp ( App ) . mount ( '#vue-app' ) ;
9
8
}
10
9
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 1
1
<template >
2
2
<div >
3
- <h1 >Hello from Vue!</h1 >
3
+ <h2 >Hello from Vue</h2 >
4
+ <p >{{ message }}</p >
4
5
</div >
5
6
</template >
6
7
7
8
<script >
8
9
export 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
+ }
10
25
}
11
26
</script >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 12
12
"webpack-notifier" : " ^1.15.0"
13
13
},
14
14
"dependencies" : {
15
- "vue" : " 3 "
15
+ "vue" : " ^3.5.16 "
16
16
},
17
17
"scripts" : {
18
18
"prepare" : " husky install"
Original file line number Diff line number Diff line change 19
19
{# Optionally include Bootstrap JS if you use interactive components #}
20
20
<script src =" https://code.jquery.com/jquery-3.5.1.slim.min.js" ></script >
21
21
<
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 >
23
24
</body >
24
25
</html >
Original file line number Diff line number Diff line change 25
25
<button type =" submit" class =" btn btn-primary btn-block" >Sign in</button >
26
26
</form >
27
27
</div >
28
- <div id =" my-widget " ></div >
28
+ <div id =" vue-app " ></div >
29
29
{% endblock %}
Original file line number Diff line number Diff line change @@ -3,12 +3,8 @@ const Encore = require('@symfony/webpack-encore');
3
3
Encore
4
4
. setOutputPath ( 'public/build/' )
5
5
. setPublicPath ( '/build' )
6
- . enableVueLoader ( )
7
6
. addEntry ( 'app' , './assets/app.js' )
8
- . cleanupOutputBeforeBuild ( )
9
- . enableBuildNotifications ( )
10
- . enableSourceMaps ( ! Encore . isProduction ( ) )
11
- . enableVersioning ( Encore . isProduction ( ) )
7
+ . enableVueLoader ( )
12
8
. enableSingleRuntimeChunk ( )
13
9
;
14
10
Original file line number Diff line number Diff line change @@ -2835,7 +2835,7 @@ vue-template-compiler@^2.7.14:
2835
2835
de-indent "^1.0.2"
2836
2836
he "^1.2.0"
2837
2837
2838
- vue@3 :
2838
+ vue@^3.5.16 :
2839
2839
version "3.5.16"
2840
2840
resolved "https://registry.yarnpkg.com/vue/-/vue-3.5.16.tgz#f0cde88c2688354f00ff2d77eb295c26440f8c7a"
2841
2841
integrity sha512-rjOV2ecxMd5SiAmof2xzh2WxntRcigkX/He4YFJ6WdRvVUrbt6DxC1Iujh10XLl8xCDRDtGKMeO3D+pRQ1PP9w==
You can’t perform that action at this time.
0 commit comments