mirror of
https://github.com/bobwen-dev/react-templates
synced 2025-04-12 00:56:39 +02:00
Automatically add key to "rt-if" if missing (fixes #99)
This commit is contained in:
parent
731296b27a
commit
b2483bd2de
@ -329,6 +329,9 @@ function convertHtmlToReact(node, context) {
|
|||||||
if (node.attribs[ifAttr]) {
|
if (node.attribs[ifAttr]) {
|
||||||
validateIfAttribute(node, context, data);
|
validateIfAttribute(node, context, data);
|
||||||
data.condition = node.attribs[ifAttr].trim();
|
data.condition = node.attribs[ifAttr].trim();
|
||||||
|
if (!node.attribs.key) {
|
||||||
|
_.set(node, ['attribs', 'key'], `${node.startIndex}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
data.props = generateProps(node, context);
|
data.props = generateProps(node, context);
|
||||||
|
@ -25,6 +25,6 @@ define([
|
|||||||
height: '100%',
|
height: '100%',
|
||||||
border: '0'
|
border: '0'
|
||||||
}
|
}
|
||||||
}))), React.createElement('div', {}, 'editor\n ', !this.props.editorState.previewMode ? React.createElement('div', {}, 'left bar') : null));
|
}))), React.createElement('div', {}, 'editor\n ', !this.props.editorState.previewMode ? React.createElement('div', { 'key': '440' }, 'left bar') : null));
|
||||||
};
|
};
|
||||||
});
|
});
|
Loading…
x
Reference in New Issue
Block a user