0.1.55 • Published 4 months ago

vue-essentials v0.1.55

Weekly downloads
2
License
ISC
Repository
github
Last release
4 months ago

vue-essentials

Some VueJS essentials directives.

v-number

Params

  • decimals: (Optional, Default: 0) The number of decimal places.
  • decimals-separator: (Optional, Default: '.') The decimals separator character.
  • thousands-separator: (Optional, Default: ',') The thousands separator character.

v-dirty-form

Params

  • dirty-form-message: message to be displayed when leaving page with unsaved data.

v-geocomplete

Requires

  • Jquery geocomplete dependency
  • Google Maps API key

Usage

First set the Google maps api key in the Vue config object on the beforeCompile method of the app instance:

beforeCompile: function() {  
    Vue.config.mapsApiKey = "YOUR_PLACES_API_KEY";  
},

Then insert an input field:

<input id="address" type="text" class="form-control" v-model="address" v-geocomplete details="#el" details-attribute="data-geo"/>

If you want to post also latitude and longitude you can add these two input fields in the form:

<input id="meLatitude" type="text" data-geo="lat">  
<input id="meLongitude" type="text" data-geo="lng">

If you want to post the data with an AJAX request, you must listen to the geocode:result event:

$('#address').bind("geocode:result", function(event, result){  

	this.$set('model.latitude', result.geometry.location.lat());  
	this.$set('model.longitude', result.geometry.location.lng());

}.bind(this));
0.1.54

4 months ago

0.1.55

4 months ago

0.1.52

6 months ago

0.1.53

6 months ago

0.1.51

6 months ago

0.1.50

4 years ago

0.1.49

5 years ago

0.1.48

6 years ago

0.1.47

6 years ago

0.1.46

6 years ago

0.1.45

6 years ago

0.1.44

6 years ago

0.1.43

6 years ago

0.1.42

6 years ago

0.1.41

6 years ago

0.1.40

6 years ago

0.1.39

6 years ago

0.1.38

6 years ago

1.0.0

7 years ago