Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问arco组件怎么使用viewport单位做多窗口适配? #3300

Open
1 task
WANG-Fan0912 opened this issue Sep 16, 2024 · 1 comment
Open
1 task
Labels
💤 Inactive Inactive issues

Comments

@WANG-Fan0912
Copy link

Basic Info

  • Package Name And Version: @arco-design/[email protected]
  • Framework version: "vue": "^3.4.21"
  • Browser: chrome128.0.0.0

Steps to reproduce

例如:a-layout-sider,我给定了:width: 102,这个如何转为viewport单位?
<a-layout-sider :width="102"><Menu /></a-layout-sider>
<a-image width="100" :src="item.photo" />
image

上面只是提供了一个案例,arco中的ui组件大部分场景下都提供了:width这种属性,而且这些属性只支持number类型,我无法通过自定义函数来将单位转换为viewport,例如:a-image、输入框、icon等,有些地方是可以通过属性手动设置,有些地方没法设置大小,请问这种多端兼容有解决方案吗?

@WANG-Fan0912
Copy link
Author

我想到的是利用屏幕大小和元素宽度来计算他们的比例,每次窗口大小发生变化,获取窗口大小*比例来获取最新的宽度

@github-actions github-actions bot added the 💤 Inactive Inactive issues label Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💤 Inactive Inactive issues
Projects
None yet
Development

No branches or pull requests

1 participant