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

vue-editor-oss

v1.0.1

Published

support using v-model and upload oss in vue

Downloads

2

Readme

vue-editor-oss

an editor that can use v-model and upload file to oss for vue

Install

use npm

$ npm install vue-editor-oss -S

documents

v-model使用

<template>
  <div>
    <vue-editor-oss v-model="html"></vue-editor-oss>
  </div>
</template>
...
import VueEditorOss from '@daily/vue-editor-oss'
...
components: {
    VueEditorOss
},
data () {
    return {
        html: ''
    }
}

options

参数 | 类型 | 作用 | 默认值 ---|---|---|--- custom-config | Object |继承wangEditor中customConfig | { menus, onchange } oss-access-token |Object |上传文件到阿里云所需的配置 | 需使用者传入,必须的属性:['policy', 'accessid', 'callback', 'token', 'acl', 'signature', 'host', 'dir']

具体配置如下:

customConfig与wangEditor 配置一样,直传,更多配置前往此官网

例如:
const menus = [
  'head',  // 标题
  'bold',  // 粗体
  'fontSize',  // 字号
  'fontName',  // 字体
  'italic',  // 斜体
  'underline',  // 下划线
  'strikeThrough',  // 删除线
  'foreColor',  // 文字颜色
  'backColor',  // 背景颜色
  'link',  // 插入链接
  'list',  // 列表
  'justify',  // 对齐方式
  'quote',  // 引用
  'emoticon',  // 表情
  'image',  // 插入图片
  'table',  // 表格
  'code',  // 插入代码
  'undo',  // 撤销
  'redo'  // 重复
  ]
// 组件内默认设置了两个属性,自定义可覆盖
customConfig = {
    menus,
    onchange // 富文本编辑器内容发生变化时,需要做的处理,内部利用该方法封装好v-model
}

ossAccessToken: 若需要上传图片到oss,可使用此配置

// 需传入的参数配置为:
ossAccessToken = {
    policy: '对应oss的policy',
    accessid: '对应oss的OSSAccessKeyId',
    callback: '对应oss的callback',
    token: '对应oss的x-oss-security-token',
    acl: '对应oss的x-oss-object-acl',
    signature: '对应oss的signature',
    host: '上传到oss的域名',
    dir: '上传到oss下的位置路径'
},
// 如下面的例子
{
	accessid: "STS.NUvvB1XotASGYYrTwf51fPZYN"
	host: "https://daily-static.oss-cn-hangzhou.aliyuncs.com"
	token: "CAIS/gF1q6Ft5B2yfSjIr5bDPfiFtbBV9pGsW3/DsHczOb5Kv5/yrDz2IHhOenJvBOkatvU0nmtY6/YYlqJ4T55IQ1Dza8J148y5dNF2ncyT1fau5Jko1beHewHKeTOZsebWZ+LmNqC/Ht6md1HDkAJq3LL+bk/Mdle5MJqP+/	UFB5ZtKWveVzddA8pMLQZPsdITMWCrVcygKRn3mGHdfiEK00he8Tomtvnvm5fAsUuF1QSgkLQvyt6vcsT+Xa5FJ4xiVtq55utye5fa3TRYgxowr/8s0vcbpG6b5oDGWQIBvkXcKZbF89ZvIRJhYq8zF7FereTxkvt8q/xMeX5JcdKuVxqAAQdGYsSJZuHia+SU29kh7uiZii6aze/Z3lfMju0bEymExlSv8UOI+EXsI5R1fFr8QdOjxjD44VHwnJH5Gc0DBXYRMNBTlcGpTLMJWejV+ukVyVHoz/RDjIfnbfjy11nEtw5cUJsRTYdF+74wGQ6trV+yfb2ANuq6+QnOD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