Open Mi-liu opened 1 year ago
+1
import { createSSRApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
export function createApp() {
const app = createSSRApp(App)
app.use(createPinia())
return {
app
}
}
import type { Pinia } from 'pinia'
import type { Plugin } from 'vue'
const pinia = createPinia()
//main.ts
//createApp(){
// 断言以消除类型警告(去除断言即可复现)
app.use(<Pinia & Plugin>pinia)
HBuilderX4.01-α内置pinia仍然有此爆红
4.02.2024030621-alpha已修复,相关issue
问题描述 HBX创建的项目 使用piniats报错
复现步骤 [复现问题的步骤]
import App from './App' import * as Pinia from 'pinia';
import { createSSRApp } from 'vue' export function createApp() { const app = createSSRApp(App) app.use(Pinia.createPinia()); return { app, Pinia } }
预期结果 无任何问题
实际结果 ts提示错误
系统信息:
补充信息 [可选] [根据你的分析,出现这个问题的原因可能在哪里?]