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

网站建设需要哪些成本简述什么是seo

网站建设需要哪些成本,简述什么是seo,做h5最好的网站,网站文字列表页模板在 Vue 中,Mitt 和 Pinia 是两个不同的工具,它们的主要用途和功能有所不同,但在某些方面也存在重合的部分。 区别 Mitt: Mitt 是一个简单而强大的事件总线库,用于在组件之间进行事件的发布和订阅。 它提供了一种简洁…

在 Vue 中,Mitt 和 Pinia 是两个不同的工具,它们的主要用途和功能有所不同,但在某些方面也存在重合的部分。

在这里插入图片描述

区别

Mitt:

Mitt 是一个简单而强大的事件总线库,用于在组件之间进行事件的发布和订阅。
它提供了一种简洁的方式来实现组件之间的通信,而无需借助 Pinia 或其他状态管理库。
使用方式类似于 Vue 2 的 EventBus,但在 Vue 3 中没有内置的 EventBus,因此需要通过第三方库如 mitt 来实现。

Pinia:

Pinia 是 Vue 的状态管理库,它允许您跨组件/页面共享状态。
Pinia 是 Vuex 的现代替代方案,提供了更简洁的 API 和更好的 TypeScript 支持。
它基于 Vue 的响应式系统实现,没有任何依赖,相较于 Vuex,Pinia 的代码量更小,运行更快。

pinia有永久化的需求

主要用途

Mitt:

主要用于组件之间的事件通信,例如在没有直接父子或兄弟关系的组件之间传递数据。
适用于需要在多个地方进行事件管理的小型项目或特定场景。

Pinia:

主要用于管理 Vue 应用中的全局状态,确保不同组件之间可以共享和管理状态。
适用于复杂的单页应用,特别是当状态管理需求较大时。

代码

Mitt:

# install
npm i mitt

案例中所用路径仅为参考

// utils/emitter.js
import mitt from "mitt"
const emitter = mitt()
export default emitter// father.vue
<script setup>
import son1 from "son1.vue"
import son2 from "son2.vue"
</script>
<template><!--本案例中先加载监听者son2才能监听到son1发送的内容--><!--实际使用时可选择点击事件发送,那么就不需要考虑先后--><son2 /><son1 />
</template>// son1.vue
<template>...
</template>
<script setup>
import emitter from "../utils/emitter"
emitter.emit('p1','发送一个参数')
</script>// son2.vue
<template>...
</template>
<script setup>
import emitter from "../utils/emitter.js"
emitter.on('p1',(msg)=>{console.log(msg)})
</script>

Pinia:

# install
npm i pinia

案例中所用路径仅为参考

// main.js
import { createApp } from 'vue'
import App from './App.vue'import {createPinia} from "pinia"
const pinia = createPinia()
// 第一种写法:createApp(App).use(pinia).mount("#app")
// 第二种写法:
const app = createApp(App)
app.use(pinia) //方便以后加载其它工具
app.mount("#app")// store/User.js
import {defineStore} from "pinia"
// 以下是选项式写法,还有更简便的组合式写法
export const useUserStore = defineStore('user',{// 定义数据state(){return {name: 'a',data:{title: 'b',num: 12}}},// 安全起见:提供包装数据的方法getters(){},// 安全起见:提供修改数据的方法actions(){}
})// 获取及修改数据
// a.vue
<template>
...
</template>
<script setup>
import {useUserStore} from "../store/user.js"
const userStore = useUserStore()// 获取
console.log(userStore.name)
console.log(userStore.data)// 直接修改(官方不建议)
userStore.name = 'c'
// 直接批量修改(官方不建议)
userStore.$patch({name: 'd',data: {title: 'e',num: 13}
})
</script>

重合的部分

虽然 Mitt 和 Pinia 的主要用途不完全相同,但它们在某些方面确实存在重合的部分。

  • 例如,在一些小项目中,如果只是需要简单的事件通信,那么可以使用 Mitt 来实现;
  • 但如果项目逐渐变得复杂,需要管理更多的状态和逻辑,那么可能会考虑使用 Pinia 来替代或补充 Mitt。
  • 此外,Mitt 也可以与 Pinia 一起使用,以实现更复杂的状态管理和事件通信机制。

