probil / vue-socket.io-extended

:v::zap: Socket.io bindings for Vue.js and Vuex (inspired by Vue-Socket.io)
MIT License
629 stars 38 forks source link

How can I update ref outside of setup? #524

Closed fl0w3rs closed 3 years ago

fl0w3rs commented 3 years ago

Question in the title. Example:

import { ref } from 'vue';
export default {

  setup() {
    const test = ref('');

    return {
      test,
    };
  },

  sockets: {
    testResponse(data) {
      // how can I update test ref from this place?
    },
  },
};
fl0w3rs commented 3 years ago

Realized that you can initialize ref outside of setup -.-

fl0w3rs commented 3 years ago

Don't fucking do like that.