未验证 提交 b07003e1 编写于 作者: R RemMai 提交者: GitHub

添加v-model:value双向绑定的支持 (#1073)

无需在Change事件中修改绑定的Value。
仅需在属性中设置 v-model:value,选择图标后,value值自动修改。
上级 45a8eb97
......@@ -121,7 +121,7 @@
copy: propTypes.bool.def(false),
mode: propTypes.oneOf<('svg' | 'iconify')[]>(['svg', 'iconify']).def('iconify'),
},
emits: ['change'],
emits: ['change', 'update:value'],
setup(props, { emit }) {
const isSvgMode = props.mode === 'svg';
const icons = isSvgMode ? getSvgIcons() : getIcons();
......@@ -148,7 +148,10 @@
watch(
() => currentSelect.value,
(v) => emit('change', v)
(v) => {
emit('update:value', v);
return emit('change', v);
}
);
function handlePageChange(page: number) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册