1.0.0 • Published 8 months ago

vue-drag-scale v1.0.0

Weekly downloads
-
License
-
Repository
-
Last release
8 months ago

vue-drag-scale

npm npm vue3

Vue3 component that simulates a user typing, selecting, and erasing text.

Checkout the offical project here.

Table of contents

效果

npm.io

Installation

npm install --save vue-drag-scale

Global import

Install the component:

import { createApp } from 'vue' 
import vueDragScale from "vue-drag-scale";
import "vue-drag-scale/dist/style.css"; 
import App from './App.vue' 

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

Manual import

<template>
  <div>
    <vueDragScale>
      <div class="course-view"></div>
    </vueDragScale>
  </div>
</template>

<script setup lang="ts">
import { vueDragScale } from "vue-drag-scale";
import "vue-drag-scale/dist/style.css";
</script>

<style scoped>
.course-view {
  height: 300px;
  width: 300px;
  background: red;
}
</style>

Properties

你可以使用以下属性:

参数类型默认值说明
dragCodeStringSpace当按下约定拖拽键时,允许移动操作(自定义code请到https://juejin.cn/post/7029319401178398728查询)
scaleCodeStringSpace当按下约定缩放键时,允许缩放操作(自定义code请到https://juejin.cn/post/7029319401178398728查询)
scalePercentageNumber0.05每次缩放比例
minScalePercentageNumber0.1最小缩放比例
allowNativeScaleBooleanfalse是否允许原生缩放事件,比如ctrl + ,ctrl -

Slots

你能使用以下插槽:

插槽名称说明
default内容

Features

暂时没有,欢迎来访


License

MIT