Skip to content

Commit

Permalink
NuxtDEMO
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkive committed Oct 30, 2018
1 parent 37509d4 commit e16a0df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ module.exports = {
// src: '//jkchao.disqus.com/count.js',
// id: 'dsq-count-scr'
// }
{src: 'https://hm.baidu.com/hm.js?****'}

],
// 不对<script>标签中内容做转义处理
__dangerouslyDisableSanitizers: ['script']
Expand Down
4 changes: 4 additions & 0 deletions pages/post/_id/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ export default {
validate ({ params }) {
return /^\d+$/.test(params.id)
},
async fetch ({app}) {
console.log('~~~~~~~post _id~~~~fetch~~~~~~~~~~~~~~~~')
},
asyncData ({ params }, callback) {
console.log('~~~~~~~post _id~~~~~asyncData~~~')
let post = posts.find(post => post.id === parseInt(params.id))
if (post) {
callback(null, { post })
Expand Down

0 comments on commit e16a0df

Please sign in to comment.