<script lang="ts">
import { Component, …, Vue } from "vue-property-decorator";
…
@Component(…)
export default class … extends Vue {
}
</script>
<script setup lang="ts">
</script>
@Prop({ type: String, required: true }) elementId!: string;
const props = defineProps({ elementId: String });
const elementId = toRef(props, "elementId");
import { ref } from "vue";
const showLoginDialog = ref(false);
get loginUri() {
return (
window.location.origin +
process.env.BASE_URL +
"login"
);
}
get weight() {
return dataStore.weight;
}
set weight(value: number | undefined) {
dataStore.editWeight(value ?? 0);
}
import { computed } from "vue";
const loginUri = computed(() => (
window.location.origin +
process.env.BASE_URL +
"login"
));
const weight = computed({
get: () => dataStore.weight,
set: (value: number | undefined) => dataStore.editWeight(value ?? 0)
});
@Emit("input")
onInput(value: string) {
return value;
}
const emit = defineEmits(["update:modelValue"]);
function onInput(value: string) {
emit("update:modelValue", value);
}
@Watch("userEdits", { deep: true })
onUserEdit() {
dataStore.setModified(true);
}
watch(
userEdits,
function onUserEdits() {
dataStore.setModified(true);
},
{ deep: true },
);
@Ref()
refName!: HTMLElement;
const refName: Ref<HTMLElement> = ref();
@Provide() alertStore = alertStore;
provide("alertStore", alertStore);
@Inject() alertStore!: AlertStore;
const alertStore = inject<AlertStore>("alertStore");
import { onMounted } from "vue";
onMounted(() => {…});
import { useRouter } from "vue-router";
const router = useRouter();
router.push(…);