小编Som*_*ver的帖子

Vuetify v-text 字段最小高度限制?

我有一个 v-text-field,我试图将高度设置为 37px,但似乎最小高度必须为 49px。有没有办法覆盖这个?我尝试放置自定义 css,但似乎它在 chrome 检查器中有效,但我无法以某种方式定位它

我已经制作了一个应用了自定义 css 样式的 codepen,但似乎无法使其工作: https: //codepen.io/anon/pen/MMEmex

 <div id="app">
  <v-app id="inspire">
   <v-container>
   <v-text-field solo placeholder="trying to adjust the height" 
   height="37px"></v-text-field>
   </v-container>
  </v-app>
  </div>

   new Vue({
 el: '#app'
    })
Run Code Online (Sandbox Code Playgroud)

当我在 chrome 检查器工具中的 .v-input-slot 上应用此 css 时,它似乎可以工作

  .v-input__slot {
  min-height: auto !important;
 display: flex !important;
 align-items: center !important;
 }
Run Code Online (Sandbox Code Playgroud)

提前谢谢你们了。

css vuejs2 vuetify.js

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

Vuetify 组合框多次添加选项?

我正在使用 vuetify 框架,但遇到了这个问题,我不确定如何从列表中多次添加一个项目。我有一个下拉列表,我想foo在选择时多次添加该选项或任何选项。这是演示代码笔的链接。

所以现在如果我选择 foo 或任何其他选项,然后从下拉列表中再次选择它,它就会消失,而是我想要另一个具有相同选项的芯片添加到其中?

new Vue({
  el: '#app',
  data() {
    return {
      items: [{
          text: 'Foo',
          value: 'foo'
        },
        {
          text: 'Bar',
          value: 'bar'
        },
        {
          text: 'biz',
          value: 'buzz'
        },
        {
          text: 'buzz',
          value: 'buzz'
        }
      ],
    }
  }
})
Run Code Online (Sandbox Code Playgroud)
<link href="https://cdn.jsdelivr.net/npm/vuetify@1.5.14/dist/vuetify.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/vuetify@1.5.14/dist/vuetify.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="app">
  <v-app id="inspire">
    <v-container>
      <v-combobox :items="items" label="Add Multiple Chips" multiple small-chips solo deletable-chips>
        <template v-slot:item="{ index, item }">
      <v-list-tile-content>
        {{item.text}}
      </v-list-tile-content>
    </template>
        <template v-slot:selection="{ …
Run Code Online (Sandbox Code Playgroud)

javascript vue.js vuetify.js

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

在可清除的 vuetify 文本字段上将数据设置为空字符串?

我有一个v-data-table绑定到一个search道具,以及v-text-fieldclearable集。当我使用clearable图标按钮清除文本字段时,v-text-fieldsearch道具设置为null,导致我的计算道具出错:

无法读取性能toLowerCase()null

如何将search道具设置回空字符串而不是单击图标nullclearable

我的组件.vue:

<template>
  <div>
    <v-text-field solo hide-details single-line v-model="search" clearable>
    </v-text-field>

    <v-data-table :search="search" class="mt-2" :items="myArray" hide-actions hide-headers elevation-1>
      <template v-slot:items="props">
        <td>{{props.item.myItems}}</td>
      </template>    
    </v-data-table>
  </div>
</template>

