fix?: icon and defaultStore imports

This commit is contained in:
naskya 2023-10-19 07:28:20 +09:00
parent d1bb6e02e9
commit 3e3cbb60c6
No known key found for this signature in database
GPG Key ID: 164DFF24E2D40139
6 changed files with 16 additions and 15 deletions

View File

@ -18,11 +18,14 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue";
import icon from "@/scripts/icon"; import icon from "@/scripts/icon";
defineProps<{ const props = defineProps<{
defaultOpen: boolean; defaultOpen: boolean;
}>(); }>();
const opened = ref(props.defaultOpen);
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -1,12 +1,8 @@
<template> <template>
<!--
FIXME: defaultStore and icon are undefined for some reason
<transition <transition
:name="defaultStore.state.animation ? 'fade' : ''" :name="defaultStore.state.animation ? 'fade' : ''"
mode="out-in" mode="out-in"
> >
-->
<transition name="" mode="out-in">
<div v-if="pending"> <div v-if="pending">
<MkLoading /> <MkLoading />
</div> </div>
@ -16,13 +12,11 @@
<div v-else> <div v-else>
<div class="wszdbhzo"> <div class="wszdbhzo">
<div> <div>
<!-- <i :class="icon('ph-warning')"></i> --> <i :class="icon('ph-warning')"></i>
<i class="ph-warning ph-bold ph-lg"></i>
{{ i18n.ts.somethingHappened }} {{ i18n.ts.somethingHappened }}
</div> </div>
<MkButton inline class="retry" @click="retry"> <MkButton inline class="retry" @click="retry">
<!-- <i :class="icon('ph-arrow-clockwise')"></i> --> <i :class="icon('ph-arrow-clockwise')"></i>
<i class="ph-arrow-clockwise ph-bold ph-lg"></i>
{{ i18n.ts.retry }}</MkButton {{ i18n.ts.retry }}</MkButton
> >
</div> </div>
@ -35,8 +29,8 @@ import type { PropType } from "vue";
import { defineComponent, ref, watch } from "vue"; import { defineComponent, ref, watch } from "vue";
import MkButton from "@/components/MkButton.vue"; import MkButton from "@/components/MkButton.vue";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
// import { defaultStore } from "@/store"; import { defaultStore } from "@/store";
// import icon from "@/scripts/icon"; import icon from "@/scripts/icon";
export default defineComponent({ export default defineComponent({
components: { components: {
@ -96,6 +90,8 @@ export default defineComponent({
result, result,
retry, retry,
i18n, i18n,
defaultStore,
icon,
}; };
}, },
}); });

View File

@ -75,6 +75,7 @@ export default defineComponent({
return { return {
showBody: this.expanded, showBody: this.expanded,
i18n, i18n,
icon,
}; };
}, },
methods: { methods: {

View File

@ -17,7 +17,7 @@
> >
<template #func> <template #func>
<button class="_button" @click="changeType()"> <button class="_button" @click="changeType()">
<i :class="icon('ph-pencil')"></i> <i :class="iconClass('ph-pencil')"></i>
</button> </button>
</template> </template>
@ -158,7 +158,7 @@ import * as os from "@/os";
import { isLiteralValue } from "@/scripts/hpml/expr"; import { isLiteralValue } from "@/scripts/hpml/expr";
import { funcDefs } from "@/scripts/hpml/lib"; import { funcDefs } from "@/scripts/hpml/lib";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import icon from "@/scripts/icon"; import iconClass from "@/scripts/icon";
export default defineComponent({ export default defineComponent({
components: { components: {
@ -207,6 +207,7 @@ export default defineComponent({
warn: null, warn: null,
slots: "", slots: "",
i18n, i18n,
iconClass,
}; };
}, },

View File

@ -1,5 +1,5 @@
import { defaultStore } from "@/store"; import { defaultStore } from "@/store";
export default function icon(name: string, large = true): string { export default function (name: string, large = true): string {
return `${name} ${large ? "ph-lg" : ""} ${defaultStore.state.iconSet}`; return `${name} ${large ? "ph-lg" : ""} ${defaultStore.state.iconSet}`;
} }

View File

@ -2,7 +2,7 @@ import * as mfm from "mfm-js";
import { defaultStore } from "@/store"; import { defaultStore } from "@/store";
import { expandKaTeXMacro } from "@/scripts/katex-macro"; import { expandKaTeXMacro } from "@/scripts/katex-macro";
export default function preprocess(text: string): string { export default function (text: string): string {
if (defaultStore.state.enableCustomKaTeXMacro) { if (defaultStore.state.enableCustomKaTeXMacro) {
const parsedKaTeXMacro = const parsedKaTeXMacro =
localStorage.getItem("customKaTeXMacroParsed") ?? "{}"; localStorage.getItem("customKaTeXMacroParsed") ?? "{}";