props.tableData,
() => {
- setTimeout(() => {
- nextTick(() => {
- calcTabs();
- dealData();
- });
- }, 1000);
+ nextTick(() => {
+ calcTabs();
+ dealData();
+ });
},
{
deep: true,
@@ -90,13 +88,13 @@ const calcTabs = () => {
state.lastChildren = [];
tabSlots.forEach((e) => {
//注释和v-if忽略
- if (e.type.toString() == "Symbol(Comment)") {
+ if (Object.prototype.toString.call(e.children) == "[object String]") {
//v-for 再次遍历
- } else if (e.type.toString() == "Symbol(Fragment)") {
+ } else if (Object.prototype.toString.call(e.children) == "[object Array]") {
let children = e.children || [];
children.forEach((el) => {
//注释和v-if忽略
- if (el.type.toString() == "Symbol(Comment)") {
+ if (Object.prototype.toString.call(e.children) == "[object String]") {
console.log(el.type);
} else {
tempSlots.push(el);
@@ -120,30 +118,6 @@ const calcTabs = () => {
}
};
-const showMoreBtns = () => {
- calcTabs();
- dealData();
- nextTick(() => {
- updateSytle();
- if (state.timer) clearTimeout(state.timer);
- state.showMore = true;
- });
-};
-const hideMoreBtns = () => {
- if (state.timer) clearTimeout(state.timer);
- state.timer = setTimeout(() => {
- state.showMore = false;
- }, 50);
-};
-const updateSytle = () => {
- let { top, right } = lastEl.value.getBoundingClientRect();
- let { width } = window.document.body.getBoundingClientRect();
- state.style = {
- top: `${top + 16}px`,
- right: `${width - right - 16}px`,
- };
-};
-
const dealData = () => {
let children = bgTableBtnsRef.value.children || [];
state.children = children;
@@ -168,7 +142,8 @@ const dealData = () => {
};
const bgTablePopover = {
- width: "88px",
+ width: "auto",
+ maxWidth: "96px",
padding: "4px 0",
minWidth: "60px",
};
diff --git a/vite.config.js b/vite.config.js
index e8b9c3876bf2e0fca502eccb10681de57557e561..f3854ec0b3ff8e07de34b7504e3e655a1eb83c90 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -14,6 +14,9 @@ export default defineConfig({
"@": resolve_path("src"),
},
},
+ build: {
+ sourcemap: true,
+ },
server: {
port: 3001,
proxy: {