使用 npm 下载 imagemin 插件后,如何使用它?有没有办法在需要时通过“npm run”运行插件?
“组件 A”中有一些反应性常量,可能会在某些用户操作后更新,如何将这些数据导入到另一个组件中?例如:
const MyComponent = {
import { computed, ref } from "vue";
setup() {
name: "Component A",
setup() {
const foo = ref(null);
const updateFoo = computed(() => foo.value = "bar");
return { foo }
}
}
}
Run Code Online (Sandbox Code Playgroud)
'foo' 的更新值可以在另一个组件中使用而不使用提供/注入吗?
我对 Vue 生态系统还很陌生;如果这是我在这里遗漏的明显内容,我深表歉意。