UNPKG

vue-tianditu2

Version:
3 lines (2 loc) 1.16 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),u=require("../use/state.js");;/* empty css */const o=t.defineComponent({setup(){const e=u.useState();return()=>t.h("div",{class:"route-plans"},[e.drivingPlans.length?t.h("div",null,e.drivingPlans.map((n,a)=>t.h("details",{onClick:()=>{e.drivingPlanIndex=a}},[t.h("summary",null,`方案${a+1}: ${n.duration} 秒 | ${n.distance} 公里`),...n.routes.item.map((s,i)=>t.h("div",null,`${i+1}.${s.strguide}`))]))):"",e.transitPlans.length?t.h("div",null,e.transitPlans.map((n,a)=>t.h("details",{onClick:()=>{e.transitPlanIndex=a},style:{backgroundColor:"#fff"}},[t.h("summary",null,`方案${a+1}: ${n.lineName}`),n.segments.map(s=>{const i=s.segmentLine[0],r=i.segmentStationCount?",经过"+i.segmentStationCount+"站":"";switch(s.segmentType){case 1:return"步行约"+i.segmentDistance+"米,到达"+s.stationEnd.name;case 2:case 3:return"乘坐"+i.direction+r+",到达"+s.stationEnd.name;case 4:return"站内换乘";default:return""}}).join(",")+"终点"]))):""])}});exports.RoutePlans=o; //# sourceMappingURL=RoutePlans.js.map