npm i -D @unocss/preset-icons @iconify-json/[the-collection-you-want]
the-collection-you-want
为图标库缩写
可以去icons 官网找需要的图标库
例如:Google Material Icons 的简写为https://icones.js.org/collection/ic
地址最后的 ic
图标的使用
好像只能用div
标签
图标的使用语法是i+${图标集缩写名}+${图标名}
<div class="i-fa6-solid-user"></div>
参考知乎
固定元素的高度
.scroll-box {
overflow: scroll;
/* 隐藏滚动条 */
margin-right: -20px;
padding-right: 20px;
}
使用
vueuse
中的useIntersectionObserver
钩子
app.directive('img-lazy', {
mounted(el: HTMLImageElement, binding) {
const { stop } = useIntersectionObserver(el, ([{ isIntersecting }], observerElement) => {
if (isIntersecting) {
el.src = binding.value
}
})
}
})
参考csdn
原因:创建文件时添加了文件,进行了一次提交,导致两端都有文件,但这两份内容没有关系
解决方法
git pull --rebase origin main
解决方法
const props = withDefaults(
defineProps<{
artistList: ArtistItem[]
pos: number
}>(),
{
artistList: () => [],
pos: 0
}
)