<script>
export default {
  props: ['parameter'],
  data() {
    return {
      search: ''
    }
  },
  computed: {
    myArray() {
      let myArray = []
      if(this.parameter) {
        myArray = this.parameter.filter((download) => …
Run Code Online (Sandbox Code Playgroud)

javascript vue.js vuejs2 vuetify.js

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

有没有办法使用 VueJs 将列表分成列?

我有一个使用 v-for 呈现的列表,我将数据输出到一列中。有没有办法在一定的宽度和高度之后,数据流入下一列而不创建任何新数组?这是一个演示

new Vue({
  el: '#app',
  data() {
    return {
      lists: [{
          text: 'Item1'
        },
        {
          text: 'Item2'
        },
        {
          text: 'Item3'
        },
        {
          text: 'Item4'
        },
        {
          text: 'Item5'
        },
        {
          text: 'Item6'
        },
        {
          text: 'Item7'
        },
        {
          text: 'Item8'
        },
        {
          text: 'Item9'
        },
      ]
    }
  }
})
Run Code Online (Sandbox Code Playgroud)
<script src="https://cdn.jsdelivr.net/npm/vuetify@1.5.14/dist/vuetify.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/babel-polyfill/dist/polyfill.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/vuetify@1.5.14/dist/vuetify.min.css" rel="stylesheet" />
<div id="app">
  <v-app id="inspire">
    <v-layout class="mt-3 ml-4">
      <v-flex md-4>
        <div v-for="list in lists" :key="list.text">
          {{list.text}}
        </div> …
Run Code Online (Sandbox Code Playgroud)

javascript css vue.js vuetify.js

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

如何让按钮跨越整个宽度?

我正在使用带有布局的 Vuetify 卡,并dynamic vuetify components在复选框选择上渲染卡的一些内部,该复选框选择呈现 a divider、 aspacertoolbarbutton但我无法弄清楚如何使按钮跨越整个宽度?

基本上dynamic button应该看起来像最后呈现整个宽度的按钮。

请检查这个codepen

请检查这个工作示例:-

new Vue({
  el: "#app",
  data() {
    return {
      pricing: [{
          text: "Actual price:",
          value: "$17,000",
        },
        {
          text: " Discount",
          value: "$12,345",
        }
      ],
      elements: [{
          title: "Divider",
          value: "v-divider"
        },
        {
          title: "Toolbar",
          value: "v-toolbar"
        },
        {
          title: "Button",
          value: "v-btn"
        }
      ],
      selected: []
    };
  }
});
Run Code Online (Sandbox Code Playgroud)
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vuetify@1.5.14/dist/vuetify.min.js"></script>
<link rel="stylesheet" …
Run Code Online (Sandbox Code Playgroud)

javascript css vue.js vuetify.js

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

无法建立新连接 Errno 111 连接被拒绝?

我正在尝试通过 docker compose 运行 Web、数据库和 Redis 服务,但我的 Web 容器不断出现故障。在检查日志时,我看到:-urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='localhost', port=8443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fc998b43070>: Failed to establish a new connection: [Errno 111] Connection refused'))

重现问题:-

1. git clone https://github.com/PostHog/posthog && cd posthog and run docker-compose up -d
2. This is my docker compose file :-

services:
    db:
        container_name: posthog_db
        environment:
            POSTGRES_DB: posthog
            POSTGRES_PASSWORD: posthog
            POSTGRES_USER: posthog
        image: postgres:alpine
        volumes:
            - postgres-data:/var/lib/postgresql/data
    redis:
        container_name: posthog_redis
        image: redis:alpine
    web:
        container_name: posthog_web
        depends_on: …
Run Code Online (Sandbox Code Playgroud)

docker docker-compose posthog

5
推荐指数
0
解决办法
5492
查看次数

使用 resourcegroupstagingapi CLI 时过滤资源

我正在尝试根据某些标签条件在我的 AWS 中查找资源。我一直在使用jq它来实现它,但是有没有使用的方法resourcegroupstaggingapi,因此它们提供了一种直接的方法来过滤缺少任何指定标签的资源。

我有 2 个用例,这就是我使用 jq 过滤它们的方式:

  1. 当 SV 标签存在但 DM 不存在时:aws resourcegroupstaggingapi get-resources --tags-per-page 100 | jq '.ResourceTagMappingList | map(select(.Tags[] | select(.Key == "SV") and select(.Key != "DM")))'
  2. 当 CostCenter、环境或团队标签不存在时:aws resourcegroupstaggingapi get-resources --tags-per-page 100 | jq '.ResourceTagMappingList | map(select(.Tags[] | (.Key | IN("CostCenter", "Environment", "Team",) | not)))'

我尝试在不使用 jq 的情况下执行相同的操作,如下所示:

  1. 当 SV 标签存在但 DM 不存在时:aws resourcegroupstaggingapi get-resources --tag-filters "Key=SV,Values=*" "Key=DM,Values=NULL"
  2. 当 CostCenter、环境或团队标签不存在时:aws resourcegroupstaggingapi get-resources --tag-filters "Key=CostCenter,Values=" "Key=Environment,Values=" "Key=Team,Values="

但是使用 jq …

amazon-web-services aws-cli jmespath

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

使用卡片实现 Vue 可拖动?

我正在尝试vuedraggable使用 Vuetify Cards来实现,但由于某种原因,当卡片在一行中时拖放不起作用,但当它们在列中时起作用。

看看这个有效的CodeSandbox

Parent.vue文件中,如果我移除组件的<v-layout> </v-layout>包装<HelloWorld />,卡片会进入一列,拖放会再次开始工作。

这是我的 HelloWorld 组件:-

<template>
  <v-flex xs4>
    <v-card class="mx-4">
      <v-img :src="src"></v-img>
      <v-card-title primary-title>
        <div>{{title}}</div>
      </v-card-title>
    </v-card>
  </v-flex>
</template>

<script>
export default {
  name: "HelloWorld",
  props: {
    title: String,
    src: String,
    id: Number
  },
  data() {
    return {};
  }
};
</script>
Run Code Online (Sandbox Code Playgroud)

这是我的父组件:-

<template>
  <v-container>
    <v-layout class="mt-5 align-center justify-center row fill-height">
      <h2>Parent Component</h2>
    </v-layout>
    <draggable v-model="draggableCards">
      <v-layout>
        <template v-for="(tech,i) in getCardArray">
          <HelloWorld :src="tech.src" :title="tech.title" :key="i"/>
        </template> …
Run Code Online (Sandbox Code Playgroud)

javascript vue.js sortablejs vuetify.js vuedraggable

4
推荐指数
1
解决办法
5682
查看次数

Docker compose 您是否尝试将目录挂载到文件上(或反之亦然)?

我使用的是 Docker 版本 20.07,我正在尝试挂载我的配置文件。

我的 Docker 组合看起来像这样 -:

version: '2'
services:
  prometheus:
    image: prom/prometheus
    ports:
      - '9090:9090'
    container_name: prometheus
    restart: always
    volumes:
      - './prometheus/prometheus.yml:/etc/prometheus/prometheus.yml'
  grafana:
    image: grafana/grafana
    ports:
      - '3000:3000'
    container_name: grafana
    restart: always
    depends_on:
      - prometheus
    volumes:
      - './grafana/config/grafana.ini:/etc/grafana/grafana.ini'
Run Code Online (Sandbox Code Playgroud)

我的文件夹结构如下所示:-

Root
Monitoring_Stack
-- prometheus.yml
-- grafana.ini
-- docker-compose.yml
Run Code Online (Sandbox Code Playgroud)

当我这样做时docker-compose up -d,我不断得到:-

ERROR: for prometheus  Cannot start service prometheus: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/run/desktop/mnt/host/d/Docker/monitoring_stack/prometheus/prometheus.yml" to rootfs at …
Run Code Online (Sandbox Code Playgroud)

docker docker-compose

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

在vue.js中使用v-for循环?

我试图用来v-for遍历包括标题和图标的数据。现在我只能通过循环获得一个图标,我的问题是,如何在循环过程中获得一个以上的图标?

我已经制作了一个Codepen:https ://codepen.io/anon/pen/MMaGOZ ?& editable = true & editors = 101 。因此,基本上在此示例中,如何获得多个图标。因此,如果我还希望仪表板旁边有一个搜索图标。

  <div id="app">
 <v-app id="inspire">
   <v-navigation-drawer
    class="blue lighten-3"
    dark
    permanent
   >
     <v-list>
       <v-list-tile
        v-for="item in items"
        :key="item.title"
        @click=""
       >
      <v-list-tile-action>
        <v-icon>{{ item.icon }}</v-icon>
      </v-list-tile-action>

      <v-list-tile-content>
        <v-list-tile-title>{{ item.title }}</v-list-tile-title>
      </v-list-tile-content>
    </v-list-tile>
  </v-list>
</v-navigation-drawer>
Run Code Online (Sandbox Code Playgroud)

 new Vue({
  el: '#app',
  data () {
   return {
    items: [
      { title: 'Dashboard', icon: 'dashboard','search' },
      { title: 'Account', icon: 'account_box' },
     { title: 'Admin', icon: 'gavel' }
    ]
   }
 }
 })
Run Code Online (Sandbox Code Playgroud)

如果我这样做 …

javascript vue.js vuejs2

0
推荐指数
1
解决办法
93
查看次数