小编MrG*_*ood的帖子

映射到命名空间模块时,将prop作为模块名称传递

我正在尝试通过props将商店模块命名空间传递给组件.当我尝试使用道具映射到吸气剂时,它会抛出此错误,

未捕获的TypeError:无法将undefined或null转换为object

如果我将名称作为字符串传递它是有效的.

这个作品

<script>
export default {

  props: ['store'],

  computed: {
    ...mapGetters('someString', [
      'filters'
    ])
  }
}
</script>
Run Code Online (Sandbox Code Playgroud)

这不起作用

this.store定义
this.store typeof是一个String

<script>
  export default {

    props: ['store'],

    computed: {
      ...mapGetters(this.store, [
        'filters'
      ])
    }
  }
</script>
Run Code Online (Sandbox Code Playgroud)

javascript vue.js vue-component vuex vuejs2

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

第一个孩子选择器不工作

我正在尝试构建一个简单的盒子系统,我需要删除第一个孩子的右边距.

我已经尝试了第一个孩子第一个类型,但仍然无法正确定位目标类.

我已经阅读了许多不同的例子,仍然无法找到解决方案.

请看这个小提琴并帮我删除第一个孩子的左边缘.

.container {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
  background-color: black;
}

.box {
  margin: 1% 0 1% 0;
  float: left;
  background-color: gray;
  box-sizing: border-box;
  color:white;
}
.box.full {
  width: 100%;
  margin-left: 0;
}

.box.half {
  width: 49%;
  margin-left: 1%;
}

.half:first-child {
  margin-left: 0;
}
Run Code Online (Sandbox Code Playgroud)

html css css-selectors

6
推荐指数
1
解决办法
110
查看次数

无法更改Chart.js 2.0 Beta中的标签

我不确定这是一个错误还是我错过了什么,但我无法将自定义格式应用于Chart.js 2.0 Beta条形图上的y轴标签.

以下是2.0 Beta文档中的配置选项. Chart.js 2.0 Beta文档

以下是我的条形图的配置选项:

options: {
  maintainAspectRatio: false,
  responsive: true,
  scales: {
    xAxes: [
      {
        stacked: true,
        gridLines: {
          show: false
        }
      }
    ],
    yAxes: [
      {
        stacked: true,
        display: true,
        labels: {
          show: false
        }
      }
    ]
  }
Run Code Online (Sandbox Code Playgroud)

options: {
    // Boolean - if true, bars stack on top of each other
    stacked: false,

    hover: {
        // String - We use a label hover mode since the x axis displays data by the index …
Run Code Online (Sandbox Code Playgroud)

javascript chart.js

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

附加新元素后,函数不起作用

我对jQuery函数创建的新元素上的"click"操作有问题,但它不起作用.

我为这个链接(JSFiddle)创建了一个JSFiddle ,但它不能很好地工作,因为我无法在JSFiddle中调用Ajax请求.

我有这两个按钮,

<input type="button" onclick="invia('SIC-034031','', 's');" value="AGGIUNGI" style="height: 20px; width: 110px; background-color: #A5EFC5 ; color: #000000; font-family: Arial,Helvetica,sans-serif; font-size: 12px; background-repeat: no-repeat; background-position: left center;" id="iscriviSIC-034031" class="pulsanteIscrizioni" name="xaggiorna"/>&nbsp;
<input type="button" onclick="invia('SIC-034031','R', 's');" value="RISERVA" style="height: 20px; width: 110px; background-color: #F00000; color: #FFFFFF; font-family: Arial,Helvetica,sans-serif; font-size: 12px; background-repeat: no-repeat; background-position: left center;" id="iscriviRSIC-034031" class="pulsanteIscrizioni" name="xaggiorna"/>
Run Code Online (Sandbox Code Playgroud)

当你第一次调用ajax函数时,按钮1会回答这个输出:

OK;I;SIC-034031
Run Code Online (Sandbox Code Playgroud)

按钮2仅用于擦除.按钮一创建.

<input id="iscriviSIC-034031" class="pulsanteIscrizioni" type="button" name="xaggiorna" style="height: 20px; width: 110px; background-color: #03F; color: #FFF; font-family: Arial,Helvetica,sans-serif; font-size: 12px;" value="TOGLI" onclick="invia('SIC-034031','');">
Run Code Online (Sandbox Code Playgroud)

当我单击这个新按钮时,ajax函数返回此信息, …

html javascript css ajax jquery

-1
推荐指数
1
解决办法
3845
查看次数

标签 统计

javascript ×3

css ×2

html ×2

ajax ×1

chart.js ×1

css-selectors ×1

jquery ×1

vue-component ×1

vue.js ×1

vuejs2 ×1

vuex ×1