second-com
v0.0.5
Published
### 引入npm i second-com 全局注册 ### 优点:多个弹窗可以自由拖动并且可以拖拽放大缩小,被拖拽弹窗始终放置在最上一层 #### 使用 ```ts <button @click="dig"><</button> <RDialog :show-dialog="parentMsg" @positive-click="onPositiveClick" @negative-click="onNegativeClick" > <template v-slot:header>
Downloads
2
Readme
Vue 3 + TypeScript + Vite
引入npm i second-com 全局注册
优点:多个弹窗可以自由拖动并且可以拖拽放大缩小,被拖拽弹窗始终放置在最上一层
使用
<button @click="dig"><</button>
<RDialog :show-dialog="parentMsg" @positive-click="onPositiveClick" @negative-click="onNegativeClick" >
<template v-slot:header>
封装弹窗
</template>
可以随意插入弹窗所需内容
<template #button>
可自由插入footer其他按钮;默认是取消和关闭
</template>
</RDialog>
<script setup lang="ts">
const dig2 =() => {
parentMsg.value = true
}
const parentMsg =ref(false)
const onPositiveClick2 = () => {
parentMsg.value = false
};
const onNegativeClick2 = () => {
parentMsg.value = false
};
</script>
Recommended IDE Setup
- VS Code + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).
Type Support For .vue
Imports in TS
TypeScript cannot handle type information for .vue
imports by default, so we replace the tsc
CLI with vue-tsc
for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue
types.
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:
- Disable the built-in TypeScript Extension
- Run
Extensions: Show Built-in Extensions
from VSCode's command palette - Find
TypeScript and JavaScript Language Features
, right click and selectDisable (Workspace)
- Run
- Reload the VSCode window by running
Developer: Reload Window
from the command palette.