Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vue #2

Open
utterances-bot opened this issue Jul 8, 2021 · 2 comments
Open

vue #2

utterances-bot opened this issue Jul 8, 2021 · 2 comments
Labels
comment Comment

Comments

@utterances-bot
Copy link

Vite App

https://utterances-component-58axit393-tomoki-miyauci.vercel.app/vue

Copy link
Owner

TomokiMiyauci commented Jul 8, 2021

hero image

utterances-vue-component

Type safety vue component for utterances

test GitHub release npm download

GitHub (Pre-)Release Date dependencies Status codecov Codacy Badge npm type definitions Commitizen friendly Gitmoji semantic-release License: MIT FOSSA Status


Vue component for utterances 🔮

Utterances is a lightweight comments widget built on GitHub issues, for blog comments, wiki pages and more.

✨ Features

  • 📚 Pure TypeScript and TSX and provides type definition
  • 🌎 Multiple modules, providing ES modules and Commonjs
  • 📦 Optimized, super slim size

⚡ Quick view

Locally

Local import of components is recommended.
This is a type-safe props.

<template>
  <Utterances
    repo="TomokiMiyauci/utterances-component"
    theme="github-dark"
    issueTerm="pathname"
  />
</template>

<script setup lang="ts">
  import { Utterances } from 'utterances-vue-component'
</script>

Globally

You can also register a component globally.
There will be no more type inference for props.
If there is no reason to do so, local import is recommended.

import { createApp } from 'vue'
import App from './App.vue'
import { plugin } from 'utterances-vue-component'

createApp(App).use(plugin).mount('#app')
<template>
  <Utterances
    repo="TomokiMiyauci/me"
    issue-term="pathname"
    theme="github-light"
  />
</template>

💫 Install

📦 Node.js

npm i utterances-vue-component
or
yarn add utterances-vue-component

🌐 Browser

The module that bundles the dependencies is obtained from
skypack.

import like this:

import { Utterances } from 'https://cdn.skypack.dev/utterances-vue-component'

peerDependency

package version
vue ^3.0.0

📝 API

Props

It has a strict type definition.
No default value is set to respect the original behavior.

Official document

Name Type Description
repo ${String}/${String} Repository for Utterances to connect to. Expected value: username/repo
theme Theme The Utterance theme.
label string? Choose the label that will be assigned to issues created by Utterances.
issueTerm Term | string[]1 The mapping between blog posts and GitHub issues. One of them2
issueNumber number You configure Utterances to load a specific issue by number. Issues are not automatically created.

declare type Theme =
  | 'github-light'
  | 'github-dark'
  | 'preferred-color-scheme'
  | 'github-dark-orange'
  | 'icy-dark'
  | 'dark-blue'
  | 'photon-dark'
  | 'boxy-light'
declare type Term = 'pathname' | 'url' | 'title' | 'og:title'
1

If you chose "Issue title contains specific term", specify the specific term as string array.

2

Unfortunately, props in vue cannot be exclusively defined. You can specify either an issueTerm or an issueNumber.

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check
issues.

🌱 Show your support

Give a ⭐️ if this project helped you!

💡 License

Copyright © 2021-present TomokiMiyauci.

Released under the MIT license

FOSSA Status

@TomokiMiyauci TomokiMiyauci added the comment Comment label Jul 9, 2021
Copy link

Lookin good mate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comment Comment
Projects
None yet
Development

No branches or pull requests

3 participants