提交 8efbdcaa 编写于 作者: fxy060608's avatar fxy060608

fix(mp): ignore value check when stringify style (#3456)

上级 d3884cfb
import { isString } from '@vue/shared'
import { normalizeStyle, stringifyStyle as stringify } from '@vue/shared'
import { hyphenate, isString, NormalizedStyle } from '@vue/shared'
import { normalizeStyle } from '@vue/shared'
export function stringifyStyle(value: unknown) {
if (isString(value)) {
return value
}
return stringify(normalizeStyle(value))
}
function stringify(styles: NormalizedStyle | string | undefined): string {
let ret = ''
if (!styles || isString(styles)) {
return ret
}
for (const key in styles) {
ret += `${key.startsWith(`--`) ? key : hyphenate(key)}:${styles[key]};`
}
return ret
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册