Dynamic content in Vue components
See original GitHub issueBug Report
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.
<div id="server">
<ul>
<li v-for="server in servers" :key="server.description"> {{ server.descriptionStyled }} </li>
</ul>
</div>
<script>
const API_URL = "https://tomaten.sauertracker.net/api/servers"
new Vue({
el: '#server',
data: () => ({
servers: []
}),
async mounted {}
console.log("HEY")
const response = await fetch(API_URL);
this.servers = await response.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)
-
Docsify version: 4.11.2
-
Docsify plugins: search plugin
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
How to make your components dynamic in Vue.js
Vue dynamic components enable users to switch between two or more components without routing, and even retain the state of data when switching ......
Read more >Dynamic & Async Components - Vue.js
Dynamic & Async Components. This page assumes you've already read the Components Basics. Read that first if you are new to components.
Read more >An Overview of Vue Dynamic Components - LearnVue
Vue Dynamic Components can be an extremely convenient way to make your code both more readable and adaptable. They can simplify several ...
Read more >Dynamic Components with Vue's 'component' - Telerik
Vue gives us a special component and a directive to approach this type of problem, the <component> component. This special component behaves ...
Read more >vue.js - VueJS dynamic content - Stack Overflow
My problem is when that List/Form component has actions(view, edit...) to be triggered, how can I trigger them "inside" the component and render ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 usingthis
(this
directs to thewindow
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.@Fohlen –
Fixed in #1271. The example code you provided has a few issues though. Here’s update code that will work as is: