
vue
weixin_43034862
这个作者很懒,什么都没留下…
展开
-
vue全局函数和全局变量使用方法
@TOCvue全局函数和全局变量使用方法定义全局变量:在main.js同级目录下创建global.js文件const config = {token: ‘’,device: ‘pc’}let bindToGlobal = (obj, key) => {if (typeof window[key] === ‘undefined’) {window[key] = {};}f...原创 2018-10-25 14:21:51 · 500 阅读 · 0 评论 -
vue发布以后不显示首页问题
修改index.js下的assetsPublicPath 路径为“./”查看router是否配置为如下方式,把history注释掉const router = new VueRouter({mode: ‘history’, /hash模式改为history/这个地方要注释掉,不然打包后不能打开首页routes // (缩写)相当于 routes: routes})...原创 2018-10-25 14:25:57 · 1220 阅读 · 0 评论 -
vue设置默认首页
在router.js设置如下:index就是默认页面const routes = [// 公司项目{ path: '/', redirect: '/index' },{path:'/index',component:index},{path:'/example',component:example,redirect:'/edetail',children:[...原创 2018-10-25 14:32:13 · 32238 阅读 · 0 评论 -
vue布局公共头部,底部,实现新窗口跳转页面
新建一个网页会考虑到公用的头部和底部和新窗口实现内部页面跳转的问题。1.头部和底部框架在element js里有但是不满足需求,自己写。创建新的组件文件为Header.vueprops: [“headerBacground”]这个值从父级页面传过来父级页面使用方法: //向子页面传值 2.新窗口打开内部链接关于我们这样的方法不同于this.$route...原创 2018-10-25 14:44:37 · 4328 阅读 · 0 评论