Closed maximseshuk closed 6 years ago
Hi @maximseshuk, I'm sorry to hear that you're having some problems. Can you please give me a bit more info on what is going wrong? Is there an error? Can you post a link to where the problem is happening?
@jperasmus /cc @maximseshuk I'm also experiencing the same issue, when I add <script src="//unpkg.com/vue/dist/vue.min.js"></script>
to my index.html the copy-code-plugin stops working.
The .docsify-copy-code-button
is rendered but has opacity: 0; and does not respond to hover/click events.
I'm using
I believe this issue is a result of loading two versions of Vue into the browser: one loaded by docsify (accessible as window.__EXECUTE_RESULT__
), and the other loaded from the <script>
tag added to the page.
What appears to be happening is that the second instance of Vue causes the content to render a second time. This produces all kinds of side effects, but the two that impact this plugin are as follows:
v-pre
attribute to be removed from <pre>
tags. This attribute is used as a CSS hook for displaying the button on hover, so after the second render buttons don't appear on hover.I've updated the plugin to work around these issues and will make it available via a PR shortly. That said, if loading Vue via a <script>
tag within a docsify site is something folks want to do, then this is an issue that needs to be resolved by docsify. Until then, don't be surprised if you run into similarly odd behavior from other plugins (and possibly docsify itself) after loading Vue via a <script>
tag in your docsify site.
Hi, when I plug in the vue.js, your plugin stops working, what to do?