相关疑难解决方法(0)

关闭特定行的eslint规则

为了关闭JSHint中特定行的linting规则,我们使用以下规则:

/* jshint ignore:start*/
$scope.someVar = ConstructorFunction();
/* jshint ignore:end */
Run Code Online (Sandbox Code Playgroud)

我一直试图找到相当于以上的eslint.

javascript jshint eslint

1214
推荐指数
11
解决办法
68万
查看次数

Vuejs & Vuetify:有没有办法用来自 vuetify 的数据表(带有 v-slot 动态)来循环模板?

我有几个带有服务器端分页、搜索字段和可过滤字段的数据表

但是,我希望能够生成一个组件并使用道具来避免修改相同的东西三次

有没有办法用来自 vuetify 的数据表(使用 v-slot dynamic)来循环模板?

例如 :


<template v-slot:header.id="{ header }">
    <div class="pointer border-right pa-2">
        <span class="title" @click.prevent="sortBy('id')">
            ID
            <v-icon class="ml-2">{{icon.id}}</v-icon>
        </span>
        <v-text-field v-model="searcher.ticket_id.value" type="text"
                label="Rechercher..."></v-text-field>
    </div>
</template>


<template v-slot:header.name="{ header }">
    <div class="pointer border-right pa-2">
        <span class="title" @click.prevent="sortBy('name')">
            Nom du ticket
            <v-icon class="ml-2">{{icon.name}}</v-icon>
        </span>
        <v-text-field v-model="searcher.ticket_name.value" type="text"
                label="Rechercher..."></v-text-field>
    </div>
</template>
Run Code Online (Sandbox Code Playgroud)

成为(非功能性):

<template v-for="(item, i) in headers" v-slot:item.text="{ header }">
    <div class="pointer border-right pa-2">
        <span class="title" @click.prevent="sortBy(item.name)">
            {{item.name}}
            <v-icon class="ml-2">{{icon[item.name]}}</v-icon>
        </span>
        <v-text-field v-model="item.searcher" type="text"
                label="Rechercher..."></v-text-field>
    </div>
</template>
Run Code Online (Sandbox Code Playgroud)

如果我添加 …

javascript vue.js vuejs2 vuetify.js

5
推荐指数
1
解决办法
1706
查看次数

获取错误“ index.vue中的迭代元素期望具有'v-bind:key'指令vue / require-v-for-key“

我是vue.js的新手。我有一个简单的index.vue,它试图连接到内容丰富的目录并显示内容丰富的条目。我在index.vue中的代码如下所示:


<template>
  <div>
    <!-- render data of the person -->
    <h1>{{ person.fields.name }}</h1>
    <!-- render blog posts -->
    <ul>
      <li v-for="post in posts">
        {{ post.fields.title }}
      </li>
    </ul>
  </div>
</template>

<script>
  import {createClient} from '~/plugins/contentful.js'

  const client = createClient()
Run Code Online (Sandbox Code Playgroud)

但是,当我从浏览器尝试localhost:3000时,它返回以下错误:


./pages/index.vue模块错误(来自./node_modules/eslint-loader/index.js):

C:\ Users \ admin \ pdress \ pages \ index.vue 7:7错误迭代中的元素期望具有'v-bind:key'指令vue / require-v-for-key

?1个问题(1个错误,0个警告)


如果有人可以帮助我进一步进行vue.js的学习,我将不胜感激。提前致谢

vue.js contentful

3
推荐指数
1
解决办法
2083
查看次数

标签 统计

javascript ×2

vue.js ×2

contentful ×1

eslint ×1

jshint ×1

vuejs2 ×1

vuetify.js ×1