mirror of
https://github.com/vbenjs/vben-admin-thin-next.git
synced 2025-02-02 18:08:40 +08:00
添加v-model:value双向绑定的支持 (#1073)
无需在Change事件中修改绑定的Value。 仅需在属性中设置 v-model:value,选择图标后,value值自动修改。
This commit is contained in:
parent
45a8eb974a
commit
b07003e184
@ -121,7 +121,7 @@
|
|||||||
copy: propTypes.bool.def(false),
|
copy: propTypes.bool.def(false),
|
||||||
mode: propTypes.oneOf<('svg' | 'iconify')[]>(['svg', 'iconify']).def('iconify'),
|
mode: propTypes.oneOf<('svg' | 'iconify')[]>(['svg', 'iconify']).def('iconify'),
|
||||||
},
|
},
|
||||||
emits: ['change'],
|
emits: ['change', 'update:value'],
|
||||||
setup(props, { emit }) {
|
setup(props, { emit }) {
|
||||||
const isSvgMode = props.mode === 'svg';
|
const isSvgMode = props.mode === 'svg';
|
||||||
const icons = isSvgMode ? getSvgIcons() : getIcons();
|
const icons = isSvgMode ? getSvgIcons() : getIcons();
|
||||||
@ -148,7 +148,10 @@
|
|||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => currentSelect.value,
|
() => currentSelect.value,
|
||||||
(v) => emit('change', v)
|
(v) => {
|
||||||
|
emit('update:value', v);
|
||||||
|
return emit('change', v);
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
function handlePageChange(page: number) {
|
function handlePageChange(page: number) {
|
||||||
|
Loading…
Reference in New Issue
Block a user