Skip to content

Commit

Permalink
perf: dict组件增加dict-change事件
Browse files Browse the repository at this point in the history
  • Loading branch information
greper committed Jul 8, 2022
1 parent 4bf8cc4 commit ab4416c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/fast-admin/fs-admin-antdv
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export default {
require: false
}
},
emits: ["dict-change"],
setup(props, ctx) {
const dict = useDict(props, ctx);
if (props.dict?.getNodesByValues) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default {
*/
defaultLabel: {}
},
emits: ["click"],
emits: ["click", "dict-change"],
setup(props, ctx) {
// trace.trace("values-format");
// console.log("values-format init", props.modelValue);
Expand Down Expand Up @@ -229,7 +229,7 @@ export default {
<style lang="less">
.fs-values-format .fs-tag {
margin: 2px;
.fs-tag-icon{
.fs-tag-icon {
}
}
</style>
6 changes: 3 additions & 3 deletions packages/fast-crud/src/use/use-dict.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ export function useDict(props, ctx, vModel = "modelValue") {
return dict?.data;
},
() => {
const scope = getCurrentScope();
if (ctx.attrs.onDictChange) {
const scope = getCurrentScope();
ctx.attrs.onDictChange({ dict, ...scope });
ctx.emit("dict-change", { dict, ...scope });
// ctx.attrs.onDictChange({ dict, ...scope });
}
ctx.emit("dict-change", { dict, ...scope });
},
{
immediate: true
Expand Down

0 comments on commit ab4416c

Please sign in to comment.