[Vuejs]-How to reference a setup() variable in an imported function?

3👍

You could pass the msg as a param to your change method like this

lib.js

export const change = (msg) => msg.value = 'two'

and use it like that in your file
App.vue

const msg = ref('one')
change(msg)
👤kissu

Leave a comment