Swap
Examples
Swap text
Swap volume icons
Swap icons with rotate effect
Swap with flip effect
Controlled swap
/
import { ref } from 'vue';
export default {
setup: () => {
const active = ref(false);
return () => (
<div class="text-center">
<div class="py-2">
<dv-button onClick={() => (active.value = true)}>on</dv-button>
/
<dv-button onClick={() => (active.value = false)}>off</dv-button>
</div>
<div class="text-9xl">
<dv-swap on="🥳" off="ðŸ˜" animation="flip" active={active.value} />
</div>
</div>
);
},
};
tsxSwap
Attributes
| name | description | type | default |
|---|---|---|---|
| on | render on | - | - |
| off | render off | - | - |
| tag | wrap elemnt tag | string | label |
| animation | animation effect | rotate, flip | - |
| active | swap active status | boolean | - |
| onChange | swap active status change event | Function | - |
Solts
| name | description |
|---|---|
| on | render on |
| off | render off |