Browse Source

master

master
邓宏 3 years ago
parent
commit
41cc1631fa
  1. 2
      src/views/About.vue
  2. 20
      src/views/Demo.vue
  3. 126
      src/views/Home.vue

2
src/views/About.vue

@ -1,6 +1,6 @@
<template>
<div class="about">
<h1></h1>
<h1>about</h1>
</div>
</template>
<script>

20
src/views/Demo.vue

@ -1,19 +1,15 @@
<template>
<div>
<h1>demo</h1>
<h1>demo---{{value}} ---{{name}}</h1>
<button @click="$router.back()">上一页</button>
</div>
</template>
<script>
import { defineComponent,onActivated } from 'vue'
export default defineComponent({
name:"demo",
setup() {
onActivated(()=>{
console.log("------onActivated-----------------demo---------")
})
console.log("--------------demo-------------")
},
<script setup>
import { defineProps, defineEmits, ref, useSSRContext,useAttrs, useSlots } from 'vue'
const props = defineProps({
name:String
})
console.log(useSSRContext(console.log),'--------ctx---')
const value=ref(props.name)
console.log(defineEmits(['childClick']))
</script>

126
src/views/Home.vue

@ -20,70 +20,70 @@ export default defineComponent({
}
onMounted(()=>{
window._AMapSecurityConfig={
securityJsCode:"3eceddef3eafbf06e01107c78db2c264",
}
AMapLoader.load({key:"3b999eeef15d7b6ca6a3fd0c9531160d",version:"2.0",plugins:["AMap.PolygonEditor,AMap.AutoComplete"]}).then(AMap=>{
map=new AMap.Map(_data.map.value,{
viewMode:"3D",
zoom:16,
zooms:[13,16.75],
center:[103.144875, 25.482653],
layers:[
//
new AMap.TileLayer.Satellite(),
//
new AMap.TileLayer.RoadNet()
],
})
window.m=map
//
var polygon=new AMap.Polygon({
path:[
[103.154206, 25.482612],
[103.154297, 25.482324],
[103.154146, 25.481694],
[103.15457, 25.481461],
[103.154813, 25.482379],
[103.154555, 25.482448]
],
strokeColor: "#FF33FF",
strokeWeight: 1,
strokeOpacity: 0.7,
fillOpacity: 0.2,
fillColor: '#1791fc',
zIndex: 50,
})
var polygon1=new AMap.Polygon({
path:[
[103.145047, 25.483922],
[103.149596, 25.483689],
[103.145798, 25.480222],
],
strokeColor: "#FF33FF",
strokeWeight: 3,
strokeOpacity: 0.7,
fillOpacity: 0.2,
fillColor: '#1791fc',
zIndex: 60,
})
map.add([polygon,polygon1])
var polyEditor=new AMap.PolygonEditor(map)
polyEditor.on("end",res=>{
console.log("---------end-------------")
})
// polyEditor.open()
// window._AMapSecurityConfig={
// securityJsCode:"3eceddef3eafbf06e01107c78db2c264",
// }
// AMapLoader.load({key:"3b999eeef15d7b6ca6a3fd0c9531160d",version:"2.0",plugins:["AMap.PolygonEditor,AMap.AutoComplete"]}).then(AMap=>{
// map=new AMap.Map(_data.map.value,{
// viewMode:"3D",
// zoom:16,
// zooms:[13,16.75],
// center:[103.144875, 25.482653],
// layers:[
// //
// new AMap.TileLayer.Satellite(),
// //
// new AMap.TileLayer.RoadNet()
// ],
// })
// window.m=map
// //
// var polygon=new AMap.Polygon({
// path:[
// [103.154206, 25.482612],
// [103.154297, 25.482324],
// [103.154146, 25.481694],
// [103.15457, 25.481461],
// [103.154813, 25.482379],
// [103.154555, 25.482448]
// ],
// strokeColor: "#FF33FF",
// strokeWeight: 1,
// strokeOpacity: 0.7,
// fillOpacity: 0.2,
// fillColor: '#1791fc',
// zIndex: 50,
// })
// var polygon1=new AMap.Polygon({
// path:[
// [103.145047, 25.483922],
// [103.149596, 25.483689],
// [103.145798, 25.480222],
// ],
// strokeColor: "#FF33FF",
// strokeWeight: 3,
// strokeOpacity: 0.7,
// fillOpacity: 0.2,
// fillColor: '#1791fc',
// zIndex: 60,
// })
// map.add([polygon,polygon1])
// var polyEditor=new AMap.PolygonEditor(map)
// polyEditor.on("end",res=>{
// console.log("---------end-------------")
// })
// // polyEditor.open()
var auto = new AMap.AutoComplete({
input:"search",
});
setTimeout(()=>{
auto.search('北京',(a,b)=>{
console.log(a,"-------aaaaaa----------")
console.log(b,"----------bbbbbbb---------")
})
},1000)
})
// var auto = new AMap.AutoComplete({
// input:"search",
// });
// setTimeout(()=>{
// auto.search('',(a,b)=>{
// console.log(a,"-------aaaaaa----------")
// console.log(b,"----------bbbbbbb---------")
// })
// },1000)
// })
})
return _data;
},

Loading…
Cancel
Save