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 🙏

© 2026 – Pkg Stats / Ryan Hefner

frame-editor-preview

v1.0.6

Published

Frame Editor Library

Downloads

149

Readme

@easyway/frame-editor

安装方式

npm install @easyway/frame-editor

yarn add @easyway/frame-editor

pnpm add @easyway/frame-editor

使用方法

全局使用:在 main.ts 引入

import { FrameEditor, FramePreview } from '@easyway/frame-editor';
const app = createApp(App);
app.use(FrameEditor);
// app.use(FramePreview);
// 或者
// app.component('FrameEditor', FrameEditor);
// app.component('FramePreview', FramePreview);

局部使用:在 App.vue 引入

<script setup lang="ts">
  import { FrameEditor, FramePreview } from '@easyway/frame-editor';
</script>

在 template 中使用

<frame-editor></frame-editor> <frame-preview></frame-preview>

帧编辑参数说明

| 参数 | 说明 | 类型 | | ---- | ---- | ---- | | | | |

帧编辑示例

<template>
  <main>
    <frame-editor></frame-editor>
  </main>
</template>

<script setup lang="ts"></script>

帧预览参数说明

| 参数 | 说明 | 类型 | | ------------ | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- | | style | props: 行内样式 | CSSProperties 非必传 | | className | props: 内部元素 class | string 非必传 | | bgcolor | props: 预览整体背景色 | string 非必传 | | xmlString | props: 预览的 xml 字符串 | string 非必传 | | useLiveData | props: 预览是否使用实时数据(比如动态表格数据) | boolean 非必传,不传默认 false | | autoPlay | props: 是否自动切换帧(多个帧的时候设置自动切换,不设置会显示前一个后一个按钮手动切换) | boolean 非必传,不传默认 false | | autoScale | props: 是否自动切缩放,当帧的宽高超出外层元素宽高,指示是滚动条还是缩放 | boolean 非必传,不传默认 false | | showElBorder | props: 帧内每个元素是否给一个边框 | boolean 非必传,不传默认 false | | selectedData | props: 预览中需要被选中的元素数据信息 | PreviewSelectedData 非必传 | | fileBuffer | props: 针对 ppt/word/image/video 四种元素,根据文件名称获取文件数据的方法 | (fileName: string) => Promise(ArrayBuffer) 必传 | | action | event: 单击或双击预览内部元素时会触发该事件(可在此事件中配合 selectedData 处理选中其他预览元素) | (type: PreviewEventType, data: PreviewSelectedData) => void | | change | event: 帧自动播放活手动播放,帧切换时的事件 | (index: number, data: FrameData) => void |

type PreviewEventType = 'click' | 'dblclick';
type PreviewSelectedData = {
  id: string; // 选中元素的 ID
  key: string; // 选中元素在 xml 中 对应的标签名称
  seq: number; // 选中元素的类型,xml 中的 TP 值
  type: string; // 选中元素的类型,比如 image,richText,table 等
  source: string; // 选中元素的设置的数据源值
};

帧预览示例

<template>
  <frame-preview
    :xmlString="pXmlString"
    :useLiveData
    :autoPlay="false"
    :selectedData="selectedData"
    :fileBuffer="fetchBuffer"
    @action="handleAction" />
</template>

<script setup lang="ts">
  import { ref, shallowRef, onMounted } from 'vue';
  import { fetchBuffer } from '@/views/pis/frameEdit/frameEditApi';

  const pXmlString = ref('');
  const selectedData = shallowRef({});
  const handleAction = (type, data) => {
    if (type === 'click') {
      selectedData.value = data;
    }
  };
</script>