提交初始版本,使用vant ui库
This commit is contained in:
27
miniprogram_npm/@vant/weapp/mixins/link.js
Normal file
27
miniprogram_npm/@vant/weapp/mixins/link.js
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.link = void 0;
|
||||
exports.link = Behavior({
|
||||
properties: {
|
||||
url: String,
|
||||
linkType: {
|
||||
type: String,
|
||||
value: 'navigateTo',
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
jumpLink: function (urlKey) {
|
||||
if (urlKey === void 0) { urlKey = 'url'; }
|
||||
var url = this.data[urlKey];
|
||||
if (url) {
|
||||
if (this.data.linkType === 'navigateTo' &&
|
||||
getCurrentPages().length > 9) {
|
||||
wx.redirectTo({ url: url });
|
||||
}
|
||||
else {
|
||||
wx[this.data.linkType]({ url: url });
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
Reference in New Issue
Block a user