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
Describe the bug When trying the vue3 example in the Readme:
import { onMounted } from 'vue'; export default defineComponent({ channels: { ChatChannel: { connected() { console.log('connected'); }, rejected() { console.log('rejected'); }, received(data) {}, disconnected() {}, }, }, setup() { onMounted(() => { this.$cable.subscribe({ channel: "ChatChannel", }); }); }, });
I get ReferenceError: defineComponent is not defined, so if I change the first line to: import { onMounted, defineComponent } from 'vue';
ReferenceError: defineComponent is not defined
import { onMounted, defineComponent } from 'vue';
I then get Cannot read properties of undefined (reading '$cable') .
Cannot read properties of undefined (reading '$cable')
I was able to get it to work using this:
<script> import { defineComponent } from 'vue'; export default defineComponent({ channels: { ChatChannel: { connected() { console.log('connected'); }, rejected() { console.log('rejected'); }, received(data) { console.log(data); }, disconnected() { console.log('disconnected'); }, }, }, setup() {}, mounted() { this.$cable.subscribe({ channel: "ChatChannel", }); }, }); </script>
Am I missing something or should the Readme be updated?
Plugin version (please complete the following information):
versions: { "actioncable-vue": "^3.0.4", "vue": "^3.4.29" }
The text was updated successfully, but these errors were encountered:
@acovrig Thanks for flagging. This is a README issue, and I'll update it shortly.
Sorry, something went wrong.
Same here!
mclintprojects
No branches or pull requests
Describe the bug
When trying the vue3 example in the Readme:
I get
ReferenceError: defineComponent is not defined
, so if I change the first line to:import { onMounted, defineComponent } from 'vue';
I then get
Cannot read properties of undefined (reading '$cable')
.I was able to get it to work using this:
Am I missing something or should the Readme be updated?
Plugin version (please complete the following information):
The text was updated successfully, but these errors were encountered: