0.1.55 • Published 1 year ago

vue-essentials v0.1.55

Weekly downloads
2
License
ISC
Repository
github
Last release
1 year 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

1 year ago

0.1.55

1 year ago

0.1.52

2 years ago

0.1.53

2 years ago

0.1.51

2 years ago

0.1.50

5 years ago

0.1.49

6 years ago

0.1.48

7 years ago

0.1.47

7 years ago

0.1.46

7 years ago

0.1.45

7 years ago

0.1.44

7 years ago

0.1.43

7 years ago

0.1.42

7 years ago

0.1.41

7 years ago

0.1.40

8 years ago

0.1.39

8 years ago

0.1.38

8 years ago

1.0.0

8 years ago