We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently using
"vue": "^3.2.37", "vue-meteor-tracker": "^3.0.0-beta.7",
Here is a working example that I adapted from the Akyryum/meteor-vite project.
https://github.com/mlanning/example-vue-meteor-tracker
<template> <div class="flex flex-col gap-4"> <h1 class="text-2xl">Learn Meteor!</h1> <ul> <li v-for="link of links" :key="link._id" > <a :href="link.url" target="_blank" class="underline"> {{ link.title }} </a> </li> </ul> <pre class="bg-gray-100 rounded p-4">{{ { $subReady } }}</pre> <p v-if="$subReady.links">$subReady.links is true</p> <p v-if="!$subReady.links">$subReady.links is false</p> </div> </template>
When subscribing to links in a meteor object, $subReady.links returns true in the template.
links
$subReady.links
true
<script lang="ts"> import { defineComponent } from 'vue' import { LinksCollection } from '/imports/api/links' export default defineComponent({ meteor: { $subscribe: { links: [], }, links () { return LinksCollection.find({}).fetch() }, }, // mounted() { // this.$subscribe('links') // } }) </script>
However, when I try to subscribe from the mounted() lifecycle hook, $subReady.links returns false in the template.
mounted()
false
<script lang="ts"> import { defineComponent } from 'vue' import { LinksCollection } from '/imports/api/links' export default defineComponent({ meteor: { // $subscribe: { // links: [], // }, links () { return LinksCollection.find({}).fetch() }, }, mounted() { this.$subscribe('links') } }) </script>
Also, Meteor dev tools shows the subscription as ready.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently using
Here is a working example that I adapted from the Akyryum/meteor-vite project.
https://github.com/mlanning/example-vue-meteor-tracker
When subscribing to
links
in a meteor object,$subReady.links
returnstrue
in the template.However, when I try to subscribe from the
mounted()
lifecycle hook,$subReady.links
returnsfalse
in the template.Also, Meteor dev tools shows the subscription as ready.
The text was updated successfully, but these errors were encountered: