Commit 98cf0c78 authored by liangjingpeng's avatar liangjingpeng

父组件修改

parent f6cbcf54
......@@ -5,6 +5,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- 高德api key-->
<script src="https://webapi.amap.com/loader.js"></script>
<!-- <script type="text/javascript" src="http://49.232.167.247:20016/web-apps/apps/api/documents/api.js"></script> -->
<!-- <link rel="stylesheet" href="//at.alicdn.com/t/font_2011217_f70ptj9y4oc.css">-->
<title>融创软通</title>
......
<template>
<div id="container" class="map-container"></div>
<div id="container" class="map-container" />
</template>
<script>
......@@ -9,40 +9,40 @@ export default {
data() {
return {
map: null,
marker: null,
};
marker: null
}
},
mounted() {
this.initMap();
this.initMap()
},
methods: {
initMap() {
window._AMapSecurityConfig = {
securityJsCode: "9236cc9d8ca5060f5cd017efe2ca1a3a",
};
securityJsCode: '9236cc9d8ca5060f5cd017efe2ca1a3a'
}
AMapLoader.load({
key: "1e37d7eb9484c25acf469c3657775679", // 申请好的Web端开发者 Key,调用 load 时必填
version: "2.0", // 指定要加载的 JS API 的版本,缺省时默认为 1.4.15
key: '1e37d7eb9484c25acf469c3657775679', // 申请好的Web端开发者 Key,调用 load 时必填
version: '2.0' // 指定要加载的 JS API 的版本,缺省时默认为 1.4.15
})
.then((AMap) => {
this.map = new AMap.Map("container", {
this.map = new AMap.Map('container', {
zoom: 17,
center: [117.041262, 39.1066],
keyboardEnable:false,
doubleClickZoom: false,
});
keyboardEnable: false,
doubleClickZoom: false
})
this.marker = new AMap.Marker({
position: [117.040249,39.107839],
title: "融创软通",
position: [117.040249, 39.107839],
title: '融创软通'
})
this.map.add(this.marker)
})
.catch((e) => {
console.error(e); // 加载错误提示
});
console.error(e) // 加载错误提示
})
}
},
};
}
}
</script>
<style scoped>
......
......@@ -3,17 +3,17 @@ import Router from 'vue-router'
import Framework from '@/components/Framework'
import Index from '@/components/Index'
Vue.use(Router)
/*/!*export const constantRoutes = [
export const constantRoutes = [
{
path: '/',
redirect: '/index',
hidden: true
},
/!* {
/* {
path: '/login',
component: (resolve) => require(['@/views/login/login.vue'], resolve),
hidden: true
},*!/
},*/
{
path: '/',
component: Framework,
......@@ -51,94 +51,34 @@ Vue.use(Router)
// 默认子路由(首页)
]
}
/!* {
/* {
path: '/404',
component: () => import('@/views/404'),
hidden: true
}*!/
]*!/
}*/
]
/!**
/**
* 有权限的路由
* 需要动态判断权限并通过 addRoutes 动态添加的页面。
*!/
*/
export const asyncRoutes = [
// 404 page must be placed at the end !!!
{ path: '*', redirect: '/404', hidden: true }
]
/!*const createRouter = () => new Router({
const createRouter = () => new Router({
// mode: 'history', // require service support
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
})*!/
})
/!*const router = createRouter()
const router = createRouter()
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
const newRouter = createRouter()
router.matcher = newRouter.matcher // reset router
}*!/*/
}
export default new Router({
/* mode:'histroy',*/
routes: [
// {
// path: '/',
// name: 'frameworkIndex',
// component: frameworkIndex
// },
{
path: '/',
component: Framework,
children: [
// 重定向到默认子路由 (首页)
{
path: '',
redirect: 'index' // 访问 '/' 时重定向到 '/index'
},
// 默认子路由(首页)
{
path: 'index',
name: 'Index',
component: Index
},
// 业务服务
{
path: 'businessServices',
name: 'BusinessServices',
component: () => import('@/components/BusinessServices') // 懒加载 BusinessServices 组件
},
// 产教融合
{
path: 'edutainment',
name: 'Edutainment',
component: () => import('@/components/Edutainment') // 懒加载 Edutainment 组件
},
// 加入我们
{
path: 'joinUs',
name: 'JoinUs',
component: () => import('@/components/JoinUs') // 懒加载 JoinUs 组件
},
// 关于我们
{
path: "About",
name: "About",
component: () => import('@/components/About') // 懒加载 About 组件
}
]
}
],
scrollBehavior(to, from, savedPosition) {
// 如果是返回上次保存的滚动位置,直接返回
if (savedPosition) {
return savedPosition;
} else {
// 否则始终滚动到页面顶部
return { x: 0, y: 0 };
}
}
})
export default router
......@@ -6,7 +6,6 @@
@import "./utils.scss";
@import './btn.scss';
body {
height: 100%;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment