npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@serdoo/vuetify-tiptap

v1.3.6

Published

Awesome and extendable rich text editor component for Vuetify projects using tiptap

Downloads

81

Readme

Stargazers Contributors Forks Issues MIT License LinkedIn

vuetify-tiptap

🚀 Awesome and extendable rich text editor component for Vuetify projects using tiptap

Sample

Usage

<v-tiptap v-model="value" />

To ensure full consistency between whats is seen in the editor and what you see when you render the HTML value, the component also has a view mode.

<v-tiptap v-model="value" view />

The toolbar is fully customizable and you can add, remove or reorder buttons. You can also use slots to add custom buttons with your own functionality.

<v-tiptap
  v-model="value"
  :toolbar="['bold', 'italic', '|', 'h1', 'p', '>', '#mybutton']"
>
    <template #mybutton="{ editor }">
        <v-btn icon small title="Clear Content" @click="editor.commands.clearContent()">
            <v-icon>mdi-delete-circle-outline</v-icon>
        </v-btn>
    </template>
</v-tiptap>

⚠️ This project uses Vue 2 and Vuetify 2. We plan to upgrade to Vue 3 as soon as Vuetify supports it.

Instalation

First, install the package using npm or yarn.

npm i -S @peepi/vuetify-tiptap

Then add the package to the transpileDependencies config on vue.config.js

module.exports = {
  transpileDependencies: ["vuetify", "@peepi/vuetify-tiptap"],
};

Finally, register the plugin on your main.ts.

import VTiptap from "@peepi/vuetify-tiptap";

Vue.use(VTiptap);

Uploading Images

In order to use the upload image feature, pass down a prop uploadImage to the component with a function that receives a File and returns a Promise to an URL.

<template>
  <v-tiptap :uploadImage="uploadImage" />
</template>

<script>
async function uploadImage(file) {
  const url = (await myApi.upload(file)).url;
  return url;
}
</script>

You can also pass this function as a global option to the plugin.

Vue.use(VTiptap, { uploadImage: async file => (await myApi.upload(file)).url });

Mentions

You just need set :mention="true" and pass the mentionItems prop to the component. It accepts an array or a function that returns an array of items like:

  mentionItems = [{text: 'User', value: 1, avatar: 'http://image.png'}]
<template>
  <v-tiptap :mention="true" :mentionItems="mentionItems" />
</template>

<script>
async function mentionItems(query: string) {
  const items = (await myApi.users(query)).data;
  return items;
}
</script>

You can also pass this function as a global option to the plugin and add .

Vue.use(VTiptap, { mentionItems: async query => (await myApi.users(query)).data });

Documentation

Check the live demo for documentation.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

This package was developed at Peepi, a SaaS platform to engage customers and employees.

License

The MIT License (MIT). Please see License File for more information.