JavaScript/vue.js/getCurrentInstance:修订间差异
来自康健生活
| 第35行: | 第35行: | ||
</script> | </script> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
以及 | |||
{{hc|head=./src/main.js|output=<syntaxhighlight lang="javascript"> | |||
import { createApp } from 'vue' | |||
import { store } from './store' | |||
const app = createApp(App) | |||
app.provide('appMounted', app ) | |||
</syntaxhighlight>}} | |||
另外一个思路 | 另外一个思路 | ||
| 第113行: | 第123行: | ||
store.commit('appMounted', app ) | store.commit('appMounted', app ) | ||
// useage: store.state.appMounted | // useage: store.state.appMounted | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||