Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue教程16:Vue实例生命周期详解 #17

Open
chencl1986 opened this issue Mar 18, 2019 · 0 comments
Open

Vue教程16:Vue实例生命周期详解 #17

chencl1986 opened this issue Mar 18, 2019 · 0 comments

Comments

@chencl1986
Copy link
Owner

阅读更多系列文章请访问我的GitHub博客,示例代码请访问这里

钩子Hook的概念

钩子的概念并不止存在于浏览器或者Vue实例,原意是用于拦截或监听系统的操作,类似于键盘输入等。
Vue实例生命周期中的钩子,主要用来监听Vue实例的运行阶段,并提供给使用者在不同阶段运行代码的机会。
VueRouter的路由守卫也是一种钩子,它除了监听还提供了拦截的功能。

挂载的概念

document.getElementById('id').innerHTML = '<div>挂载</div>'
这个语句其实就是一个挂载操作,它的意思就是把内容输出到页面中。

Vue实例生命周期图示详解

Vue实例生命周期

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant