N
N
nurdus2018-11-05 23:51:29
Vue.js
nurdus, 2018-11-05 23:51:29

How to import framework7-vue component list without enum?

Good evening.
I'm trying to "befriend" vue and framework7 (I use framework7-vue), for this I do:

<template>
<f7-views>
  <f7-view>
  <!--  -->
  </f7-view>
</f7-views>
</template>
<script>
import { f7Views, f7View, f7Navbar, f7NavLeft, f7Block } from 'framework7-vue'
...
  components: {
    f7Views,
    f7View,
    f7Navbar,
    f7NavLeft,
    f7Block 
  }
</script>

Is it possible to remove this "sausage" with the import of the list?
Tried different options, but always got:
Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Sokhin, 2018-11-06
@nurdus

Hello.
There is a bundle that includes all the components at once.
This is written in detail here:
https://framework7.io/vue/installation.html
and here
https://framework7.io/vue/init-app.html
Import this bundle

// Import F7 Bundle
import Framework7 from 'framework7/framework7.esm.bundle.js'
// Import F7-Vue Plugin Bundle (with all F7 components registered)
import Framework7Vue from 'framework7-vue/framework7-vue.esm.bundle.js'

Connect the plugin
// Init F7-Vue Plugin
Framework7.use(Framework7Vue);

All of this needs to be done in your main .js file, not in your component files.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question