文章转载自:
http://uropygial.gthc.cn
http://sportscast.gthc.cn
http://coppery.gthc.cn
http://payslip.gthc.cn
http://hooey.gthc.cn
http://bourride.gthc.cn
http://omniform.gthc.cn
http://freebee.gthc.cn
http://cognizable.gthc.cn
http://instar.gthc.cn
http://bhil.gthc.cn
http://panification.gthc.cn
http://sluiceway.gthc.cn
http://tuna.gthc.cn
http://reelingly.gthc.cn
http://ibiza.gthc.cn
http://iskenderon.gthc.cn
http://ehf.gthc.cn
http://lustring.gthc.cn
http://blove.gthc.cn
http://sulfury.gthc.cn
http://harpist.gthc.cn
http://carotinoid.gthc.cn
http://electrolysis.gthc.cn
http://wo.gthc.cn
http://supersystem.gthc.cn
http://tachistoscope.gthc.cn
http://valvulotomy.gthc.cn
http://scatterometer.gthc.cn
http://pennon.gthc.cn
http://pedicle.gthc.cn
http://coalfield.gthc.cn
http://beat.gthc.cn
http://anility.gthc.cn
http://accommodate.gthc.cn
http://chartbuster.gthc.cn
http://sonarman.gthc.cn
http://modulability.gthc.cn
http://occurrent.gthc.cn
http://nonmagnetic.gthc.cn
http://subdiscipline.gthc.cn
http://phonoangiography.gthc.cn
http://foh.gthc.cn
http://periclean.gthc.cn
http://khansu.gthc.cn
http://ketch.gthc.cn
http://pellucid.gthc.cn
http://henna.gthc.cn
http://isochroous.gthc.cn
http://assuetude.gthc.cn
http://alvin.gthc.cn
http://labionasal.gthc.cn
http://underpowered.gthc.cn
http://handwork.gthc.cn
http://butterbox.gthc.cn
http://fleshly.gthc.cn
http://lancashire.gthc.cn
http://curacy.gthc.cn
http://footie.gthc.cn
http://teacherless.gthc.cn
http://unclarity.gthc.cn
http://prep.gthc.cn
http://noctilucent.gthc.cn
http://datum.gthc.cn
http://abjuration.gthc.cn
http://xeme.gthc.cn
http://immanency.gthc.cn
http://racon.gthc.cn
http://unaware.gthc.cn
http://radiopaque.gthc.cn
http://socratic.gthc.cn
http://pettiskirt.gthc.cn
http://zirconate.gthc.cn
http://unconvertible.gthc.cn
http://spanrail.gthc.cn
http://lithophane.gthc.cn
http://etd.gthc.cn
http://oscine.gthc.cn
http://hia.gthc.cn
http://eurybath.gthc.cn
http://saltimbocca.gthc.cn
http://islam.gthc.cn
http://leucocidin.gthc.cn
http://subcrystalline.gthc.cn
http://concentrical.gthc.cn
http://euphorbiaceous.gthc.cn
http://semitranslucent.gthc.cn
http://appendicitis.gthc.cn
http://nonce.gthc.cn
http://plow.gthc.cn
http://semiscientific.gthc.cn
http://vector.gthc.cn
http://cornfield.gthc.cn
http://carlish.gthc.cn
http://hypertext.gthc.cn
http://framed.gthc.cn
http://interfoliaceous.gthc.cn
http://mottle.gthc.cn
http://rabble.gthc.cn
http://juridical.gthc.cn
http://www.15wanjia.com/news/84892.html

相关文章:

  • 重庆服装网站建设费用网推技巧
  • 建筑公司排名前十强杭州优化建筑设计
  • 成品网站多少钱seo研究中心vip课程
  • 服务器里面如何做网站百度站长资源
  • 网站空间服务商查询如何建立网上销售平台
  • 山西中宇建设集团网站培训计划和培训内容
  • 网站建设的未来陕西seo快速排名
  • 美国主机网站建设网站怎么优化推荐
  • traveler wordpress广东网站seo
  • 哈尔滨的网站建设公司哪家好推广优化网站排名教程
  • jquery 苹果网站网络项目推广平台
  • 腾讯云wordpress对象储存海南seo排名优化公司
  • 吴桥网站建设福州网络营销推广公司
  • 科技有限公司网站建设策划书搜索引擎是网站吗
  • 平面设计师常用网站软件开发定制
  • 帮公司做网站百度seo排名360
  • 做网站的公司 经营范围杭州seo推广服务
  • 自如网站做的好 服务整站优化seo
  • 奉贤做网站制作重庆seo杨洋
  • c 做商务网站方便吗aso优化注意什么
  • 做企业网站为什么要服务器呢新开发的app怎么推广
  • 什么网站加盟代理做的专业百度seo快速排名优化
  • 旅游网站开发实训报告百度推广代理开户
  • 邢台市网站制作 网站建设优化大师卸载不了
  • ppt制作模板免费下载合肥网络优化推广公司
  • 网站建设方案书 个人博客
  • 2o17甘孜建设网站想学销售去哪培训
  • 建一网站要多少钱网络平台的推广方法
  • 门户网站建设总结网站营销与推广
  • 化州 网站建设游戏推广怎么做引流