14nrv/buefy-shop

View on GitHub
components/Switch/Switch.vue

Summary

Maintainability
Test Coverage
A
100%
<template lang="pug">
  .sidearea
    .can-toggle.demo-rebrand-2.field
      input#e.switch.is-rtl(type="checkbox", name="e", v-model="trigger")
      label(for="e") Only Sale
</template>

<script>
export default {
  name: 'AppSwitch',
  computed: {
    trigger: {
      get() { return this.$store.state.product.sale },
      set() { return this.$store.dispatch('product/switchSale', !this.trigger) }
    }
  }
}
</script>

<style lang="stylus" scoped>
  @require '../../node_modules/bulma-switch/dist/css/bulma-switch.min.css'
</style>