File tree 3 files changed +22
-4
lines changed
3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ export default {
116
116
},
117
117
onClick (ev ) {
118
118
// close link dropdown if clicked outside
119
- if (this .linkDropdownOpen && ! this .$refs .dropdown .contains (ev .target )) this .linkDropdownOpen = false
119
+ if (this .linkDropdownOpen && this . $refs . dropdown && ! this .$refs .dropdown .contains (ev .target )) this .linkDropdownOpen = false
120
120
}
121
121
},
122
122
mounted () {
@@ -126,6 +126,9 @@ export default {
126
126
observer .observe (this .$refs .nav )
127
127
document .addEventListener (' click' , this .onClick )
128
128
},
129
+ beforeUnmount () {
130
+ document .removeEventListener (' click' , this .onClick )
131
+ },
129
132
watch: {
130
133
linkDropdownOpen () {
131
134
if (this .linkDropdownOpen ) this .langDropdownOpen = false
Original file line number Diff line number Diff line change @@ -259,13 +259,17 @@ export default {
259
259
const key = this .stars .find (({ name }) => href .toLowerCase ().includes (name .toLowerCase ()))
260
260
if (key) return key .stars
261
261
return null
262
+ },
263
+ onClick ({ target }) {
264
+ if (this .$refs .tagInput && ! this .$refs .tagInput .contains (target)) this .tagsDropdownShown = false
262
265
}
263
266
},
264
267
mounted () {
265
268
this .stars = stars ()
266
- document .addEventListener (' click' , ({ target }) => {
267
- if (! this .$refs .tagInput .contains (target)) this .tagsDropdownShown = false
268
- })
269
+ document .addEventListener (' click' , this .onClick )
270
+ },
271
+ beforeUnmount () {
272
+ document .removeEventListener (' click' , this .onClick )
269
273
}
270
274
}
271
275
</script >
Original file line number Diff line number Diff line change @@ -29,5 +29,16 @@ module.exports = {
29
29
}
30
30
return args
31
31
} )
32
+ config
33
+ . plugin ( 'preload' )
34
+ . tap ( args => {
35
+ args [ 0 ] . include = 'allAssets'
36
+ args [ 0 ] . as = ( entry ) => {
37
+ if ( / \. c s s $ / . test ( entry ) ) return 'style'
38
+ if ( / \. w o f f $ / . test ( entry ) ) return 'font'
39
+ return 'script'
40
+ }
41
+ return args
42
+ } )
32
43
}
33
44
}
You can’t perform that action at this time.
0 commit comments