我也说不上来是哪儿错误了,比如2个页面路径,这2个页面内容是完全一模一样,且是最简单的vue文件。
在微信小程序中:index2不能执行onload,index3确能执行,是啥情况?
在H5中:2个路径都可以执行onload。
-
如果这2个url在微信小程序都不能执行onload的时候,那么新建一个页面index4,并把文件内容原样复制过去,编译,又能执行到onload生命周期了。。是怎么回事啊???
<template>
<view>
我是页面
</view>
</template>
<script>
export default {
components: {
},
data() {
return {
};
},
onLoad (t) {
console.log("onLoad,页面加载",t)
},
};
</script>
<style>
</style>
{
"path": "ymq_canyino2o/pages/index/index2",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "ymq_canyino2o/pages/index/index3",
"style": {
"navigationStyle": "custom"
}
},
IDE版本:3.8.12.20230802-alpha
{
"name": "uni-app-vue2-tailwind-hbuilder-template",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@dcloudio/uni-automator": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-cli-i18n": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-cli-shared": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-migration": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-template-compiler": "2.0.2-alpha-3081220230802001",
"@dcloudio/vue-cli-plugin-hbuilderx": "2.0.2-alpha-3081220230802001",
"@dcloudio/vue-cli-plugin-uni": "2.0.2-alpha-3081220230802001",
"@dcloudio/vue-cli-plugin-uni-optimize": "2.0.2-alpha-3081220230802001",
"@dcloudio/webpack-uni-mp-loader": "2.0.2-alpha-3081220230802001",
"@dcloudio/webpack-uni-pages-loader": "2.0.2-alpha-3081220230802001",
"autoprefixer": "9",
"babel-plugin-import": "1.13.8",
"cross-env": "7.0.3",
"jest": "25.5.4",
"postcss": "7",
"postcss-comment": "^2.0.0",
"postcss-rem-to-responsive-pixel": "^5.1.3",
"tailwindcss": "npm:@tailwindcss/postcss7-compat",
"weapp-tailwindcss-webpack-plugin": "^1.12.8",
"webpack": "npm:webpack@webpack-4"
},
"dependencies": {
"@dcloudio/uni-app": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-app-plus": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-h5": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-i18n": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-mp-360": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-mp-alipay": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-mp-baidu": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-mp-jd": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-mp-kuaishou": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-mp-lark": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-mp-qq": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-mp-toutiao": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-mp-vue": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-mp-weixin": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-mp-xhs": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-quickapp-native": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-quickapp-webview": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-stacktracey": "2.0.2-alpha-3081220230802001",
"@dcloudio/uni-stat": "2.0.2-alpha-3081220230802001",
"@vue/shared": "3.3.4",
"flyio": "0.6.14",
"vuex": "3.6.2"
}
}
1 个回复
JJJJJ (作者)
置顶。。老大有看看么