xiguaxigua / vuepress-plugin-demo-block

write vue, react, vanilla js demo in vuepress
https://daxigua.me/vuepress-plugin-demo-block
MIT License
113 stars 24 forks source link

页面引入vue.min.js会影响nav导航router-link-active样式的切换 #20

Open xugaoyi opened 4 years ago

xugaoyi commented 4 years ago

config.js中配置vue demo所需要的vue.min.js文件

head: [
    ['script', { src: 'https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js' }]
  ],

会影响到页面nav导航的样式class类router-link-active的切换,不知道怎么解决这个问题。

cy0131 commented 4 years ago

去除head的引入链接,在 .vuepress/enhanceApp.js 里面加载vue,然后绑定到window对象上


import vue from 'vue/dist/vue.esm.browser'
export default () => {
  window.Vue = vue
}
hoi-lau commented 4 years ago

去除head的引入链接,在 .vuepress/enhanceApp.js 里面加载vue,然后绑定到window对象上

import vue from 'vue/dist/vue.esm.browser'
export default () => {
  window.Vue = vue
}

it works!