hwdglasses home page push
来源:互联网 发布:成都学软件开发 编辑:程序博客网 时间:2024/05/22 03:23
1.创建 listvc.vue
<template> <div class="listBox"> test-view </div></template><script> export default{}</script><style scoped> .listBox{ position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rebeccapurple; z-index: 100;}</style>
2.配置路由 index.js
import Vue from 'vue'import Router from 'vue-router'import Home from '../../src/components/Home/home.vue'import ListVC from '../../src/components/Home/listvc.vue'Vue.use(Router)const routers = new Router({ routes: [ { path: '/home', name: 'homeModule', meta:{title:'首页'}, component: Home, children:[ { name:'listModule', path:'/listvc', component:ListVC, } ] }, { path: '*', redirect: '/home' } ]})export default routers;
3.home.vue
<template> <div class="homeContainer"> <k-slider :banners="sliders" :swiperOption="swiperOption"></k-slider> <k-glasess @glassesClick="glassesClick"></k-glasess> <k-recommend :recommendArray="recommends"></k-recommend> <k-hot-sell :productsArray="products"></k-hot-sell> //需要用routeview承载子路由 <router-view></router-view> </div></template>
methods:{ glassesClick:function (ID,title) { // push this.$router.push({ name:'listModule', params:{ID:ID,title:title}, }) }},
导航
<div class="listnav"> <img @click="backAction" class="back" src="http://img.blog.csdn.net/20171107133347623"> <span class="titleA">标题</span></div>
methods:{ backAction:function () { //返回导航控制器 this.$router.back() }}
//导航.listnav{ height: 64px; width: 100%; background: white; text-align: center;}//返回.listnav img{ width: 15px; height: 25px; position: absolute; left: 16px; top: 25px;}//标题.listnav span{ display: inline-block; font-size: 16px; height: 44px; line-height: 44px; color: black; margin-top: 20px;}
获取导航参数
{{this.$route.params.title}}
导航返回
this.$router.back()
阅读全文
0 0
- hwdglasses home page push
- Home page
- peper home page--amulet
- The SNOW Home Page
- jquery set home page
- Standard C++ Library Home Page
- 首页---Home Page Goal---First
- Accessing the Database Home Page
- Jim Gray Summary Home Page
- Digital Audio Resampling Home Page
- git-push(1) Manual Page
- my home page: skybluemoon.go.nease.com
- 目标二,三,四---Home Page Goal
- NVIDIA GPU Computing Developer Home Page
- 数据库的 Connection String Home Page
- Android Browser home page的实现
- Home Page - Online Documentation - Developer Express Inc.
- Matt King's Geodesy Home Page
- 好东西来了!2017云栖大会300+份重磅资料下载
- c语言中 #define的基本用法
- 在OpenBSD中安装Apache
- 超级好用Android网络加载图片库
- CSV文件的读取
- hwdglasses home page push
- CXF系列一:创建一个简单的web service
- MySQL运算符
- javaee(servlet)
- Kinect切水果
- php中empty、isset、is_null、!!、==null、==0区分
- 低版本cad如何打开高版本图纸?不用升级软件也可以搞定
- 第10章 NuGet
- numpy中linspace用法