Skip to content

Commit

Permalink
文件迁移
Browse files Browse the repository at this point in the history
  • Loading branch information
czf2015 committed Jun 28, 2019
1 parent e25c48d commit be01a2b
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 3 deletions.
55 changes: 53 additions & 2 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ export default {
{ hid: 'description', name: 'description', content: process.env.npm_package_description || '' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
]
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'stylesheet', href: 'https://netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' }
],
script: [
{ src: 'http://echarts.baidu.com/dist/echarts.js' }
],
},
/*
** Customize the progress-bar color
Expand Down Expand Up @@ -56,6 +60,53 @@ export default {
}
}
},
// 默认当前路径
rootDir: process.cwd(),
//
router: {
base: '',
mode: 'history',
linkActiveClass: 'nuxt-link-active',
scrollBehavior: (to, from, savedPosition) => {
// savedPosition 只有在 popstate 导航(如按浏览器的返回按钮)时可以获取。
if (savedPosition) {
return savedPosition
} else {
let position = {}
// 目标页面子组件少于两个
if (to.matched.length < 2) {
// 滚动至页面顶部
position = { x: 0, y: 0 }
}
else if (to.matched.some(r => r.components.default.options.scrollToTop)) {
// 如果目标页面子组件中存在配置了scrollToTop为true
position = { x: 0, y: 0 }
}
// 如果目标页面的url有锚点, 则滚动至锚点所在的位置
if (to.hash) {
position = { selector: to.hash }
}
return position
}
},
// default
// middleware: 'user-agent',
// 扩展路由
extendRoutes: () => { },
// 默认同 rootDir
// srcDir: this.rootDir,
transition: {
name: 'page',
mode: 'out-in'
},
watchers: {
chokidar: {}, // 文件监控
webpack: {
aggregateTimeout: 300,
poll: 1000
}
}
},
/*
** Build configuration
*/
Expand Down
2 changes: 1 addition & 1 deletion services/Questionnaire.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function prov(condition, answers) {
}

//
export default function prerequisite(questionId, r, answers) {
export function prerequisite(questionId, r, answers) {
const relation = r[questionId]
return prov(relation, answers)
}
Expand Down

0 comments on commit be01a2b

Please sign in to comment.