删除模块,移到efms里面,修改样式
This commit is contained in:
3
web_widget_model_viewer/static/src/js/3d_viewer.css
Normal file
3
web_widget_model_viewer/static/src/js/3d_viewer.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.model-viewer-in-list {
|
||||
width: 150px;
|
||||
}
|
||||
@@ -63,11 +63,16 @@ StepViewer.supportedTypes = ["binary"];
|
||||
StepViewer.props = {
|
||||
...standardFieldProps,
|
||||
url: {type: String, optional: true},
|
||||
isInList: {type: Boolean, optional: true},
|
||||
};
|
||||
|
||||
StepViewer.extractProps = ({attrs}) => {
|
||||
const modifiedAttrs = JSON.parse(attrs.modifiers || '{}');
|
||||
|
||||
|
||||
return {
|
||||
url: attrs.options.url,
|
||||
isInList: modifiedAttrs.isInList,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
<t t-if="props.value">
|
||||
<model-viewer
|
||||
t-att-class="props.isInList ? 'model-viewer-in-list' : ''"
|
||||
t-att-src='props.url'
|
||||
name="3D model"
|
||||
alt="3D model"
|
||||
|
||||
Reference in New Issue
Block a user