Skip to content

Commit d3b96eb

Browse files
author
liangweiwen
committed
fix: #207
copy code from https://github.com/vuejs/component-compiler-utils/blob/master/lib/stylePlugins/scoped.ts#L70 just find out keyframes name from values array
1 parent dcb95dd commit d3b96eb

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/style-compiler/plugins/scope-id.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,11 @@ module.exports = postcss.plugin('add-id', function (opts) {
7272
if (/-?animation$/.test(decl.prop)) {
7373
decl.value = decl.value.split(',')
7474
.map(v => {
75-
var vals = v.split(/\s+/)
76-
var name = vals[0]
77-
if (keyframes[name]) {
78-
return [keyframes[name]].concat(vals.slice(1)).join(' ')
75+
var vals = v.trim().split(/\s+/)
76+
var i = vals.findIndex(val => keyframes[val])
77+
if (i !== -1) {
78+
vals.splice(i, 1, keyframes[vals[i]])
79+
return vals.join(' ')
7980
} else {
8081
return v
8182
}

0 commit comments

Comments
 (0)