在Vue组件中,有一些内容是从Firebase中提取并导入到表格中以便显示的。其中一个“字段”是URL。在数据库中,它的结构为{name:“我的链接”,url:“www.example.com”},直接放入标签的href属性中。当该组件加载时,我检查标签,其href属性值为“www.example.com”,但当我单击该链接时,它会跳转到“currentURL / www.example.com”。以下是相关的标签。它是一个
看一下URL的语法:
The following are two example URIs and their component parts:
foo://example.com:8042/over/there?name=ferret#nose \_/ \______________/\_________/ \_________/ \__/ | | | | | scheme authority path query fragment | _____________________|__ / \ / \ urn:example:animal:ferret:nose
www.example.com
不以协议或 //
开头,因此它是相对于当前路径的 URL。//
),例如:http://www.example.com
。
<a href="www.example.com">链接!</a>
无法工作”,这可能意味着它是一个重复的问题。 - SIGSTACKFAULT