Match-id-20f906ffbbc23478561e56623690bbcb516e0f46
This commit is contained in:
commit
bd50434e32
|
@ -38,7 +38,7 @@ export function updateDomProps(
|
|||
}
|
||||
}
|
||||
|
||||
function updateOneProp(dom, propName, propVal, isNativeTag, isInit = false) {
|
||||
function updateOneProp(dom, propName, propVal, isNativeTag, isInit?: boolean) {
|
||||
if (propName === 'style') {
|
||||
setStyles(dom, propVal);
|
||||
} else if (propName === 'dangerouslySetInnerHTML') {
|
||||
|
@ -65,8 +65,8 @@ export function compareProps(
|
|||
newProps: Object,
|
||||
): Array<any> {
|
||||
let updatesForStyle = {};
|
||||
const toBeDeletedProps = [];
|
||||
const toBeUpdatedProps = [];
|
||||
const toBeDeletedProps: Array<any> = [];
|
||||
const toBeUpdatedProps: Array<any> = [];
|
||||
const keysOfOldProps = Object.keys(oldProps);
|
||||
const keysOfNewProps = Object.keys(newProps);
|
||||
|
||||
|
@ -124,7 +124,7 @@ export function compareProps(
|
|||
const oldStyleProps = Object.keys(oldPropValue);
|
||||
for (let j = 0; j < oldStyleProps.length; j++) {
|
||||
const styleProp = oldStyleProps[j];
|
||||
if (!newPropValue || !newPropValue.hasOwnProperty(styleProp)) {
|
||||
if (!newPropValue || !Object.prototype.hasOwnProperty.call(newPropValue, styleProp)) {
|
||||
updatesForStyle[styleProp] = '';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ export function watchValueChange(dom) {
|
|||
// 获取 value 属性的描述信息,其 value 在其 constructor 的 原型上
|
||||
const descriptor = Object.getOwnPropertyDescriptor(dom.constructor.prototype, keyForValue);
|
||||
|
||||
if (dom.hasOwnProperty(keyForValue)) {
|
||||
if (Object.prototype.hasOwnProperty.call(dom, keyForValue)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,8 @@
|
|||
"types": [], // 赋值为空数组使@types/node不会起作用
|
||||
"lib": ["dom", "esnext", "ES2015", "ES2016", "ES2017", "ES2018", "ES2019", "ES2020"],
|
||||
"baseUrl": ".",
|
||||
"rootDir": "./libs"
|
||||
"rootDir": "./libs",
|
||||
"strictNullChecks": true
|
||||
},
|
||||
"include": [
|
||||
"./libs/**/src/**/*.ts",
|
||||
|
|
Loading…
Reference in New Issue