[Vuejs]-Vue & Native messaging

1👍

In your Vue component, use a computed property to return the value of the message, whereas computed properties watch for changes and update accordingly.

For example:

<template>
  <div>
    {{ message }}
  </div>
</template>

<script>
export default {
  name: 'MyComponent',
  computed: {
    message() {
      return window.message // or whatever the variable is
    }
  }
}
</script>

Leave a comment