You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.4 KiB
56 lines
1.4 KiB
"use strict";
|
|
const common_vendor = require("../../../../common/vendor.js");
|
|
const _sfc_main = {
|
|
options: {
|
|
virtualHost: true
|
|
},
|
|
externalClasses: ["class"],
|
|
props: {
|
|
to: {
|
|
type: [String, Object]
|
|
},
|
|
navType: {
|
|
type: String,
|
|
default: "navigate"
|
|
},
|
|
delta: {
|
|
type: Number,
|
|
default: 1
|
|
}
|
|
},
|
|
computed: {
|
|
url() {
|
|
if (this.to) {
|
|
const type = common_vendor.NavigationTypesEnums[this.navType];
|
|
const to = this.$uniRouter.resolve(this.to, type);
|
|
return to == null ? void 0 : to.fullPath;
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
navigate() {
|
|
const type = common_vendor.NavigationTypesEnums[this.navType];
|
|
if (type == null) {
|
|
return console.error(
|
|
` "navType" unknown type
|
|
|
|
value:${this.navType}`
|
|
);
|
|
}
|
|
let to = this.to || {};
|
|
if (this.navType == "navigateBack") {
|
|
to = {
|
|
delta: this.delta
|
|
};
|
|
}
|
|
this.$uniRouter.navigate(to, type);
|
|
}
|
|
}
|
|
};
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return {
|
|
a: common_vendor.o((...args) => $options.navigate && $options.navigate(...args))
|
|
};
|
|
}
|
|
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:/uniapp/uniapp/node_modules/uniapp-router-next/components/router-navigate/router-navigate.vue"]]);
|
|
wx.createComponent(Component);
|
|
|