New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

undown

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

undown

Markdown component for Vue

latest
Source
npmnpm
Version
0.0.11
Version published
Weekly downloads
1
-50%
Maintainers
0
Weekly downloads
 
Created
Source

undown

npm version npm downloads

Markdown component for Vue.

Usage

Install package:

# npm
npm install undown

# yarn
yarn add undown

# pnpm
pnpm install undown

Import:

<script setup lang="tsx">
import { defineComponent } from "vue";
import { Markdown } from "undown";
import type { MarkdownPlugin, MarkdownComponents } from "undown";
import { alert } from "@mdit/plugin-alert";
import { tasklist } from "@mdit/plugin-tasklist";

const content = "# Hello, World!";
const plugins: MarkdownPlugin[] = [
  alert,
  [
    tasklist,
    {
      // your options, optional
    },
  ],
];
const components: MarkdownComponents = {
  pre: (_props, { slots }) => {
    return h("pre", slots.default?.());
  },
  h1: (props, { slots }) => {
    return (
      <h1 class="text-3xl font-semibold mt-6 mb-2" {...props}>
        {slots.default?.()}
      </h1>
    );
  },
  Counter: defineComponent({
    setup() {
      const count = ref(0);
      return () => h("button", { onClick: () => count.value++ }, count.value);
    },
  }),
};
</script>

<template>
  <Markdown :content :components :plugins />
</template>

License

Published under the MIT license. Made by community 💛

FAQs

Package last updated on 23 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts