用于nuxt.js构建的自定义index.html

时间:2019-11-08 22:34:25

标签: vue.js nuxt.js

很抱歉,如果有人问,只是不确定要搜索什么。在spa模式下构建nuxt应用程序时,是否可以更改用于生成index.html文件的模板?

2 个答案:

答案 0 :(得分:6)

要覆盖.nuxt/views/app.template.html,需要在项目的根目录下创建app.html文件。然后,您可以从app.template.html复制并粘贴常规内容,然后开始进行修改。

例如-我必须将lang属性添加到html标记中,所以我在app.html 中更新了代码>

app.html

<!DOCTYPE html>
<html lang="en" {{ HTML_ATTRS }}>
  <head {{ HEAD_ATTRS }}>
    {{ HEAD }}
  </head>
  <body {{ BODY_ATTRS }}>
    {{ APP }}
  </body>
</html>

答案 1 :(得分:0)

Option Explicit Public Sub test() Dim ie As InternetExplorer, ids(), i As Long Set ie = New InternetExplorer ids = Array("footer", "banana") With ie .Visible = True .Navigate2 "https://stackoverflow.com/" While .Busy Or .readyState <> 4: DoEvents: Wend For i = LBound(ids) To UBound(ids) If IdFound(.document, ids(i)) Then Debug.Print ids(i), vbTab, "Found" Next Stop '.Quit End With End Sub Public Function IdFound(ByVal document As htmlDocument, ByVal ident As String) As Boolean Dim node As Object Set node = document.querySelector("#" & ident & "") IdFound = Not node Is Nothing End Function 所说的,nuxt没有@Ohgodwhy

但是您可以使用nuxt中默认使用的index.html更改所需的所有内容,以查看更多内容:https://nuxtjs.org/api/pages-head/