-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle dynamic content in empathize
- Loading branch information
Showing
2 changed files
with
24 additions
and
9 deletions.
There are no files selected for viewing
28 changes: 21 additions & 7 deletions
28
packages/_vue3-migration-test/src/x-modules/empathize/test-empathize.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,39 @@ | ||
<template> | ||
<SearchInput /> | ||
<Empathize :animation="CollapseHeight" class="empathize"> | ||
<h1>It is a Empathize</h1> | ||
<h2>It is a Empathize</h2> | ||
<h3>It is a Empathize</h3> | ||
<p> | ||
Component containing the empathize. It has a required slot to define its content and two props | ||
to define when to open and close it: `eventsToOpenEmpathize` and `eventsToCloseEmpathize`. | ||
</p> | ||
<div v-if="showContent"> | ||
<h1>It is a Empathize</h1> | ||
<h2>It is a Empathize</h2> | ||
<h3>It is a Empathize</h3> | ||
<p> | ||
Component containing the empathize. It has a required slot to define its content and two | ||
props to define when to open and close it: `eventsToOpenEmpathize` and | ||
`eventsToCloseEmpathize`. | ||
</p> | ||
</div> | ||
</Empathize> | ||
<Empathize :animation="CollapseHeight" class="empathize" /> | ||
<button @click="toggleContent"> | ||
{{ showContent ? 'hide empathize content' : 'show empathize content' }} | ||
</button> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { ref } from 'vue'; | ||
import CollapseHeight from '../../../../x-components/src/components/animations/collapse-height.vue'; | ||
import Empathize from '../../../../x-components/src/x-modules/empathize/components/empathize.vue'; | ||
import SearchInput from '../../../../x-components/src/x-modules/search-box/components/search-input.vue'; | ||
const showContent = ref(true); | ||
const toggleContent = () => { | ||
showContent.value = !showContent.value; | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
.empathize { | ||
border: 3px solid red; | ||
padding-top: 16px; | ||
padding-bottom: 16px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters