-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Valine在使用Vue构建的单页面应用下无法正常显示 #273
Comments
请尝试修改为下面的初始化方式试试: <script>
import Valine from 'valine'
export default {
name: 'Article',
data(){
return {
valine:null
}
},
mounted() {
let vm = this
vm.$nextTick(()=>{
vm.valine = new Valine({
el: '#vcomments',
appId: '*****',
appKey: '*****',
path: vm.$route.path
})
})
},
watch: {
$route (to, from) {
if (from.path != to.path) {
this.valine && this.valine.setPath(to.path)
}
}
}
}
</script> |
这样就可以显示了,谢谢 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Valine在使用Vue构建的单页面应用下无法正常显示
如果先进入主页,再点击
router-link
标签进入文章页面,无法显示,必须手动刷新但如果通过文章页面链接直接进入则可以显示
首页跳转部分:
文章页面部分:
请问是否有办法解决
The text was updated successfully, but these errors were encountered: