2021-11-01 01:02:21 +08:00
|
|
|
::: title 基础使用
|
|
|
|
:::
|
|
|
|
|
|
|
|
::: block 使 用 useMove 为 元 素 提 供 拖 拽 支 持
|
|
|
|
:::
|
|
|
|
|
|
|
|
```vue
|
|
|
|
<template>
|
|
|
|
<lay-button @click="fullScreen">全屏切换</lay-button>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-12-06 09:35:18 +08:00
|
|
|
import { useFullScreen } from '@layui/hooks-vue'
|
2021-11-01 01:02:21 +08:00
|
|
|
|
|
|
|
export default {
|
|
|
|
setup() {
|
|
|
|
const { fullScreen, isFullScreen } = useFullScreen()
|
|
|
|
|
|
|
|
watch(isFullScreen, () => {
|
|
|
|
console.log('全屏切换')
|
|
|
|
})
|
|
|
|
|
|
|
|
return {
|
|
|
|
fullScreen,
|
|
|
|
isFullScreen,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
```
|
|
|
|
|
|
|
|
::: title 使用备注
|
|
|
|
:::
|
|
|
|
|
2021-11-07 15:55:08 +08:00
|
|
|
::: table
|
|
|
|
|
2021-11-01 01:02:21 +08:00
|
|
|
| 事件 | 描述 | 类型 |
|
|
|
|
| ------------ | -------- | -------- |
|
|
|
|
| fullScreen | 全屏切换 | Function |
|
|
|
|
| isFullScreen | 当前状态 | Ref |
|
2021-11-07 15:55:08 +08:00
|
|
|
|
2021-11-07 15:56:24 +08:00
|
|
|
:::
|