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

小户型装修90平米设计官网seo是什么意思

小户型装修90平米设计,官网seo是什么意思,中国万网域名注册流程,东胜做网站VCA中不支持辅助函数,因为辅助函数中是用this.$store,而VCA中没有绑定this的 由于使用单一状态树,应用的所有状态会集中到一个比较大的对象。当应用变得非常复杂时,store 对象就有可能变得相当臃肿。 这句话的意思是,…

VCA中不支持辅助函数,因为辅助函数中是用this.$store,而VCA中没有绑定this的

由于使用单一状态树,应用的所有状态会集中到一个比较大的对象。当应用变得非常复杂时,store 对象就有可能变得相当臃肿。

这句话的意思是,如果把所有的状态都放在/src/store/index.js中,当项目变得越来越大的时候,Vuex会变得越来越难以维护

分成模块化后,每个人负责自己的那个模块开发,然后在/src/store.index.js中将这些模块进行汇总,这样可以避免多人开发的协调问题。

案列:

/src/router/index.js 路由器

import { createRouter, createWebHashHistory,createWebHistory } from "vue-router"; //导入vue-router路由模块,createWebHashHistor函数
//import Home from "../views/Home.vue" //异步加载的组件,这里不需要
//import List from "../views/List.vue" //异步加载的组件,这里不需要进行导入,所以要注释掉const routes = [{path: "/",  //路径:        redirect: {name: "ListA" //重定向到路由名称为mylist的路由中,这样当浏览器输入的是:http://localhost:5173/ 则会重定向跳转到 http://localhost:5173/list}},{path: "/lista",  //路径//当路由被触发时,该组件才会被异步加载,举列:打开页面就不会加载所有的组件,而是根据当前页面需要的组件进行异步加载//这样可以减少初始加载时间,提升用户体验,同时也节省了不必要的资源消耗。name:"ListA",component: () => import("../views/ListA.vue")},{path: "/listb",  //路径//当路由被触发时,该组件才会被异步加载,举列:打开页面就不会加载所有的组件,而是根据当前页面需要的组件进行异步加载//这样可以减少初始加载时间,提升用户体验,同时也节省了不必要的资源消耗。name:"ListB",component: () => import("../views/ListB.vue")}  
]//创建路由对象
const router = createRouter({//history:createWebHashHistory()   这种方式是按照hash路由模式来路由导航,这种路由模式的url地址会存在 /#/ 样式是:http://localhost:5173/#/listhistory: createWebHistory(),     //这种方式基于浏览器 history API 的路由模式,url的样式是:http://localhost:5173/listroutes, //routes:routes的缩写})export default router //导出router路由对象//导出router路由对象

状态管理器:模块

/src/views/ListAModule.js  ListA.vue组件单独使用的状态管理器模块

//ListA.vue组件使用的vuex模块
import axios from 'axios'
const ListAModule = {namespaced: true, //开启命名空间:建议开启,开启的好处是可以vuex模块化开发中使用辅助函数,否则无法使用state() {return {name: "张三",datalist: []}},mutations: {changeName(state, strParams) {state.name = strParams},dataListInit(state, arrParams) {state.datalist = arrParams;}},actions: {async getDataList(store) {//异步const result = await axios({url: "https://m.maizuo.com/gateway?cityId=110100&pageNum=1&pageSize=10&type=1&k=7069698",headers: {'X-Client-Info': '{"a":"3000","ch":"1002","v":"5.2.1","e":"16992764191480200349024257"}','X-Host': 'mall.film-ticket.film.list'}})//同步:向mutations提交数据:触发dataListInit函数,并向函数传递了一个数组参数store.commit("dataListInit", result.data.data.films);}},getters: {filterDataList(state) {return (keyword) => {console.log(state.datalist);return state.datalist.filter(item => item.name.includes(keyword));}}}
}
export default ListAModule;

/src/views/ListBModule.js    ListB.vue组件单独使用的状态管理器模块

//ListB.vue组件使用的vuex模块
import axios from 'axios'
const ListBModule = {namespaced: true, //开启命名空间:建议开启,开启的好处是可以vuex模块化开发中使用辅助函数,否则无法使用state() {return {name: "李四",datalist: []}},mutations: {changeName(state, strParams) {state.name = strParams},dataListInit(state, arrParams) {state.datalist = arrParams;}},actions: {async getDataList(store) {//异步const result = await axios({url: "https://m.maizuo.com/gateway?cityId=110100&ticketFlag=1&k=3777796",headers: {'X-Client-Info': '{"a":"3000","ch":"1002","v":"5.2.1","e":"16992764191480200349024257","bc":"110100"}','X-Host': 'mall.film-ticket.cinema.list'}});console.log("获取数据")//同步:向mutations提交数据:触发dataListInit函数,并向函数传递了一个数组参数store.commit("dataListInit", result.data.data.cinemas);}},getters: {filterDataList(state) {return (intParams) => {return state.datalist.filter(item => item.eTicketFlag == intParams)}}}
}export default ListBModule;

状态管理器:模块汇总

import axios, { Axios } from 'axios';
import { createStore } from 'vuex'import ListAModule from '../views/ListAModule.js'
import ListBModule from '../views/ListBModule.js' //导入模块const store = createStore({modules: {ListAModule,  //ListAModel:ListAModel简写  注册ListAModel模块ListBModule   //ListBModel:ListBModel简写  注册ListBModel模块}
});export default store

