Line data Source code
1 : // @ts-check 2 : 3 : import Vue from "vue"; 4 : import PropertyMixin from "./PropertyMixin"; 5 : import BadgeButton from "../BadgeButton.vue"; 6 : import { getAttribute } from "../../utils/element"; 7 : 8 : export default /** @type {V.Constructor<any, any>} */ (Vue).extend({ 9 : name: "PropertyBoolean", 10 : components: { BadgeButton }, 11 : mixins: [ PropertyMixin ], 12 : computed: { 13 : /** @returns {string} */ 14 0 : min() { return getAttribute(this.property, "min"); }, 15 : /** @returns {string} */ 16 0 : max() { return getAttribute(this.property, "max"); } 17 : }, 18 : methods: { 19 : /** @param {Event} event */ 20 : onInputClick(event) { 21 0 : event.stopPropagation(); 22 0 : this.$store.commit("engine/updateState", { [this.name]: !this.value }); 23 : } 24 : } 25 : });