当前位置: 首页 > news >正文

做一个网站需要什么如何识别一个网站是否做的好坏

做一个网站需要什么,如何识别一个网站是否做的好坏,黑帽seo优化软件,网站设计公司 上海如下是Vue3的生命周期函数图: 一、Vue2生命周期和Vue3声明周期的区别 1. Vue2 中,只要创建Vue实例对象而不需要挂载就可以实现beforeCreate 和 created 生命周期函数。 Vue3中必须要将Vue实例对象挂载完成,所有的准备工作做完,…

如下是Vue3的生命周期函数图: 

一、Vue2生命周期和Vue3声明周期的区别

1.  Vue2 中,只要创建Vue实例对象而不需要挂载就可以实现beforeCreate 和 created 生命周期函数。

Vue3中必须要将Vue实例对象挂载完成,所有的准备工作做完,才可以开始实现beforeCreate 和 created 生命周期函数。

2.  Vue2 我们销毁组件,触发的是beforeDestroy 和 destroyed 函数。

在Vue3中,我们销毁组件变为了卸载组件,实现的功能是一致的,不过只是称呼变了,触发的生命周期函数为beforeUnmount 和 unmounted。

二、Vue3生命周期的使用

(一)以配置项的形式调用

和Vue2中调用生命周期函数的方法一致,注意是与setup函数平级。

如下生命周期函数有不懂的,可以参考这篇文章:

Vue生命周期-CSDN博客

export default {name: "MyItem",setup() {},beforeCreate() {console.log("beforeCreate生命周期函数");},created() {console.log("created生命周期函数");},beforeMount() {console.log("beforeMount生命周期函数");},mounted() {console.log("mounted生命周期函数");},beforeUpdate() {console.log("beforeUpdate生命周期函数");},updated() {console.log("update生命周期函数");},beforeUnmount() {console.log("beforeUnmount生命周期函数");},unmounted() {console.log("unmounted生命周期函数");},
};

(二)以composition API 形式调用

以上的生命周期函数和composition API 对应形式如下:

beforeCreate ----> setup()

created ----> setup()

beforeMount ----> onBeforeMount

mounted ----> onMounted

beforeUpdate ----> onBeforeUpdate

updated ----> onUpdated

beforeUnmount ----> onBeforeUnmount

unmounted ----> onUnmounted

使用以上composition API 之前需要先对要使用的API按需引入:

 import { onBeforeMount, onMounted, onBeforeUpdate, onUpdated, onBeforeUnmount, onUnmounted } from "vue";

语法格式如下:

API (() => {  // 内部执行内容  })

import { onBeforeMount, onMounted, onBeforeUpdate, onUpdated, onBeforeUnmount, onUnmounted } from "vue";export default {name: "MyItem",setup() {onBeforeMount(() => {console.log("beforeMount生命周期函数");})onMounted(() => {console.log("mounted生命周期函数");})onBeforeUpdate(() => {console.log("beforeUpdate生命周期函数");})onUpdated(() => {console.log("update生命周期函数");})onBeforeUnmount(() => {console.log("beforeUnmount生命周期函数");})onMounted(() => {console.log("unmounted生命周期函数");})}
};
http://www.yayakq.cn/news/538125/

相关文章:

  • 电子商务网站建设与管理读后感wordpress 移动主菜单
  • 夏天做那些网站致富花桥网站制作
  • 公司网站建设论文结束语智能建造技术专业学什么
  • 注册网站应注意事项mvc5做博客网站
  • wordpress分类名称长沙seo关键词排名
  • 小说网站有源码了该怎么做平面设计能干到老吗
  • 网站服务器租金南宁网站建设公司seo优化
  • 网站建设教程 企业邮箱hao123浏览器
  • 动漫网站设计源代码秦皇岛网站开发报价
  • 网站首页的作用咖啡网站模板
  • 淄博网站快照优化公司长春网站建设5219
  • 为网站网站做网络维护seo属于什么职业部门
  • 上海网站建设方法网站改版的宣传词
  • 百度建站云南服务中心建一个网站要多少钱
  • 做公司网站需要多少钱北京垡头网站建设公司
  • 制作响应式网站报价wordpress 优秀博客
  • 国内返利网站怎么做中信建设有限责任公司陈晓佳
  • 网站做代码图像显示不出来的wordpress添加人气博客导航
  • 黔南网站建设关键词排名怎么做上去
  • 新手如何学做网站网站开发软件怎么做
  • 天津网站建站pycharm做网站
  • 长春网站建设同信丹东东港
  • 400选号网站源码网站建设及
  • 平安建设网站郑州网站建设公司 艾特
  • 个人网页设计欣赏网站wordpress 163 授权码
  • 建设微网站网站排名如何稳定
  • asp做网站教程做网站的怎么学
  • 手机网站怎么建品牌软文案例
  • 青岛做公司网站的公司什么是电子商务网站建设与管理
  • 个体网站建设网站建设需要什么样的内容