vux

项目结构:


index.html:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>ll3</title>
  </head>
  <body>
    <div id="app-box"></div>
    <!-- built files will be auto injected -->
  </body>
</html>

----------------------------------------------------------------------------

main.js:

/*所有的入口逻辑我们都将在 main.js 中编写;顶级路由的配置,多少个页面(组件)分别设置多少个顶级路由。在main.js中配置路由;
2.x的routes接收的就是多个对象*/
import Vue from 'vue'                   // 0、
import FastClick from 'fastclick' // 0、
import VueRouter from 'vue-router' // 0、


//发送ajax请求,mainjs中引入axios,其他地方使用的话 如同使用 vue-resource 一样 
import axios from 'axios'
//import VueAxios from 'vue-axios'
//Vue.use(VueAxios, axios)
Vue.prototype.$http = axios


/* 加入各组件包块中的Index.vue,各个包中Index.vue管理自己的子组件 */
//import Index from './components/public/Index'     //test
//import App from './App'     // 1、


import arroundSpace from './components/arroundSpace/Index' //块一
import person from './components/person/Index' //块二
import dynamic from './components/dynamic/Index' //块三
import festivalCustom from './components/festivalCustom/Index' //块三


//##########################
Vue.config.debug = true  //
Vue.use(VueRouter)
//###########################


const routes = [
// Vue 应用里面覆盖所有的路由情况,然后在给出一个 404 页面。
{
path: '/',  //默认
name:'def',
component: festivalCustom,
//children: [{path:'clink',component: Clink},{path:'loving',component: Loving}]
},
{
path: '/arr',       //路径
name:'arr',         //别名
component: arroundSpace,     //对应导入的 import
},
{
path: '/per',
name:'per',  
component: person
},
{
path: '/dy',
name:'dy',  
component: dynamic
},

/*子菜单
{
path: 'comm',
component: Comm
},
{
path: 'invite',
component: Invite
},
{
path: 'record',
component: Record
},
{
path: 'hot',
component: Hot
}
*/
]


const router = new VueRouter({
mode: 'history',       //如果不想要很丑的 hash,我们可以用路由的 history 模式,这种模式充分利用 history.pushState API 来完成 URL 跳转而无须重新加载页面。
base: __dirname , //
routes,
})


FastClick.attach(document.body)
Vue.config.productionTip = false


/* eslint-disable no-new  */
new Vue({
  router,
  render: h => h(App)
}).$mount('#app-box')

-------------------------------------------------

APP.vue

<template>
  <div id="app">
<!-- <loading v-model="isLoading"> </loading> -->
<!-- <router-view  ></router-view> -->

<!-- test -->
<router-view  > </router-view>
<!-- <footer>u</footer> -->
  </div>
</template>


<script>


//import Home from './components/public/Home';      //test
//import Footer from './components/Footer';         //页脚
//import {Card,Box,Icon,Grid, GridItem, GroupTitle,XHeader,Tabbar,TabbarItem,Sticky} from 'vux' 
   
export default {
name: 'app',
components: {
//Grid,
//GridItem,
//GroupTitle,
//XHeader,
//Tabbar,  
//TabbarItem,
//Sticky,
//Box,
//Icon,
//Card,
//Home
//Footer,
    },
}
</script>




<style lang="less"> 
@import '~vux/src/styles/reset.less'; 


body {
  background-color: #fbf9fe;
}


html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
}


home,footer,footer1{
height: 10%;
width: 100%;
background-color: #D80000;
}
</style>

------------------

其他子组件....

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值