代码片段如下:
page.json页面:
{
"path" : "pages/powerStation/station/stationDetail/index",
"style" : {
"app-plus": {
"titleNView": false,
"subNVues":[{
"id":"map",
"path":"components/yj-map/map.nvue",
"style":{
"position":"popup",
"width":"100%",
"height":"300"
}
}]
}
}
}
map.nvue代码如下:
<template>
<div style="background-color: red;">
<map style="width:100%;height:300px;" layer-style="22f774a414c8ebfd679eedbb6889c96d" ></map>
</div>
</template>
<script>
export default {
data() {
return {
}
},
mounted() {
}
}
</script>
<style scoped>
</style>
pages/powerStation/station/stationDetail/index 部分代码如下:
const subnvue = uni.getSubNVueById('map') // 获取nvue
subnvue.show('slide-in-top', 300, () => {
console.log('subNVue 原生子窗体显示成功1');
})