Skip to main content
replaced https://vuejs.org/v2 with https://v2.vuejs.org/v2
Source Link

The biggest comment I have about this code is that it modifies DOM elements using vanillaJS techniques. With VueJS, there are ways of achieving this without needing to reference those elements via properties like id or ref. One way is to use computed propertiescomputed properties and bound stylesbound styles. See rewritten code below for examples.

This code relies heavily on global variables (e.g. dividerRef, currentDivider, leftDivider, rightDivider, etc.). Unless those variables are needed for other code, the Vue instance's datadata object can be used to store properties used within the various methods.

The biggest comment I have about this code is that it modifies DOM elements using vanillaJS techniques. With VueJS, there are ways of achieving this without needing to reference those elements via properties like id or ref. One way is to use computed properties and bound styles. See rewritten code below for examples.

This code relies heavily on global variables (e.g. dividerRef, currentDivider, leftDivider, rightDivider, etc.). Unless those variables are needed for other code, the Vue instance's data object can be used to store properties used within the various methods.

The biggest comment I have about this code is that it modifies DOM elements using vanillaJS techniques. With VueJS, there are ways of achieving this without needing to reference those elements via properties like id or ref. One way is to use computed properties and bound styles. See rewritten code below for examples.

This code relies heavily on global variables (e.g. dividerRef, currentDivider, leftDivider, rightDivider, etc.). Unless those variables are needed for other code, the Vue instance's data object can be used to store properties used within the various methods.

add headings
Source Link

Alternative to directly modifying style ofManipulating DOM elementswith VueJS

The biggest comment I have about this code is that it modifies DOM elements using vanillaJS techniques. With VueJS, there are often ways of manipulating DOM elementsachieving this without needing to reference themthose elements via properties like id or ref. One way is to use computed properties and bound styles. See rewritten code below for examples.

Reviewing current codeOther review points

Global variables

Readability aspect: indentation

Repeated code

Unused variables

Styles can be consolidated

Alternative to directly modifying style of DOM elements

With VueJS, there are often ways of manipulating DOM elements without needing to reference them via properties like id or ref. One way is to use computed properties and bound styles. See rewritten code below for examples.

Reviewing current code

Manipulating DOM with VueJS

The biggest comment I have about this code is that it modifies DOM elements using vanillaJS techniques. With VueJS, there are ways of achieving this without needing to reference those elements via properties like id or ref. One way is to use computed properties and bound styles. See rewritten code below for examples.

Other review points

Global variables

Readability aspect: indentation

Repeated code

Unused variables

Styles can be consolidated

added 1 character in body
Source Link

Alternative to directly modifying style of DOM elementelements

Alternative to directly modifying style of DOM element

Alternative to directly modifying style of DOM elements

added 715 characters in body
Source Link
Loading
added 8334 characters in body
Source Link
Loading
added 8334 characters in body
Source Link
Loading
added 2615 characters in body
Source Link
Loading
added 99 characters in body
Source Link
Loading
added 27 characters in body
Source Link
Loading
Source Link
Loading