附main.js代码
import { createSSRApp } from "vue";
import App from "./App";
import store from "./store";
export function createApp() {
const app = createSSRApp(App);
app.use(store);
app.config.globalProperties.$store = store;
app.config.globalProperties.showToast = function (
text,
time = 2000,
image
) {
uni.showToast({
title: text,
icon: "none",
duration: time,
image,
});
};
app.config.globalProperties.vibrateShort = function () {
return uni.vibrateShort({});
};
return {
app,
};
}