Code Monkey home page Code Monkey logo

Comments (4)

lbb1811 avatar lbb1811 commented on June 2, 2024

Q2: 什么是CSS定位?

from web_q_a.

ForestHo avatar ForestHo commented on June 2, 2024

A1: 闭包是函数在执行的时候,能够记住它所定义的词法作用域,或者也可以说闭包是指有权访问另一个函数作用域中变量的函数。闭包的优点是可以实现私有数据(方法或者变量),这是面向对象编程的特征之一,以及避免全局变量的污染。缺点是闭包会常驻内存,增大内存使用量,使用不当容易内存泄漏。

from web_q_a.

ForestHo avatar ForestHo commented on June 2, 2024

Q2: 什么是CSS定位?

CSS定位有相对定位,绝对定位,固定定位这3种,当然position样式不只有这3种取值,还有默认的static和inherit,其中相对定位没有脱离文档流,元素在文档流中还占有位置,它只是相对它自己在文档中的位置做的一个偏移,相对定位一般用于元素位置的微调,或者子绝父相中其子元素的绝对定位。而绝对定位和固定定位脱离文档流了,绝对定位是相对于它最近一个设置了定位属性(relative,absolute,fixed都可以)的父级元素进行的定位,而固定定位是相对于浏览器当前可视窗口(区域)的定位,不管浏览器滚动条怎么滚动,它在可视区域中的位置都保持不变。

from web_q_a.

ForestHo avatar ForestHo commented on June 2, 2024

vue-router中在标签中router-link指定tag路由跳转,和在组件标签中绑定点击事件然后在js中直接push或者go进行路由跳转,有什么场景下的优缺点?

from web_q_a.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.