提交 d0116346 编写于 作者: fxy060608's avatar fxy060608

wip(app): nvue store

上级 55ac1075
......@@ -57,7 +57,7 @@ function buildNVuePage(filename: string, options: BuildOptions) {
return transformWithEsbuild(
`import App from './${filename}'
import { AppStyles } from './app.css.js'
const app = Vue.createApp(App)
const app = Vue.createApp(App,{$store:getApp().$store})
App.mpType = 'page'
app.provide('__globalStyles', Vue.useCssStyles([...AppStyles, ...App.styles]))
app.mount('#root')`,
......
......@@ -2,8 +2,10 @@ export const external = ['vue', 'vuex']
export const globals = {
vue: 'Vue',
vuex: 'Vuex',
pinia: 'Pinia',
}
export const esbuildGlobals = {
vue: 'Vue',
vuex: 'Vue.Vuex',
vuex: 'uni.Vuex',
pinia: 'uni.Pinia',
}
......@@ -24,7 +24,7 @@ function createApp(code: string) {
return `${code.replace(
'createSSRApp',
'createVueApp as createSSRApp'
)};const __app__=createApp().app;__app__._component.mpType='app';__app__._component.render=()=>{};__app__.use(uni.__vuePlugin).mount("#app");`
)};const {app:__app__,Vuex:__Vuex__,Pinia:__Pinia__}=createApp();uni.Vuex=__Vuex__;uni.Pinia=__Pinia__;__app__._component.mpType='app';__app__._component.render=()=>{};__app__.use(uni.__vuePlugin).mount("#app");`
}
function createLegacyApp(code: string) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册