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

fix(ssr): Compatible with vite@3

上级 296f2d63
......@@ -15,6 +15,7 @@
<!--app-context-->
</head>
<body>
<div id="ssr-log"></div>
<div id="app"><!--app-html--></div>
<script type="module" src="/src/main.js"></script>
</body>
......
<template>
<view id="ssr-log"></view>
<page-meta>
<head>
<meta name="keywords" content="uni-app ssr" />
......
......@@ -3434,6 +3434,22 @@ const Input = /* @__PURE__ */ defineBuiltInComponent({
input.addEventListener("blur", resetCache);
return false;
}
if (cache.value) {
if (cache.value.indexOf(".") !== -1) {
if (event.data !== "." && event.inputType === "deleteContentBackward") {
const dotIndex = cache.value.indexOf(".");
cache.value = input.value = state2.value = cache.value.slice(0, dotIndex);
return true;
}
} else if (event.data === ".") {
cache.value += ".";
resetCache = () => {
cache.value = input.value = cache.value.slice(0, -1);
};
input.addEventListener("blur", resetCache);
return false;
}
}
cache.value = state2.value = input.value = cache.value === "-" ? "" : cache.value;
return false;
} else {
......@@ -7540,7 +7556,9 @@ function initHistory() {
const index$f = {
install(app) {
initApp$1(app);
app.config.warnHandler = warnHandler;
if (!app.config.warnHandler) {
app.config.warnHandler = warnHandler;
}
if (__UNI_FEATURE_PAGES__) {
initRouter(app);
}
......
......@@ -9551,6 +9551,22 @@ const Input = /* @__PURE__ */ defineBuiltInComponent({
input.addEventListener("blur", resetCache);
return false;
}
if (cache.value) {
if (cache.value.indexOf(".") !== -1) {
if (event.data !== "." && event.inputType === "deleteContentBackward") {
const dotIndex = cache.value.indexOf(".");
cache.value = input.value = state3.value = cache.value.slice(0, dotIndex);
return true;
}
} else if (event.data === ".") {
cache.value += ".";
resetCache = () => {
cache.value = input.value = cache.value.slice(0, -1);
};
input.addEventListener("blur", resetCache);
return false;
}
}
cache.value = state3.value = input.value = cache.value === "-" ? "" : cache.value;
return false;
} else {
......@@ -15316,7 +15332,9 @@ const index$g = {
initApp$1(app);
initViewPlugin(app);
initServicePlugin(app);
app.config.warnHandler = warnHandler;
if (!app.config.warnHandler) {
app.config.warnHandler = warnHandler;
}
if (__UNI_FEATURE_PAGES__) {
initRouter(app);
}
......
......@@ -11,7 +11,9 @@ export default {
initViewPlugin(app)
initServicePlugin(app)
app.config.warnHandler = warnHandler
if (!app.config.warnHandler) {
app.config.warnHandler = warnHandler
}
if (__UNI_FEATURE_PAGES__) {
initRouter(app)
......
......@@ -1346,7 +1346,6 @@ function showToast({ icon = 'success' } = {}) {
const args = {
title: 'content',
icon: 'type',
duration: false,
image: false,
mask: false,
};
......
......@@ -56,6 +56,8 @@ export async function createSSRServer(
*/
const vite = await createViteServer(
addConfigFile({
// custom: don't include HTML middlewares
appType: 'custom',
root: process.env.VITE_ROOT_DIR,
base: options.base,
mode: options.mode,
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册