我按照Apple 的应用程序图标设计模板为我的 Web 应用程序创建了 PWA 图标。
在 macOS 的 Dock 上看起来不错,但在 Windows 的工具栏上看起来有点小:
如何使图标适合两个平台?或者我可以为不同的平台配置不同的图标吗?
使用 webpack,我们可以像下面这样设置 sassOptions:
{
loader: require.resolve('sass-loader'),
options: {
sassOptions: { quietDeps: true },
},
}
Run Code Online (Sandbox Code Playgroud)
在vite 文档之后,我尝试配置如下:
css: {
preprocessorOptions: {
scss: {
sassOptions: { quietDeps: true },
},
},
},
Run Code Online (Sandbox Code Playgroud)
但它似乎对我不起作用。我需要的是在终端中隐藏第三方 sass deps 的警告消息。
在文档中,它给出了代码:
<div v-for="item in list" :ref="setItemRef"></div>
Run Code Online (Sandbox Code Playgroud)
export default {
setup() {
let itemRefs = []
const setItemRef = el => {
if (el) {
itemRefs.push(el)
}
}
onBeforeUpdate(() => {
itemRefs = []
})
onUpdated(() => {
console.log(itemRefs)
})
return {
setItemRef
}
}
}
Run Code Online (Sandbox Code Playgroud)
但我也想将 v-for 索引传递给处理程序,就像这样:
// fake code
<div v-for="(item, index) in navItems" :key="index":ref="setNavItemRefs($el, index)">
<span>{{ item }}</span>
</div>
Run Code Online (Sandbox Code Playgroud)
我该如何绑定这个index?