优化小程序菜单管理功能
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
:placeholder="placeholder"
|
||||
@update:value="updateValue"
|
||||
:style="`width: ${width}px`"
|
||||
@change="change"
|
||||
@blur="onBlur"
|
||||
/>
|
||||
</template>
|
||||
@@ -20,6 +21,7 @@
|
||||
(e: 'update:value', value: string): void;
|
||||
(e: 'index', index: number): void;
|
||||
(e: 'blur'): void;
|
||||
(e: 'done', item: any): void;
|
||||
}>();
|
||||
|
||||
const props = withDefaults(
|
||||
@@ -42,12 +44,16 @@
|
||||
|
||||
/* 更新选中数据 */
|
||||
const updateValue = (value: string) => {
|
||||
console.log(value);
|
||||
emit('update:value', value);
|
||||
emit('index', Number(props.index));
|
||||
};
|
||||
|
||||
/* 失去焦点 */
|
||||
const onBlur = () => {
|
||||
emit('blur');
|
||||
};
|
||||
|
||||
const change = (e, item) => {
|
||||
emit('done', item);
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user