How to use the buefy.Loading function in buefy

To help you get started, we’ve selected a few buefy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CodeForPhilly / philly-ward-leaders / tests / app.spec.js View on Github external
test('Shows loading indicator when there are pending requests', () => {
    const $store = new Vuex.Store({
      state: {
        pendingRequests: {
          foo: { msg: 'bar' }
        }
      }
    })

    const wrapper = shallow(App, {
      mocks: { $store },
      stubs: ['router-view']
    })

    const indicator = wrapper.find(Buefy.Loading)
    const isActive = indicator.hasProp('active', true)
    expect(isActive).toBe(true)
  })
github CodeForPhilly / philly-ward-leaders / tests / app.spec.js View on Github external
test('Doesn\'t show loading indicator when no pending requests', () => {
    const $store = new Vuex.Store({
      state: {
        pendingRequests: {}
      }
    })

    const wrapper = shallow(App, {
      mocks: { $store },
      stubs: ['router-view']
    })

    const indicator = wrapper.find(Buefy.Loading)
    const isActive = indicator.hasProp('active', false)
    expect(isActive).toBe(true)
  })
github CodeForPhilly / philly-ward-leaders / src / App.vue View on Github external
isLoading () {
      const routeName = this.$route && this.$route.name
      return (this.pendingRequests.length > 0) && (routeName !== 'splash')
    },
    shouldShowFooter () {
      const routeName = this.$route && this.$route.name
      return routeName !== 'city-map'
    }
  },
  methods: mapMutations({
    removeNotification: 'REMOVE_NOTIFICATION'
  }),
  components: {
    'nav-bar': NavBar,
    'notification': Notification,
    'b-loading': Buefy.Loading,
    'site-footer': SiteFooter
  }
}