You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the documentation it says that one can embed Vue instances. I tried building an interactive component for our documentation like so:
# Servers
Thanks to [AngrySnout](https://github.com/AngrySnout/SauerTracker) we have excellent statistics for the game.
<divid="server">
<ul> <li v-for="server in servers" :key="server.description"> {{ server.descriptionStyled }} </li></ul>
</div>
<script>
constAPI_URL="https://tomaten.sauertracker.net/api/servers"newVue({
el:'#server',
data: () => ({
servers: []
}),
async mounted {}
console.log("HEY")
constresponse=awaitfetch(API_URL);
this.servers=awaitresponse.json();
}
})
</script>
However when loading the page the content quickly flashes before getting "rendered away".
I have no idea what sorcery is going on behind the scenes but my best bet is that it's an unsupported feature.
Steps to reproduce
(see above)
What is current behaviour
(see above)
What is the expected behaviour
The app that is rendered on screen should allow for dynamic content.
Other relevant information
Bug does still occur when all/other plugins are disabled?
Your OS: OSX 10.15.3 (19D76)
Browser version: Version 80.0.3987.132 (Official Build) (64-bit)
Actually ,It seems some issues about the Vue supports in docsify.
Currently, when u create ur own Vue instance, you will not get the Vue instance in the mounted hook by using this (this directs to the window obj in docsify now).
the Vue instance was covered in this.__EXECUTE_RESULT__.
there is showing how we execute script in docsify.
Although, I tried to set the root data in a hack way, it seems not work.
I haven't found a way to resolve it yet, I hope those informations could be helpful.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Regarding the original issue, I think I encountered them. I believe it has to do with double execution of scripts, and I refactored this code in my personal fork. I will make a PR soon...
Activity
anikethsaha commentedon Mar 14, 2020
Sorry I am not familiar with vue so cant really help you here !
Feel Free to investigate and submit the fix.
Also, try testing with older version and check in which it broke, it will help in investigation
Koooooo-7 commentedon Mar 15, 2020
Actually ,It seems some issues about the Vue supports in docsify.
Currently, when u create ur own Vue instance, you will not get the Vue instance in the
mountedhook by usingthis(thisdirects to thewindowobj in docsify now).the Vue instance was covered in
this.__EXECUTE_RESULT__.there is showing how we execute script in docsify.
Although, I tried to set the
root datain a hack way, it seems not work.I haven't found a way to resolve it yet, I hope those informations could be helpful.
stale commentedon May 14, 2020
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
trusktr commentedon Jun 21, 2020
stale bot may make it harder to triage issues if they get closed before we see them. Wdyt?
Now that I've realized this, I need to go check all the closed issues.
trusktr commentedon Jun 21, 2020
Regarding the original issue, I think I encountered them. I believe it has to do with double execution of scripts, and I refactored this code in my personal fork. I will make a PR soon...
jhildenbiddle commentedon Jul 5, 2020
@Fohlen --
This bug is currently being addressed in #1271. The changes in that PR allow your example to work as expected, albeit with a few minor changes:
woshiguabi commentedon Aug 14, 2020
my solution:
set
executeScripttofalseand use a plugin to initial Vue instancejhildenbiddle commentedon Oct 8, 2020
@Fohlen --
Fixed in #1271. The example code you provided has a few issues though. Here's update code that will work as is: