collapse icon indicating copy to clipboard operation
collapse copied to clipboard

Collapse not showing up

Open andela-oadebayo opened this issue 7 years ago • 10 comments

Bellow is a screen shot of my code screen shot 2017-07-26 at 11 22 58 pm

But in my console i get this error

Failed to mount component: template or render function not defined
found in
---> <Collapse>
       <CreatePatient> at resources/assets/js/components/reception/patient/CreatePatient.vue
         <Root>

Please help, i have being blocked on this for days. Thank you

andela-oadebayo avatar Jul 26 '17 22:07 andela-oadebayo

Check this out, to solve the issue i had if you come across it https://github.com/OgaBoss/collapse

OgaBoss avatar Jul 28 '17 19:07 OgaBoss

That link is not working.

Can you post what was the solution?.

holic-cl avatar Aug 02 '17 20:08 holic-cl

i changed

exports.Collapse = require('./Collapse') exports.Item = require('./Item')

in src/index.js to

import Collapse from './Collapse' import Item from './Item'

export { Collapse, Item } @holic-cl

OgaBoss avatar Aug 02 '17 21:08 OgaBoss

@OgaBoss thanks for fast answer, but didn't work here (mine is another problem anyway).

holic-cl avatar Aug 02 '17 21:08 holic-cl

what error are you getting @holic-cl

OgaBoss avatar Aug 02 '17 22:08 OgaBoss

Not getting error, collapse items are showing on vue-tools but i don't know why i can't see it. #9

holic-cl avatar Aug 02 '17 22:08 holic-cl

@OgaBoss solution didn't work as-is in my case. I needed to just add the .vue extension at the end and then it worked!

import Collapse from './Collapse.vue'
import Item from './Item.vue'

export {
Collapse,
Item
}

albertoantunes avatar Aug 28 '17 21:08 albertoantunes

turns out my webpack.config was not configured to recognize .vue extensions. After i added extensions property in my resolve config, it worked as is, without the need to add .vue extension!

module.exports = {
  entry: {
    app: './src/main.js'
  },
  output: {
    path: config.build.assetsRoot,
    filename: '[name].js',
    publicPath: process.env.NODE_ENV === 'production'
      ? config.build.assetsPublicPath
      : config.dev.assetsPublicPath
  },
  resolve: {
    extensions: ['.js', '.vue', '.json'], //THIS LINE

albertoantunes avatar Sep 11 '17 16:09 albertoantunes

Faced the same issue, here's the solution, add class="show" to your top level collapse element.

<collapse accordion is-fullwidth class="show">
...
</collapse>

SilverFoxA avatar May 31 '19 14:05 SilverFoxA

components: {
   Collapse: Collapse.default,
   CollapseItem: CollapseItem.default,
 }

Zikoi5 avatar Nov 27 '20 13:11 Zikoi5