Skip to content

Commit

Permalink
feat: Add reset embed in $disqus
Browse files Browse the repository at this point in the history
  • Loading branch information
ktquez committed Jun 8, 2020
1 parent 9e4bd45 commit bfd89f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/Disqus.vue
Expand Up @@ -67,7 +67,12 @@ export default {
methods: {
init () {
if (window.DISQUS) return this.reset()
if (this.$disqus) {
this.$disqus.reset = this.reset
}
if (window.DISQUS) {
return this.reset()
}
const setBaseConfig = this.setBaseConfig
window.disqus_config = function () {
setBaseConfig(this)
Expand Down
3 changes: 2 additions & 1 deletion src/plugin.js
Expand Up @@ -6,7 +6,8 @@ export default function install (Vue, options = {}) {
Vue.component('DisqusCount', DisqusCount)

Vue.prototype.$disqus = {
shortname: options.shortname || null
shortname: options.shortname || null,
reset: null
}
}

Expand Down

0 comments on commit bfd89f6

Please sign in to comment.