# simple-component-vue3

> This template should help get you started developing with Vue 3 in Vite.

Latest version **0.2.10** (published 2022-08-16) · 0 weekly downloads

## Install

```sh
npm install simple-component-vue3
pnpm add simple-component-vue3
yarn add simple-component-vue3
bun add simple-component-vue3
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.10 |
| Published | 2022-08-16 |
| First published | 2022-08-08 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 2.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | hurrinade |

## Links

- npm: https://www.npmjs.com/package/simple-component-vue3
- npm.io page: https://npm.io/package/simple-component-vue3

## Dependencies (2)

- [vue](https://npm.io/package/vue.md) ^3.2.37
- [pinia](https://npm.io/package/pinia.md) ^2.0.16

## Recent versions

- 0.2.10 (latest) — 2022-08-16
- 0.2.9 — 2022-08-16
- 0.2.8 — 2022-08-10
- 0.2.7 — 2022-08-10
- 0.2.5 — 2022-08-09
- 0.1.5 — 2022-08-09
- 0.0.5 — 2022-08-08
- 0.0.4 — 2022-08-08
- 0.0.3 — 2022-08-08
- 0.0.2 — 2022-08-08
- 0.0.1 — 2022-08-08
- 0.0.0 — 2022-08-08

## README

# simple-component-vue3

This template should help get you started developing with Vue 3 in Vite.

## Recommended IDE Setup

[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).

## Type Support for `.vue` Imports in TS

TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:

1. Disable the built-in TypeScript Extension
    1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
    2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.

## Customize configuration

See [Vite Configuration Reference](https://vitejs.dev/config/).

## Project Setup

```sh
npm install
```

To install web component into your project you need to initialize it inside 

index.html (vanilla js or vue)
```
<script type="module">
    import {register} from "path_to/simple-component-vue3/dist/index.js"
    register()
</script>
```

index.js (react root script)
```
    import {register} from "path_to/simple-component-vue3/dist/index.js"
    register()
```

vue can also initialize it inside 

main.js/ts script
```
    import {register} from "path_to/simple-component-vue3/dist/index.js"
    register()
```

### USAGE
First component is direct which gets msg as property in vue.
```
<simple-component-vue3-direct msg="something"></simple-component-vue3-direct>
```
Second component is non-direct which gets msg as property in vue.
```
<simple-component-vue3-ref msg="something"></simple-component-vue3-ref>
```
Third component is emit does not work right now
```
<simple-component-vue3-emit></simple-component-vue3-emit>
```
Fourth component is vmodel which creates input field that shows input below it.
```
<simple-component-vue3-vmodel></simple-component-vue3-vmodel>
```
Fifth component is broadcast which uses broadcast channel.
Declaration of BroadcastChannel in your project should be like this with 'test-channel' name required
```
// Declaration
const bc = new BroadcastChannel('test-channel')

// Usage
bc.onmessage = (event) => {
        console.log(event.data);
    }

// even.data gets object of data sent from vue component (parameters: type, title)
```

To use component declare it like this.
```
<simple-component-vue3-broadcast></simple-component-vue3-broadcast>
```
Component creates input field which value is broadcasted via BroadcastChannel
.data object is holding input value in parameter "title"

### Compile and Hot-Reload for Development

```sh
npm run dev
```

### Type-Check, Compile and Minify for Production

```sh
npm run build
```

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