Skip to content

Commit

Permalink
chore(es6): esm模块环境适配
Browse files Browse the repository at this point in the history
  • Loading branch information
X3ZvaWQ committed Jul 2, 2024
1 parent 82206c9 commit 610fcf2
Show file tree
Hide file tree
Showing 23 changed files with 47 additions and 23 deletions.
5 changes: 4 additions & 1 deletion assets/js/a.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// 链接标签
import url from 'url'
import { resolveImagePath } from "@jx3box/jx3box-common/js/utils";

import * as utilModule from "@jx3box/jx3box-common/js/utils";
const { resolveImagePath } = utilModule;

function formatLink(str){
if(!str) return

Expand Down
3 changes: 2 additions & 1 deletion assets/js/combo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import $ from "jquery";
import { iconLink } from "@jx3box/jx3box-common/js/utils";
import * as utilModule from "@jx3box/jx3box-common/js/utils";
const { iconLink } = utilModule;

function renderCombo(selector = ".e-skill-combo .w-skill-combo-item") {
try {
Expand Down
3 changes: 2 additions & 1 deletion assets/js/img.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// 图片地址&懒加载
import { resolveImagePath } from "@jx3box/jx3box-common/js/utils";
import * as utilModule from "@jx3box/jx3box-common/js/utils";
const { resolveImagePath } = utilModule;
import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
function lazyLoad(str) {
if (!str) return;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jx3box/jx3box-vue3-ui",
"version": "0.8.6",
"version": "0.8.7",
"description": "JX3BOX Vue3 UI",
"main": "index.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/author/AuthorInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@

<script>
import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
import { authorLink } from "@jx3box/jx3box-common/js/utils";
import * as utilModule from "@jx3box/jx3box-common/js/utils";
const { authorLink } = utilModule;
import User from "@jx3box/jx3box-common/js/user";
import { getUserInfo } from "../../service/author";
import Avatar from "./Avatar.vue";
Expand Down
3 changes: 2 additions & 1 deletion src/author/AuthorLink.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
</template>

<script>
import { tvLink } from "@jx3box/jx3box-common/js/utils";
import * as utilModule from "@jx3box/jx3box-common/js/utils";
const { tvLink } = utilModule;
export default {
name: "AuthorLink",
props: ["data"],
Expand Down
3 changes: 2 additions & 1 deletion src/author/AuthorMedals.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
</template>

<script>
import { getMedalLink } from "@jx3box/jx3box-common/js/utils";
import * as utilModule from "@jx3box/jx3box-common/js/utils";
const { getMedalLink } = utilModule;
import { getUserMedals } from "../../service/author";
import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
const { __imgPath, __Root } = JX3BOX;
Expand Down
3 changes: 2 additions & 1 deletion src/author/UserPop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
</template>

<script>
import { showAvatar } from "@jx3box/jx3box-common/js/utils";
import * as utilModule from "@jx3box/jx3box-common/js/utils";
const { showAvatar } = utilModule;
import { getUserInfoByUidOrName } from "../../service/author";
export default {
name: "UserPop",
Expand Down
3 changes: 2 additions & 1 deletion src/bread/Admin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@

<script>
import Bus from "../../utils/bus";
import { getRewrite } from "@jx3box/jx3box-common/js/utils";
import * as utilModule from "@jx3box/jx3box-common/js/utils";
const { getRewrite } = utilModule;
import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
import { getSetting, postSetting } from "../../service/admin";
import User from "@jx3box/jx3box-common/js/user";
Expand Down
3 changes: 2 additions & 1 deletion src/comment/CommentContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@

<script>
import Uploader from "./Upload.vue";
import { resolveImagePath } from "@jx3box/jx3box-common/js/utils";
import * as utilModule from "@jx3box/jx3box-common/js/utils";
const { resolveImagePath } = utilModule;
import { formatContent } from "../../utils/emotion";
import Emotion from "@jx3box/jx3box-emotion/src/Emotion2.vue";
Expand Down
3 changes: 2 additions & 1 deletion src/editor/UploadBanner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
</template>

<script>
import { getThumbnail } from "@jx3box/jx3box-common/js/utils";
import * as utilModule from "@jx3box/jx3box-common/js/utils";
const { getThumbnail } = utilModule;
import { upload } from "../../service/cms.js";
export default {
name: "upload-banner",
Expand Down
3 changes: 2 additions & 1 deletion src/editor/components/Buff.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

<script>
import { getBuff } from "../../../service/database.js";
import { iconLink } from "@jx3box/jx3box-common/js/utils";
import * as utilModule from "@jx3box/jx3box-common/js/utils";
const { iconLink } = utilModule;
import detach_types from "../../../assets/data/detach_type.json";
export default {
name: "BuffComponent",
Expand Down
3 changes: 2 additions & 1 deletion src/editor/components/Combo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@

<script>
import Vue from "vue";
import { iconLink } from "@jx3box/jx3box-common/js/utils";
import * as utilModule from "@jx3box/jx3box-common/js/utils";
const { iconLink } = utilModule;
import { getSkill } from "../../service/resource";
import Sortable from "sortablejs";
import { cloneDeep } from "lodash";
Expand Down
3 changes: 2 additions & 1 deletion src/editor/components/Equip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
<script>
import EquipPosition from "../../../service/enum/EquipPosition";
import ItemSimple from "./ItemSimple.vue";
import { authorLink } from "@jx3box/jx3box-common/js/utils.js";
import * as utilModule from "@jx3box/jx3box-common/js/utils.js";
const { authorLink } = utilModule;
import QRcode from "@jx3box/jx3box-common-ui/src/interact/QRcode.vue";
import { showTime } from "@jx3box/jx3box-common/js/moment.js";
import { get_plan } from "../../../service/item.js";
Expand Down
3 changes: 2 additions & 1 deletion src/editor/components/Item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,8 @@ import GameText from "./GameText.vue";
import attribute_percent from "../../../assets/js/item/attribute_percent.js";
import bind from "../../../assets/js/item/bind.js";
import color from "../../../assets/js/item/color.js";
import { iconLink } from "@jx3box/jx3box-common/js/utils";
import * as utilModule from "@jx3box/jx3box-common/js/utils";
const { iconLink } = utilModule;
import second_format from "../../../assets/js/item/second_format.js";
import dayjs from "dayjs";
Expand Down
3 changes: 2 additions & 1 deletion src/editor/components/Npc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@

<script>
import { getNpc } from "../../../service/database.js";
import { iconLink } from "@jx3box/jx3box-common/js/utils";
import * as utilModule from "@jx3box/jx3box-common/js/utils";
const { iconLink } = utilModule;
export default {
name: "NpcComponent",
props: ["client", "id"],
Expand Down
3 changes: 2 additions & 1 deletion src/editor/components/PostAuthor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
</template>

<script>
import { authorLink } from "@jx3box/jx3box-common/js/utils";
import * as utilModule from "@jx3box/jx3box-common/js/utils";
const { authorLink } = utilModule;
import { getEmotion } from "../../../service/author";
import dayjs from "dayjs";
import Avatar from "./Avatar.vue";
Expand Down
3 changes: 2 additions & 1 deletion src/editor/components/Skill.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

<script>
import { getSkill } from "../../../service/database.js";
import { iconLink } from "@jx3box/jx3box-common/js/utils";
import * as utilModule from "@jx3box/jx3box-common/js/utils";
const { iconLink } = utilModule;
export default {
name: "SkillComponent",
props: ["client", "id", "level"],
Expand Down
3 changes: 2 additions & 1 deletion src/header/UserInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@

<script>
import User from "@jx3box/jx3box-common/js/user";
import { showAvatar } from "@jx3box/jx3box-common/js/utils";
import * as utilModule from "@jx3box/jx3box-common/js/utils";
const { showAvatar } = utilModule;
import { showDate } from "@jx3box/jx3box-common/js/moment";
import { getMyInfo } from "../../service/author";
import JX3BOX from "@jx3box/jx3box-common/data/jx3box.json";
Expand Down
3 changes: 2 additions & 1 deletion src/interact/Contributors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
</template>

<script>
import { showAvatar } from "@jx3box/jx3box-common/js/utils";
import * as utilModule from "@jx3box/jx3box-common/js/utils";
const { showAvatar } = utilModule;
export default {
name: "ContributorsComp",
props: {
Expand Down
3 changes: 2 additions & 1 deletion src/single/Collection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
</template>

<script>
import { getLink } from "@jx3box/jx3box-common/js/utils";
import * as utilModule from "@jx3box/jx3box-common/js/utils";
const { getLink } = utilModule;
import { getCollection } from "../../service/cms";
export default {
name: "SingleCollection",
Expand Down
3 changes: 2 additions & 1 deletion src/single/PostTopic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

<script>
import { getSliders } from "../../service/cms";
import { getThumbnail } from "@jx3box/jx3box-common/js/utils";
import * as utilModule from "@jx3box/jx3box-common/js/utils";
const { getThumbnail } = utilModule;
import dayjs from "dayjs";
export default {
name: "PostTopic",
Expand Down
3 changes: 2 additions & 1 deletion src/single/cms-single.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ import Article from "../editor/Article.vue";
// import ArticleMarkdown from "@jx3box/jx3box-editor/src/ArticleMarkdown.vue";
import Comment from "./Comment.vue";
const { __visibleMap } = require("@jx3box/jx3box-common/data/jx3box.json");
import { getAppType } from "@jx3box/jx3box-common/js/utils";
import * as utilModule from "@jx3box/jx3box-common/js/utils";
const { getAppType } = utilModule;
export default {
name: "cms-single",
components: {
Expand Down

0 comments on commit 610fcf2

Please sign in to comment.