首页 > 解决方案 > Vue/Nuxt JS 没有重复的属性

问题描述

我在 Vue JS 中创建了一个带有导航栏的标题组件,我收到了 Eslint 的错误消息:

Parsing error: unexpected-character-in-attribute-name. (vue/no-parsing-error)   13:14
Error   ESLint  Parsing error: duplicate-attribute. (vue/no-parsing-error)  13:14
Error   ESLint  Duplicate attribute 'to'. (vue/no-duplicate-attributes) 13:14
Error   ESLint  Parsing error: Unexpected closing tag "li". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags (prettier/prettier)

当它们只是链接时,我不确定如何解决这个问题,我们是否不允许在同一页面上拥有具有相同属性和标签的链接?

这是代码:

<template>
  <header class="header">
    <h1 class="title">Dad Jokes</h1>
    <ul>
      <li>
        <nuxt-link to="/">Home</nuxt-link>
      </li>
      <li>
        <nuxt-link to="/jokes">Jokes</nuxt-link>
      </li>
      <li>
        <nuxt-link to="/about">About</nuxt-link>
      </li>
    </ul>
  </header>
</template>

标签: vue.jsnuxt.js

解决方案


推荐阅读