chore: update

This commit is contained in:
xiaoxian521
2022-08-11 20:32:55 +08:00
parent 5f1466b574
commit 243c8f71a7
19 changed files with 200 additions and 2766 deletions

View File

@@ -4,8 +4,7 @@ import {
ref,
unref,
onBeforeMount,
onBeforeUnmount,
getCurrentInstance
onBeforeUnmount
} from "vue";
import { reboundProps } from "./props";
@@ -13,6 +12,7 @@ export default defineComponent({
name: "ReboundCountTo",
props: reboundProps,
setup(props) {
const ulRef = ref();
const timer = ref(null);
onBeforeMount(() => {
@@ -23,8 +23,7 @@ export default defineComponent({
// Safari浏览器的兼容代码
isSafari &&
(timer.value = setTimeout(() => {
// @ts-ignore
getCurrentInstance().refs["ul"].setAttribute(
ulRef.value.setAttribute(
"style",
`
animation: none;
@@ -44,7 +43,7 @@ export default defineComponent({
class="scroll-num"
style={{ "--i": props.i, "--delay": props.delay }}
>
<ul ref="ul" style={{ fontSize: "32px" }}>
<ul ref="ulRef" style={{ fontSize: "32px" }}>
<li>0</li>
<li>1</li>
<li>2</li>

View File

@@ -106,7 +106,7 @@ let defaultOption = computed(() => {
});
let options = computed(() => {
// @ts-ignore
// @ts-expect-error
return copyObj({}, unref(defaultOption), classOption);
});
@@ -167,8 +167,7 @@ let autoPlay = computed(() => {
let scrollSwitch = computed(() => {
// 从 props 解构出来的 属性 不再具有相应性.
// @ts-expect-error
return props.data.length >= unref(options).limitMoveNum;
return (props.data as any).length >= unref(options).limitMoveNum;
});
let hoverStopSwitch = computed(() => {

View File

@@ -15,8 +15,7 @@ notices.value.forEach(notice => {
});
function tabClick() {
// @ts-expect-error
dropdownDom.value.handleOpen();
(dropdownDom as any).v.handleOpen();
}
</script>

View File

@@ -289,8 +289,7 @@ function dynamicRouteTag(value: string, parentPath: string): void {
});
}
}
// @ts-expect-error
concatPath(router.options.routes, value, parentPath);
concatPath(router.options.routes as any, value, parentPath);
}
// 重新加载
@@ -327,11 +326,10 @@ function deleteDynamicTag(obj: any, current: any, tag?: string) {
if (other) {
useMultiTagsStoreHook().handleTags("equal", [routerArrays[0], obj]);
} else {
// @ts-ignore
delAliveRouteList = useMultiTagsStoreHook().handleTags("splice", "", {
startIndex,
length
});
}) as any;
}
};
@@ -430,8 +428,7 @@ function onClickDrop(key, item, selectRoute?: RouteConfigs) {
});
}
function handleCommand(command: object) {
// @ts-expect-error
function handleCommand(command: any) {
const { key, item } = command;
onClickDrop(key, item);
}
@@ -610,11 +607,9 @@ onBeforeMount(() => {
showMenuModel(route.fullPath);
// 触发隐藏标签页
emitter.on("tagViewsChange", key => {
// @ts-expect-error
if (unref(showTags) === key) return;
// @ts-expect-error
showTags.value = key;
emitter.on("tagViewsChange", (key: any) => {
if (unref(showTags as any) === key) return;
(showTags as any).value = key;
});
// 改变标签风格

View File

@@ -136,7 +136,6 @@ export function useElementPlus(app: App) {
});
// 注册指令
plugins.forEach(plugin => {
// @ts-ignore
app.use(plugin);
});
}

View File

@@ -81,8 +81,7 @@ export const remainingPaths = Object.keys(remainingRouter).map(v => {
// 创建路由实例
export const router: Router = createRouter({
history: getHistoryMode(),
// @ts-expect-error
routes: constantRoutes.concat(...remainingRouter),
routes: constantRoutes.concat(...(remainingRouter as any)),
strict: true,
scrollBehavior(to, from, savedPosition) {
return new Promise(resolve => {

View File

@@ -237,8 +237,7 @@ function addAsyncRoutes(arrRoutes: Array<RouteRecordRaw>) {
} else {
// 对后端传component组件路径和不传做兼容如果后端传component组件路径那么path可以随便写如果不传component组件路径会根path保持一致
const index = v?.component
? // @ts-expect-error
modulesRoutesKeys.findIndex(ev => ev.includes(v.component))
? modulesRoutesKeys.findIndex(ev => ev.includes(v.component as any))
: modulesRoutesKeys.findIndex(ev => ev.includes(v.path));
v.component = modulesRoutes[modulesRoutesKeys[index]];
}

View File

@@ -98,8 +98,7 @@ Print.prototype = {
const child = selects[k3].children;
for (const i in child) {
if (child[i].tagName == "OPTION") {
// @ts-ignore
if (child[i].selected == true) {
if ((child[i] as any).selected == true) {
child[i].setAttribute("selected", "selected");
} else {
child[i].removeAttribute("selected");

View File

@@ -46,8 +46,7 @@ function dig(path = "0", level = 3) {
};
if (level > 0) {
// @ts-expect-error
treeNode.children = dig(value, level - 1);
(treeNode as any).children = dig(value, level - 1);
}
list.push(treeNode);
@@ -111,8 +110,7 @@ const onLoadData = treeNode => {
return new Promise(resolve => {
const { id } = treeNode.dataRef;
setTimeout(() => {
// @ts-expect-error
treeData3.value = treeData3.value.concat([
treeData3.value = (treeData3 as any).value.concat([
genTreeNode(id, false),
genTreeNode(id, true)
]);

View File

@@ -31,8 +31,7 @@ let menusData = computed(() => {
let expandedKeys = extractPathList(menusData.value);
const onQueryChanged = (query: string) => {
// @ts-expect-error
treeRef.value!.filter(query);
(treeRef as any).value!.filter(query);
};
const filterMethod = (query: string, node: treeNode) => {

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, nextTick, getCurrentInstance } from "vue";
import { ref, nextTick } from "vue";
import Cropper from "/@/components/ReCropper";
import img from "./picture.jpeg";
@@ -7,20 +7,17 @@ defineOptions({
name: "Cropping"
});
let refCropper = ref();
let info = ref<object>(null);
let cropperImg = ref<string>("");
const instance = getCurrentInstance();
const onCropper = (): void => {
nextTick(() => {
// @ts-expect-error
instance.refs.refCropper.cropper.getCroppedCanvas().toBlob(blob => {
refCropper.value.cropper.getCroppedCanvas().toBlob(blob => {
let fileReader: FileReader = new FileReader();
fileReader.onloadend = (e: ProgressEvent) => {
// @ts-ignore
cropperImg.value = e.target.result;
// @ts-expect-error
info.value = instance.refs.refCropper.cropper.getData();
cropperImg.value = (e.target as any).result;
info.value = refCropper.value.cropper.getData();
};
fileReader.readAsDataURL(blob);
}, "image/jpeg");

View File

@@ -1,4 +1,5 @@
<script setup lang="ts">
import Sortable from "sortablejs";
import { ref, onMounted } from "vue";
import draggable from "vuedraggable/src/vuedraggable";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
@@ -39,7 +40,6 @@ const change = (evt): void => {
onMounted(() => {
// 使用原生sortable实现元素位置切换
// @ts-ignore
new Sortable(document.querySelector(".cut-container"), {
swap: true,
forceFallback: true,

View File

@@ -44,8 +44,7 @@ let classOption = reactive({
});
function changeDirection(val) {
// @ts-ignore
unref(scroll).reset();
(unref(scroll) as any).reset();
unref(classOption).direction = val;
}
</script>

View File

@@ -45,8 +45,7 @@ function nodeClick(value) {
}
function toggleRowExpansionAll(status) {
// @ts-expect-error
let nodes = proxy.$refs["treeRef"].store._getAllNodes();
let nodes = (proxy.$refs["treeRef"] as any).store._getAllNodes();
for (var i = 0; i < nodes.length; i++) {
nodes[i].expanded = status;
}

View File

@@ -38,8 +38,9 @@ function onCloseTags() {
getNodeByUniqueId(treeData.value, uniqueId).path;
useMultiTagsStoreHook().handleTags("splice", currentPath);
if (currentPath === "/tabs/index")
// @ts-expect-error
router.push({ path: multiTags.value[multiTags.value.length - 1].path });
router.push({
path: multiTags.value[(multiTags as any).value.length - 1].path
});
});
}
</script>