Skip to content

Input: Vue2 Mixins

import { useStore } from "vuex";
import { toRefs, ref, computed } from "@vue/composition-api";
export const useMixinSample = (props, ctx) => {
  const store = useStore();
  const { dirty } = toRefs(props);
  const firstName = ref("first");
  const lastName = ref("last");
  const fullName = computed(() => {
    return firstName.value + lastName.value;
  });
  const isDirty = computed(() => {
    return dirty.value;
  });
  return { firstName, lastName, fullName, isDirty };
};