This commit is contained in:
@@ -135,18 +135,11 @@
|
||||
};
|
||||
|
||||
// 监听 identifier 变化
|
||||
watch(() => props.identifier, (newVal) => {
|
||||
watch(() => props.identifier || userStore.state.identifier, (newVal) => {
|
||||
if (newVal) {
|
||||
loadPackageData();
|
||||
}
|
||||
}, { immediate: true });
|
||||
|
||||
// 如果没有传入 identifier,则使用 store 中的
|
||||
watch(() => userStore.state.identifier, (newVal) => {
|
||||
if (newVal && !props.identifier) {
|
||||
loadPackageData();
|
||||
}
|
||||
}, { immediate: true });
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user