Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Motion Bank
MB.js
Quasar Components Shared
Commits
e8a2fc8f
Commit
e8a2fc8f
authored
Mar 03, 2019
by
Anton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add generic StyleTag component
parent
ea06c9bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
partials/StyleTag.vue
partials/StyleTag.vue
+27
-0
No files found.
partials/StyleTag.vue
0 → 100644
View file @
e8a2fc8f
<
template
lang=
"pug"
>
span
</
template
>
<
script
>
export
default
{
props
:
{
styles
:
Array
},
data
()
{
return
{
style
:
undefined
}
},
created
()
{
const
styles
=
this
.
styles
||
this
.
$slots
.
default
if
(
Array
.
isArray
(
styles
))
{
this
.
style
=
styles
.
reduce
((
style
,
val
)
=>
style
+
(
val
.
text
||
val
),
''
)
}
},
mounted
:
function
()
{
const
style
=
document
.
createElement
(
'
style
'
)
style
.
append
(
document
.
createTextNode
(
this
.
style
))
this
.
$el
.
replaceWith
(
style
)
}
}
</
script
>
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