@cicada/render
Advanced tools
Comparing version 1.1.22-alpha7 to 1.1.22-alpha8
@@ -82,3 +82,3 @@ 'use strict'; | ||
// 避免state数据传入到react开发版props属性被设置为frozen导致无法set | ||
function simpleCloneWithoutfrozen(state) { | ||
function simpleCloneWithoutFrozen(state) { | ||
if (!isObject(state)) return state; | ||
@@ -164,4 +164,6 @@ return (0, _util.mapValues)(state, function (v) { | ||
if (!visible) { | ||
if (!lastStyleList.includes(DISPLAY_NONE)) { | ||
ref.setAttribute('data-cicada-' + DISPLAY_NONE, ''); | ||
var displayNoneAttr = 'data-cicada-' + DISPLAY_NONE; | ||
// CAUTION 这里要拿实际的 ref 去检验,因为有可能真实的 ref 被外部更改了。 | ||
if (ref.attributes[displayNoneAttr] === undefined) { | ||
ref.setAttribute(displayNoneAttr, ''); | ||
} | ||
@@ -171,4 +173,5 @@ addedStyleList.push(DISPLAY_NONE); | ||
styleList.forEach(function (cls) { | ||
if (!lastStyleList.includes(cls)) { | ||
ref.setAttribute('data-cicada-' + cls, ''); | ||
var clsAttr = 'data-cicada-' + cls; | ||
if (ref.attributes[clsAttr] === undefined) { | ||
ref.setAttribute(clsAttr, ''); | ||
} | ||
@@ -234,3 +237,3 @@ addedStyleList.push(cls); | ||
componentArg.props = (0, _extends3.default)({}, componentArg.props, injectedExternalProps); | ||
componentArg.state = _constant.isDebug ? simpleCloneWithoutfrozen(componentArg.state) : componentArg.state; | ||
componentArg.state = _constant.isDebug ? simpleCloneWithoutFrozen(componentArg.state) : componentArg.state; | ||
var styleList = appearance[id].styleList; | ||
@@ -237,0 +240,0 @@ |
{ | ||
"name": "@cicada/render", | ||
"version": "1.1.22-alpha7", | ||
"version": "1.1.22-alpha8", | ||
"main": "./lib/index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
411714
9942