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

sam-editor

v0.1.4

Published

sam-editor

Downloads

37

Readme

sam-editor

一个集成富文本的在线WORD文档编辑器

[ 查看演示 Demo ] [ 更新日志 ]

一、安装使用

1. 安装

# npm 安装
npm install sam-editor
# yarn 安装
yarn add sam-editor

2. 引入 sam-editor

Vue 3 组件内引入

import { samEditor } from 'sam-editor';
import 'sam-editor/index/style.css';

Vue3 全局引入

import { samEditor } from 'sam-editor';
import 'sam-editor/index/style.css';

const app = createApp(App)
app.use(VueCropper)
app.mount('#app')

nuxt 引入方式

if(process.browser) {
  samEditor = require('sam-editor')
  Vue.use(samEditor)
}

3. 代码中使用

<sam-editor ref="samEditor" :data="editorSetting" @change="changeEvent"></sam-editor>

二、文档

1. props 属性配置

editorSetting: {
    readonly: false,                                // 只读模式
    hideMenu: true,                                 // 隐藏菜单
    hideNav: true,                                  // 隐藏左侧导航栏
    menu: {                                         // 菜单栏
        file: { title: 'File', items: 'newStandard openFile save-btn restoredraft | preview | close-btn' },
        edit: { title: 'Edit', items: 'undo redo | cut copy paste | searchreplace' },
        view: { title: 'View', items: ' | preview fullscreen' },
        insert: { title: 'Insert', items: 'image inserttable | charmap hr | math linecode-btn textnode-btn' },
        format: { title: 'Format', items: 'bold italic underline strikethrough superscript subscript | fontformats fontsizes align lineheight | forecolor backcolor | removeformat' },
        tools: { title: 'Tools', items: 'spellchecker spellcheckerlanguage | code' },
        table: { title: 'Table', items: 'inserttable | cell row column | tableprops deletetable' },
        help: { title: 'Help', items: 'help | bzt-ver' },
    },
    toolbar1: 'undo redo | close-btn save-btn | queue levels | hr finished-btn paragraph-btn title-block formatting | alignment indent2em lineheight | image charmap table | pageLayout page-type | searchreplace preview fullscreen | code',
    toolbar2: 'zhu-btn | example-btn | articleTitle imgtitle-btn | footer-btn | math graphy | introduceGroup quote-btn term quota | comment | catalogue | exportFile mergePage',
    quickbars: 'bold italic underline strikethrough superscript subscript',
    draftTimes: 30000,
    htmlContent: ''
}

2. 可用回调方法 changeEvent

  • @realTime 实时预览事件
  • @imgMoving 图片移动回调函数
  • @cropMoving 截图框移动回调函数
  • @imgLoad 图片加载的回调, 返回结果 success, error

3. 外部接口调用