@gaoding/editor-miniprogram-sdk
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -58,5 +58,8 @@ Component({ | ||
observers: { | ||
'thirdPartyUserCode': function(v) { | ||
v && this.setUrl(); | ||
}, | ||
'thirdPartyUserCode,tokenData,templateId,thirdCateId,pageRoutes,currentPage,mode,image': function(v) { | ||
const props = this.properties; | ||
if(props.thirdPartyUserCode || props.tokenData) { | ||
this.lazySetUrl(); | ||
} | ||
} | ||
}, | ||
@@ -77,6 +80,13 @@ methods: { | ||
}, | ||
lazySetUrl() { | ||
clearTimeout(this._timer); | ||
this._timer = setTimeout(() => { | ||
this.setUrl(); | ||
}, 10) | ||
}, | ||
setUrl() { | ||
console.log(this.getUrl() + '#wechat_redirect'); | ||
const url = this.getUrl() + '#wechat_redirect'; | ||
console.log(url); | ||
this.setData({ | ||
url: this.getUrl() + '#wechat_redirect' | ||
url | ||
}) | ||
@@ -83,0 +93,0 @@ }, |
@@ -14,3 +14,2 @@ import { getCode } from '../../utils/util.js'; | ||
onLoad: function (options) { | ||
this.setData({ | ||
@@ -17,0 +16,0 @@ query: options |
{ | ||
"name": "@gaoding/editor-miniprogram-sdk", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "稿定小程序编辑器对外 SDK", | ||
@@ -5,0 +5,0 @@ "main": "src/editor-miniprogram-sdk.js", |
@@ -58,5 +58,8 @@ Component({ | ||
observers: { | ||
'thirdPartyUserCode': function(v) { | ||
v && this.setUrl(); | ||
}, | ||
'thirdPartyUserCode,tokenData,templateId,thirdCateId,pageRoutes,currentPage,mode,image': function(v) { | ||
const props = this.properties; | ||
if(props.thirdPartyUserCode || props.tokenData) { | ||
this.lazySetUrl(); | ||
} | ||
} | ||
}, | ||
@@ -77,6 +80,13 @@ methods: { | ||
}, | ||
lazySetUrl() { | ||
clearTimeout(this._timer); | ||
this._timer = setTimeout(() => { | ||
this.setUrl(); | ||
}, 10) | ||
}, | ||
setUrl() { | ||
console.log(this.getUrl() + '#wechat_redirect'); | ||
const url = this.getUrl() + '#wechat_redirect'; | ||
console.log(url); | ||
this.setData({ | ||
url: this.getUrl() + '#wechat_redirect' | ||
url | ||
}) | ||
@@ -83,0 +93,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20984
534