因此,我正在制作这个小应用程序,允许用户输入命令来调整div的大小。
在执行此操作时,我希望通过简单地从全名调用相同值的速记选项来简化操作,但这会返回未定义的值。
将this.small更改为sizes.small将返回错误:
Uncaught TypeError: Cannot read property 'small' of undefined
这是我的代码:
var sizes = {
// Full names for sizes
small : [200, 150],
medium : [500, 350],
la
一切都在开发中正常工作,但是当我进入生产环境时,我得到一个错误:WebpackError: Cannot read property 'pathname' of undefined
但是当I console.log(this.props);时,location: {pathname: "/", ...}会显示为键值对之一。
这是在我的布局index.js中。
代码如下:
import React from 'react';
import Head from 'components/head';
import Header from
我有这样的代码:
var sizes = ["1/9","1/8","1/7","1/6","1/5","1/4","1/3","1/2","1/1","2/1","3/1","4/1","5/1","6/1","7/1","8/1","9/1"];
var slider = new dijit.fo