tags: Error in mounted hook: "TypeEr
The template in the parent component music-list.vue calls the child component scroll
<scroll ref="list" @scroll="scroll" :data="songs" :probeType="probeType" :listenScroll="listenScroll" class="list">
Set the bottom value of the root element of the child component in a method in the methods of the parent component music-list.vue
this.$refs.list.style.bottom = bottomThen the following error is reported in the browser: roughly means that the attribute bottom cannot be set because it is not defined; the error is the error in line 79 in the method handlePlaylist() in the music-list.vue file, which is this.$refs.list.style.bottom = bottom is wrong
analysis: According to this.$refs.list.style.bottom = bottom, we can know that the intention is to get the DOM root element of the child component, and then set a value to the css attribute bottom of this element, but because this.$refs.list is only obtained The component, and cannot get the DOM inside the sub-component, this is the reason for the error
Solution: Get the DOM of the child component through the $el option, which is rewritten as: this.$refs.list.$el.style.bottom = bottom, that is, this.$refs.list.$el can get the DOM of the child component
Vue echarts initialization example "Error in mounted hook: "TypeError: Cannot read property ‘init’ of undefined"" You can see that there is no problem with downloading ...
background: When using the ECharts chart component in a Vue project, this error message appeared and the chart could not be displayed normally...
uni-app runs on the h5 end and reports Error in mounted hook: "TypeError: Cannot read property ‘length’ of undefined Can run normally but report an error At first, I couldn't find the...
The following problem occurs is to report the following error when using official examples in mounted (): Error in mounted hook: “TypeError: Cannot read property ‘init’ of undefined&...
In the first two days, I encountered the following error when using the Echarts chart: Reason for error: Echarts' introduction method error Correct Echarts introduction method: This is solved in this ...
[Vue warn]: Error in mounted hook: "TypeError: Cannot read property ‘init’ of undefined" TypeError: Cannot read property ‘init’ of undefined Solution: Change import e...
The main reason: the JDK version used by the container does not match For example, tomcat7 does not support JDK5, which is a fundamental problem. Solution: Use the matching JDK according to the corres...
Input.GetAxis Get axis static function GetAxis (axisName : string) : float Descriptiondescription Returns the value of the virtual axis identified by axisName. Returns the value in the ...
Today encounter a strange question, I write a sql statement directly in the mysql database visualization tool sqlyog, paste directly into the project xml file directly suggestive of error, at first I ...
The front -end Vue project uses an ECharts error solution, which is valid for pro -testing. (1) Originally introduced echarts as follows: the following code: (2) The writing of ECharts was introduced ...