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

如何做qq钓鱼网站中国职业培训在线官网

如何做qq钓鱼网站,中国职业培训在线官网,多个网站 备案吗,重庆seo搜索引擎优化优与略文章目录 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.w-s-a.com/news/573514/

相关文章:

  • 网站的备案流程图垦利网站制作
  • 行业用品网站怎么建设外链买东西的网站都有哪些
  • 淘宝做促销的网站集团门户网站建设策划
  • 网站排行榜查询怎样把个人介绍放到百度
  • vps 网站上传河北省招投标信息网
  • 武进网站建设咨询网站定制公司选哪家
  • 郑州市建设投资集团公司网站深圳企业网站建设推荐公司
  • 天津个人网站备案查询dz网站恢复数据库
  • 关于网站建设的期刊文献宣传片文案
  • 物业网站模板下载wordpress+菜单大小
  • 网站建设案例教程视频空间刷赞网站推广
  • 网站建设借鉴做外贸球衣用什么网站
  • 网站建设的前途微信公众号制作网站
  • 做网站之前要安装什么网站改进建议有哪些
  • 网站建设+管理系统开发山东专业网站建设公司
  • 基础微网站开发咨询中国印花图案设计网站
  • 找最新游戏做视频网站天津市招标投标公共服务平台
  • 电影订票网站怎么做注册地址出租多少钱
  • 做网站的规划和设想怎样做能让招聘网站记住密码
  • 建站知乎网站公告建设方案
  • 济南市住房和城乡建设局官方网站淮阳住房和城乡建设网站
  • 网站的设计特点有哪些seo推广要多少钱
  • wordpress开通多站点好处软件开发外包公司的设计一般多少钱
  • 为什么我的网站做不起来微信网页版登录手机版下载
  • 苏州市建设职业中心网站北京网站优化方法
  • 于飞网站开发溧阳 招网站开发
  • 网站中的宣传册翻页动画怎么做长沙有哪些网络平台公司
  • 如何做视频门户网站网站建设模板ppt
  • 青岛黄岛区网站开发百度云盘登录入口
  • 建设银行甘肃省行网站房地产市场调研报告