File tree 2 files changed +18
-20
lines changed
2 files changed +18
-20
lines changed Original file line number Diff line number Diff line change @@ -41,16 +41,10 @@ export default {
41
41
'@/plugins/element-ui' ,
42
42
'@/plugins/api' ,
43
43
'@/plugins/filters' ,
44
- {
45
- src : '~/plugins/swiper.js' ,
46
- ssr : false
47
- } ,
44
+ { src : '~/plugins/swiper.js' , ssr : false } ,
48
45
'@/plugins/utils' ,
49
- {
50
- src : '~/plugins/cropper.js' ,
51
- ssr : false
52
- } ,
53
- "@/plugins/goatcounter"
46
+ { src : '~/plugins/cropper.js' , ssr : false } ,
47
+ { src : "@/plugins/goatcounter" , ssr : false }
54
48
] ,
55
49
56
50
// Auto import components: https://go.nuxtjs.dev/config-components
Original file line number Diff line number Diff line change 1
- export default ( { router } ) => {
2
- if ( typeof window !== 'undefined' ) {
3
- ( function ( ) {
4
- var goatcounter = document . createElement ( "script" )
5
- goatcounter . setAttribute ( "data-goatcounter" , "http://cms.vispp.cn/analytics/count" )
6
- goatcounter . setAttribute ( "async" , "true" ) ;
1
+ export default ( { app} ) => {
2
+ console . log ( '全局插件执行了' )
3
+ app . router . afterEach ( ( to , from ) => {
4
+ if ( typeof window !== 'undefined' ) {
5
+ ( function ( ) {
6
+ var goatcounter = document . createElement ( "script" )
7
+ goatcounter . setAttribute ( "data-goatcounter" , "http://cms.vispp.cn/analytics/count" )
8
+ goatcounter . setAttribute ( "async" , "true" ) ;
7
9
// goatcounter.setAttribute("src","//gc.zgo.at/count.js");
8
- goatcounter . setAttribute ( "src" , "http://cms.vispp.cn/analytics/count.js" ) ;
9
- var s = document . getElementsByTagName ( "script" ) [ 0 ]
10
- s . parentNode . insertBefore ( goatcounter , s )
11
- } ) ( )
12
- }
10
+ goatcounter . setAttribute ( "src" , "http://cms.vispp.cn/analytics/count.js" ) ;
11
+ var s = document . getElementsByTagName ( "script" ) [ 0 ]
12
+ s . parentNode . insertBefore ( goatcounter , s )
13
+ } ) ( )
14
+ }
15
+ } )
13
16
}
17
+
You can’t perform that action at this time.
0 commit comments