@fecp/mobile 1.1.3 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,6 +17,7 @@ function route({
17
17
  }
18
18
  }
19
19
  function useRoute() {
20
+ debugger;
20
21
  const vm = getCurrentInstance().proxy;
21
22
  return () => route(vm);
22
23
  }
@@ -23,6 +23,7 @@ var stdin_default = defineComponent({
23
23
  setup(props, {
24
24
  slots
25
25
  }) {
26
+ debugger;
26
27
  const {
27
28
  linkChildren
28
29
  } = useChildren(GRID_KEY);
@@ -30,6 +30,7 @@ var stdin_default = defineComponent({
30
30
  index
31
31
  } = useParent(GRID_KEY);
32
32
  const route = useRoute();
33
+ debugger;
33
34
  if (!parent) {
34
35
  return;
35
36
  }
@@ -2,6 +2,7 @@ import stdin_default from "./GridItem.mjs";
2
2
  import { gridItemProps } from "./GridItem.mjs";
3
3
  import { withInstall } from "../utils/with-install.mjs";
4
4
  const GridItem = withInstall(stdin_default);
5
+ debugger;
5
6
  export {
6
7
  GridItem,
7
8
  gridItemProps
@@ -2,24 +2,53 @@
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  /* empty css */
5
- import { createBlock, openBlock, normalizeProps, guardReactiveProps, createSlots, renderList, withCtx, renderSlot } from "vue";
6
- import _export_sfc from "../../../../../../_virtual/_plugin-vue_export-helper.mjs";
5
+ import { computed, createBlock, openBlock, mergeProps, unref, createSlots, renderList, withCtx, renderSlot } from "vue";
6
+ import { routeProps, useRoute } from "../../../utils/use-route.mjs";
7
7
  import { FloatingBubble } from "../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/floating-bubble/index.mjs";
8
- const _sfc_main = {};
9
- function _sfc_render(_ctx, _cache) {
10
- const _component_van_floating_bubble = FloatingBubble;
11
- return openBlock(), createBlock(_component_van_floating_bubble, normalizeProps(guardReactiveProps(_ctx.$attrs)), createSlots({ _: 2 }, [
12
- renderList(_ctx.$slots, (item, key) => {
13
- return {
14
- name: key,
15
- fn: withCtx(() => [
16
- renderSlot(_ctx.$slots, key)
17
- ])
18
- };
19
- })
20
- ]), 1040);
21
- }
22
- const _FloatingBubble = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
8
+ const _sfc_main = {
9
+ __name: "FloatingBubble",
10
+ props: {
11
+ axis: {
12
+ //拖拽的方向,xy 代表自由拖拽,lock 代表禁止拖拽
13
+ type: String,
14
+ default: "xy"
15
+ },
16
+ magnetic: {
17
+ //自动磁吸的方向 'x' | 'y'
18
+ type: String,
19
+ default: ""
20
+ },
21
+ ...routeProps
22
+ },
23
+ setup(__props) {
24
+ const route = useRoute();
25
+ const props = __props;
26
+ const compMagnetic = computed(() => {
27
+ if (props.axis == "xy") {
28
+ return props.magnetic;
29
+ } else {
30
+ return "";
31
+ }
32
+ });
33
+ return (_ctx, _cache) => {
34
+ const _component_van_floating_bubble = FloatingBubble;
35
+ return openBlock(), createBlock(_component_van_floating_bubble, mergeProps(_ctx.$attrs, {
36
+ axis: __props.axis,
37
+ magnetic: compMagnetic.value,
38
+ onClick: unref(route)
39
+ }), createSlots({ _: 2 }, [
40
+ renderList(_ctx.$slots, (item, key) => {
41
+ return {
42
+ name: key,
43
+ fn: withCtx(() => [
44
+ renderSlot(_ctx.$slots, key)
45
+ ])
46
+ };
47
+ })
48
+ ]), 1040, ["axis", "magnetic", "onClick"]);
49
+ };
50
+ }
51
+ };
23
52
  export {
24
- _FloatingBubble as default
53
+ _sfc_main as default
25
54
  };
@@ -1,8 +1,8 @@
1
- import _FloatingBubble from "./FloatingBubble.vue.mjs";
1
+ import _sfc_main from "./FloatingBubble.vue.mjs";
2
2
  import install from "../../../utils/install.mjs";
3
3
  const MobileFloatingBubble = install.withInstall(
4
4
  "MobileFloatingBubble",
5
- _FloatingBubble
5
+ _sfc_main
6
6
  );
7
7
  export {
8
8
  MobileFloatingBubble,
@@ -0,0 +1,23 @@
1
+ import { getCurrentInstance } from "vue";
2
+ const routeProps = {
3
+ to: [String, Object],
4
+ url: String,
5
+ replace: Boolean
6
+ };
7
+ function route({ to, url, replace, $router: router }) {
8
+ debugger;
9
+ if (to && router) {
10
+ router[replace ? "replace" : "push"](to);
11
+ } else if (url) {
12
+ replace ? location.replace(url) : location.href = url;
13
+ }
14
+ }
15
+ function useRoute() {
16
+ const vm = getCurrentInstance().proxy;
17
+ return () => route(vm);
18
+ }
19
+ export {
20
+ route,
21
+ routeProps,
22
+ useRoute
23
+ };
@@ -19,6 +19,7 @@ function route({
19
19
  }
20
20
  }
21
21
  function useRoute() {
22
+ debugger;
22
23
  const vm = vue.getCurrentInstance().proxy;
23
24
  return () => route(vm);
24
25
  }
@@ -25,6 +25,7 @@ var stdin_default = vue.defineComponent({
25
25
  setup(props2, {
26
26
  slots
27
27
  }) {
28
+ debugger;
28
29
  const {
29
30
  linkChildren
30
31
  } = index_esm.useChildren(GRID_KEY);
@@ -32,6 +32,7 @@ var stdin_default = vue.defineComponent({
32
32
  index: index$2
33
33
  } = index_esm.useParent(Grid.GRID_KEY);
34
34
  const route = useRoute.useRoute();
35
+ debugger;
35
36
  if (!parent) {
36
37
  return;
37
38
  }
@@ -3,5 +3,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const GridItem$1 = require("./GridItem.js");
4
4
  const withInstall = require("../utils/with-install.js");
5
5
  const GridItem = withInstall.withInstall(GridItem$1.default);
6
+ debugger;
6
7
  exports.gridItemProps = GridItem$1.gridItemProps;
7
8
  exports.GridItem = GridItem;
@@ -5,21 +5,50 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
5
5
  ;/* empty css */
6
6
  ;/* empty css */
7
7
  const vue = require("vue");
8
- const _pluginVue_exportHelper = require("../../../../../../_virtual/_plugin-vue_export-helper.js");
8
+ const useRoute = require("../../../utils/use-route.js");
9
9
  const index = require("../../../../../../node_modules/.pnpm/vant@4.9.17_vue@3.5.13_typescript@5.7.3_/node_modules/vant/es/floating-bubble/index.js");
10
- const _sfc_main = {};
11
- function _sfc_render(_ctx, _cache) {
12
- const _component_van_floating_bubble = index.FloatingBubble;
13
- return vue.openBlock(), vue.createBlock(_component_van_floating_bubble, vue.normalizeProps(vue.guardReactiveProps(_ctx.$attrs)), vue.createSlots({ _: 2 }, [
14
- vue.renderList(_ctx.$slots, (item, key) => {
15
- return {
16
- name: key,
17
- fn: vue.withCtx(() => [
18
- vue.renderSlot(_ctx.$slots, key)
19
- ])
20
- };
21
- })
22
- ]), 1040);
23
- }
24
- const _FloatingBubble = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["render", _sfc_render]]);
25
- exports.default = _FloatingBubble;
10
+ const _sfc_main = {
11
+ __name: "FloatingBubble",
12
+ props: {
13
+ axis: {
14
+ //拖拽的方向,xy 代表自由拖拽,lock 代表禁止拖拽
15
+ type: String,
16
+ default: "xy"
17
+ },
18
+ magnetic: {
19
+ //自动磁吸的方向 'x' | 'y'
20
+ type: String,
21
+ default: ""
22
+ },
23
+ ...useRoute.routeProps
24
+ },
25
+ setup(__props) {
26
+ const route = useRoute.useRoute();
27
+ const props = __props;
28
+ const compMagnetic = vue.computed(() => {
29
+ if (props.axis == "xy") {
30
+ return props.magnetic;
31
+ } else {
32
+ return "";
33
+ }
34
+ });
35
+ return (_ctx, _cache) => {
36
+ const _component_van_floating_bubble = index.FloatingBubble;
37
+ return vue.openBlock(), vue.createBlock(_component_van_floating_bubble, vue.mergeProps(_ctx.$attrs, {
38
+ axis: __props.axis,
39
+ magnetic: compMagnetic.value,
40
+ onClick: vue.unref(route)
41
+ }), vue.createSlots({ _: 2 }, [
42
+ vue.renderList(_ctx.$slots, (item, key) => {
43
+ return {
44
+ name: key,
45
+ fn: vue.withCtx(() => [
46
+ vue.renderSlot(_ctx.$slots, key)
47
+ ])
48
+ };
49
+ })
50
+ ]), 1040, ["axis", "magnetic", "onClick"]);
51
+ };
52
+ }
53
+ };
54
+ exports.default = _sfc_main;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const vue = require("vue");
4
+ const routeProps = {
5
+ to: [String, Object],
6
+ url: String,
7
+ replace: Boolean
8
+ };
9
+ function route({ to, url, replace, $router: router }) {
10
+ debugger;
11
+ if (to && router) {
12
+ router[replace ? "replace" : "push"](to);
13
+ } else if (url) {
14
+ replace ? location.replace(url) : location.href = url;
15
+ }
16
+ }
17
+ function useRoute() {
18
+ const vm = vue.getCurrentInstance().proxy;
19
+ return () => route(vm);
20
+ }
21
+ exports.route = route;
22
+ exports.routeProps = routeProps;
23
+ exports.useRoute = useRoute;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fecp/mobile",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "main": "lib/packages/mobile/index.js",
5
5
  "module": "es/packages/mobile/index.mjs",
6
6
  "files": [