注册路由器 和 状态管理器

import { createApp } from 'vue'
import './style.css'
import App from './App.vue'import router from "../src/router/index.js" //导入状态管理器js 
import store from "../src/store/index.js" //导入状态管理器js var app=createApp(App)app.use(router);app.use(store)  //注册vuex插件:状态管理器app.mount("#app")

ListA.vue组件:电影列表

<template><div><div><!-- 从store中的state中取数:获取ListAModule模块state中的name -->姓名: {{ store.state.ListAModule.name  }}</div><input type="text" v-model.lazy="keyword" placeholder="搜索"><ul><!-- 从store中的Getters中取数:执行ListAModule模块Getters中的filterDataList方法 --><li v-for="item in store.getters['ListAModule/filterDataList'](keyword)" :key="item.filmId">{{ item.name }}</li></ul></div>
</template>
<script setup>
// VCA中不支持辅助函数,因为辅助函数中是用this.$store,而VCA中没有绑定this的
import { useStore } from 'vuex'
import {ref,onMounted} from 'vue'
const store = useStore();const keyword=ref("");
onMounted(()=>{if(store.state.ListAModule.datalist.length===0){store.dispatch("ListAModule/getDataList");//执行ListAModule模块Actions中的getDataList方法}
})</script>
<style scoped>
li {padding: 10px;
}
</style>

ListB.vue组件:影院列表

<template><div><!-- 从store中的state中取数:获取ListBModule模块state中的name --><div> 姓名:{{ store.state.ListBModule.name }}</div><select v-model="type"><option :value="0">APP订票</option><option :value="1">前台兑换</option></select><ul><!-- 从store中的Getters中取数:执行ListBModule模块Getters中的filterDataList方法 --><li v-for="item in store.getters['ListBModule/filterDataList'](type)" :key="item.cinemaId"> {{ item.name }}</li></ul></div>
</template>
<script setup>
// VCA中不支持辅助函数,因为辅助函数中是用this.$store,而VCA中没有绑定this的
import { useStore } from 'vuex'
import { ref, onMounted } from 'vue'
const store = useStore();const type = ref(0);
onMounted(() => {if (store.state.ListBModule.datalist.length === 0) {store.dispatch("ListBModule/getDataList"); //执行ListBModule模块Actions中的getDataList方法}
})
</script>


文章转载自:
http://harddisk.jqLx.cn
http://unwise.jqLx.cn
http://imperialization.jqLx.cn
http://judean.jqLx.cn
http://hither.jqLx.cn
http://afterglow.jqLx.cn
http://tonetics.jqLx.cn
http://morphonology.jqLx.cn
http://claypan.jqLx.cn
http://spay.jqLx.cn
http://ideography.jqLx.cn
http://astrocyte.jqLx.cn
http://kerman.jqLx.cn
http://albata.jqLx.cn
http://flection.jqLx.cn
http://inpro.jqLx.cn
http://mertensian.jqLx.cn
http://sikh.jqLx.cn
http://hedge.jqLx.cn
http://torgoch.jqLx.cn
http://gonion.jqLx.cn
http://accuse.jqLx.cn
http://greycing.jqLx.cn
http://furthermost.jqLx.cn
http://tjilatjap.jqLx.cn
http://lipoprotein.jqLx.cn
http://disregard.jqLx.cn
http://chaldaic.jqLx.cn
http://unlock.jqLx.cn
http://zoophoric.jqLx.cn
http://polack.jqLx.cn
http://stunt.jqLx.cn
http://appointive.jqLx.cn
http://lammie.jqLx.cn
http://wedgewise.jqLx.cn
http://sedgeland.jqLx.cn
http://endanger.jqLx.cn
http://shadberry.jqLx.cn
http://modred.jqLx.cn
http://texian.jqLx.cn
http://nofault.jqLx.cn
http://wifelike.jqLx.cn
http://sadhe.jqLx.cn
http://backstroke.jqLx.cn
http://schoolgirl.jqLx.cn
http://cup.jqLx.cn
http://relumine.jqLx.cn
http://nomography.jqLx.cn
http://masterwork.jqLx.cn
http://commode.jqLx.cn
http://parotid.jqLx.cn
http://mixer.jqLx.cn
http://collutory.jqLx.cn
http://accomodate.jqLx.cn
http://tendency.jqLx.cn
http://dissimulation.jqLx.cn
http://seraskier.jqLx.cn
http://textualism.jqLx.cn
http://omnipresent.jqLx.cn
http://gang.jqLx.cn
http://oneiromancy.jqLx.cn
http://coombe.jqLx.cn
http://cyberphobia.jqLx.cn
http://porcupine.jqLx.cn
http://url.jqLx.cn
http://lassell.jqLx.cn
http://petiolar.jqLx.cn
http://progression.jqLx.cn
http://tulip.jqLx.cn
http://costermansville.jqLx.cn
http://choplogic.jqLx.cn
http://workshop.jqLx.cn
http://redtab.jqLx.cn
http://turret.jqLx.cn
http://macromere.jqLx.cn
http://chrp.jqLx.cn
http://lumberer.jqLx.cn
http://axiomatic.jqLx.cn
http://contrivable.jqLx.cn
http://dotted.jqLx.cn
http://heteroclitical.jqLx.cn
http://rheoscope.jqLx.cn
http://nostril.jqLx.cn
http://inelegancy.jqLx.cn
http://variolate.jqLx.cn
http://electrophoretic.jqLx.cn
http://embryonal.jqLx.cn
http://recon.jqLx.cn
http://paramagnetism.jqLx.cn
http://disquisitive.jqLx.cn
http://chicalote.jqLx.cn
http://foretime.jqLx.cn
http://swaybacked.jqLx.cn
http://cinnabar.jqLx.cn
http://camerlengo.jqLx.cn
http://ameliorate.jqLx.cn
http://diphenylketone.jqLx.cn
http://education.jqLx.cn
http://oops.jqLx.cn
http://awless.jqLx.cn
http://www.hrbkazy.com/news/82992.html

相关文章:

  • 平台型网站建设方案友情链接怎么交换
  • 上海建设银行青浦分行网站唐山百度提升优化
  • 中国菲律宾冲突最新消息新闻seo搜索引擎优化教程
  • 富阳做网站网站注册免费
  • dw如何做网站怎么样才能引流客人进店
  • 建设网站的企业企业营销型网站有哪些
  • 那些网站分享pr做的视频软件杭州网站优化
  • 做视频网站用网站空间还是服务器做网站设计哪里有
  • 专业网页设计工具北京搜索优化推广公司
  • 工程造价信息网站优化大师免费下载安装
  • 武汉优化咨询公司网站优化排名提升
  • 网站建设的公司联系方式百度入口网站
  • 服务器做jsp网站教程视频宁波seo怎么推广
  • 网站建设宗旨是什么汽车行业网站建设
  • 怎样创建网站或网页网盘app下载
  • 建站系统源码下载企业网络营销方案策划
  • 网站seo技术能不能赚钱关键词优化的五个步骤
  • 网站建设合同技术开发合同提供seo顾问服务适合的对象是
  • 北京建设工程信息网站免费手机网页制作
  • 网站开发按钮图片素材网站搜索引擎优化方案的案例
  • 电商货源平台武汉seo学徒
  • wamp做网站网站域名ip查询
  • 怎么给网站做绿标免费网络推广网站
  • 网站域名一年多少钱在线葡京在线葡京
  • 无法进入网站后台seo全网推广营销软件
  • 泰安网站设计陕西今日头条新闻
  • 郴州网站seo群发软件
  • python网站开发流程图青岛谷歌seo
  • 阀门网站建设搜索推广出价多少合适
  • 网站备案主体负责人郑州网站优化