🐛(component): 修复 side 组件 width 属性失效

This commit is contained in:
就眠儀式 2022-05-04 05:08:46 +08:00
parent 6a46d0de8a
commit 3713bd2e6a
3 changed files with 6 additions and 4 deletions

View File

@ -13,12 +13,13 @@ export interface LaySideProps {
} }
const props = withDefaults(defineProps<LaySideProps>(), { const props = withDefaults(defineProps<LaySideProps>(), {
width: "200", width: "200px",
}); });
const styles = computed<CSSProperties>(() => { const styles = computed<CSSProperties>(() => {
return { return {
width: `${props.width}px`, "flex": `0 0 ${props.width}`,
"width": `${props.width}`
}; };
}); });
</script> </script>

View File

@ -188,7 +188,7 @@ export default {
<lay-header>Header</lay-header> <lay-header>Header</lay-header>
<lay-body> <lay-body>
<lay-layout> <lay-layout>
<lay-side :width="160">Left</lay-side> <lay-side>Left</lay-side>
<lay-body>Content</lay-body> <lay-body>Content</lay-body>
</lay-layout> </lay-layout>
</lay-body> </lay-body>
@ -200,7 +200,7 @@ export default {
<lay-body> <lay-body>
<lay-layout> <lay-layout>
<lay-body>Content</lay-body> <lay-body>Content</lay-body>
<lay-side :width="160">Right</lay-side> <lay-side>Right</lay-side>
</lay-layout> </lay-layout>
</lay-body> </lay-body>
<lay-footer>Footer</lay-footer> <lay-footer>Footer</lay-footer>

View File

@ -19,6 +19,7 @@
<li>[新增] menu 组件 changeOpenKeys 事件。</li> <li>[新增] menu 组件 changeOpenKeys 事件。</li>
<li>[新增] menu 组件 changeSelectedKey 事件。</li> <li>[新增] menu 组件 changeSelectedKey 事件。</li>
<li>[新增] slider 组件 showDots 属性, 显示步长断点。</li> <li>[新增] slider 组件 showDots 属性, 显示步长断点。</li>
<li>[修复] side 组件 width 属性失效, 随内容宽度自适应的问题。</li>
</ul> </ul>
</li> </li>
</ul> </ul>