【发布时间】:2022-01-08 09:57:58
【问题描述】:
假设我在 vue 中有这样的脚本
<script>
export default {
name: "BaseCardAnnotationOption",
data() {
return {
includeAnnotations1: false,
embedIntoImage: null,
burnIntoImage: null,
burnReduction1: false,
maintainColor1: false,
annotationOption1: null
};
},
methods: {
deselectDisabled() {
return this.includeAnnotations1 === false
? ((this.annotationOption1 = null), (this.maintainColor1 = false))
: ((this.annotationOption1 = 0), (this.maintainColor1 = false));
}
}
};
</script>
我在其他 4 或 5 个地方使用数据变量和方法。有没有办法我可以将所有这些放在一个新文件中,并在需要时从组件中调用它们。谢谢
【问题讨论】:
-
如果您正在寻找集中式商店:vuex.vuejs.org
标签: vue.js vuetify.js