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

哪个网站做的win10系统公司创建一个网站多少钱

哪个网站做的win10系统,公司创建一个网站多少钱,wordpress使用培训,新冠感染最新数据文章目录 1#xff0c;入门案例2#xff0c;一些细节高亮效果非当前路由会被销毁 3#xff0c;嵌套路由4#xff0c; 传递查询参数5#xff0c;命名路由6#xff0c;传递路径参数7#xff0c;路径参数转props8#xff0c;查询参数转props9#xff0c;replace模式10入门案例2一些细节高亮效果非当前路由会被销毁 3嵌套路由4 传递查询参数5命名路由6传递路径参数7路径参数转props8查询参数转props9replace模式10编程式导航11缓存路由组件12新生命周期13路由守卫 1入门案例 安装库。 npm install vue-router3准备三个组件。 App.vue AAA.vue BBB.vue templatedivrouter-link to/aaaa/router-linkrouter-link to/bbbb/router-linkrouter-view //div /templatetemplatedivAAA/div /templatetemplatedivBBB/div /template新建router.js。 import Vue from vue import VueRouter from vue-router import AAA from ./AAA.vue import BBB from ./BBB.vueVue.use(VueRouter)const router new VueRouter({routes: [{ path: /a, component: AAA },{ path: /b, component: BBB }] }) export default routermain.js。 import router from ./router.jsnew Vue({render: h h(App),router }).$mount(#app)效果 2一些细节 高亮效果 router-link的active-class属性指定当前路由链接的高亮类名。 templatedivrouter-link to/a active-classabcaaa/router-linkrouter-link to/b active-classabcbbb/router-linkrouter-view //div /template style .abc {color: red; } /style非当前路由会被销毁 templatedivAAA/div /template script export default {beforeDestroy() {console.log(1);} } /script3嵌套路由 AAA内还有CCC和DDD。 二级路由链接要从一级开始写 配置项无须加斜线。 templatedivrouter-link to/aaaa/router-linkrouter-link to/bbbb/router-linkrouter-view //div /templatetemplatedivrouter-link to/a/cccc/router-linkrouter-link to/a/dddd/router-linkrouter-view //div /templatetemplatedivBBB/div /templatetemplatedivCCC/div /templatetemplatedivDDD/div /templaterouter.js。 import Vue from vue import VueRouter from vue-router import AAA from ./AAA.vue import BBB from ./BBB.vue import CCC from ./CCC.vue import DDD from ./DDD.vue Vue.use(VueRouter)const router new VueRouter({routes: [{path: /a, component: AAA,children: [{path: c, component: CCC}, {path: d, component: DDD}]},{ path: /b, component: BBB }] }) export default router4 传递查询参数 发送。 templatedivrouter-link to/a?id123aaa/router-linkrouter-link to/a?id124aaa/router-linkrouter-link to/bbbb/router-linkrouter-view //div /template接收。 templatedivAAA{{ $route.query.id }}/div /template发送的第二种写法。 templatedivrouter-link :to{path: /a,query: {id: 123}}aaa/router-linkrouter-link to/a?id124aaa/router-linkrouter-link to/bbbb/router-linkrouter-view //div /template5命名路由 给路由起个名字。 import Vue from vue import VueRouter from vue-router import AAA from ./AAA.vue import BBB from ./BBB.vueVue.use(VueRouter)const router new VueRouter({routes: [{ path: /a, component: AAA, name: a },{ path: /b, component: BBB, name: b }] }) export default router跳转时传递名称。 templatedivrouter-link :to{name: a}aaa/router-linkrouter-link :to{name: b}bbb/router-linkrouter-view //div /template6传递路径参数 发送。 templatedivrouter-link to/a/123aaa/router-linkrouter-link to/a/124aaa/router-linkrouter-link to/bbbb/router-linkrouter-view //div /template配置。 import Vue from vue import VueRouter from vue-router import AAA from ./AAA.vue import BBB from ./BBB.vueVue.use(VueRouter)const router new VueRouter({routes: [{ path: /a/:id, component: AAA },{ path: /b, component: BBB }] }) export default router接收。 templatedivAAA{{ $route.params.id }}/div /template7路径参数转props 启用props会将所有路径参数通过props传递给组件。 import Vue from vue import VueRouter from vue-router import AAA from ./AAA.vue import BBB from ./BBB.vueVue.use(VueRouter)const router new VueRouter({routes: [{ path: /a/:id, component: AAA, props: true },{ path: /b, component: BBB }] }) export default router组件要声明该props。 templatedivAAA{{ id }}/div /template script export default {props: [id] } /script8查询参数转props props写成函数。 import Vue from vue import VueRouter from vue-router import AAA from ./AAA.vue import BBB from ./BBB.vueVue.use(VueRouter)const router new VueRouter({routes: [{path: /a, component: AAA, props(route) {return {id: route.query.id}}},{ path: /b, component: BBB }] }) export default router9replace模式 替换掉之前的路由而不是压栈。 templatedivrouter-link to/a replaceaaa/router-linkrouter-link to/b replacebbb/router-linkrouter-view //div /template10编程式导航 代码进行跳转。 templatedivdivAAA/divbutton clickadd按钮/button/div /template script export default {methods: {add() {this.$router.push(/b)}}, } /script参数可以是对象与前面route-link的to用法一致。 11缓存路由组件 不销毁。 keep-aliverouter-view / /keep-alive12新生命周期 不销毁的时候激活与失活。 templatedivdivAAA/div/div /template script export default {activated() {console.log(1);},deactivated() {console.log(2);}, } /script13路由守卫
http://www.dnsts.com.cn/news/155636.html

相关文章:

  • crm系统网站跟网站做流量
  • 建设公司网站费用多少成都有哪些网站建设
  • 建设工程质量监督站网站如何后台修改网站联系人
  • 摄影作品欣赏网站网络规划设计师招聘
  • 建设旅游网站的费用预算微信自助下单小程序怎么弄
  • 如何注册公司并获得营业执照seo公司发展前景
  • 手机网站jquery底部导航菜单Linux网站开发设计
  • 打鱼网站建设天津放心站内优化seo
  • 做英文的小说网站泰安有什么好的网络科技公司
  • 大良营销网站建设渠道关于建设部门子网站的请示
  • 国外免费建站网站搭建福州云建站
  • 刮奖网站石家庄营销网站建设价格
  • 做网站架构需要什么步骤无锡建设工程项目代码申请网站
  • 教做flash的网站做宠物服务的相关网站
  • 哪些网站百度不收录用wordpress建网站
  • 如何做好网站推广优化计算机前端和后端区别
  • 南京网站建设 个人网站开发与设计案例
  • 长春谁家做网站使用织梦系统建设网站
  • 微网站建设申请株洲市建设局网站
  • 网站建设公众号小程序属于什么新手建设什么网站好
  • 网站怎么做视频背景网站建设从建立服务器开始
  • 呼和浩特建设厅官方网站深圳创业园
  • 关于网站开发的销售wordpress图片快速主题
  • 如何给自己网站做外链网站建设实训指导书
  • 自己做网站用什么软件wordpress淘口令插件
  • 漳州本地企业网站建设服务海丰建设局网站
  • 电商的网站怎么做的好docker wordpress 备份
  • 做网站用别人图片文章会侵权吗本地网站模板修改
  • 微网站欣赏源码网站php
  • 软件开发做网站海外推广是什么工作