perf 优化支付宝js文件加载逻辑

This commit is contained in:
DaxPay
2024-09-26 14:57:08 +08:00
parent d45408250b
commit 34bfe028a3

View File

@@ -21,16 +21,16 @@ script.setAttribute(
'https://gw.alipayobjects.com/as/g/h5-lib/alipayjsapi/3.1.1/alipayjsapi.min.js',
)
document.head.appendChild(script)
// 脚本加载完毕后进行初始化
script.onload = () => {
init()
}
const route = useRoute()
const { appId, channel, queryCode, aliAppId } = route.params
const show = ref(true)
setTimeout(() => {
init()
}, 300)
/**
* 页面初始化
*/
@@ -57,7 +57,6 @@ async function init() {
})
})
}
console.log(appId, channel)
</script>
<style scoped lang="less">