console.log(this.$store.state.mobile) //0
this.$store.watch((state) => state.mobile, (oldValue, newValue) => {
console.log('search string is changing')
console.log(oldValue)
console.log(newValue)
})
this.$store.state.mobile = 1
console.log(this.$store.state.mobile) //1
//больше никаких сообщений
import { createApp } from 'vue'
import { createStore } from 'vuex'
const app = createApp({ ... })
const store = createStore({ ... })
app.use(store)
You can then include it using a script tag, just like with the CDN approach.
vue.global.js is the "full" build
@change="clog('var')"
clog(arg){
console.log(this[arg])
}