Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

# fix: 处理icon-value 与 value-icon 同步的问题 #239

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/components/SelectIcon/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
</div>
</div>
</el-scrollbar>
<el-empty v-else description="未搜索到您要找的图标~" />
<el-empty description="未搜索到您要找的图标~" v-else />
</el-dialog>
</div>
</template>

<script setup lang="ts" name="SelectIcon">
import { ref, computed } from "vue";
import { ref, computed, watch } from "vue";
import * as Icons from "@element-plus/icons-vue";

interface SelectIconProps {
Expand All @@ -48,7 +48,10 @@ const props = withDefaults(defineProps<SelectIconProps>(), {

// 重新接收一下,防止打包后 clearable 报错
const valueIcon = ref(props.iconValue);

watch(props, newValue => {
console.log("iconValue change", newValue);
valueIcon.value = newValue.iconValue;
});
// open Dialog
const dialogVisible = ref(false);
const openDialog = () => (dialogVisible.value = true);
Expand Down