npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-amap-n

v0.1.5

Published

vue2.x amap search component vue2.x高德地图搜索组件

Downloads

5

Readme

vue-amap-new

基于现有现有 vue-amap-search 项目修改,配合自己项目进行了修改,感谢作者 mactive 提供。

A Vue.js amap 高德地图

如何使用

  1. 配置参数和你的高德key
window.amapConfig = {
  key: '你的高德地图key'
}
  1. 导入js和css,声明component

单一组件内部使用

import AmapSearch from 'vue-amap-search'
import 'vue-amap-search/dist/lib/main.css'

export default {
  // 省略
  components:{
      'amap-search': AmapSearch
  }
}

or 全局声明

import Vue from 'vue'
import AmapSearch from 'vue-amap-search'
import 'vue-amap-search/dist/vue-instant.css'
Vue.use(AmapSearch)

html 中使用都是一样的,及得给amap-search设定宽和高,

<amap-search 
  :searchCount="5"
  :autoConfirm="false"
  :useClick="false"
  :width="800"
  :height="340"
  :defaultLng="31.12571"
  :defaultLat="121.327522"
  :dragEnable="false"
  @userInput="handleUserInput"
  @pickedLocation="handlePickedLocation">
</amap-search>
  1. event and props

props

  • width 宽度 height 高度
  • searchCount 返回结果的数量
  • autoConfirm 是否自动确认点的地址, 默认 false 不开启 .

默认false, 用户点击确定后才会触发 handlePickedLocation 绑定的事件 如果true,searchCount 会自动变成1

  • useClick 是否开启用户单机地图, 默认 false 不开启 .

默认false, 用户点击地图没有反应, 只能搜索结果后拖动图标 如果true,searchCount 会自动变成1

  • defaultLng, 设置地图经度
  • defaultLat, 设置地图纬度
  • dragEnable, 设置地图是否允许拖拽,默认是false

Event

  • handleUserInput 输入框中的值
  • handlePickedLocation 用户选定坐标,并点击确定后的值

TODO:

  • [x] 传入宽和高
  • [x] 样式自包含, 不依赖于 bootstrap 3.3版本
  • [x] 自动完成鼠标上下选择第三下失效.
  • [x] 支持手点位置, 但是只能有一个搜索结果结果
  • [x] 去掉sass 改用postcss
  • [x] 支持开关确认按钮, 点击确定关闭
  • [x] BUG: 拖动POI显示时候错位的问题, 应该是显示的问题
  • [x] 做成 amap-search 组件, 组件的实现可以用到mixin
  • [x] 优化 webpack task
  • [ ] 输出组件的ts定义 d.ts文件

Build Setup 二次开发或者fork


# 先安装typescript 然后 link
npm install typescript -g
npm link typescript

# install dependencies
npm install

# serve with hot reload at localhost:3030
npm run dev

# build for vue component with js, css with sourcemaps
npm run build:lib

# build for example project with vue framework in
npm run build:example