DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead

The deprecation message: DeprecationWarning: Tapable.apply is deprecated. Call apply on the plugin directly insteadDeprecationWarning: Tapable.plugin is deprecated. Use new API on .hooks instead Is just a warning: Here is a quick summary for everyone encountering this message. What is this message? webpack 4 is using a new plugin system and deprecates the previous APIs. There are 2 new … Read more

What is the best way to declare global variables in Vue.js?

Warning: The following answer is using Vue 1.x. The twoWay data mutation is removed from Vue 2.x (fortunately!). In case of “global” variables—that are attached to the global object, which is the window object in web browsers—the most reliable way to declare the variable is to set it on the global object explicitly: However form Vue’s hierarchy perspective … Read more

Vue ‘export default’ vs ‘new Vue’

When you declare: That is typically your root Vue instance that the rest of the application descends from. This hangs off the root element declared in an html document, for example: The other syntax is declaring a component which can be registered and reused later. For example, if you create a single file component like: … Read more

forEach is not a function error with JavaScript array

First option: invoke forEach indirectly The parent.children is an Array like object. Use the following solution: The parent.children is NodeList type, which is an Array like object because: It contains the length property, which indicates the number of nodes Each node is a property value with numeric name, starting from 0: {0: NodeObject, 1: NodeObject, length: 2, …} See more details in this article. Second … Read more

tech