# vue-navigator-share

> A Vue component to use native sharing mechanism of the device as part of the Web Share API.

Latest version **1.0.3** (published 2018-11-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-navigator-share
pnpm add vue-navigator-share
yarn add vue-navigator-share
bun add vue-navigator-share
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2018-11-29 |
| First published | 2018-11-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Gabriel Bibiano |
| Maintainers | gabrielbibiano |
| Keywords | vue, VueJs, share, navigator.share, navigator |

## Links

- npm: https://www.npmjs.com/package/vue-navigator-share
- Repository: https://github.com/GabrielBibiano/vue-navigator-share
- Homepage: https://github.com/GabrielBibiano/vue-navigator-share#readme
- Issues: https://github.com/GabrielBibiano/vue-navigator-share/issues
- npm.io page: https://npm.io/package/vue-navigator-share

## Recent versions

- 1.0.3 (latest) — 2018-11-29
- 1.0.2 — 2018-11-21
- 1.0.1 — 2018-11-21
- 1.0.0 — 2018-11-20

## README

# vue-navigator-share
A Vue component to use native sharing mechanism of the device as part of the Web Share API.

Support only https and mobile browser
<a href="https://navigator-share.surge.sh/" target="_blank">Demo</a>

## Instalation
```sh
$ npm install --save vue-navigator-share
```

## Properties

| prop | type | description | required |
| ------ | ------ | ------ | ------ |
| on-error | Function | callback on error | false |
| on-success | Function | callback on success | false |
| url | String | url to share | true |
| title | String | title to share | false |
| text | String | text to share | false |

## Usage

```HTML
<navigator-share
  v-bind:on-error="function"
  v-bind:on-success="otherFunction"
  url="url_to_share"
  title="title_to_share"
  text="text_to_share"
></navigator-share>
```

```javascript
<script>
import NavigatorShare from 'vue-navigator-share'

export default {
  name: 'app',
  data () {
    return {
    }
  },
  components: {
    NavigatorShare
  },
  methods: {
  }
}
</script>
```

## Example

```HTML
<navigator-share
  v-bind:on-error="onError"
  v-bind:on-success="onSuccess"
  v-bind:url="url"
  v-bind:title="title"
  text="Hello World"
></navigator-share>
```


```javascript
<script>
import NavigatorShare from 'vue-navigator-share'

export default {
  name: 'app',
  data () {
    return {
    }
  },
  components: {
    NavigatorShare
  },
  computed: {
    url() {
      return window.location.href;
    },
    title() {
      return document.title;
    }
  },
  methods: {
    onError(err) {
      alert(err);
      console.log(err);
    },
    onSuccess(err) {
      console.log(err);
    }
  }
}
</script>
```

---
_Source: https://npm.io/package/vue-navigator-share · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
