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

@ddosdor/vue-sh-wysiwyg

v0.2.2

Published

Simple and very basic Wysiwyg editor for Vue.js

Downloads

15

Readme

 __      __                     _____ _ __          __        _                      
 \ \    / /                    / ____| |\ \        / /       (_)                     
  \ \  / /   _  ___   ______  | (___ | |_\ \  /\  / /   _ ___ ___      ___   _  __ _ 
   \ \/ / | | |/ _ \ |______|  \___ \| '_ \ \/  \/ / | | / __| \ \ /\ / / | | |/ _` |
    \  /| |_| |  __/           ____) | | | \  /\  /| |_| \__ \ |\ V  V /| |_| | (_| |
     \/  \__,_|\___|          |_____/|_| |_|\/  \/  \__, |___/_| \_/\_/  \__, |\__, |
                                                     __/ |                __/ | __/ |
                                                    |___/                |___/ |___/

@ddosdor/vue-sh-wysiwyg

What is this?

This is my very basic and very simple HTML wysiwyg editor.

Why I made this?

Because I need some very basic and very simple HTML wysiwyg editor for my project. Need is the mother of invention. :)

Where to get it from?

It's simple:

npm install @ddosdor/vue-sh-wysiwyg

or

yarn add @ddosdor/vue-sh-wysiwyg

How to use this?

First import it and let Vue know to use it.

In your main.js file:

import Vue from 'vue';
import ShWysiwyg from '@ddosdor/vue-sh-wysiwyg';

Vue.use(ShWysiwyg)

Remember to add a stylesheet:

In main.js (I prefer this solution):

import "@ddosdor/vue-sh-wysiwyg/lib/ShWysiwyg.css";

or in some css file:

@import "~@ddosdor/vue-sh-wysiwyg/lib/ShWysiwyg.css";

Use this in components

To use ShWysiwyg in components:

<ShWysiwyg v-model="someHtml" />

Value passed on to the v-model is 'two-way binding' (Vue docs).

You can also use the emitted events:

<ShWysiwyg v-model="someHtml" 
           @change="handleChange"
           @focus="handleFocus"
           @blur="handleBlur"
/>
  • @change is emitted on every content change
  • @focus is emitted when content is focused
  • @blur is emitted when content is blur

Possible commands and customization

So far, there are only a few possible commands (Did I mentioned that it's a simple editor?)

  • Heading (heading)
  • Bold (bold)
  • Italic (italic)
  • Strikethrough (strikeThrough)
  • Underline (Underline)
  • Align left (justifyLeft)
  • Align center (justifyCenter)
  • Align right (justifyRight)
  • Align justify (justifyFull)
  • Hyperlink (createLink)
  • Undo (undo)
  • Remove format (removeFormat)

By default, all the above options are available. However, they can be customized with props:

<ShWysiwyg v-model="someHtml" 
           :toolbar="['bold', 'underline', '|', 'createLink', 'removeFormat']"
/>

Mysterious '|' is divider.

Can I use it for production?

I don't know, I use it. :)

What's next?

I still have some ideas that I would like to implement for this tool. So far, this is a beta version, that's why every feedback is welcome.