Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pro-layout
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
packages
pro-layout
Commits
09f10445
Commit
09f10445
authored
Nov 27, 2019
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: util lint
parent
6e5ce3ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
39 deletions
+39
-39
util.js
src/components/DocumentTitle/util.js
+17
-17
index.test.js
test/index.test.js
+22
-22
No files found.
src/components/DocumentTitle/util.js
View file @
09f10445
export
const
setDocumentTitle
=
function
(
title
)
{
export
const
setDocumentTitle
=
function
(
title
)
{
document
.
title
=
title
document
.
title
=
title
const
ua
=
navigator
.
userAgent
const
ua
=
navigator
.
userAgent
// eslint-disable-next-line
// eslint-disable-next-line
const
regex
=
/
\b
MicroMessenger
\/([\d\.]
+
)
/
const
regex
=
/
\b
MicroMessenger
\/([\d\.]
+
)
/
if
(
regex
.
test
(
ua
)
&&
/ip
(
hone|od|ad
)
/i
.
test
(
ua
))
{
if
(
regex
.
test
(
ua
)
&&
/ip
(
hone|od|ad
)
/i
.
test
(
ua
))
{
const
i
=
document
.
createElement
(
'iframe'
)
const
i
=
document
.
createElement
(
'iframe'
)
i
.
src
=
'/favicon.ico'
i
.
src
=
'/favicon.ico'
i
.
style
.
display
=
'none'
i
.
style
.
display
=
'none'
i
.
onload
=
function
()
{
i
.
onload
=
function
()
{
setTimeout
(
function
()
{
setTimeout
(
function
()
{
i
.
remove
()
i
.
remove
()
},
9
)
},
9
)
}
}
document
.
body
.
appendChild
(
i
)
document
.
body
.
appendChild
(
i
)
}
}
}
}
test/index.test.js
View file @
09f10445
import
Vue
from
'vue'
import
Vue
from
'vue'
import
{
mount
}
from
'@vue/test-utils'
import
{
mount
}
from
'@vue/test-utils'
import
BlockLayout
from
'../src/BlockLayout'
import
BlockLayout
from
'../src/BlockLayout'
describe
(
'BlockLayout'
,
()
=>
{
describe
(
'BlockLayout'
,
()
=>
{
it
(
'should render BlockLayout'
,
()
=>
{
it
(
'should render BlockLayout'
,
()
=>
{
const
wrapper
=
mount
({
const
wrapper
=
mount
({
render
()
{
render
()
{
return
(
return
(
<
div
>
<
div
>
<
BlockLayout
>
<
BlockLayout
>
<
span
>
demo
<
/span
>
<
span
>
demo
<
/span>
<
/BlockLayout
>
<
/BlockLayout>
<
/div
>
<
/div>
)
)
}
}
})
})
expect
(
wrapper
).
toMatchSnapshot
()
expect
(
wrapper
).
toMatchSnapshot
()
})
})
})
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment