小编Bas*_*spa的帖子

如何禁用Vuetify数据表的悬停效果?

Vuetify 中的数据表默认具有悬停效果。当我检查表格行时,我发现应用了这个 CSS 类,

.theme--light.v-data-table tbody tr:hover:not(.v-data-table__expanded__content) {
    background: #eee;
}
Run Code Online (Sandbox Code Playgroud)

因此,这似乎为表格行添加了背景颜色。但是当我将这个作用域 CSS 添加到 Vuetify 组件时,

<template>
  <v-data-table
    :headers="headers"
    :items="items"
    :disable-sort="true"
    hide-default-footer
    :item-key="itemKey"
  >
    <template v-for="slot in Object.keys($scopedSlots)" :slot="slot" slot-scope="scope">
      <slot :name="slot" v-bind="scope" />
    </template>
  </v-data-table>
</template>

<script>
export default {
  name: "BaseDataTable",
  props: {
    headers: Array,
    items: Array,
    itemKey: {
      type: String,
      default: "id"
    }
  }
};
</script>

<style scoped>
.theme--light.v-data-table
  tbody
  tr:hover:not(.v-data-table__expanded__content) {
  background: #fff;
}
</style>
Run Code Online (Sandbox Code Playgroud)

它对我添加的新 CSS 没有任何作用。即使我!important在背景之后添加。有人能告诉我为什么新的 CSS 规则不起作用甚至没有应用吗?因为我什至无法在控制台中看到它们。

css vuetify.js

9
推荐指数
1
解决办法
1万
查看次数

Vue3/Inertia 无法解析组件

我有一个使用 VILT 堆栈(Vue、Inertia、Laravel、Tailwind)构建的应用程序。我有一些类似的组件cards可以在应用程序中的任何地方使用。因为我不想每次构建一个在某些目录中注册组件的函数时都手动导入这些组件:

/**
 * Register components from the ./components and ./components/core
 * directories. This way these components don't have to be imported
 * manually every time.
 *
 * @param {Vue instance} app
 */
function registerGlobalComponents (app) {
  const requireComponent = require.context(
    './components' || './components/core',
    true,
    /\.vue$/
  );

  for (const file of requireComponent.keys()) {
    const componentConfig = requireComponent(file);
    const name = file
      .replace(/index.js/, '')
      .replace(/^\.\//, '')
      .replace(/\.\w+$/, '');
    const componentName = upperFirst(camelCase(name));

    app.component(componentName,
      componentConfig.default || componentConfig);
  }
} …
Run Code Online (Sandbox Code Playgroud)

inertiajs vue.js vuejs3

7
推荐指数
1
解决办法
4099
查看次数

多选的标签被输入框的轮廓划掉

我用 Material-UI 做了一个多选列表。但是当我选择一个项目时,标签应该缩小并适合输入字段的轮廓。问题是轮廓保持不变,而标签在其后面缩小。

我尝试在 Material-UI 文档中寻找解决方案。似乎没有任何多选列表概述的变体。所以我想知道是因为没有多选列表的轮廓变体,还是由于其他原因。

<FormControl
   variant="outlined"
   fullWidth
>
   <InputLabel
      ref={ref => {
         this.InputLabelRef = ref;
      }}
      htmlFor="members"
      error={this.props.touched.members && Boolean(this.props.errors.members)}
   >
      Members
   </InputLabel>
   <Select
      onChange={this.change.bind(null, "members")}
      multiple
      value={this.state.members}
      error={this.props.touched.members && Boolean(this.props.errors.members)}
       input={
          <OutlinedInput
              labelWidth={0}
              name="members"
              id="members"
          />
        }
     >
     <MenuItem value={'Baspa'}>Baspa</MenuItem>
     <MenuItem value={'Plorky'}>Plorky</MenuItem>
     <MenuItem value={'Rizzels'}>Rizzels</MenuItem>
    </Select>
Run Code Online (Sandbox Code Playgroud)

我还做了一个 CodeSandBox:https ://codesandbox.io/s/jnlx1vky39

这是它的样子:

表格图片

https://imgur.com/a/Wpf7OE0

reactjs material-ui

5
推荐指数
2
解决办法
2090
查看次数

如何在数组中查找包含最高值的对象

我正在使用一个库来预测用户在网络摄像头前的情绪.有四种情绪:生气,悲伤,惊讶和快乐.我想检查哪种情绪得分最高.当我在console.log中预测到情绪时,我看到了这个:

(4) [{…}, {…}, {…}, {…}]
 0: {emotion: "angry"value: 0.08495773461377512}
 1: {emotion: "sad", value: 0.05993173506165729}
 2: {emotion: "surprised", value: 0.054032595527500206}
 3: {emotion: "happy", value: 0.18562819815754616}
Run Code Online (Sandbox Code Playgroud)

关于如何获得最高价值的情感的任何想法?

javascript

2
推荐指数
1
解决办法
83
查看次数

标签 统计

css ×1

inertiajs ×1

javascript ×1

material-ui ×1

reactjs ×1

vue.js ×1

vuejs3 ×1

vuetify.js ×1