Dingjie front-end development school recruitment technical interview (passed)

Preface

Dingjie has two sides, one focusing on technology. This blog records issues that I think are valuable.

valuable questions

How to inherit js classes

es5, involving inheritance of prototypes and prototype chains;
es6, classes and objects, extends, super;

Also asked about some principles of Vue direction. But let me talk about the principles I know. I talked about responsiveness, event cars, diff comparison algorithms, EL rendering (render function), etc.

How do you think about writing a render function yourself?

Render is used for rendering and is essentially a function. The internal parameter passed is a createElement function. There are three parameters inside this function. The first one is required and is the label that needs to be rendered; the second and third are related to the characteristics of the rendering element and the virtual node, and are not required.

Once you know the principle, the idea will be easy to explain. My answer involves innerHTML and innerText in native js. We can also write a render1 whose internal parameter is a function. The first parameter of the function is an HTML structure or a string.

After the internal function gets the string, it can parse and render the passed parameters onto the page to implement a basic rendering function.

Guess you like

Origin blog.csdn.net/zxdznyy/article/details/134515213