Skip to content

Commit

Permalink
refactor: dropdown examples use script setup
Browse files Browse the repository at this point in the history
  • Loading branch information
wxsms committed Nov 23, 2021
1 parent e715aaf commit 461d309
Showing 1 changed file with 16 additions and 25 deletions.
41 changes: 16 additions & 25 deletions docs/.vitepress/components/dropdown/advanced.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<template>
<section class="uiv">
<alert>You selected: {{ selected }}</alert>
<dropdown
<Alert>You selected: {{ selected }}</Alert>
<Dropdown
ref="dropdown"
v-model="show"
:not-close-elements="ele"
class="dropdown-form"
>
<btn type="primary" class="dropdown-toggle"
<Btn type="primary" class="dropdown-toggle"
>Dropdown Form <span class="caret"></span
></btn>
></Btn>
<template #dropdown>
<li class="checkbox">
<label>
Expand All @@ -29,35 +29,26 @@
</label>
</li>
<li>
<btn block type="primary" @click="show = false">Apply</btn>
<Btn block type="primary" @click="show = false">Apply</Btn>
</li>
</template>
</dropdown>
</Dropdown>
</section>
</template>
<script>
import { onMounted, ref } from 'vue';

export default {
setup() {
const show = ref(false);
const dropdown = ref(null);
const ele = ref([]);
const selected = ref([]);
<script setup>
import { onMounted, ref } from 'vue';
onMounted(() => {
ele.value.push(dropdown.value.$el);
});
const show = ref(false);
const dropdown = ref(null);
const ele = ref([]);
const selected = ref([]);
return {
ele,
dropdown,
show,
selected,
};
},
};
onMounted(() => {
ele.value.push(dropdown.value.$el);
});
</script>

<style>
.uiv .dropdown-form .dropdown-menu {
padding: 10px;
Expand Down

0 comments on commit 461d309

Please sign in to comment.