草庐IT

item_property

全部标签

javascript - [Vue 警告] : Error in render function: "TypeError: Cannot read property ' first_name' of null"

我有以下Navigation.vue组件:{{user.first_name}}import{mapActions,mapGetters}from'vuex'exportdefault{name:'hello',methods:{...mapActions(['myAccount'])},mounted:function(){if(localStorage.getItem('access_token')){this.myAccount()}},computed:{...mapGetters(['user'])}}此代码返回:[Vuewarn]:Errorinrenderfunction

javascript - 未捕获的类型错误 : Cannot read property 'offsetWidth' of null

这个问题在这里已经有了答案:GoogleMAPAPIUncaughtTypeError:Cannotreadproperty'offsetWidth'ofnull(26个答案)OffsetWidthnullorundefined(Can'tfindsolution)[closed](1个回答)关闭8年前。不幸的是,我在发布这个问题之前阅读了几个线程,我找不到适合我的问题的答案。这是我的代码片段-->functionpopulateIframe(id){varifrm=document.getElementById(id);ifrm.src="business_data_to_excel

c# - JavaScript 运行时错误 : Unable to get property 'msie' of undefined or null reference

我刚刚尝试更改我对母版页的jqueryui引用。我只在InternetExplorer上收到上述错误。我在Firefox和Chrome上没有收到错误。这是抛出错误的jquery代码:returna.browser.msie?(b=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),c=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth),b我有下面的母版页:请让我知道我需要做什么?我尝试将jquery引

javascript - Angular2 - 类型错误 : Cannot read property 'Id' of undefined in (Typescript)

我收到以下错误:angular2.dev.js:23925EXCEPTION:TypeError:Cannotreadproperty'Id'ofnullin[{{product.Id}}inProductEditComponent@0:68]抛出://Product-edit.component.ts:import{Component}from'angular2/core';import{IProduct}from'./product'import{ProductService}from'./product.service'import{RouteParams}from'angula

javascript - react - 类型错误 : Cannot read property 'props' of undefined

我正在尝试创建一个能够删除列表中项目的点击事件,但是当我点击它时,我得到“类型错误:无法读取未定义的属性‘props’”。我尽量坚持使用ES6,而且我很确定在某处绑定(bind)“this”是一件好事,但我尝试了很多地方但都没有成功。importReact,{Component}from'react';import'./App.css';classAppextendsComponent{render(){return();}}classStreetFighterextendsComponent{constructor(props){super(props);this.state={ch

javascript - 导入 anuglar2/forms 导致 "Cannot read property ' 未定义注释”

我正在尝试创建简单的表单,如http://angularjs.blogspot.no/2015/03/forms-in-angular-2.html中所述,但是当我添加从'angular2/forms'导入{forms,required};在崩溃中TypeError:Cannotreadproperty'annotations'ofundefinedTypeError:Cannotreadproperty'annotations'ofundefinedatReflectionCapabilities.System.register.execute.$__export.annotatio

javascript - Jquery-自动完成 : makes the tab key select the first item if no item is selected

这个问题的目标是:通过使用jquery-autocomplete,使tab键能够在没有选择任何项目的情况下选择第一个项目。我实现的代码(1)有效,但我有一些疑问,我想澄清它们,或者如果可能的话,改进/更改代码(1)以实现我的目标。我的疑问是:我太早触发了ENTER:事件调度是异步的(不同的监听器是同步调用的,但它是异步的触发器),所以我可能会在监听器处理DONE之前触发它。因此,我在这里仍然为两个事件使用相同的对象,所以我可能会产生令人讨厌的副作用(如果我在第一次调度期间阻止默认设置,那么第二个调度也会被阻止,因为它是同一个对象,例如).有什么建议/意见吗?附言:这是jsfiddle链

javascript - promise - TypeError : Cannot read property 'then' of undefined

我想我只需要另一双眼睛看这个,因为我无法得到我在这里缺少的东西。$scope.checkout=function(form){//somecodeherefunctioncheckoutErrorHandler(error){//somecodehere}functiondisplaySuccessMessage(){$scope.success=true;cartService.emptyCart();}checkoutService.makePayment($scope.payment).then(function(i){//somecodeherecheckoutService.

javascript - 开 Jest + 火力地堡 : TypeError: Cannot read property 'defineProperties' of undefined

我目前正在做一个ReactNative项目,想使用FirebaseJSSDK。为了熟悉它的所有API,我想用Jest编写一些学习测试。这是我的测试:importFirebasefrom'firebase';describe('Firebase',function(){it('shouldwork',function() {expect(null).toBeNull()})});不幸的是我收到了这个错误:●测试套件运行失败TypeError:Cannotreadproperty'defineProperties'ofundefinedatnode_modules/firebase/app

javascript - {...object, property : value} work with spread syntax? 如何

在查看ES6文档时,我注意到建议使用扩展语法而不是更冗长的Object.assign()方法。但是,我对这是如何实现的有点困惑。在这种情况下object是否被分解为key:value对,之后添加或覆盖逗号右侧的属性,最后被重新组装? 最佳答案 Isobjectinthiscasebeingbrokendowntokey:valuepairs,afterwhichthepropertyontherightofthecommaiseitheraddedoroverwritten,andfinallybeingreassembled?原始