Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dashboard
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
dashboard
Commits
b62efeae
Commit
b62efeae
authored
2 years ago
by
Konrad Mohrfeldt
Browse files
Options
Downloads
Patches
Plain Diff
feat(DX): hide (most) Vue warnings from bootstrap-vue components
parent
87a5c4f0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main.js
+6
-0
6 additions, 0 deletions
src/main.js
src/utilities.js
+14
-0
14 additions, 0 deletions
src/utilities.js
with
20 additions
and
0 deletions
src/main.js
+
6
−
0
View file @
b62efeae
...
@@ -13,8 +13,14 @@ import '../node_modules/bootstrap-vue/dist/bootstrap-vue.css'
...
@@ -13,8 +13,14 @@ import '../node_modules/bootstrap-vue/dist/bootstrap-vue.css'
import
'
../node_modules/bootstrap/scss/bootstrap.scss
'
import
'
../node_modules/bootstrap/scss/bootstrap.scss
'
import
'
./assets/custom.scss
'
import
'
./assets/custom.scss
'
import
'
./assets/styles/tailwind.css
'
import
'
./assets/styles/tailwind.css
'
import
{
shouldLog
}
from
'
@/utilities
'
const
app
=
createApp
(
App
)
const
app
=
createApp
(
App
)
app
.
config
.
warnHandler
=
(
message
,
instance
,
trace
)
=>
{
if
(
shouldLog
(
message
,
instance
,
trace
))
{
console
.
warn
(
`[Vue warn]:
${
message
}
`
,
trace
)
}
}
app
.
use
(
store
)
app
.
use
(
store
)
app
.
use
(
router
)
app
.
use
(
router
)
...
...
This diff is collapsed.
Click to expand it.
src/utilities.js
+
14
−
0
View file @
b62efeae
...
@@ -47,3 +47,17 @@ export function useSelectedShow() {
...
@@ -47,3 +47,17 @@ export function useSelectedShow() {
return
store
.
state
.
shows
.
shows
[
store
.
state
.
shows
.
selected
.
index
]
return
store
.
state
.
shows
.
shows
[
store
.
state
.
shows
.
selected
.
index
]
})
})
}
}
export
function
shouldLog
(
message
,
instance
,
trace
)
{
// don’t log any Bootstrap-Vue warnings
if
(
/^B
[
A-Z
]
/
.
test
(
instance
?.
$options
?.
name
??
''
))
{
return
false
}
if
(
!
instance
&&
/^at <B
[
A-Z
]
/
.
test
(
trace
))
{
return
false
}
if
(
/Functional component <B
[
A-Z
]
/
.
test
(
message
))
{
return
false
}
return
instance
?.
$parent
?
shouldLog
(
message
,
instance
.
$parent
)
:
true
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment