halo/console/packages/components
Ryan Wang 44cb311fac
refactor: visible condition of modal component (#5078)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.12.x

#### What this PR does / why we need it:

重构 UI 的 Modal 组件,支持通过 v-if 控制是否显示(渲染)。

example:

```vue
<script lang="ts" setup>
import { ref } from "vue"
const visible = ref(false)
const modal = ref()

function open() {
  visible.value = true
}

function close() {
  modal.value.close()
}
</script>

<template>
  <button @click="open">Open</button>
    <VModal v-if="visible" ref="modal" title="test">
      <button @click="close">Close</button>
    </VModal>
</template>
```

#### Which issue(s) this PR fixes:

Fixes #5077 

#### Special notes for your reviewer:

测试方式:

1. cd console && pnpm --filter "./packages/components" storybook
2. 测试 Modal 组件在文档中是否工作正常。
3. 启动 Console 或者 UC。
4. 观察以前页面上的弹框是否工作正常。

#### Does this PR introduce a user-facing change?

```release-note
重构 UI 的 Modal 组件,支持通过 v-if 控制是否显示(渲染)。
```
2023-12-29 07:15:39 +00:00
..
.storybook feat: use storybook to refactor components library docs (#4944) 2023-12-06 08:30:13 +00:00
src refactor: visible condition of modal component (#5078) 2023-12-29 07:15:39 +00:00
.eslintignore feat: use storybook to refactor components library docs (#4944) 2023-12-06 08:30:13 +00:00
.eslintrc.cjs feat: use storybook to refactor components library docs (#4944) 2023-12-06 08:30:13 +00:00
env.d.ts feat: use storybook to refactor components library docs (#4944) 2023-12-06 08:30:13 +00:00
package.json feat: use storybook to refactor components library docs (#4944) 2023-12-06 08:30:13 +00:00
postcss.config.js Move root to console 2023-03-02 15:49:22 +08:00
prettier.config.js Move root to console 2023-03-02 15:49:22 +08:00
tailwind.config.js Move root to console 2023-03-02 15:49:22 +08:00
tsconfig.app.json chore: improve the console project infrastructure (#4105) 2023-06-26 03:54:17 +00:00
tsconfig.json chore: improve the console project infrastructure (#4105) 2023-06-26 03:54:17 +00:00
tsconfig.node.json chore: improve the console project infrastructure (#4105) 2023-06-26 03:54:17 +00:00
tsconfig.vitest.json Move root to console 2023-03-02 15:49:22 +08:00
vite.config.ts chore: improve the console project infrastructure (#4105) 2023-06-26 03:54:17 +00:00