Skip to content

Commit

Permalink
fix(vue3): delete source prop for img
Browse files Browse the repository at this point in the history
  • Loading branch information
zealotchen0 committed Feb 28, 2024
1 parent c9a7f0b commit 20f3e66
Showing 1 changed file with 1 addition and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ export class HippyElement extends HippyNode {
* @param child - child node
* @param isHydrate - is hydrate or not
*/
public appendChild(child: HippyNode, isHydrate: boolean = false): void {
public appendChild(child: HippyNode, isHydrate = false): void {
// If the node type is text node, call setText method to set the text property
if (child instanceof HippyText) {
this.setText(child.text, { notToNative: true });
Expand Down Expand Up @@ -1024,26 +1024,6 @@ export class HippyElement extends HippyNode {
return style;
}

/**
* When generating props for Native Node, some additional logic needs to be hacked
*
* @param rawProps - original props
*/
private hackNativeProps(rawProps: NativeNodeProps) {
const props = rawProps;

// solve the problem of src props of iOS image, which should be repaired by native
if (this.tagName === 'img' && Native.isIOS()) {
props.source = [
{
uri: props.src,
},
];

props.src = undefined;
}
}

/**
* get the props of the Native node, the properties include the properties of the node and
* the default properties of the component to which the node belongs
Expand Down Expand Up @@ -1113,9 +1093,6 @@ export class HippyElement extends HippyNode {
});
}

// Finally handle the hack logic
this.hackNativeProps(props);

return props;
}

Expand Down

0 comments on commit 20f3e66

Please sign in to comment.