集成 prettier 插件, 新增 npm run lint:prettier 命令
This commit is contained in:
@@ -6,7 +6,14 @@
|
||||
|
||||
<script setup name="LayCollapse"></script>
|
||||
<script setup lang="ts">
|
||||
import { withDefaults, defineProps, provide, ref, defineEmits, watch } from 'vue'
|
||||
import {
|
||||
withDefaults,
|
||||
defineProps,
|
||||
provide,
|
||||
ref,
|
||||
defineEmits,
|
||||
watch,
|
||||
} from "vue";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@@ -15,25 +22,24 @@ const props = withDefaults(
|
||||
}>(),
|
||||
{
|
||||
modelValue: () => [],
|
||||
accordion: false
|
||||
accordion: false,
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
// 监听传入的值
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
(val, oldVal)=>{
|
||||
activeValues.value = ([] as any[]).concat(val)
|
||||
() => props.modelValue,
|
||||
(val, oldVal) => {
|
||||
activeValues.value = ([] as any[]).concat(val);
|
||||
}
|
||||
)
|
||||
const emit = defineEmits(["update:modelValue", "change"])
|
||||
);
|
||||
const emit = defineEmits(["update:modelValue", "change"]);
|
||||
|
||||
const activeValues = ref<Array<any>>(([] as any[]).concat(props.modelValue));
|
||||
|
||||
provide("layCollapse", {
|
||||
accordion : props.accordion,
|
||||
accordion: props.accordion,
|
||||
activeValues,
|
||||
emit
|
||||
})
|
||||
|
||||
emit,
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user