naive-ui
naive-ui copied to clipboard
`<n-image>` aspect ratio
This function solves the problem (这个功能解决的问题)
Support aspect-ratio
prop on <n-image>
so the height or width can be set automatically.
Expected API (期望的 API)
<n-image src="..." width="100%" aspect-ratio="16 / 9" />
you can use:
<n-image
:img-props="{ style: { 'aspect-ratio': '16 / 9' } }"
width="100"
src="blablabla"
fallback-src="https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg"
/>
https://codesandbox.io/s/elated-alex-wze3ug?file=/src/Demo.vue
This issue does not have any recent activity. If you are still experiencing similar problems, open a new error, including a minimal copy of the problem