master
管理员 8 months ago
parent 38be2a9427
commit e97bf21780

@ -0,0 +1,83 @@
<template>
<div class="w-tags-input">
<el-tag
v-for="(tag, index) in model"
:key="index"
closable
:disable-transitions="false"
:type="props.type"
@close="handleClose(index)"
>
{{ tag }}
</el-tag>
<el-input
v-if="inputVisible"
ref="inputRef"
v-model="inputValue"
:style="{width:props.placeholder.length+1+'em'}"
size="small"
@keyup.enter="handleInputConfirm"
@blur="handleInputConfirm"
/>
<el-button v-else class="button-new-tag" size="small" @click="showInput">
{{ props.placeholder }}
</el-button>
</div>
</template>
<script setup>
import { nextTick, ref } from 'vue'
const model = defineModel({
type: Array,
required: true
});
const props = defineProps({
/**
* 输入提示
*/
placeholder: {
type: String,
default: "新增分组",
},
type:{
type:String,
default:'primary'
}
});
const inputValue = ref('')
const inputVisible = ref(false);
const inputRef = ref(undefined);
const handleClose = (index) => {
model.value.splice(index, 1);
};
const showInput = () => {
inputVisible.value = true
nextTick(() => {
inputRef.value?.input?.focus();
})
}
const handleInputConfirm = () => {
if (inputValue.value) {
model.value.push(inputValue.value)
}
inputVisible.value = false
inputValue.value = ''
}
</script>
<style lang="scss" scoped>
.w-tags-input {
display: flex;
flex-wrap: wrap;
& > * {
margin: 0 1em 1em 0;
}
}
</style>

@ -23,7 +23,7 @@ public class DynConfigApi {
public Object get(){
// return config; //java中可以直接使用但是不能JSON序列号因为他是经过aop代理后的bean
// return BeanUtil.toBean(config, TestDynConfig.class);
return DynConfigUtils.toBean(config,TestDynConfig.class);
return DynConfigUtils.toBean(config, TestDynConfig.class);
}

@ -23,7 +23,7 @@ import java.util.Map;
/**
* Service
*
* @author Lion Li
* @author ZLZ
* @date 2021-07-26
*/
//@RequiredArgsConstructor

Loading…
Cancel
Save