我基本上使用这些步骤设置了一个非常基本的 Vue.js 应用程序。当我将路由器添加到这个项目时,它询问我是否要使用历史模式,我说是。
现在我正在尝试实现相应的服务器配置更改,即“添加到服务器的简单包罗万象的后备路由”,但我不确定如何执行此操作,因为我正在使用Vercel进行部署并且据我了解,它正在为我管理服务器。
看来我可以在 Vercel 中进行一些配置,我想也许我需要像他们的 firebase.json 示例中那样配置重定向?如果是这样,我的 vercel.json 会像这样吗?
{
"redirects": [
{ "source": "**", "destination": "/index.html" }
]
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试向使用Bootstrap-Vue的下拉菜单组件添加一些自定义样式。我在这里使用文档。
这是我的模板:
<div class="container">
<b-dropdown id="dropdownMenuButton" text="Dropdown Button" no-caret class="custom-dropdown">
<b-dropdown-item>First Action</b-dropdown-item>
<b-dropdown-item>Second Action</b-dropdown-item>
<b-dropdown-item>Third Action</b-dropdown-item>
<b-dropdown-divider></b-dropdown-divider>
<b-dropdown-item>Something else here...</b-dropdown-item>
<b-dropdown-item disabled>Disabled action</b-dropdown-item>
</b-dropdown>
</div>
Run Code Online (Sandbox Code Playgroud)
我发现我可以设置#dropdownMenuButton的样式,但是当下拉列表在浏览器中呈现时,它会在#dropdownMenuButton内创建一个元素,而我无法设置样式。我尝试这样做:
<style scoped>
#dropdownMenuButton > button {
width: 100%;
}
#dropdownMenuButton__BV_toggle_ {
width: 100%;
}
</style>
Run Code Online (Sandbox Code Playgroud)
但是没有运气。仅供参考,要创建的按钮的ID为dropdownMenuButton__BV_toggle_。